• R/O
  • HTTP
  • SSH
  • HTTPS

immortalwrt: Commit

Mirror only - Please move to https://github.com/immortalwrt/immortalwrt


Commit MetaInfo

Revision6ee0a41e3283bf67db7cbcf5e0dbaca3fbc38f8a (tree)
Zeit2022-05-18 13:05:07
AutorTianling Shen <cnsztl@immo...>
CommiterTianling Shen

Log Message

Revert "r8152: drop led configuration patch"

This doesn't make sense at all. For more details see comments in the
original commit.

This reverts commit 4a22f9ad8ae5b9102cf7af68efeacd5a81848bf3.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>

Ändern Zusammenfassung

Diff

--- a/package/kernel/r8152/Makefile
+++ b/package/kernel/r8152/Makefile
@@ -1,7 +1,8 @@
1-#
2-# Download realtek r8152 linux driver from official site:
3-# [https://www.realtek.com/en/component/zoo/category/network-interface-controllers-10-100-1000m-gigabit-ethernet-usb-3-0-software]
4-#
1+#Download realtek r8152 linux driver from official site [https://www.realtek.com/en/component/zoo/category/network-interface-controllers-10-100-1000m-gigabit-ethernet-usb-3-0-software]
2+#Unpack source file
3+#Replace orginal Makefile with this file
4+#Put this source to 'package' folder of OpenWRT/LEDE SDK
5+#Build(make menuconfig, make defconfig, make)
56
67 include $(TOPDIR)/rules.mk
78 include $(INCLUDE_DIR)/kernel.mk
@@ -26,7 +27,7 @@ define KernelPackage/usb-net-rtl8152-vendor
2627 TITLE:=Kernel module for USB-to-Ethernet Realtek convertors
2728 SUBMENU:=USB Support
2829 VERSION:=$(LINUX_VERSION)+$(PKG_VERSION)-$(BOARD)-$(PKG_RELEASE)
29- DEPENDS:=@TARGET_x86 +kmod-usb-net
30+ DEPENDS:=+kmod-usb-net
3031 CONFLICTS:=kmod-usb-net-rtl8152
3132 FILES:= $(PKG_BUILD_DIR)/r8152.ko
3233 AUTOLOAD:=$(call AutoProbe,r8152)
--- /dev/null
+++ b/package/kernel/r8152/patches/100-add-LED-configuration-from-OF.patch
@@ -0,0 +1,74 @@
1+From 82985725e071f2a5735052f18e109a32aeac3a0b Mon Sep 17 00:00:00 2001
2+From: David Bauer <mail@david-bauer.net>
3+Date: Sun, 26 Jul 2020 02:38:31 +0200
4+Subject: [PATCH] add LED configuration from OF
5+
6+This adds the ability to configure the LED configuration register using
7+OF. This way, the correct value for board specific LED configuration can
8+be determined.
9+
10+Signed-off-by: David Bauer <mail@david-bauer.net>
11+---
12+ r8152.c | 23 +++++++++++++++++++++++
13+ 1 file changed, 23 insertions(+)
14+
15+--- a/r8152.c
16++++ b/r8152.c
17+@@ -18,6 +18,7 @@
18+ #include <linux/mii.h>
19+ #include <linux/ethtool.h>
20+ #include <linux/usb.h>
21++#include <linux/of.h>
22+ #include <linux/crc32.h>
23+ #include <linux/if_vlan.h>
24+ #include <linux/uaccess.h>
25+@@ -9804,6 +9805,22 @@ static void rtl_tally_reset(struct r8152
26+ ocp_write_word(tp, MCU_TYPE_PLA, PLA_RSTTALLY, ocp_data);
27+ }
28+
29++static int r8152_led_configuration(struct r8152 *tp)
30++{
31++ u32 led_data;
32++ int ret;
33++
34++ ret = of_property_read_u32(tp->udev->dev.of_node, "realtek,led-data",
35++ &led_data);
36++
37++ if (ret)
38++ return ret;
39++
40++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_LEDSEL, led_data);
41++
42++ return 0;
43++}
44++
45+ static void r8152b_init(struct r8152 *tp)
46+ {
47+ u32 ocp_data;
48+@@ -9865,6 +9882,8 @@ static void r8152b_init(struct r8152 *tp
49+ ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_USB_CTRL);
50+ ocp_data &= ~(RX_AGG_DISABLE | RX_ZERO_EN);
51+ ocp_write_word(tp, MCU_TYPE_USB, USB_USB_CTRL, ocp_data);
52++
53++ r8152_led_configuration(tp);
54+ }
55+
56+ static void r8153_init(struct r8152 *tp)
57+@@ -10008,6 +10027,8 @@ static void r8153_init(struct r8152 *tp)
58+ tp->coalesce = COALESCE_SLOW;
59+ break;
60+ }
61++
62++ r8152_led_configuration(tp);
63+ }
64+
65+ static void r8153b_init(struct r8152 *tp)
66+@@ -10098,6 +10119,8 @@ static void r8153b_init(struct r8152 *tp
67+ rtl_tally_reset(tp);
68+
69+ tp->coalesce = 15000; /* 15 us */
70++
71++ r8152_led_configuration(tp);
72+ }
73+
74+ static void r8153c_init(struct r8152 *tp)
Show on old repository browser