openwrt/target/linux/realtek/image/rtl930x.mk
Lars Gierth 0a907daa80
realtek: rtl930x: add support for Hasivo F1100W-4SX-4XGT and variants
This commit adds support for the Hasivo F1100W-4SX-4XGT ethernet 10Gbase and PoE switch.
It also adds support for a whole matrix of variants of this device:

| Device              | Revision | RAM    | PoE | Console  |
|---------------------|----------|--------|-----|----------|
| F1100W-4SX-4XGT     | v1.03    | 256 MB | n/a | RJ45     |
| F1100W-4SX-4XGT     | v1.02    | 512 MB | n/a | RJ45     |
| F1100W-4SX-4XGT-SE  | v1.03    | 256 MB | n/a | internal |
| F1100W-4SX-4XGT-SE  | v1.02    | 512 MB | n/a | internal |
| F1100WP-4SX-4XGT    | v1.03    | 256 MB | yes | RJ45     |
| F1100WP-4SX-4XGT    | v1.02    | 512 MB | yes | RJ45     |
| F1100WP-4SX-4XGT-SE | v1.03    | 256 MB | yes | internal |
| F1100WP-4SX-4XGT-SE | v1.02    | 512 MB | yes | internal |

The devices are identical except for presence of the PoE daughter board,
RJ45 console port, and 256 or 512 MB RAM.

The non-512 MB image also works on the older 512 MB board revisions, but not vice versa.

Credit to @mensi @bevanweiss @markc1984

Hardware
--------

|          |                                                           |
|----------|-----------------------------------------------------------|
| SoC      | RTL9303 rev B                                             |
| RAM      | 256 MB Samsung K4B2G1646F DDR3L (board revision v1.03),   |
|          | or 512 MB unknown module (board revision v1.02 and older) |
| Flash    | 32 MB Macronix MX25L25645G SPI NOR,                       |
|          | 29 MiB usable by OpenWrt                                  |
| Ethernet | 4x SFP+ via SoC (10G/2.5G/1G),                            |
|          | 4x RJ45 via 4x RTL8261BE PHY (10G/5G/2.5G/1G/100M/10M)    |
| PoE      | only on WP variants                                       |
|          | 1x 802.3bt 90 W (port 5)                                  |
|          | 3x 802.3at 30 W (ports 6, 7, 8)                           |
|          | via daughter board with Hasivo HS104PTI controller        |
|          | PoE works but is unmanaged --> future work                |
| LEDs     | 1x system orange/green, 8x link green/red, 4x PoE orange  |
| Button   | Reset                                                     |
| Console  | RJ45 38400 bps 8n1, or pin holes on SE variants           |

Installing OpenWrt
------------------

Note: With vendor firmware 7.1.9, the bootloader's network profile is broken.
We need to select a different profile with port/phy overlap to make the TFTP
transfer work. Then only port 5 works in the OpenWrt initramfs, but all ports
work fine after flashing, when we don't need the profile trick anymore.

1. Attach to RJ45 serial console port using a cisco cable.
2. Attach your computer to Port 5 (the first RJ45 port).
3. Serve initramfs-kernel.bin on TFTP 192.168.1.111.
4. Power on the device.
5. Interrupt U-Boot by pressing `Ctrl+C`, then `Z`, then `H`, during 3 second countdown.
6. Run: `setenv boardmodel 'RTL9303_5x8261BE_2XGE_ZHIHUI' ; rtk network on`
7. Run: `tftpboot 0x84f00000 initramfs-kernel.bin ; bootm 0x84f00000`
8. Use `mtd dump` to make backups of all flash partitions.
9. Use SCP to copy `squashfs-sysupgrade.bin` to the device, then run `sysupgrade`.

Restoring factory firmware
--------------------------

OpenWrt uses the `RUNTIME` and `RUNTIME2` partitions as one combined partition.
To restore them from backups, boot from `initramfs-kernel.bin` just like during
the installation, then use `mtd write` to write your backups of the factory
`mtd5` and `mtd6` partitions.

Notes/Quirks
------------

- U-Boot interruption is obfuscated. Press `Ctrl+C`, then `Z`, then `H`,
  during the 3 second countdown.
- U-Boot rtk network profile is broken. Use the `RTL9303_5x8261BE_2XGE_ZHIHUI` profile
  instead, it makes at least port 5 work.
- MAC address is stored on the `RUNTIME` or `RUNTIME2` partitions, which are used by OpenWrt.
  Instead, we generate one random MAC address and store it in the U-Boot environment.
- PoE works but is unmanaged. The HS104 driver is worked on in
  https://github.com/openwrt/openwrt/pull/22245 and will work with ethtool and the
  kernel's new `pse-pd` subsystem.

Signed-off-by: Lars Gierth <larsg@systemli.org>
Link: https://github.com/openwrt/openwrt/pull/23020
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-05-28 22:10:00 +02:00

328 lines
7.8 KiB
Makefile

# SPDX-License-Identifier: GPL-2.0-only
include ./common.mk
define Device/d-link_dgs-1250-28x
SOC := rtl9301
DEVICE_VENDOR := D-Link
DEVICE_MODEL := DGS-1250-28X
DEVICE_PACKAGES += kmod-hwmon-lm75
IMAGE_SIZE := 24576k
$(Device/kernel-lzma)
endef
TARGET_DEVICES += d-link_dgs-1250-28x
define Device/hasivo_f1100w-4sx-4xgt-common
SOC := rtl9303
DEVICE_VENDOR := Hasivo
DEVICE_MODEL := F1100W-4SX-4XGT
DEVICE_ALT0_VENDOR := Hasivo
DEVICE_ALT0_MODEL := F1100W-4SX-4XGT-SE
DEVICE_ALT1_VENDOR := Hasivo
DEVICE_ALT1_MODEL := F1100WP-4SX-4XGT
DEVICE_ALT2_VENDOR := Hasivo
DEVICE_ALT2_MODEL := F1100WP-4SX-4XGT-SE
DEVICE_PACKAGES := kmod-phy-realtek rtl8261n-firmware
IMAGE_SIZE := 29696k
$(Device/kernel-lzma)
endef
define Device/hasivo_f1100w-4sx-4xgt
$(Device/hasivo_f1100w-4sx-4xgt-common)
endef
TARGET_DEVICES += hasivo_f1100w-4sx-4xgt
define Device/hasivo_f1100w-4sx-4xgt-512mb
$(Device/hasivo_f1100w-4sx-4xgt-common)
DEVICE_VARIANT := 512MB
DEVICE_ALT0_VARIANT := 512MB
DEVICE_ALT1_VARIANT := 512MB
DEVICE_ALT2_VARIANT := 512MB
endef
TARGET_DEVICES += hasivo_f1100w-4sx-4xgt-512mb
define Device/hasivo_s1100w-8xgt-se
SOC := rtl9303
DEVICE_VENDOR := Hasivo
DEVICE_MODEL := S1100W-8XGT-SE
IMAGE_SIZE := 12288k
DEVICE_PACKAGES := rtl8264b-firmware
$(Device/kernel-lzma)
endef
TARGET_DEVICES += hasivo_s1100w-8xgt-se
define Device/hasivo_s1100wp-8gt-se
SOC := rtl9303
DEVICE_VENDOR := Hasivo
DEVICE_MODEL := S1100WP-8GT-SE
IMAGE_SIZE := 12288k
$(Device/kernel-lzma)
endef
TARGET_DEVICES += hasivo_s1100wp-8gt-se
define Device/hasivo_s600wp-5gt-2sx-se
SOC := rtl9303
DEVICE_VENDOR := Hasivo
DEVICE_MODEL := S600WP-5GT-2SX-SE
IMAGE_SIZE := 12288k
$(Device/kernel-lzma)
endef
TARGET_DEVICES += hasivo_s600wp-5gt-2sx-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/ubnt_usw-aggregation
SOC := rtl9303
DEVICE_VENDOR := Ubiquiti
DEVICE_MODEL := UniFi USW Aggregation
IMAGE_SIZE := 14464k
$(Device/kernel-lzma)
endef
TARGET_DEVICES += ubnt_usw-aggregation
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_sks7300-4x4t
SOC := rtl9303
DEVICE_VENDOR := XikeStor
DEVICE_MODEL := SKS7300-4X4T
DEVICE_PACKAGES := kmod-hwmon-lm75
KERNEL_SIZE:= 8192k
IMAGE_SIZE := 28160k
KERNEL := \
kernel-bin | \
append-dtb | \
lzma | \
xikestor-sks7300-img
KERNEL_INITRAMFS := \
kernel-bin | \
append-dtb | \
lzma | \
xikestor-sks7300-img
IMAGE/sysupgrade.bin := \
append-kernel | \
pad-to 8192k | \
append-rootfs | \
pad-rootfs | \
check-size | \
append-metadata
endef
TARGET_DEVICES += xikestor_sks7300-4x4t
define Device/xikestor_sks8300-8t
SOC := rtl9303
UIMAGE_MAGIC := 0x93000000
DEVICE_VENDOR := XikeStor
DEVICE_MODEL := SKS8300-8T
DEVICE_PACKAGES := kmod-hwmon-lm75 rtl8261n-firmware
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_sks8300-8t
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_sks8300-12e2t2x
SOC := rtl9302
UIMAGE_MAGIC := 0x93000000
DEVICE_VENDOR := XikeStor
DEVICE_MODEL := SKS8300-12E2T2X
DEVICE_PACKAGES := rtl8261n-firmware
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_sks8300-12e2t2x
define Device/xikestor_sks8310-8x
SOC := rtl9303
UIMAGE_MAGIC := 0x93000000
DEVICE_VENDOR := XikeStor
DEVICE_MODEL := SKS8310-8X
DEVICE_PACKAGES := kmod-hwmon-lm75
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
DEVICE_PACKAGES += rtl8261n-firmware
endef
TARGET_DEVICES += zyxel_xgs1250-12-b1
define Device/zyxel_xgs1930-28hp
SOC := rtl9301
DEVICE_MODEL := XGS1930-28HP
DEVICE_PACKAGES := kmod-hwmon-gpiofan
FLASH_ADDR := 0xb4260000
IMAGE_SIZE := 30336k
ZYNFW_ALIGN := 0x10000
$(Device/zyxel_zynos)
endef
TARGET_DEVICES += zyxel_xgs1930-28hp
define Device/zyxel_xmg1915
SOC := rtl9302
FLASH_ADDR := 0xb4270000
IMAGE_SIZE := 30336k
ZYNFW_ALIGN := 0x10000
$(Device/zyxel_zynos)
endef
define Device/zyxel_xmg1915-10e
DEVICE_MODEL := XMG1915-10E
$(Device/zyxel_xmg1915)
endef
TARGET_DEVICES += zyxel_xmg1915-10e
define Device/zyxel_xmg1915-10ep
DEVICE_MODEL := XMG1915-10EP
$(Device/zyxel_xmg1915)
DEVICE_PACKAGES := realtek-poe
endef
TARGET_DEVICES += zyxel_xmg1915-10ep