openwrt-redmi-ax3000/target/linux/realtek/image/rtl930x.mk
Harshal Gohel f84371ddb5 realtek: rtl930x: Add support for Plasma Cloud MCX3 Media Converter
The Plasma Cloud MCX3 Media Converter is a 3 port multi-GBit switch with
2x 10/100/1000/2500BaseT Ethernet ports and 1x SFP+ module slot.

Hardware:

- RTL9302C SoC
- Macronix MX25L25645G (32MB flash)
- Winbond W632GU6rB-11 (256MB DDR3 SDRAM)
- RTL8224 4x 10m/100m/1/2.5 Gigabit PHY
- IC+ IP802AR POE+ PSE controller

The media converter is powered by 54 Volts 1.2A barrel connector. The
internal TTL serial connector can be used to access the terminal. Pins from
1: TX RX (unused) GND. Serial connection is via 115200 baud, 8N1.

A reset button is accessible through a hole next to the SFP+ module slot.

Installation
------------

* The device can be flashed by using sysupgrade command. Either from the
  original vendor firmware or using an initramfs (see "Debug")
* Connect serial as per the layout above. Connection parameters: 115200 8N1
* The image must be copied using scp to /tmp of the device

      scp openwrt-realtek-rtl930x-plasmacloud_mcx3-squashfs-sysupgrade.bin root@[IP address of the device]:/tmp/

* start sysupgrade without saving the original vendor configuration

      sysupgrade -n /tmp/openwrt-realtek-rtl930x-plasmacloud_mcx3-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 0x100000 0x01f00000

    # write firmware to both partitions
    sf write ${fileaddr} 0x100000 ${filesize}
    sf write ${fileaddr} 0x1080000 ${filesize}

    # adjust the boot commands
    setenv bootargs "mtdparts=spi0.0:896k(u-boot),64k(u-boot-env),64k(u-boot-env2),15872k(inactive),15872k(firmware2)"
    setenv bootcmd "rtk init; bootm 0xb5080000"

    # restart
    reset

Debug
-----

* Connect serial as per the layout above. 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
* 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-rtl930x-plasmacloud_mcx3-initramfs-kernel.bin

* Boot loaded file:

      bootm 0x84000000

Signed-off-by: Harshal Gohel <hg@simonwunderlich.de>
Signed-off-by: Sven Eckelmann <se@simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/20625
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-11-07 21:12:58 +01:00

167 lines
4.0 KiB
Makefile

# SPDX-License-Identifier: GPL-2.0-only
include ./common.mk
define Build/xikestor-nosimg
$(STAGING_DIR_HOST)/bin/nosimg-enc -i $@ -o $@.new
mv $@.new $@
endef
define Device/hasivo_s1100w-8xgt-se
SOC := rtl9303
DEVICE_VENDOR := Hasivo
DEVICE_MODEL := S1100W-8XGT-SE
IMAGE_SIZE := 12288k
$(Device/kernel-lzma)
endef
TARGET_DEVICES += hasivo_s1100w-8xgt-se
define Device/plasmacloud-common
SOC := rtl9302
UIMAGE_MAGIC := 0x93000000
DEVICE_VENDOR := Plasma Cloud
DEVICE_PACKAGES := poemgr
IMAGE_SIZE := 15872k
BLOCKSIZE := 64k
KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | uImage lzma
KERNEL := kernel-bin | append-dtb | lzma | uImage lzma | pad-to $$(BLOCKSIZE)
IMAGES += factory.bin
IMAGE/factory.bin := append-kernel | append-rootfs | pad-rootfs | check-size
IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata
endef
define Device/plasmacloud_mcx3
$(Device/plasmacloud-common)
DEVICE_MODEL := MCX3
endef
TARGET_DEVICES += plasmacloud_mcx3
define Device/plasmacloud_psx8
$(Device/plasmacloud-common)
DEVICE_MODEL := PSX8
endef
TARGET_DEVICES += plasmacloud_psx8
define Device/plasmacloud_psx10
$(Device/plasmacloud-common)
DEVICE_MODEL := PSX10
endef
TARGET_DEVICES += plasmacloud_psx10
define Device/tplink_tl-st1008f-v2
SOC := rtl9303
UIMAGE_MAGIC := 0x93030000
DEVICE_VENDOR := TP-Link
DEVICE_MODEL := TL-ST1008F
DEVICE_VARIANT := v2.0
DEVICE_PACKAGES := kmod-gpio-pca953x
SUPPORTED_DEVICES += tplink,tl-st1008f,v2
IMAGE_SIZE := 31808k
$(Device/kernel-lzma)
endef
TARGET_DEVICES += tplink_tl-st1008f-v2
define Device/vimin_vm-s100-0800ms
SOC := rtl9303
UIMAGE_MAGIC := 0x93000000
DEVICE_VENDOR := Vimin
DEVICE_MODEL := VM-S100-0800MS
IMAGE_SIZE := 13312k
$(Device/kernel-lzma)
endef
TARGET_DEVICES += vimin_vm-s100-0800ms
define Device/xikestor_sks8300-8x
SOC := rtl9303
DEVICE_VENDOR := XikeStor
DEVICE_MODEL := SKS8300-8X
DEVICE_ALT0_VENDOR := ONTi
DEVICE_ALT0_MODEL := ONT-S508CL-8S
BLOCKSIZE := 64k
KERNEL_SIZE := 8192k
IMAGE_SIZE := 30720k
IMAGE/sysupgrade.bin := pad-extra 256 | append-kernel | xikestor-nosimg | \
jffs2 nos.img -e 4KiB -x lzma | pad-to $$$$(KERNEL_SIZE) | \
append-rootfs | pad-rootfs | append-metadata | check-size
endef
TARGET_DEVICES += xikestor_sks8300-8x
define Device/xikestor_sks8310-8x
SOC := rtl9303
UIMAGE_MAGIC := 0x93000000
DEVICE_VENDOR := XikeStor
DEVICE_MODEL := SKS8310-8X
IMAGE_SIZE := 20480k
$(Device/kernel-lzma)
IMAGE/sysupgrade.bin := \
pad-extra 16 | \
append-kernel | \
pad-to 64k | \
append-rootfs | \
pad-rootfs | \
check-size | \
append-metadata
endef
TARGET_DEVICES += xikestor_sks8310-8x
define Device/zyxel_xgs1010-12-a1
SOC := rtl9302
UIMAGE_MAGIC := 0x93001010
DEVICE_VENDOR := Zyxel
DEVICE_MODEL := XGS1010-12
DEVICE_VARIANT := A1
KERNEL_SIZE := 7168k
IMAGE_SIZE := 13184k
$(Device/kernel-lzma)
endef
TARGET_DEVICES += zyxel_xgs1010-12-a1
define Device/zyxel_xgs1210-12-a1
$(Device/zyxel_xgs1210-12)
SUPPORTED_DEVICES += zyxel,xgs1210-12
DEVICE_VARIANT := A1
endef
TARGET_DEVICES += zyxel_xgs1210-12-a1
define Device/zyxel_xgs1210-12-b1
$(Device/zyxel_xgs1210-12)
DEVICE_VARIANT := B1
endef
TARGET_DEVICES += zyxel_xgs1210-12-b1
define Device/zyxel_xgs1250-12-common
SOC := rtl9302
UIMAGE_MAGIC := 0x93001250
ZYXEL_VERS := ABWE
DEVICE_VENDOR := Zyxel
DEVICE_MODEL := XGS1250-12
DEVICE_PACKAGES := kmod-hwmon-gpiofan kmod-thermal
IMAGE_SIZE := 13312k
KERNEL := \
kernel-bin | \
append-dtb | \
rt-compress | \
rt-loader | \
uImage none
KERNEL_INITRAMFS := \
kernel-bin | \
append-dtb | \
rt-compress | \
zyxel-vers | \
rt-loader | \
uImage none
endef
define Device/zyxel_xgs1250-12-a1
$(Device/zyxel_xgs1250-12-common)
SUPPORTED_DEVICES += zyxel,xgs1250-12
DEVICE_VARIANT := A1
endef
TARGET_DEVICES += zyxel_xgs1250-12-a1
define Device/zyxel_xgs1250-12-b1
$(Device/zyxel_xgs1250-12-common)
DEVICE_VARIANT := B1
endef
TARGET_DEVICES += zyxel_xgs1250-12-b1