From: Jonas Jelonek Date: Tue, 23 Dec 2025 12:08:12 +0000 (+0000) Subject: realtek: add generic support for Zyxel XS1930 lineup X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1409c25c9a5faeed8a6716e93849b9c97815e58d;p=thirdparty%2Fopenwrt.git realtek: add generic support for Zyxel XS1930 lineup Add generic support for Zyxel's XS1930 10G switch lineup. This will be used by subsequent patches to share common behavior/settings. Common specs: - Realtek RTL9313 switch SoC - 256MB RAM - 32MB Flash with shared layout - different 10G copper/SFP port configurations The devices use a proprietary software chain from Zyxel, consisting of: - stripped-down, heavily modified U-boot masked as "Bootbase" - BootExtension stage2 loader - Thread-X based ZyNOS Those devices require to add some symbols to the kernel config, i.e. CONFIG_AQUANTIA_PHY for the used PHYs and symbols for GPIO peripherals and muxes due to the hardware design. Signed-off-by: Jonas Jelonek Link: https://github.com/openwrt/openwrt/pull/22909 Signed-off-by: Robert Marko --- diff --git a/target/linux/realtek/dts/rtl9313_zyxel_xs1930.dtsi b/target/linux/realtek/dts/rtl9313_zyxel_xs1930.dtsi new file mode 100644 index 00000000000..efb517e485a --- /dev/null +++ b/target/linux/realtek/dts/rtl9313_zyxel_xs1930.dtsi @@ -0,0 +1,139 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/dts-v1/; + +#include "rtl931x.dtsi" + +#include +#include +#include +#include + +/ { + aliases { + label-mac-device = ðernet0; + led-boot = &led_sys_green; + led-failsafe = &led_sys_red; + led-running = &led_sys_green; + led-upgrade = &led_sys_green; + }; + + chosen { + bootargs = "console=ttyS0,115200 earlycon"; + }; + + memory@0 { + device_type = "memory"; + reg = <0x00000000 0x10000000>; + }; + + keys { + compatible = "gpio-keys"; + + key-restore { + label = "restore"; + gpios = <&gpio0 28 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds: leds { + compatible = "gpio-leds"; + pinctrl-names = "default"; + pinctrl-0 = <&pinmux_disable_sys_led>; + + led_sys_green: led-0 { + color = ; + function = LED_FUNCTION_INDICATOR; + gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>; + }; + + led_sys_red: led-1 { + color = ; + function = LED_FUNCTION_INDICATOR; + gpios = <&gpio0 30 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "BootBase"; + reg = <0x0 0xa0000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + factory_macaddr: macaddr@9fff8 { + reg = <0x9fff8 0x6>; + }; + }; + }; + + /* DbgArea */ + partition@a0000 { + label = "reserved"; + reg = <0xa0000 0x20000>; + read-only; + }; + + partition@c0000 { + label = "RomDir2"; + reg = <0xc0000 0x120000>; + read-only; + + /* boot image index at offset 0x151 */ + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + boot_selector: boot-selector@151 { + reg = <0x151 0x1>; + }; + }; + }; + + /* BootBase has dual-image support. Second partition starts at + * 0x1280000 and has same layout as first partition but smaller size + */ + partition@280000 { + reg = <0x280000 0x1d80000>; + label = "factory"; + + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "loader"; + reg = <0x0 0x10000>; + }; + + partition@10000 { + label = "firmware"; + reg = <0x10000 0x1d70000>; + compatible = "openwrt,uimage", "denx,uimage"; + }; + }; + }; + }; +}; + +ðernet0 { + nvmem-cells = <&factory_macaddr 0>; + nvmem-cell-names = "mac-address"; +}; diff --git a/target/linux/realtek/image/rtl931x.mk b/target/linux/realtek/image/rtl931x.mk index 0302988742f..0fde3c9b51a 100644 --- a/target/linux/realtek/image/rtl931x.mk +++ b/target/linux/realtek/image/rtl931x.mk @@ -1,5 +1,7 @@ # SPDX-License-Identifier: GPL-2.0-only +include ./common.mk + define Device/plasmacloud-common SOC := rtl9312 UIMAGE_MAGIC := 0x93100000 @@ -44,3 +46,13 @@ define Device/xikestor_sks8300-12x-v1 append-rootfs | pad-rootfs | append-metadata | check-size endef TARGET_DEVICES += xikestor_sks8300-12x-v1 + +define Device/zyxel_xs1930 + SOC := rtl9313 + DEVICE_PACKAGES := kmod-hwmon-lm85 + FLASH_ADDR := 0xb4280000 + IMAGE_SIZE := 31808k + ZYNFW_ALIGN := 0x10000 + $(Device/zyxel_zynos) +endef + diff --git a/target/linux/realtek/rtl931x/config-6.18 b/target/linux/realtek/rtl931x/config-6.18 index 5520ff3f355..3f5a7289c67 100644 --- a/target/linux/realtek/rtl931x/config-6.18 +++ b/target/linux/realtek/rtl931x/config-6.18 @@ -4,6 +4,7 @@ CONFIG_ARCH_KEEP_MEMBLOCK=y CONFIG_ARCH_MMAP_RND_BITS_MAX=15 CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=15 CONFIG_ARCH_SUSPEND_POSSIBLE=y +CONFIG_AQUANTIA_PHY=y CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=4096 @@ -81,6 +82,8 @@ CONFIG_GENERIC_TIME_VSYSCALL=y CONFIG_GPIOLIB_IRQCHIP=y CONFIG_GPIO_CDEV=y CONFIG_GPIO_GENERIC=y +CONFIG_GPIO_LINE_MUX=y +CONFIG_GPIO_PCA953X=y CONFIG_GPIO_REALTEK_OTTO=y CONFIG_GPIO_REGMAP=y CONFIG_GRO_CELLS=y @@ -163,6 +166,7 @@ CONFIG_MTD_SPLIT_EVA_FW=y CONFIG_MTD_SPLIT_FIRMWARE=y CONFIG_MTD_SPLIT_TPLINK_FW=y CONFIG_MTD_SPLIT_UIMAGE_FW=y +CONFIG_MUX_GPIO=y CONFIG_NEED_DMA_MAP_STATE=y CONFIG_NEED_SRCU_NMI_SAFE=y CONFIG_NET_DEVLINK=y