]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
realtek: rtl930x: add support for Zyxel XGS1010-12 B1 main master 23882/head
authorShine <4c.fce2@proton.me>
Fri, 19 Jun 2026 14:09:27 +0000 (16:09 +0200)
committerMarkus Stockhausen <markus.stockhausen@gmx.de>
Sat, 20 Jun 2026 13:26:36 +0000 (15:26 +0200)
This commit adds support for the Zyxel XGS1010-12 B1 revision, which is
basically the unmanaged version of the XGS1210-12 B1. It features a newer
uBoot build and slightly different 2.5G PHYs than the A1 revision of this
model.

SoC:         RTL9302B
RAM:         128MB DDR3
Flash:       16MB SPI-NOR
Ethernet:    8x 1GBE RJ45 (RTL8218D)
             2x 2.5GBE (2x RTL8226B)
             2x SFP+ cage (10G/2.5G/1G)
UART:        3.3V 115200 8N1, accessible from the right side of the case
             Pinout (top to bottom): Vcc - Tx - Rx - Gnd

MAC address:
The base MAC is stored in uBoot env variable 'ethaddr', which contains only
a placeholder ('00:E0:4C:00:00:00') in the factory default configuration.
Will be generated randomly at boot unless manually preset (see installation
instructions). Additional port MACs are assigned incrementally per port.

This contribution is based on the already existing support for the Zyxel
XGS1010-12-A1 and XGS1210-12-B1.

Installation instructions:

1. Set your PC's IP address to 192.168.1.111 and serve the OpenWrt Initramfs
   image via TFTP (e.g. as "initramfs.bin")
2. Connect to the device via UART, power on and press Esc within 1 second
   after prompted.
3. (Optional) Set a unique MAC address:
   setenv ethaddr AA:BB:CC:DD:EE:FF
4. Populate the uBoot env partition with the command:
   saveenv
5. Enter the following command line to boot the Initramfs OpenWrt image:
   rtk network on; tftpboot 0x84f00000 initramfs.bin; bootm
6. Wait until OpenWrt has booted and connect via SSH.
7. (Optional) Back up the original partitions (at least mtd5-mtd9) in order
   to be able to revert to stock later.
8. Update the boot command needed to boot OpenWrt:
   fw_setenv bootcmd "rtk network on; bootm 0xb4900000"
9. Install the OpenWrt sysupgrade image and wait for the device to boot
   OpenWrt from flash. Enjoy.

Back to stock:

1. Boot the Initramfs image as described above.
2. Write the previously backed up mtd5-mtd9 partitions to flash.
3. Restore the boot command to stock:
   fw_setenv bootcmd boota
4. Reboot into stock firmware.

Signed-off-by: Shine <4c.fce2@proton.me>
Link: https://github.com/openwrt/openwrt/pull/23882
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
target/linux/realtek/base-files/etc/board.d/02_network
target/linux/realtek/base-files/etc/uci-defaults/99_fwenv-store-ethaddr
target/linux/realtek/dts/rtl9302_zyxel_xgs1010-12-b1.dts [new file with mode: 0644]
target/linux/realtek/image/rtl930x.mk

index d5bd3bf3db19b11a720c95722e05445cba02abe4..95ea56a268e1fb2e6ab445f8269ff6d7791ec1f0 100644 (file)
@@ -102,7 +102,8 @@ realtek_setup_macs()
        hasivo,f1100w-4sx-4xgt-512mb|\
        hasivo,f5800w-12s-plus|\
        tplink,tl-st1008f-v2|\
        hasivo,f1100w-4sx-4xgt-512mb|\
        hasivo,f5800w-12s-plus|\
        tplink,tl-st1008f-v2|\
-       zyxel,xgs1010-12-a1)
+       zyxel,xgs1010-12-a1|\
+       zyxel,xgs1010-12-b1)
                lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
                mac_prefix=$(echo "$lan_mac" | cut -d: -f1-5)
                [ -z "$lan_mac" ] || [ "$mac_prefix" = "00:e0:4c:00:00" ] && lan_mac=$(macaddr_random)
                lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
                mac_prefix=$(echo "$lan_mac" | cut -d: -f1-5)
                [ -z "$lan_mac" ] || [ "$mac_prefix" = "00:e0:4c:00:00" ] && lan_mac=$(macaddr_random)
index 285aca82db3de9576de3596fadfff3ff6f058e6b..5a8e3a8ae1bd287d0d3d9224e072386e4ba49d92 100644 (file)
@@ -56,7 +56,8 @@ tplink,tl-st1008f-v2)
 # that state, we don't want to modify it, because that would write the defaults
 # of the userspace U-Boot tools (which differ from the ones in the bootloader).
 # Thus, we don't do anything here if the ethaddr variable is empty.
 # that state, we don't want to modify it, because that would write the defaults
 # of the userspace U-Boot tools (which differ from the ones in the bootloader).
 # Thus, we don't do anything here if the ethaddr variable is empty.
-zyxel,xgs1010-12-a1)
+zyxel,xgs1010-12-a1|\
+zyxel,xgs1010-12-b1)
        env_ethaddr=$(macaddr_canonicalize "$(fw_printenv -n ethaddr 2>/dev/null)")
 
        if [ "$env_ethaddr" = "00:e0:4c:00:00:00" ]; then
        env_ethaddr=$(macaddr_canonicalize "$(fw_printenv -n ethaddr 2>/dev/null)")
 
        if [ "$env_ethaddr" = "00:e0:4c:00:00:00" ]; then
diff --git a/target/linux/realtek/dts/rtl9302_zyxel_xgs1010-12-b1.dts b/target/linux/realtek/dts/rtl9302_zyxel_xgs1010-12-b1.dts
new file mode 100644 (file)
index 0000000..7437890
--- /dev/null
@@ -0,0 +1,17 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/dts-v1/;
+
+#include "rtl9302_zyxel_xgs1010-12-common.dtsi"
+
+/ {
+       compatible = "zyxel,xgs1010-12-b1", "realtek,rtl930x-soc";
+       model = "Zyxel XGS1010-12 B1";
+};
+
+&mdio_bus1 {
+       PHY_C45(24, 1)
+};
+
+&mdio_bus2 {
+       PHY_C45(25, 2)
+};
index b1a2602fa13fd0546c964052c9d9a0f6f81e99db..e58020551b44444be5af7ae2d800da13bb9ef639 100644 (file)
@@ -277,6 +277,12 @@ define Device/zyxel_xgs1010-12-a1
 endef
 TARGET_DEVICES += zyxel_xgs1010-12-a1
 
 endef
 TARGET_DEVICES += zyxel_xgs1010-12-a1
 
+define Device/zyxel_xgs1010-12-b1
+  $(Device/zyxel_xgs1010-12)
+  DEVICE_VARIANT := B1
+endef
+TARGET_DEVICES += zyxel_xgs1010-12-b1
+
 define Device/zyxel_xgs1210-12-a1
   $(Device/zyxel_xgs1210-12)
   SUPPORTED_DEVICES += zyxel,xgs1210-12
 define Device/zyxel_xgs1210-12-a1
   $(Device/zyxel_xgs1210-12)
   SUPPORTED_DEVICES += zyxel,xgs1210-12