]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
realtek: rtl931x: Add support for Plasma Cloud ESX28 Switch
authorHarshal Gohel <hg@simonwunderlich.de>
Mon, 14 Jul 2025 16:00:58 +0000 (18:00 +0200)
committerHauke Mehrtens <hauke@hauke-m.de>
Sat, 4 Oct 2025 14:16:22 +0000 (16:16 +0200)
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 <hg@simonwunderlich.de>
Co-developed-by: Sven Eckelmann <se@simonwunderlich.de>
Signed-off-by: Sven Eckelmann <se@simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/20172
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
target/linux/realtek/base-files/etc/board.d/02_network
target/linux/realtek/base-files/etc/init.d/hwmon_fancontrol
target/linux/realtek/base-files/lib/upgrade/platform.sh
target/linux/realtek/base-files/lib/upgrade/upgrade_dualboot_plasmacloud.sh
target/linux/realtek/dts/rtl9312_plasmacloud_esx28.dts [new file with mode: 0644]
target/linux/realtek/image/rtl931x.mk

index f44ceb18d14554a510bae446e780b5b1bed04d4b..56643ba556757a48f78cfe38b8e0bf30011992d5 100644 (file)
@@ -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|\
index 781bec666e48f47b4574082973a5d2de3d8530fb..8301f1df536bcdd4e4b08d7333740b2ba5322520 100755 (executable)
@@ -37,6 +37,7 @@ plasmacloud_common() {
 
 boot() {
        case $(board_name) in
+       plasmacloud,esx28|\
        plasmacloud,psx28)
                plasmacloud_common
                ;;
index d443b8a32f502459142cdb6881ecb3fb7233f680..f02bbd19f3428148c70939759002d0c60547cfa5 100644 (file)
@@ -27,6 +27,7 @@ platform_do_upgrade() {
        local board=$(board_name)
 
        case "$board" in
+       plasmacloud,esx28|\
        plasmacloud,psx8|\
        plasmacloud,psx10|\
        plasmacloud,psx28)
index 085869d88cbf61ed05832d447381039f79b69522..e07c1d63300d17cbe3fa923a070827fd4658545e 100644 (file)
@@ -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 (file)
index 0000000..cbf2a09
--- /dev/null
@@ -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";
+};
index b855c9f080ad6b2d789918422b586029c275a2df..1cf1d1e6727aa61fb42eead4814a45ab83b63e52 100644 (file)
@@ -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