1
1
openwrt/target/linux/realtek/dts
Jonas Jelonek e4ed8e7fe7
realtek: add support for Ubiquiti UniFi USW Aggregation
Add support for the RTL9303-based Ubiquiti UniFi USW Aggregation, an
8-port 10G SFP+ aggregation switch.

Hardware
========

  - RTL9303 SoC
  - 256 MiB DDR
  - 16 MiB SPI-NOR flash
  - 8x 1G/10G SFP+ cages
  - Per-port LEDs: 1x white LED per SFP+ cage
  - Buttons: 1x Reset
  - Console: TTL 3.3V, 115200 8N1, internal unpopulated 4-hole THT
    footprint (the device must be opened to solder a header)
    - pinout (with the front panel facing you, left to right):
      VCC/unused, RX, TX, GND
  - Front touch display (see below)
  - Software chain:
    - U-Boot (Ubiquiti-flavoured)
    - UniFi OS (OpenWrt-based)

MAC address
===========

Single MAC address derived from the eeprom partition. Applied to all
switch ports.

Front touch display
===================

The unit has a touch-capable front display, driven by a dedicated
STM32-based MCU connected to the host via UART. The MCU runs Ubiquiti's
LCM firmware and exposes a high-level JSON protocol (page selection,
button-press events, etc.); arbitrary pixel-level control is not
possible without replacing the MCU firmware. The display is therefore
not supported beyond what the stock LCM firmware offers.

Disclaimer
==========

Stock uses a dual-bank layout (kernel0/kernel1, 7 MiB each). OpenWrt
replaces both banks with a single contiguous firmware partition.
Flashing OpenWrt overwrites both stock kernel slots; U-Boot remains
intact and can be used for recovery.

The stock firmware blob is RSA-signed and cannot be flashed via the
UniFi web UI. Installation has to be done from a root shell on the
running UniFi OS.

Installation
============

1. Enable SSH on the stock UniFi OS and log in as root.

2. Copy the OpenWrt sysupgrade image to /tmp on the switch (e.g. via
   scp).

3. Adjust IMG below to point at the copied file, then run the block as
   a whole. It writes kernel0, splits into kernel1 if the image is
   larger than that slot (otherwise invalidates kernel1 so U-Boot
   cannot pick a stale bank), and reboots:

   IMG=/tmp/openwrt-realtek-rtl930x-ubnt_usw-aggregation-squashfs-sysupgrade.bin
   K0_BLOCKS=$((0x710000 / 0x10000))

   dd if="$IMG" of=/dev/mtdblock2 bs=64k count=$K0_BLOCKS conv=fsync
   if [ "$(wc -c < "$IMG")" -gt $((0x710000)) ]; then
       dd if="$IMG" of=/dev/mtdblock3 bs=64k skip=$K0_BLOCKS conv=fsync
   else
       dd if=/dev/zero of=/dev/mtdblock3 bs=64k count=1 conv=fsync
   fi
   sync
   reboot

   The switch comes up in OpenWrt after reboot.

It does not matter which bank stock booted from when the dd block
runs: both banks are touched in the same pass (kernel0 written, kernel1
either written or invalidated). With kernel1 invalidated, U-Boot's
internal fallback kicks in and permanently switches to kernel0 on the
next boot, so the device stays on OpenWrt as long as kernel0 is
bootable.

Recovery
========

Since the installation procedure invalidates or partially overwrites
the second bank, recovery requires serial console access (see Hardware
above for pinout).

1. Interrupt U-Boot autoboot by spamming a key during early boot to
   drop into the U-Boot prompt.

2. Bring up networking:

   rtk network on

3. Transfer an OpenWrt initramfs image via TFTP and boot it:

   tftpboot 0x82000000 <server>:<initramfs.bin>
   bootm 0x82000000

4. From the running initramfs OpenWrt, re-run the installation
   procedure above (the dd block, with $IMG pointing at the image on
   /tmp).

Return to stock firmware
========================

There is no fully-supported revert path. The stock firmware blob is a
Ubiquiti UBNT archive (header + parts, see firmware-utils' fw.h) that
embeds a u-boot and a kernel0 uImage payload; only the latter is
relevant when writing back to the kernel partitions.

The snippet below extracts the kernel0 uImage from such a blob by
locating the uImage magic and using the size carried in the uImage
header itself, without parsing any UBNT framing. It is provided as a
best-effort starting point; verify the result before flashing,
otherwise you're on your own:

   BLOB=US.rtl930x_X.Y.Z.bin
   OFF=$(grep -aboF $'\x27\x05\x19\x56' "$BLOB" | head -1 | cut -d: -f1)
   SIZE=$(( $(dd if="$BLOB" bs=1 skip=$((OFF + 12)) count=4 2>/dev/null \
               | hexdump -e '1/4 "%u"') + 64 ))
   dd if="$BLOB" of=kernel0.uImage bs=1 skip="$OFF" count="$SIZE"

Once you have a clean uImage, write it to both kernel banks (since
the bootselect mechanism is not yet decoded, this guarantees U-Boot
picks the stock image regardless of bank):

   dd if=kernel0.uImage of=/dev/mtdblock2 bs=64k conv=fsync
   dd if=kernel0.uImage of=/dev/mtdblock3 bs=64k conv=fsync

Link: https://github.com/openwrt/openwrt/pull/23506
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-05-24 19:32:31 +02:00
..
macros.dtsi realtek: support configurable LED interface mode on RTL930x 2026-05-03 01:32:52 +02:00
rtl83xx_d-link_dgs-1210_common.dtsi realtek: Drop unused property on DGS-1210 gpio0 2025-01-28 07:30:32 +01:00
rtl83xx_d-link_dgs-1210_gpio_sfp.dtsi realtek: add full SFP support to D-Link DGS-1210-28 series 2024-09-15 16:40:40 +02:00
rtl83xx_d-link_dgs-1210_gpio.dtsi realtek: switch RTL8231 driver for D-Link DGS-1210 2025-01-28 07:30:33 +01:00
rtl83xx_hpe_1920.dtsi realtek: switch HPE 1920 series to NVMEM 2026-02-13 12:06:20 +01:00
rtl83xx_panasonic_mxxeg-pn28xx0k.dtsi realtek: normalize dts directory 2024-09-14 16:56:37 +02:00
rtl93xx_linksys_lgs3xxc_nand_common.dtsi realtek: dts: convert LGS3xxC to NVMEM 2026-03-14 10:50:47 +01:00
rtl838x.dtsi realtek: pcs: derive SerDes link count from DT at probe time 2026-05-23 11:02:15 +02:00
rtl839x_zyxel_gs1920-24hp-common.dtsi realtek: dts: convert EXTERNAL_PHY() to PHY_C22() 2026-03-31 12:56:24 +02:00
rtl839x.dtsi realtek: pcs: derive SerDes link count from DT at probe time 2026-05-23 11:02:15 +02:00
rtl930x.dtsi realtek: pcs: derive SerDes link count from DT at probe time 2026-05-23 11:02:15 +02:00
rtl931x.dtsi realtek: pcs: derive SerDes link count from DT at probe time 2026-05-23 11:02:15 +02:00
rtl8380_d-link_dgs-1210-10mp-f.dts realtek: drop INTERNAL_PHY() macro 2026-04-13 18:42:33 +02:00
rtl8380_datto_l8.dts realtek: drop INTERNAL_PHY() macro 2026-04-13 18:42:33 +02:00
rtl8380_engenius_ews2910p-v1.dts realtek: engenius_ews2910p: support multiple hardware versions 2025-05-31 23:19:01 +02:00
rtl8380_engenius_ews2910p-v3.dts realtek: support EnGenius EWS2910P v3 2025-05-31 23:19:01 +02:00
rtl8380_engenius_ews2910p.dtsi realtek: drop INTERNAL_PHY() macro 2026-04-13 18:42:33 +02:00
rtl8380_hpe_1920-8g-poe-65w.dts realtek: normalize dts directory 2024-09-14 16:56:37 +02:00
rtl8380_hpe_1920-8g-poe-180w.dts realtek: HPE 1920 8G PoE+ 180W move fans to hwmon 2025-01-15 08:21:08 +01:00
rtl8380_hpe_1920-8g.dts realtek: normalize dts directory 2024-09-14 16:56:37 +02:00
rtl8380_hpe_1920-8g.dtsi realtek: drop INTERNAL_PHY() macro 2026-04-13 18:42:33 +02:00
rtl8380_linksys_lgs310c.dts realtek: drop INTERNAL_PHY() macro 2026-04-13 18:42:33 +02:00
rtl8380_netgear_gigabit.dtsi realtek: drop INTERNAL_PHY() macro 2026-04-13 18:42:33 +02:00
rtl8380_netgear_gs108t-v3.dts realtek: normalize dts directory 2024-09-14 16:56:37 +02:00
rtl8380_netgear_gs110tpp-v1.dts realtek: dts: convert EXTERNAL_PHY() to PHY_C22() 2026-03-31 12:56:24 +02:00
rtl8380_netgear_gs110tup-v1.dts realtek: dts: convert EXTERNAL_PHY() to PHY_C22() 2026-03-31 12:56:24 +02:00
rtl8380_netgear_gs308t-v1.dts realtek: normalize dts directory 2024-09-14 16:56:37 +02:00
rtl8380_netgear_gs310tp-v1.dts realtek: dts: replace ports by ethernet-ports 2026-03-01 14:19:36 +01:00
rtl8380_panasonic_m8eg-pn28080k.dts realtek: drop INTERNAL_PHY() macro 2026-04-13 18:42:33 +02:00
rtl8380_tplink_sg2xxx.dtsi realtek: drop INTERNAL_PHY() macro 2026-04-13 18:42:33 +02:00
rtl8380_tplink_sg2008p-v1.dts realtek: rtl838x: drop SFP pseudo-PHYs and phy-handle 2025-12-09 00:28:41 +01:00
rtl8380_tplink_sg2210p-v3.dts realtek: dts: replace ports by ethernet-ports 2026-03-01 14:19:36 +01:00
rtl8380_zyxel_gs1900_gpio_emulated.dtsi realtek: rtl838x: drop GS1900 MDIO reset GPIO 2026-02-24 21:29:26 +01:00
rtl8380_zyxel_gs1900_gpio.dtsi realtek: rtl838x: drop GS1900 MDIO reset GPIO 2026-02-24 21:29:26 +01:00
rtl8380_zyxel_gs1900-8-a1.dts realtek: rtl838x: rename GS1900 series v1/v2 to A1/B1 2025-09-24 13:41:04 +02:00
rtl8380_zyxel_gs1900-8-b1.dts realtek: rtl838x: rename GS1900 series v1/v2 to A1/B1 2025-09-24 13:41:04 +02:00
rtl8380_zyxel_gs1900-8hp-a1.dts realtek: rtl838x: rename GS1900 series v1/v2 to A1/B1 2025-09-24 13:41:04 +02:00
rtl8380_zyxel_gs1900-8hp-b1.dts realtek: rtl838x: rename GS1900 series v1/v2 to A1/B1 2025-09-24 13:41:04 +02:00
rtl8380_zyxel_gs1900-10hp-a1.dts realtek: dts: replace ports by ethernet-ports 2026-03-01 14:19:36 +01:00
rtl8380_zyxel_gs1900.dtsi realtek: drop INTERNAL_PHY() macro 2026-04-13 18:42:33 +02:00
rtl8382_allnet_all-sg8208m.dts realtek: drop INTERNAL_PHY() macro 2026-04-13 18:42:33 +02:00
rtl8382_apresia_aplgs120gtss.dts realtek: dts: convert EXTERNAL_SFP_PHY_FULL to PHY_C22_SFP 2026-04-22 16:58:04 +02:00
rtl8382_d-link_dgs-1210-10p.dts realtek: drop INTERNAL_PHY() macro 2026-04-13 18:42:33 +02:00
rtl8382_d-link_dgs-1210-16.dts realtek: dts: drop EXTERNAL_SFP_PHY macro 2026-04-22 16:58:04 +02:00
rtl8382_d-link_dgs-1210-20.dts realtek: dts: drop EXTERNAL_SFP_PHY macro 2026-04-22 16:58:04 +02:00
rtl8382_d-link_dgs-1210-26.dts realtek: drop INTERNAL_PHY() macro 2026-04-13 18:42:33 +02:00
rtl8382_d-link_dgs-1210-28_common.dtsi realtek: dts: convert EXTERNAL_SFP_PHY_FULL to PHY_C22_SFP 2026-04-22 16:58:04 +02:00
rtl8382_d-link_dgs-1210-28.dts realtek: add full SFP support to D-Link DGS-1210-28 series 2024-09-15 16:40:40 +02:00
rtl8382_d-link_dgs-1210-28mp-f.dts realtek: d-link: add support for dgs-1210-28p-f 2024-09-24 20:59:50 +02:00
rtl8382_d-link_dgs-1210-28p_common.dtsi realtek: d-link: add support for dgs-1210-28p-f 2024-09-24 20:59:50 +02:00
rtl8382_d-link_dgs-1210-28p-f.dts realtek: d-link: add support for dgs-1210-28p-f 2024-09-24 20:59:50 +02:00
rtl8382_hpe_1920-16g.dts realtek: dts: replace ports by ethernet-ports 2026-03-01 14:19:36 +01:00
rtl8382_hpe_1920-24g-poe-180w.dts realtek: HPE 1920 24G PoE+ 180W/370W move fans to hwmon 2025-01-16 07:32:16 +01:00
rtl8382_hpe_1920-24g-poe-370w.dts realtek: HPE 1920 24G PoE+ 180W/370W move fans to hwmon 2025-01-16 07:32:16 +01:00
rtl8382_hpe_1920-24g.dts realtek: rtl838x: refactor hpe_1920-24g dts 2024-12-31 08:29:56 +01:00
rtl8382_hpe_1920-24g.dtsi realtek: dts: convert EXTERNAL_PHY() to PHY_C22() 2026-03-31 12:56:24 +02:00
rtl8382_hpe_1920.dtsi realtek: dts: convert EXTERNAL_SFP_PHY_FULL to PHY_C22_SFP 2026-04-22 16:58:04 +02:00
rtl8382_inaba_aml2-17gp.dts realtek: drop INTERNAL_PHY() macro 2026-04-13 18:42:33 +02:00
rtl8382_iodata_bsh-g24mb.dts realtek: drop INTERNAL_PHY() macro 2026-04-13 18:42:33 +02:00
rtl8382_panasonic_m16eg-pn28160k.dts realtek: drop INTERNAL_PHY() macro 2026-04-13 18:42:33 +02:00
rtl8382_panasonic_m24eg-pn28240k.dts realtek: drop INTERNAL_PHY() macro 2026-04-13 18:42:33 +02:00
rtl8382_tplink_t1600g-28ts-v3.dts realtek: drop INTERNAL_PHY() macro 2026-04-13 18:42:33 +02:00
rtl8382_zyxel_gs1900-16-a1.dts realtek: dts: convert EXTERNAL_PHY() to PHY_C22() 2026-03-31 12:56:24 +02:00
rtl8382_zyxel_gs1900-24-a1.dts realtek: use common dtsi for Zyxel GS1900-24 2026-01-27 01:34:21 +01:00
rtl8382_zyxel_gs1900-24-b1.dts realtek: add Zyxel GS1900-24 B1 device definition 2026-01-27 01:34:21 +01:00
rtl8382_zyxel_gs1900-24.dtsi realtek: dts: convert EXTERNAL_PHY() to PHY_C22() 2026-03-31 12:56:24 +02:00
rtl8382_zyxel_gs1900-24e-a1.dts realtek: dts: convert EXTERNAL_PHY() to PHY_C22() 2026-03-31 12:56:24 +02:00
rtl8382_zyxel_gs1900-24ep-a1.dts realtek: dts: convert EXTERNAL_PHY() to PHY_C22() 2026-03-31 12:56:24 +02:00
rtl8382_zyxel_gs1900-24hp-a1.dts realtek: dts: convert EXTERNAL_PHY() to PHY_C22() 2026-03-31 12:56:24 +02:00
rtl8382_zyxel_gs1900-24hp-b1.dts realtek: dts: convert EXTERNAL_PHY() to PHY_C22() 2026-03-31 12:56:24 +02:00
rtl8391_zyxel_gs1920-24hp-v2.dts realtek: dts: convert EXTERNAL_SFP_PHY_FULL to PHY_C22_SFP 2026-04-22 16:58:04 +02:00
rtl8392_zyxel_gs1920-24hp-v1.dts realtek: dts: adapt RTL839x mdio bus topology 2026-05-06 10:52:40 +02:00
rtl8393_d-link_dgs-1210-52.dts realtek: dts: adapt RTL839x mdio bus topology 2026-05-06 10:52:40 +02:00
rtl8393_edgecore_ecs4100-12ph.dts treewide: remove unused u-boot,env compatible 2026-05-14 23:02:47 +02:00
rtl8393_hpe_1920-48g-poe.dts realtek: dts: adapt RTL839x mdio bus topology 2026-05-06 10:52:40 +02:00
rtl8393_hpe_1920-48g.dts realtek: dts: adapt RTL839x mdio bus topology 2026-05-06 10:52:40 +02:00
rtl8393_hpe_1920.dtsi realtek: dts: adapt RTL839x mdio bus topology 2026-05-06 10:52:40 +02:00
rtl8393_netgear_gs750e.dts realtek: dts: adapt RTL839x mdio bus topology 2026-05-06 10:52:40 +02:00
rtl8393_panasonic_m48eg-pn28480k.dts realtek: dts: adapt RTL839x mdio bus topology 2026-05-06 10:52:40 +02:00
rtl8393_tplink_sg2452p-v4.dts realtek: dts: adapt RTL839x mdio bus topology 2026-05-06 10:52:40 +02:00
rtl8393_zyxel_gs1900-48-a1.dts realtek: extract shared GS1900-48 dtsi 2026-04-11 19:32:57 +02:00
rtl8393_zyxel_gs1900-48.dtsi realtek: dts: adapt RTL839x mdio bus topology 2026-05-06 10:52:40 +02:00
rtl8393_zyxel_gs1900-48hp-a1.dts realtek: add Zyxel GS1900-48HP A1 support 2026-04-11 19:35:53 +02:00
rtl9301_d-link_dgs-1250-28x.dts realtek: hwmon: backport lm75 alert polarity patches 2026-05-06 10:51:32 +02:00
rtl9301_linksys_lgs328c.dts realtek: dts: rtl93xx: use SWITCH_PORT_SFP for ports 2026-05-01 12:41:49 +02:00
rtl9301_zyxel_xgs1930-28hp.dts realtek: add support for Zyxel XGS1930-28HP 2026-05-17 13:12:18 +02:00
rtl9302_plasmacloud_common.dtsi realtek: rtl930x: psx8: specify RTL8224 reset GPIO 2026-05-13 11:34:34 +02:00
rtl9302_plasmacloud_mcx3.dts realtek: dts: rtl93xx: use SWITCH_PORT_SFP for ports 2026-05-01 12:41:49 +02:00
rtl9302_plasmacloud_psx8.dts realtek: rtl930x: Add support for Plasma Cloud PSX8 Switch 2025-08-28 21:07:57 +02:00
rtl9302_plasmacloud_psx10.dts realtek: dts: rtl93xx: use SWITCH_PORT_SFP for ports 2026-05-01 12:41:49 +02:00
rtl9302_xikestor_sks8300-12e2t2x.dts realtek: dts: rtl93xx: use macro for PHY port definitions 2026-05-01 12:41:49 +02:00
rtl9302_zyxel_xgs1x10-12-common.dtsi realtek: dts: rtl93xx: use PHY_* macros for Zyxel XGS1X10/1250 2026-05-01 12:41:49 +02:00
rtl9302_zyxel_xgs1010-12-a1.dts realtek: dts: rtl93xx: use PHY_* macros for Zyxel XGS1X10/1250 2026-05-01 12:41:49 +02:00
rtl9302_zyxel_xgs1210-12-a1.dts realtek: dts: rtl93xx: use PHY_* macros for Zyxel XGS1X10/1250 2026-05-01 12:41:49 +02:00
rtl9302_zyxel_xgs1210-12-b1.dts realtek: dts: rtl93xx: use PHY_* macros for Zyxel XGS1X10/1250 2026-05-01 12:41:49 +02:00
rtl9302_zyxel_xgs1210-12-common.dtsi realtek: switch Zyxel XGS1210 to NVMEM 2026-02-15 12:02:38 +01:00
rtl9302_zyxel_xgs1250-12-a1.dts realtek: force in-band autoneg on XGS1250-12 A1 10G PHYs 2026-03-31 12:54:57 +02:00
rtl9302_zyxel_xgs1250-12-b1.dts realtek: mdio: drop realtek,smi-address property 2026-03-21 22:26:02 +01:00
rtl9302_zyxel_xgs1250-12-common.dtsi realtek: dts: rtl93xx: use PHY_* macros for Zyxel XGS1X10/1250 2026-05-01 12:41:49 +02:00
rtl9302_zyxel_xmg1915-10e.dts realtek: make Zyxel XMG1915-10E generic for whole family 2026-05-11 10:34:53 +02:00
rtl9302_zyxel_xmg1915-10ep.dts realtek: add support for Zyxel XMG1915-10EP 2026-05-11 10:34:53 +02:00
rtl9302_zyxel_xmg1915.dtsi realtek: add support for Zyxel XMG1915-10EP 2026-05-11 10:34:53 +02:00
rtl9303_hasivo_s600wp-5gt-2sx-se.dts realtek: rtl930x: add Hasivo S600WP-5GT-2SX-SE 2026-04-24 12:17:26 +02:00
rtl9303_hasivo_s1100w-8xgt-se.dts realtek: dts: rtl93xx: use macro for PHY port definitions 2026-05-01 12:41:49 +02:00
rtl9303_hasivo_s1100wp-8gt-se.dts realtek: dts: convert devices to PHY_C45() 2026-04-01 14:12:14 +02:00
rtl9303_tplink_tl-st1008f-v2.dts realtek: dts: rtl93xx: replace LED magic values with macros 2026-05-01 12:41:49 +02:00
rtl9303_ubnt_usw-aggregation.dts realtek: add support for Ubiquiti UniFi USW Aggregation 2026-05-24 19:32:31 +02:00
rtl9303_vimin_vm-s100-0800ms.dts realtek: dts: rtl93xx: replace LED magic values with macros 2026-05-01 12:41:49 +02:00
rtl9303_xikestor_sks7300-4x4t.dts realtek: add support for XikeStor SKS7300-4X4T 2026-05-17 13:11:05 +02:00
rtl9303_xikestor_sks8300-8t.dts realtek: dts: add PHY_C45() macro 2026-04-01 14:12:14 +02:00
rtl9303_xikestor_sks8300-8x.dts realtek: dts: rtl93xx: replace LED magic values with macros 2026-05-01 12:41:49 +02:00
rtl9303_xikestor_sks8310-8x.dts realtek: dts: rtl93xx: replace LED magic values with macros 2026-05-01 12:41:49 +02:00
rtl9311_linksys_lgs352c.dts realtek: dts: rtl93xx: use SWITCH_PORT_SFP for ports 2026-05-01 12:41:49 +02:00
rtl9312_plasmacloud_common.dtsi realtek: rtl931x: psx28: specify RTL8224 reset GPIO 2026-05-13 11:34:34 +02:00
rtl9312_plasmacloud_esx28.dts realtek: rtl931x: Add support for Plasma Cloud ESX28 Switch 2025-10-04 16:16:22 +02:00
rtl9312_plasmacloud_psx28.dts realtek: rtl931x: psx28: specify POE MCU reset GPIO 2026-04-14 10:38:28 +02:00
rtl9313_xikestor_sks8300-12x-v1.dts realtek: dts: rtl93xx: use SWITCH_PORT_SFP for ports 2026-05-01 12:41:49 +02:00
rtl9313_zyxel_xs1930-10.dts realtek: reorganize DTS for Zyxel XS1930 2026-05-21 12:08:41 +02:00
rtl9313_zyxel_xs1930-12f.dts realtek: improve DTS readability for XS1930 switches 2026-05-21 12:08:42 +02:00
rtl9313_zyxel_xs1930-12hp.dts realtek: improve DTS readability for XS1930 switches 2026-05-21 12:08:42 +02:00
rtl9313_zyxel_xs1930-aqr813.dtsi realtek: add hog for PHY reset for XS1930-10 and -12HP 2026-05-21 12:08:42 +02:00
rtl9313_zyxel_xs1930.dtsi realtek: make LED set config for XS1930 more generic 2026-05-21 12:08:42 +02:00