Add support for the DrayTek VigorSwitch G2282x, a 28-port L2 access
switch based on the Realtek RTL9301.
- SoC: Realtek RTL9301
- RAM: 256 MiB
- Flash: SPI-NOR 64 MiB
- Ethernet: 24x GE copper + 4x 10G SFP+
- LEDs: 1x system status ("SYS"), 1x "MONITOR", per-port
link/activity via led_set
- Buttons: Reset, Stack
- Console: UART, 115200 8n1
Same chip and port configuration as rtl9301_d-link_dgs-1250-28x.dts,
so the &switch0/&mdio_bus0-2/ethernet-ports block is derived from
that file, with PHYs enclosed in ethernet-phy-package nodes. Ports
0-7 use qsgmii and ports 8-23 use usxgmii; a uniform qsgmii mode
fails PCS configuration (-EOPNOTSUPP) on ports 8-23. led_set1 for
SFP+ cages supports 10M/100M/1G/2.5G/5G/10G range, referencing the
identically wired rtl9301_d-link_dgs-1250-28x.dts board.
GPIO expanders
------------
Two RTL8231 I2C/MDC GPIO expanders are present. The one at address
0x0 backs the system LED (pin 29, always-on ~1 Hz blink, no status
encoding) and the 4 SFP+ cages' module-detect lines (read-only),
LOS is not wired on board. The one at address 0x18 drives a
single-digit 7-segment "Stack ID" display (pins 0-6: segments,
active-low; pin 8: decimal point; pin 7: a second corner dot with
no slot in the gpio-7-segment binding) plus the "MONITOR" LED
(pin 22, red, active-low) and the reset (pin 9) / stack (pin 10)
buttons. The digit display is declared but left disabled: enabling
it requires kmod package support 7 segment display. Both RTL8231's
also carry a disabled led-controller child, since mfd-core
unconditionally registers the rtl8231-leds cell and its probe
fails without a matching node.
Hardware monitor
------------
The native SoC i2c_mst1 engine carries an ADT7475 hardware monitor
and the 4 SFP+ cages on one shared master. The board is passively
cooled (no fan), so the ADT7475 here is monitor-only.
Flash layout
------------
64 MiB SPI-NOR, dual-image A/B: two uImage-capable "Kernel"/
"Kernel2" partitions (compatible = "openwrt,uimage", "denx,uimage"),
selected by a "bootpartition" variable stored in the Factory
partition rather than standard U-Boot env (so fw_setenv/saveenv
cannot read or persist it -- use the LOADER's own "setsys"/
"printsys"/"savesys" commands instead). platform.sh self-upgrades
whichever slot is currently active instead of flipping slots, so
the normal staged sysupgrade rewrite stays safe and no separate
boot-slot-select step is needed after flashing. bootpartition is
also validated in platform_check_image, since do_stage2 does not
check platform_do_upgrade's exit status and an unreadable
bootpartition would otherwise look like a successful upgrade.
MAC Address
------------
The MAC address is read from the BDINFO partition's U-Boot-env
"ethaddr" variable via the label-mac-device alias, and
board.d/02_network assigns it to the LAN bridge/ports.
Initial Flashing
------------
1. Attach to the serial console, 115200 8n1.
2. Power on and interrupt the U-Boot banner by pressing x to
reach the LOADER's password-protected console.
3. Set
printsys
setsys ipaddr <IP>
setsys serverip <IP>
rtk network on
savesys
The LOADER's network stack is off by default and neither ping nor
tftpboot will do anything without it. PHY init takes a few
seconds with no console output; this is not a hang.
Confirm with:
ping <serverip>
4. Optionally pin which flash slot this install will target, since
sysupgrade later targets whichever slot is active at that time.
This is stored in the Factory partition, not standard U-Boot env,
so it needs the LOADER's own "sys" commands rather than setenv/
saveenv:
printsys # confirm current bootpartition
setsys bootpartition <0|1>
printsys # confirm the new value in RAM
savesys # persists it to Factory
printsys # confirm it actually persisted
5. Serve the initramfs-kernel.bin image from a TFTP server reachable
at <serverip> (e.g. "atftpd --daemon --no-fork --directory
<dir-containing-the-image>"), then fetch and boot it directly
from the LOADER prompt:
tftpboot 81000000 initramfs-kernel.bin
bootm 81000000
tftpboot reports "Bytes transferred = N"; compare this against
the local image's exact file size before running bootm -- a
truncated transfer will otherwise fail confusingly partway
through boot instead of at the transfer itself. The load address
0x81000000 is above the uImage header's own Load Address
(0x80100000); loading at or below that address lets the in-place
LZMA decompressor overwrite its own not-yet-read input.
6. The resulting OpenWrt console comes up on the default LAN address
(192.168.1.1). Set network.lan.ipaddr via UCI to a reachable
address if needed.
7. Send the squashfs-sysupgrade.bin image to the device (e.g. via
"scp -O", since dropbear here only speaks legacy SCP, not SFTP)
and run sysupgrade as normal.
Assisted-By: Claude Sonnet <noreply@anthropic.com>
Signed-off-by: Jakob Baumann <jakobbaumann@riseup.net>
Link: https://github.com/openwrt/openwrt/pull/25171
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
OpenWrt Project is a Linux operating system targeting embedded devices. Instead of trying to create a single, static firmware, OpenWrt provides a fully writable filesystem with package management. This frees you from the application selection and configuration provided by the vendor and allows you to customize the device through the use of packages to suit any application. For developers, OpenWrt is the framework to build an application without having to build a complete firmware around it; for users this means the ability for full customization, to use the device in ways never envisioned.
Sunshine!
Download
Built firmware images are available for many architectures and come with a package selection to be used as WiFi home router. To quickly find a factory image usable to migrate from a vendor stock firmware to OpenWrt, try the Firmware Selector.
If your device is supported, please follow the Info link to see install instructions or consult the support resources listed below.
An advanced user may require additional or specific package. (Toolchain, SDK, ...) For everything else than simple firmware download, try the wiki download page:
Development
To build your own firmware you need a GNU/Linux, BSD or macOS system (case sensitive filesystem required). Cygwin is unsupported because of the lack of a case sensitive file system.
Requirements
You need the following tools to compile OpenWrt, the package names vary between distributions. A complete list with distribution specific packages is found in the Build System Setup documentation.
binutils bzip2 diff find flex gawk gcc-6+ getopt grep install libc-dev libz-dev
make4.1+ perl python3.8+ rsync subversion unzip which
Quickstart
-
Run
./scripts/feeds update -ato obtain all the latest package definitions defined in feeds.conf / feeds.conf.default -
Run
./scripts/feeds install -ato install symlinks for all obtained packages into package/feeds/ -
Run
make menuconfigto select your preferred configuration for the toolchain, target system & firmware packages. -
Run
maketo build your firmware. This will download all sources, build the cross-compile toolchain and then cross-compile the GNU/Linux kernel & all chosen applications for your target system.
Related Repositories
The main repository uses multiple sub-repositories to manage packages of
different categories. All packages are installed via the OpenWrt package
manager called opkg. If you're looking to develop the web interface or port
packages to OpenWrt, please find the fitting repository below.
-
LuCI Web Interface: Modern and modular interface to control the device via a web browser.
-
OpenWrt Packages: Community repository of ported packages.
-
OpenWrt Routing: Packages specifically focused on (mesh) routing.
-
OpenWrt Video: Packages specifically focused on display servers and clients (Xorg and Wayland).
Support Information
For a list of supported devices see the OpenWrt Hardware Database
Documentation
Support Community
- Forum: For usage, projects, discussions and hardware advise.
- Support Chat: Channel
#openwrton oftc.net.
Developer Community
- Bug Reports: Report bugs in OpenWrt
- Dev Mailing List: Send patches
- Dev Chat: Channel
#openwrt-develon oftc.net.
License
OpenWrt is licensed under GPL-2.0
