Skip to content

realtek: rtl930x: add support for MokerLink 2G080GM - #25193

Open
ctalaveraw wants to merge 1 commit into
openwrt:mainfrom
ctalaveraw:mokerlink-2g080gm-submit
Open

ctalaveraw wants to merge 1 commit into
openwrt:mainfrom
ctalaveraw:mokerlink-2g080gm-submit

Conversation

@ctalaveraw

Copy link
Copy Markdown

This PR adds support for the MokerLink 2G080GM, an 8-port 2.5GbE
managed switch based on the Realtek RTL9303.

Device specification

  • SoC: Realtek RTL9303
  • RAM: 128 MiB
  • Flash: 16 MiB Fudan FM25Q128 SPI NOR
  • Ethernet: 8x 10/100/1000/2500BASE-T
  • PHYs: 8x Realtek RTL8221B
  • Console: 38400 8N1
  • Button: reset, GPIO 5 active-low
  • System LED: GPIO 0
  • Bootloader: Realtek U-Boot 2011.12

The factory MAC address is stored as ethaddr in the U-Boot
environment at 0xe0000 and is exposed through NVMEM.

Flash layout

  • 0x000000-0x0e0000: U-Boot / LOADER
  • 0x0e0000-0x0f0000: U-Boot environment / BDINFO
  • 0x0f0000-0x100000: SYSINFO
  • 0x100000-0x200000: vendor configuration / JFFS2 CFG
  • 0x200000-0x300000: vendor log / JFFS2 LOG
  • 0x300000-0xf00000: firmware / RUNTIME
  • 0xf00000-0x1000000: OEMINFO

Image format

The stock bootloader uses legacy uImage magic 0x83800000 for the
RUNTIME image.

This PR sets both UIMAGE_MAGIC and openwrt,ih-magic to
0x83800000 so that the image generated by OpenWrt is accepted by the
vendor bootloader and correctly split into kernel/rootfs partitions by
OpenWrt.

A dedicated squashfs-factory.bix image is generated for installation
from the stock web interface. The regular squashfs-sysupgrade.bin
image is used for subsequent OpenWrt upgrades.

Installation from stock firmware

  1. Open Management -> Firmware in the stock web interface.
  2. Select:
    • Action: Upgrade
    • Method: HTTP
  3. Upload the OpenWrt squashfs-factory.bix image.
  4. Wait for the stock firmware to report that the upgrade completed.
  5. Reboot the switch.

No U-Boot environment modification is required for normal
installation.

Recovery

An OpenWrt initramfs image can be loaded from U-Boot via TFTP at
0x84f00000.

The serial console operates at 38400 8N1.

The stock firmware boots from the RUNTIME partition at
0xb4300000.

Hardware validation

Tested on a MokerLink 2G080GM:

  • all 8 RTL8221B ports
  • 100M, 1G and 2.5G Ethernet links
  • port LEDs
  • system LED
  • reset button
  • cold boot and warm reboot
  • access VLANs
  • VLAN isolation
  • tagged VLAN trunking
  • persistent OpenWrt installation
  • OpenWrt sysupgrade
  • stock firmware restoration
  • stock web UI -> OpenWrt factory.bix installation
  • factory MAC preservation

The stock web upgrader was also tested with an intentionally invalid
uImage header checksum and correctly rejected the image.

The final patch was built successfully against current OpenWrt main.

@openwrt openwrt Bot added the target/realtek pull request/issue for realtek target label Sep 15, 2026
Comment thread target/linux/realtek/dts/rtl9303_mokerlink_2g080gm.dts Outdated
Comment thread target/linux/realtek/dts/rtl9303_mokerlink_2g080gm.dts Outdated
Comment thread target/linux/realtek/base-files/etc/board.d/02_network Outdated

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit checks

  • 2478ad7 "realtek: rtl930x: add support for MokerLink 2G080GM" — the hardware specification omits the system LED (the DTS adds one), the UART header location/pinout and the power rating, and says "16 MiB SPI NOR" while the DTS names fudan,fm25q128.
  • 2478ad7 — install step 2 reads "Select Upgrade, HTTP and Image0", but the PR body's tested procedure lists only Action and Method; make the two agree so the target slot is unambiguous.

Generated by Claude Code

Comment thread target/linux/realtek/dts/rtl9303_mokerlink_2g080gm.dts Outdated
Comment thread target/linux/realtek/image/rtl930x.mk Outdated
The MokerLink 2G080GM is an 8-port 2.5GbE managed switch based
on the Realtek RTL9303.

Device specification:
- SoC: Realtek RTL9303
- RAM: 128 MiB
- Flash: 16 MiB Fudan FM25Q128 SPI NOR
- Ethernet: 8x 10/100/1000/2500BASE-T
- PHYs: 8x Realtek RTL8221B
- Console: 38400 8N1
- Button: reset
- LED: green system/status LED
- Bootloader: Realtek U-Boot 2011.12

Flash layout:
- 0x000000-0x0e0000: U-Boot
- 0x0e0000-0x0f0000: U-Boot environment / BDINFO
- 0x0f0000-0x100000: SYSINFO
- 0x100000-0x200000: vendor configuration
- 0x200000-0x300000: vendor log
- 0x300000-0xf00000: firmware
- 0xf00000-0x1000000: OEMINFO

The factory MAC address is read from ethaddr in the U-Boot environment.

The vendor bootloader uses legacy uImage magic 0x83800000.
Generate both OpenWrt images with this magic and configure the
firmware splitter accordingly.

Installation:
1. Open Management -> Firmware in the stock web interface.
2. Select Upgrade and HTTP.
3. Upload the squashfs-factory.bix image.
4. Reboot after the upgrade completes.

The factory image has been verified using the stock web upgrader.
Normal OpenWrt sysupgrade is supported after installation.

Signed-off-by: Christian Talavera <[email protected]>
@ctalaveraw
ctalaveraw force-pushed the mokerlink-2g080gm-submit branch from 2478ad7 to d2dda9d Compare September 15, 2026 18:31
@ctalaveraw

Copy link
Copy Markdown
Author

Addressed the review feedback in d2dda9d:

  • compacted the RTL9303 LED configuration
  • removed the stock partition comments
  • sorted the board and image entries
  • switched the system LED to color/function bindings
  • updated the commit message with the Fudan FM25Q128 and system LED
  • corrected the stock web installation steps to remove the Image0 reference

The amended commit builds successfully, and the generated factory/sysupgrade images still use uImage magic 0x83800000 with the factory image remaining an exact prefix of the sysupgrade image.

I did not add UART header pinout/location or power-rating details because those were not independently verified.

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit checks

  • d2dda9d "realtek: rtl930x: add support for MokerLink 2G080GM" — the Installation section documents no way back: the PR body lists "stock firmware restoration" as tested and gives a TFTP initramfs load address (0x84f00000) and console rate, none of which reach the commit message. Add a revert-to-stock / recovery note with the verbatim addresses.

Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

target/realtek pull request/issue for realtek target

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants