2023-05-23 12:48:31 +08:00
|
|
|
--- a/drivers/net/ethernet/realtek/r8169_main.c
|
|
|
|
|
+++ b/drivers/net/ethernet/realtek/r8169_main.c
|
|
|
|
|
@@ -21,6 +21,7 @@
|
|
|
|
|
#include <linux/in.h>
|
|
|
|
|
#include <linux/io.h>
|
|
|
|
|
#include <linux/ip.h>
|
|
|
|
|
+#include <linux/of.h>
|
|
|
|
|
#include <linux/tcp.h>
|
|
|
|
|
#include <linux/interrupt.h>
|
|
|
|
|
#include <linux/dma-mapping.h>
|
2023-05-23 13:11:35 +08:00
|
|
|
@@ -171,6 +172,7 @@ enum rtl_registers {
|
2023-05-23 12:48:31 +08:00
|
|
|
MAR0 = 8, /* Multicast filter. */
|
|
|
|
|
CounterAddrLow = 0x10,
|
|
|
|
|
CounterAddrHigh = 0x14,
|
|
|
|
|
+ CustomLED = 0x18,
|
|
|
|
|
TxDescStartAddrLow = 0x20,
|
|
|
|
|
TxDescStartAddrHigh = 0x24,
|
|
|
|
|
TxHDescStartAddrLow = 0x28,
|
2023-12-25 11:19:30 +08:00
|
|
|
@@ -2112,6 +2114,22 @@ void r8169_apply_firmware(struct rtl8169
|
2023-05-23 12:48:31 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
+static int rtl8169_led_configuration(struct rtl8169_private *tp)
|
|
|
|
|
+{
|
|
|
|
|
+ u32 led_data;
|
|
|
|
|
+ int ret;
|
|
|
|
|
+
|
|
|
|
|
+ ret = of_property_read_u32(tp->pci_dev->dev.of_node,
|
|
|
|
|
+ "realtek,led-data", &led_data);
|
|
|
|
|
+
|
|
|
|
|
+ if (ret)
|
|
|
|
|
+ return ret;
|
|
|
|
|
+
|
|
|
|
|
+ RTL_W16(tp, CustomLED, led_data);
|
|
|
|
|
+
|
|
|
|
|
+ return 0;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
static void rtl8168_config_eee_mac(struct rtl8169_private *tp)
|
|
|
|
|
{
|
|
|
|
|
/* Adjust EEE LED frequency */
|
2023-12-25 11:19:30 +08:00
|
|
|
@@ -3260,6 +3278,8 @@ static void rtl_hw_start_8168h_1(struct
|
2023-05-23 12:48:31 +08:00
|
|
|
r8168_mac_ocp_write(tp, 0xc094, 0x0000);
|
|
|
|
|
r8168_mac_ocp_write(tp, 0xc09e, 0x0000);
|
|
|
|
|
|
|
|
|
|
+ rtl8169_led_configuration(tp);
|
|
|
|
|
+
|
|
|
|
|
rtl_hw_aspm_clkreq_enable(tp, true);
|
|
|
|
|
}
|
|
|
|
|
|
2023-12-25 11:19:30 +08:00
|
|
|
@@ -3632,6 +3652,8 @@ static void rtl_hw_start_8125b(struct rt
|
2023-05-23 12:48:31 +08:00
|
|
|
rtl_ephy_init(tp, e_info_8125b);
|
|
|
|
|
rtl_hw_start_8125_common(tp);
|
|
|
|
|
|
|
|
|
|
+ rtl8169_led_configuration(tp);
|
|
|
|
|
+
|
|
|
|
|
rtl_hw_aspm_clkreq_enable(tp, true);
|
|
|
|
|
}
|
|
|
|
|
|