realtek: setup cpu port in soc_info structure
authorMarkus Stockhausen <markus.stockhausen@gmx.de>
Tue, 30 Dec 2025 13:07:32 +0000 (14:07 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Wed, 31 Dec 2025 20:55:32 +0000 (21:55 +0100)
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 <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21327
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
target/linux/realtek/files-6.12/arch/mips/rtl838x/prom.c

index acd9f4581d863243b82010e85b5f32fcee7b92ec..689e862d27d6e801e175dd6de000e247e2b56de0 100644 (file)
@@ -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;
        }