[openwrt/openwrt] kernel: rtl8367: set the correct cpu_port value

LEDE Commits lede-commits at lists.infradead.org
Sat Jun 8 07:28:40 PDT 2024


robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/c1a26de1c6e4384bc8c80d3a73fc26eb05634c9c

commit c1a26de1c6e4384bc8c80d3a73fc26eb05634c9c
Author: Mieczyslaw Nalewaj <namiltd at yahoo.com>
AuthorDate: Tue Jun 4 17:25:39 2024 +0200

    kernel: rtl8367: set the correct cpu_port value
    
    Set the appropriate cpu_port value based on the use of realtek,extif0 or realtek,extif1 parameter.
    
    Signed-off-by: Mieczyslaw Nalewaj <namiltd at yahoo.com>
    Link: https://github.com/openwrt/openwrt/pull/15033
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 target/linux/generic/files/drivers/net/phy/rtl8367.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/target/linux/generic/files/drivers/net/phy/rtl8367.c b/target/linux/generic/files/drivers/net/phy/rtl8367.c
index 7f0569d038..b14b63e036 100644
--- a/target/linux/generic/files/drivers/net/phy/rtl8367.c
+++ b/target/linux/generic/files/drivers/net/phy/rtl8367.c
@@ -1641,7 +1641,7 @@ static int rtl8367_switch_init(struct rtl8366_smi *smi)
 	int err;
 
 	dev->name = "RTL8367";
-	dev->cpu_port = RTL8367_CPU_PORT_NUM;
+	dev->cpu_port = smi->cpu_port;
 	dev->ports = RTL8367_NUM_PORTS;
 	dev->vlans = RTL8367_NUM_VIDS;
 	dev->ops = &rtl8367_sw_ops;
@@ -1722,6 +1722,11 @@ static int rtl8367_detect(struct rtl8366_smi *smi)
 	dev_info(smi->parent, "RTL%s ver. %u chip found\n",
 		 chip_name, rtl_ver & RTL8367_RTL_VER_MASK);
 
+	if (of_property_present(smi->parent->of_node, "realtek,extif1"))
+		smi->cpu_port = RTL8367_CPU_PORT_NUM - 1;
+
+	dev_info(smi->parent, "CPU port: %u\n", smi->cpu_port);
+
 	return 0;
 }
 




More information about the lede-commits mailing list