From: Harshal Gohel Date: Mon, 14 Jul 2025 16:00:58 +0000 (+0200) Subject: realtek: rtl931x: Add support for Plasma Cloud ESX28 Switch X-Git-Url: http://git.openwrt.org/?a=commitdiff_plain;h=ce8ea739ebba573c65509c689a12aa5949b74639;p=openwrt%2Fstaging%2Fblocktrron.git realtek: rtl931x: Add support for Plasma Cloud ESX28 Switch The Plasma Cloud ESX28 Switch is a 24 + 4 port multi-GBit switch with 24x 10/100/1000/2500BaseT Ethernet ports and 4x SFP+ module slot. Hardware: - RTL9312C SoC - Macronix MX25L25645G (32MB flash) - 512MB DDR3 SDRAM - RTL8231 GPIO extender to control the port LEDs - 6x RTL8224 4x 10m/100m/1/2.5 Gigabit PHY - SFP+ 4x 10GBit slot The switch is powered directly via AC. The external RS232 serial connector (RJ45, Cisco pinout) can be used to access the terminal. Serial connection is via 115200 baud, 8N1. A reset button is accessible through a hole in the front panel. Installation ------------ * The device can be flashed by using sysupgrade command. Either from the original vendor firmware or using an initramfs (see "Debug") * Connect serial on front panel. Connection parameters: 115200 8N1 * The image must be copied using scp to /tmp of the device scp openwrt-realtek-rtl931x-plasmacloud_esx28-squashfs-sysupgrade.bin root@[IP address of the device]:/tmp/ * start sysupgrade without saving the original vendor configuration sysupgrade -n /tmp/openwrt-realtek-rtl931x-plasmacloud_esx28-squashfs-sysupgrade.bin Installation via u-boot ----------------------- If you have an TFTP server connected to the switch, it is possible to directly install the device using the factory image from u-boot # setup networking and IP of TFP server rtk network on setenv ipaddr 10.100.100.99 setenv serverip 10.100.100.20 # get factory image tftp 0x84000000 factory.bin # erase firmware partitions sf probe 0 sf erase 0x5e0000 0x1a20000 # write firmware to both partitions sf write ${fileaddr} 0x5e0000 ${filesize} sf write ${fileaddr} 0x12f0000 ${filesize} # adjust the boot commands setenv bootargs "mtdparts=spi0.0:768k(u-boot),64k(u-boot-env),64k(u-boot-env2),5120k(reserved),13376k(inactive),13376k(firmware2)" setenv bootcmd "rtk init; bootm 0xb52f0000" # restart reset Debug ----- * Connect serial on front panel. Connection parameters: 115200 8N1. * A tftp server is required, tftpd-hpa works well. * Power the device, at U-Boot start rapidly hit Esc key to stop autoboot * Enter passwords: "1234" or "plasmapsx" * Enable network: rtk network on * Change ip address of device: setenv ipaddr 192.168.1.6 * Download initramfs from TFTP server: tftpboot 0x84000000 192.168.1.111:openwrt-realtek-rtl931x-plasmacloud_esx28-initramfs-kernel.bin * Boot loaded file: bootm 0x84000000 Signed-off-by: Harshal Gohel Co-developed-by: Sven Eckelmann Signed-off-by: Sven Eckelmann Link: https://github.com/openwrt/openwrt/pull/20172 Signed-off-by: Hauke Mehrtens --- diff --git a/target/linux/realtek/base-files/etc/board.d/02_network b/target/linux/realtek/base-files/etc/board.d/02_network index f44ceb18d1..56643ba556 100644 --- a/target/linux/realtek/base-files/etc/board.d/02_network +++ b/target/linux/realtek/base-files/etc/board.d/02_network @@ -47,6 +47,7 @@ hpe,1920-48g-poe) lan_mac_start=$(macaddr_add $lan_mac 2) lan_mac_end=$(macaddr_add $lan_mac $((mac_count2-mac_count1))) ;; +plasmacloud,esx28|\ plasmacloud,psx8|\ plasmacloud,psx10|\ plasmacloud,psx28|\ diff --git a/target/linux/realtek/base-files/etc/init.d/hwmon_fancontrol b/target/linux/realtek/base-files/etc/init.d/hwmon_fancontrol index 781bec666e..8301f1df53 100755 --- a/target/linux/realtek/base-files/etc/init.d/hwmon_fancontrol +++ b/target/linux/realtek/base-files/etc/init.d/hwmon_fancontrol @@ -37,6 +37,7 @@ plasmacloud_common() { boot() { case $(board_name) in + plasmacloud,esx28|\ plasmacloud,psx28) plasmacloud_common ;; diff --git a/target/linux/realtek/base-files/lib/upgrade/platform.sh b/target/linux/realtek/base-files/lib/upgrade/platform.sh index d443b8a32f..f02bbd19f3 100644 --- a/target/linux/realtek/base-files/lib/upgrade/platform.sh +++ b/target/linux/realtek/base-files/lib/upgrade/platform.sh @@ -27,6 +27,7 @@ platform_do_upgrade() { local board=$(board_name) case "$board" in + plasmacloud,esx28|\ plasmacloud,psx8|\ plasmacloud,psx10|\ plasmacloud,psx28) diff --git a/target/linux/realtek/base-files/lib/upgrade/upgrade_dualboot_plasmacloud.sh b/target/linux/realtek/base-files/lib/upgrade/upgrade_dualboot_plasmacloud.sh index 085869d88c..e07c1d6330 100644 --- a/target/linux/realtek/base-files/lib/upgrade/upgrade_dualboot_plasmacloud.sh +++ b/target/linux/realtek/base-files/lib/upgrade/upgrade_dualboot_plasmacloud.sh @@ -17,6 +17,7 @@ set_boot_part() { return 1 fi ;; + plasmacloud,esx28|\ plasmacloud,psx28) if [ "$part_num" = "1" ]; then echo "bootargs mtdparts=spi0.0:768k(u-boot),64k(u-boot-env),64k(u-boot-env2),5120k(reserved),13376k(firmware1),13376k(inactive)" > $setenv_script @@ -73,6 +74,7 @@ platform_do_upgrade_dualboot_plasmacloud() { plasmacloud,psx10) primary_firmware_mtd=3 ;; + plasmacloud,esx28|\ plasmacloud,psx28) primary_firmware_mtd=4 ;; diff --git a/target/linux/realtek/dts/rtl9312_plasmacloud_esx28.dts b/target/linux/realtek/dts/rtl9312_plasmacloud_esx28.dts new file mode 100644 index 0000000000..cbf2a0900d --- /dev/null +++ b/target/linux/realtek/dts/rtl9312_plasmacloud_esx28.dts @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/dts-v1/; + +#include "rtl9312_plasmacloud_common.dtsi" + +/ { + compatible = "plasmacloud,esx28", "realtek,rtl9312-soc"; + model = "Plasma Cloud ESX28"; +}; diff --git a/target/linux/realtek/image/rtl931x.mk b/target/linux/realtek/image/rtl931x.mk index b855c9f080..1cf1d1e672 100644 --- a/target/linux/realtek/image/rtl931x.mk +++ b/target/linux/realtek/image/rtl931x.mk @@ -18,6 +18,12 @@ define Device/plasmacloud-common IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata endef +define Device/plasmacloud_esx28 + $(Device/plasmacloud-common) + DEVICE_MODEL := ESX28 +endef +TARGET_DEVICES += plasmacloud_esx28 + define Device/plasmacloud_psx28 $(Device/plasmacloud-common) DEVICE_MODEL := PSX28