--- a/src/r8126_n.c
+++ b/src/r8126_n.c
@@ -44,6 +44,7 @@
 #include <linux/etherdevice.h>
 #include <linux/delay.h>
 #include <linux/mii.h>
+#include <linux/of.h>
 #include <linux/if_vlan.h>
 #include <linux/crc32.h>
 #include <linux/interrupt.h>
@@ -11652,6 +11653,25 @@ rtl8126_setup_mqs_reg(struct rtl8126_pri
         }
 }
 
+static int
+rtl8126_led_configuration(struct rtl8126_private *tp)
+{
+        const int led_regs[] = { 0x18, 0x86, 0x84, 0x96 }; /* LEDSEL 0-3 */
+        u32 led_data[4];
+        int ret, i;
+
+        ret = of_property_read_u32_array(tp->pci_dev->dev.of_node,
+                                  "realtek,led-data", led_data, 4);
+
+        if (ret)
+                return ret;
+
+        for (i = 0; i < 4; i++)
+                RTL_W16(tp, led_regs[i], led_data[i]);
+
+        return 0;
+}
+
 static void
 rtl8126_init_software_variable(struct net_device *dev)
 {
@@ -12024,6 +12044,8 @@ rtl8126_init_software_variable(struct ne
         if (tp->InitRxDescType == RX_DESC_RING_TYPE_3)
                 tp->rtl8126_rx_config |= EnableRxDescV3;
 
+        rtl8126_led_configuration(tp);
+
         tp->NicCustLedValue = RTL_R16(tp, CustomLED);
 
         tp->wol_opts = rtl8126_get_hw_wol(tp);