From: Markus Stockhausen Date: Tue, 30 Dec 2025 13:07:32 +0000 (+0100) Subject: realtek: setup cpu port in soc_info structure X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=8e6cd2608ab14a017f493dd10bd4a6045a5bac0f;p=openwrt%2Fopenwrt.git realtek: setup cpu port in soc_info structure A lot of soc_info usage has been reorganized. Nevertheless there are some consumers left. A very critical one is the dsa/qos coding. It makes use of the cpu_port in this shared structure. This is totally broken as that info is never properly initialized. Fill the cpu_port according to the identified hardware. Remark: Looking at the prom.c history soc_info.cpu_port was never setup since the beginning of time. So no "fixes" tag here. Signed-off-by: Markus Stockhausen Link: https://github.com/openwrt/openwrt/pull/21327 Signed-off-by: Hauke Mehrtens --- diff --git a/target/linux/realtek/files-6.12/arch/mips/rtl838x/prom.c b/target/linux/realtek/files-6.12/arch/mips/rtl838x/prom.c index acd9f4581d..689e862d27 100644 --- a/target/linux/realtek/files-6.12/arch/mips/rtl838x/prom.c +++ b/target/linux/realtek/files-6.12/arch/mips/rtl838x/prom.c @@ -187,6 +187,7 @@ static u32 __init read_model(void) if ((id >= 0x8380 && id <= 0x8382) || id == 0x8330 || id == 0x8332) { soc_info.id = id; soc_info.family = RTL8380_FAMILY_ID; + soc_info.cpu_port = RTL838X_CPU_PORT; rtl838x_read_details(model); return model; } @@ -196,6 +197,7 @@ static u32 __init read_model(void) if ((id >= 0x8391 && id <= 0x8396) || (id >= 0x8351 && id <= 0x8353)) { soc_info.id = id; soc_info.family = RTL8390_FAMILY_ID; + soc_info.cpu_port = RTL839X_CPU_PORT; rtl839x_read_details(model); return model; } @@ -205,11 +207,13 @@ static u32 __init read_model(void) if (id >= 0x9301 && id <= 0x9303) { soc_info.id = id; soc_info.family = RTL9300_FAMILY_ID; + soc_info.cpu_port = RTL930X_CPU_PORT; rtl93xx_read_details(model); return model; } else if (id >= 0x9311 && id <= 0x9313) { soc_info.id = id; soc_info.family = RTL9310_FAMILY_ID; + soc_info.cpu_port = RTL931X_CPU_PORT; rtl93xx_read_details(model); return model; }