Specifications:
SoC: Allwinner A527 SoC (Octa-core Cortex-A55)
DRAM: 1/2/4 GB LPDDR4 DRAM
Power: 5V USB-C
Video: HDMI (Type 2.0A), MIPI FPC
Storage: microSD / 16MByte SPI flash, m.2 2230 for SSD or wifi
Network: 2x Gbit ethernet (1x with PoE), BLink BL-M8800DS2 (unsupported)
Debug: serial UART
This patchset also adds IOMMU, PCIe, USB3, LED and SPI support from
backported patches for the A523/527 SoCs.
Flashing instructions:
Standard sunxi SD card installation procedure - copy image to SD card,
insert into SD card slot on the device and boot.
Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
Modernize the target slightly to use kernel+dtb FIT images,
which is also a preparation step for labgrid-automated testing
with initramfs. This follows similar changes in d1 and sunxi.
Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
The binman build of u-boot.itb needs pylibfdt, which failed to build in two
ways:
- SWIG 4.3 dropped its Python 2 compatibility macros, but libfdt.i_shipped
still calls PyString_FromString and PyInt_AsLong. Switch to
PyUnicode_FromString and PyLong_AsLong.
- LDSHARED is hardcoded to "$(HOSTCC) -shared". On macOS, Python extensions
resolve libpython symbols at load time, so the link fails with undefined _Py*
symbols. Add -undefined dynamic_lookup on Darwin hosts.
Signed-off-by: Paul Spooren <mail@aparcar.org>
This PR aligns the U-Boot Airoha AN8855 switch initialization code with
the proposed Linux DSA driver [1], fixing several register configuration
bugs and improving overall signal integrity.
[1] https://lore.kernel.org/all/20261009161102.38961-11-ansuelsmth@gmail.com/
The current default U-Boot configuration leaves the SerDes with
marginal drive characteristics. On some hardware iterations, this
results in severe packet loss (50-60%) and timeouts during TFTP
recovery. This drop occurs because of marginal signal integrity on the
internal 2500Base-X link connecting the switch to the CPU.
By correcting a bitwise shift overlap, enabling link error recovery,
and applying the proper TX FIR / RX CDR analog tuning parameters used
in the proposed Linux driver, this series ensures a stable physical
link between the CPU and switch across different boards.
These changes have been run-tested on the CMCC RAX3000ME and Xiaomi
AX3000T, both featuring the AN8855 switch, confirming stable network
operation and reliable gigabit TFTP recovery.
Upstream-Status: Submitted
Link: https://patchwork.ozlabs.org/project/uboot/list/?series=533727
Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/26549
Signed-off-by: Robert Marko <robimarko@gmail.com>
The RT-AX89X B1 has its 10G PHY, an AQR107 or an AQR113, at address 7
on the IPQ8074 MDIO bus instead of the AQR113C on the GPIO MDIO bus.
The ASUS bootloader enables the AQR113C node only on boards that have
that PHY and leaves the device tree untouched on B1, so 10g-copper has
no PHY there and stays down.
A port references a single PHY and the bootloader only edits fixed /soc
paths, so one device tree cannot serve both revisions. Move the board
into ipq8074-rt-ax89x.dtsi and build it as two devices: B1, whose
10g-copper port uses the PHY at address 7 and whose unused GPIO MDIO bus
is disabled, and B2, whose device tree is the current one apart from
model and compatible.
The asus_rt-ax89x profile becomes asus_rt-ax89x-b2 and the board name
becomes asus,rt-ax89x-b1 or asus,rt-ax89x-b2. The B2 image also accepts
the old asus,rt-ax89x name, so installed B2 routers upgrade to it as
before. An installed B1 reports the same old name and needs sysupgrade
-F once to move to the B1 image; accepting the old name there too would
let a B2 take the B1 image without a warning.
Link: https://forum.openwrt.org/t/add-support-for-asus-rt-ax89x-ax6000/137003/1120
Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/25556
Signed-off-by: Robert Marko <robimarko@gmail.com>
The CZ.NIC Turris 1.0 (RTRS01) and 1.1 (RTRS02) are open-hardware
routers based on the Freescale P2020RDB-PC-A reference design. Design
sources [1] and user documentation [2] are public.
Specification:
- SoC: Freescale P2020 dual-core e500v2 @ 1.2 GHz
- RAM: 2 GiB DDR3 (SO-DIMM)
- Storage: 16 MiB NOR, 256 MiB NAND, microSD slot
- Ethernet: 5x LAN (Qualcomm Atheros QCA8337N switch),
1x WAN (Micrel KSZ9031 PHY)
- Wireless: 2x mini PCIe slots, one of them populated from the factory
with an AR9390 (ath9k) 2.4/5 GHz card, 3x3 MIMO with 3 detachable
RP-SMA antennas
- SIM slot (Turris 1.1 only)
- USB: 2x USB 2.0, on Turris 1.1 also 1x USB 3.0 front and 2x USB 3.0
ports via an internal header
- Misc: 8x RGB LEDs (CPLD-driven) with a brightness button, ATSHA204
crypto auth, MCP7940x RTC, SA56004 temp sensor, MAX6370 watchdog
- Console: UART on the internal microUSB connector
- Power: 7.5 V DC (Turris 1.0), 12 V DC (Turris 1.1)
The mainline device tree [3] covers the hardware. Two target patches
rename the NAND partition, so that the kernel finds the root volume by
name, and describe the switch PHYs on the MDIO bus, which fixes the WAN
port.
The factory U-Boot 2015.04 stays. It boots a FIT with the kernel and
the device tree from the microSD card or from UBI on the NAND, and
reads the MAC addresses from the ATSHA204. One sysupgrade image serves
both media and goes to the one the system booted from.
The p2020 subtarget now builds in the eSDHC MMC driver, BCH ECC,
FSL_GUTS, SOC_BUS, GLOB and the loop driver, and gains the boot-part and
rootfs-part features. Loop has to be built in because the overlay on the
card needs a loop device in preinit, where procd creates device nodes
only for the devices present when it starts. This also reaches the
P2020RDB and the WatchGuard XTM330.
Installation:
- microSD: write the sdcard image to a card and point the factory
U-Boot at it:
fw_setenv bootargsmmc root=/dev/mmcblk0p2 rootfstype=squashfs \
rootwait console=ttyS0,115200
fw_setenv mmcboot 'atsha204_mac_read; max6370_wdt_off;' \
'setenv bootargs $bootargsmmc; bootm $nandbootaddr'
- NAND: boot from the card and run turris1x-nand-install with the
factory-nand.ubi image.
OpenWrt changes nothing on the NOR except the U-Boot environment, so
holding RESET for 6 seconds still restores the factory Turris OS. That
also brings back the compiled-in U-Boot environment, whose bootcmd
skips the card. turris1x-nand-install prints the commands to set it
again.
Tested on Turris 1.1: install, boot and sysupgrade on microSD and NAND.
[1] https://web.archive.org/web/20241211162206/https://project.turris.cz/en/hardware-documentation.html
[2] https://docs.turris.cz/hw/turris-1x/turris-1x/
[3] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/powerpc/boot/dts/turris1x.dts
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24755
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
This is an amendment to e42e9c8133.
Trusted Firmware Tools for the layerscape target are maintained in a
separate package, which has been missed in the original commit. Add the
same MUSL host-build fix here, too.
Patch 005 is unchanged, the diff comes from auto-refreshing patches.
Fixes: e42e9c8133
Signed-off-by: Shine- GH <4c.fce2@proton.me>
Link: https://github.com/openwrt/openwrt/pull/26478
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
A loop that accepts the mtd partition to scan,
an offset and the desired variable to test using printenv,
which gets the size and attempts different sizes
for the CRC calculation to find a match with the stored value.
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/24866
Signed-off-by: Robert Marko <robimarko@gmail.com>
Similar to a psychopath, the bootloader of the ESR series demands
to check the CRC of the u-boot environment and replace it with
a CRC based on its own calculation on every boot cycle if it differs,
even if it is replaced with a correct and working one after boot.
When these boards were moved to using the u-boot-env layout driver
instead of userspace scripts for setting the MAC address,
some alternatives were discussed on how to handle this.
- a general fix to ignore the CRC would be inappropriate.
- upstream kernel would reject a method for ignoring the CRC.
- a kernel patch series to make NVMEM devices optional causes random MACs.
- a userspace fix to allow using the NVMEM driver as intended afterward.
After a deep investigation, it was discovered that the environment partitions
are 4k sector size despite being reported as 64k block size in bootloader console.
Therefore these other extreme measures are not necessary, however, the method
for fixing the CRC in userspace is provided by parent commits, and a helper function
to determine the correct size that represents an existing CRC is added afterward.
Thanks to recent kernel patches that added the env-size property
we can inform the layout driver of the true range to calculate the CRC with.
NVMEM detection with env-size is also supported in u-boot tools since version v2026.10.
In the uboot-tools scripts, we make sure to delete the "ubootenv" config file,
so that u-boot tools uses the NVMEM device instead of any previous uci settings.
Reviewed-by: Tomasz Maciej Nowak <tmn505@gmail.com>
Tested-by: Tomasz Maciej Nowak <tmn505@gmail.com>
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/24866
Signed-off-by: Robert Marko <robimarko@gmail.com>
Repair of a corrupted CRC in a u-boot environment can be done
with simple shell commands, thanks to the ability to abuse gzip.
When gzip compresses data, it creates a CRC32 little-endian checksum
in exactly the same form that a u-boot environment uses in the gzip footer.
For big-endian systems, u-boot uses a big-endian checksum,
so it must be read backwards from gzip. Therefore,
we have two versions of the function for endianness with mtd devices.
In order to facilitate different situations properly
these script functions allow for a userspace fix as a one-time execution
of a combined action that reads the environment, repairs the CRC,
adds an indicator variable, and writes the u-boot environment back
to the same or different partition so a bootloader doesn't mangle it further.
The success of correcting the CRC, and possibly migration, of the u-boot
environment is indicated by modifying it with a new variable "owrt_crc_fix".
The indicator variable is necessary to differentiate the fixed partition
from the bogus default environment, so that u-boot tools return an exit status
other than success when not properly discovering the fixed CRC partition.
Also, on the next sysupgrade, this prevents the fixup from happening again.
The uboot-tools are not allowed to write to the new partition directly,
as an NVMEM device is considered read-only by the kernel,
however, the mtd utility bypasses this if the parent mtd partition
is not marked as read-only in devicetree.
To handle writing a new variable,
another function writes a temporary uboot-tools environment config
so that the new variable can be written
to the new environment before it is written back to flash.
The function uses an optional while loop with sleep to ensure that
the NVMEM cells are available to use by checking the sysfs
for whether it exists yet so that later scripts can safely get values,
as using this is a rare situation that causes the NVMEM driver to probe late.
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/24866
Signed-off-by: Robert Marko <robimarko@gmail.com>
Backport U-Boot commit ce82cd191de2 to U-Boot 2026.07 and enable the
TRNG driver for Airoha builds. AN7581 and AN7583 boards have TRNG nodes,
allowing U-Boot to provide /chosen/kaslr-seed.
Signed-off-by: Vitaliy Sochnev <sochnev.v.74@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/25290
Signed-off-by: Robert Marko <robimarko@gmail.com>
Specifications:
SoC: MediaTek MT7988A (4x Cortex-A73)
RAM: 2048 MiB (early samples: 1024 MiB)
Flash: 64 GB eMMC
Ethernet:
- 4x GbE LAN (lan6-9, MT7988 built-in switch)
- 4x 2.5GbE LAN (lan2-5, YT8824 PHYs) and a 10G SFP cage (sfp,
10GBASE-R) on a Motorcomm YT9224 switch, which links to gmac1 over
a fixed 10G USXGMII and is its own DSA tree
- 1x 10GbE WAN/LAN1 (wan, Realtek RTL8261D PHY, gmac2 USXGMII)
WiFi: MT7996 (2+3+3 variant) 2.4/5/6 GHz (BE)
Display: 240x320 SPI LCD (Sitronix ST7789P3) via panel-mipi-dbi, with
PWM backlight on pwm3_0
Touch: Hynitron CST3530
Buttons: Reset
Cooling: PWM fan (SoC thermal controlled)
USB: 2x USB 3.0, 1x USB-C (power)
Power: DC barrel jack
Boot: vendor U-Boot loads the OpenWrt FIT from the "kernel" GPT
partition and roots on the "rootfs" partition (PARTLABEL=rootfs),
so no bootloader replacement is required. The device also ships an
OpenWrt bootchain as artifacts: the preloader from the BL2 variant
that draws the splash on the panel, and the BL31+U-Boot FIP. They
replace the vendor ones in mmcblk0boot0 and the fip partition and
keep the vendor GPT layout, so the same images boot under either
loader. The vendor U-Boot keeps one copy of its environment and the
OpenWrt U-Boot keeps two, so uboot-envtools detects the layout at
first boot.
The YT8824 ports get no link unless the board MDI swap value is in a
YT9224 common extended register. Only the vendor U-Boot writes it, so
the driver now takes it from the "motorcomm,mdi-swap" property and
writes it after the chip reset.
Preinit uses lan9 for failsafe.
The interface names follow the chassis labels. The YT9224 uses the
four-byte YT922x tag, which the PPE offloads, and bridger offloads the
bridged flows between the two switches. The SFP core drives the
rate-select lines of the cage.
Installation:
Flash the factory image from the GL.iNet U-Boot web recovery, or
via "mtkupgrade fw" from the U-Boot console. The eMMC GPT layout
from the vendor firmware is reused (kernel + rootfs partitions).
To switch to the OpenWrt bootchain, write the preloader to
/dev/mmcblk0boot0 (clear its force_ro first) and the FIP to the
GPT partition labelled "fip", or use "mtkupgrade bl2" and
"mtkupgrade fip" from the vendor U-Boot console.
MAC addresses (factory partition on /dev/mmcblk0p2):
WAN (label) : 0x4000
LAN (lan6-9) : 0x4000 + 2
LAN (lan2-5, sfp) : 0x4000 + 1
2.4GHz : 0x4006
5GHz : 0x4006 + 1
6GHz : 0x4006 + 2
Signed-off-by: Shi Jiayang <shi05275@163.com>
Signed-off-by: Nilanka de Silva <nilankadsilva@gmail.com>
Signed-off-by: Til Kaiser <mail@tk154.de>
Signed-off-by: John Crispin <john@phrozen.org>
The board arrived with its LCD and its touchscreen named in the hardware
description and configured nowhere, and with one flash layout.
The hardware moves into mt7987a-glinet-gl-be10000.dtsi so that two boards
can share it. mt7987a-glinet-gl-be10000.dts keeps the vendor layout with
NMBM. mt7987a-glinet-gl-be10000-ubootmod.dts drops NMBM for a single UBI
across the whole chip, which gives 512 MiB rather than the 480 MiB the
NMBM layer exposed. BL2 hardcodes the UBI start at 0x200000 on MT7987, so
bl2 is 2 MiB there and holds four copies of the preloader. The factory
cells sit in a partition in one layout and in a UBI volume in the other,
so GL_BE10000_NVMEM_LAYOUT is a macro.
The panel is a Sitronix ST7789P3 on spi1, 320x240, driven through
panel-mipi-dbi-spi, with a PWM backlight on pwm2. The touchscreen is a
Hynitron CST3530 on i2c0. The panel is mounted upside down and
compensates in its MADCTL, so the touch axes are swapped and inverted to
match.
The profile carries video-support and input-support, which the
backlight, DRM and evdev modules depend on.
cpu_thermal replaces its trips and its cooling maps with four active
steps between 40C and 110C, and the fan gets cooling levels and a pulse
count, so it is quiet at idle instead of running flat out.
The buttons take the button-reset and button-switch names the binding
asks for, and the switch reports EV_SW rather than a key.
Signed-off-by: John Crispin <john@phrozen.org>
MT7988A board that boots from eMMC. eth0 drives the internal switch, so
the node carries mediatek,switch = "mt7988".
The board takes the BL2 variant with the panel, mt7988-emmc-comb-be14000,
because BL2 draws the splash and leaves the panel running before U-Boot
starts. Redraw the logo from board_late_init() with the U-Boot version
under it, and again at preboot_os with the FIT description, so the screen
tracks the boot instead of holding one picture until Linux starts.
The driver, the bitmap and the code that draws it are already shared with
the BE10000. Only the board wiring is new: SPI1 with the panel, PWM
channel 3 with the backlight, and the rotation the panel is mounted at,
which is 180 degrees against the BE10000 one.
Two gaps had to be closed first. U-Boot's MT7988 pinctrl only knew PWM
channel 3 on GPIO81, which is the SFP loss of signal input here, so the
GPIO59 group the kernel driver calls pwm3_0 is added. The defconfig also
had no SPI at all, because the board boots from eMMC.
The SPI1 node takes the dummy 208 MHz clock mt7988.dtsi hands every SPI
master on this SoC, so the mux and the gates stay as BL2 left them. BL2
drives this bus itself to draw the splash, so it sets both.
Signed-off-by: John Crispin <john@phrozen.org>
Boots from SPI-NAND on SPI2 with the FIP inside UBI, so it pairs with
trusted-firmware-a-mt7987-spim-nand2-4k-ubi-comb-be10000, which also
draws the BL2 splash. The environment follows
the ASUS ZenWiFi BT8 all-UBI layout: fit, recovery and rootfs_data
volumes, a TFTP boot menu, and self update of BL2 and the FIP. The board
carries no LEDs, so the boot status LED commands are dropped.
Ethernet uses the LAN MAC, the factory base plus one, which is the
address Linux gives to gmac1. gmac1 drives the SoC built-in 2.5G PHY, which
mtk-2p5ge supports on MT7987. The WAN MAC reaches an external Realtek
RTL8221B-VB-CG, for which U-Boot has no driver, so it stays disabled.
genphy would bind it and supply a wrong default for ethact.
The built-in PHY needs a firmware download. The default path runs an
environment script to read the blobs out of storage, which cannot work
during a RAM boot and fails exactly when a broken UBI is being replaced.
Override the weak mt7987_i2p5ge_get_fw() and link both blobs in instead.
Returning 0 tells the caller the buffers are static. That costs 124 KiB
in the FIP. The U-Boot variant selects mt7987-2p5g-phy-firmware,
because the install step of that package stages the blobs.
pio 0 is the MDIO bus reset, active low. mtk_eth only releases it on the
switch code path, which this board does not take, so hog it high. The hog
lists one GPIO, because U-Boot applies only the first GPIO of a hog list.
bootdelay and bootmenu_delay are 3. At 0, bootmenu_show() draws no menu
and runs entry 0 directly, which is _firstboot, which calls saveenv. On a
board still carrying the vendor flash layout that attaches UBI over the
vendor Factory partition, unattended, during what is meant to be a
read-only RAM boot.
Also enable mdio, mii and net, the commands for diagnosing any of this.
The panel comes up here too. Its node carries skip-init and rotation =
<270>, so U-Boot adopts the picture that BL2 drew. NO_FB_CLEAR keeps
that picture through probe. board_show_logo() then lays down the white
background, the version text and the centred logo in one blit, and
board_preboot_os() draws the FIT description the same way before
Linux starts. Only the logo itself is shipped, not a full 320x240
frame.
&spi1 needs the seven MediaTek tuning properties that &spi2 already
carries. mt7987a-u-boot.dtsi declares the controllers "mediatek,ipm-spi",
while mtk_spim.c only hardcodes its capability flags for the other
spelling, "mediatek,spi-ipm", and falls back to reading DT properties
otherwise. Without them the controller runs with ipm_design,
enhance_timing, dma_ext and support_quad all false, every transfer
reports success and the panel shows nothing.
bootph-all is needed on the SPI controller, the panel and the PWM: the
framebuffer is reserved from the top of RAM before relocation, so a
device bound later fails video_post_bind() with -ENOSPC.
VIDEO_LOGO is off, or U-Boot draws its own logo over ours, and CYCLIC
stays off, or video_sync_all() runs every 10 ms and a full frame SPI blit
dominates boot.
The bitmap is 8bpp palettised, which needs no extra BMP_*BPP symbol and
gets a proper palette to RGB565 conversion. It is committed and copied
into the U-Boot tree by Build/Prepare, because quilt takes text only.
Set bootloader-initialized on the panel node from mtk_ft_system_setup(),
the board's only fdt fixup hook, which already writes /chosen/rootdisk so
the path is known to reach the blob Linux receives. Write it only when
uclass_try_first_device(UCLASS_VIDEO) returns a device that is
device_active(), so the property appears exactly when this U-Boot really
did initialise the panel. A property in the DT instead would be a promise
that cannot be kept under netboot or recovery, and the panel is
write-only so the kernel has no way to check.
Signed-off-by: John Crispin <john@phrozen.org>
A UCLASS_VIDEO driver for the ST7789P3 attached over SPI in MIPI DBI type
C mode, where a D/C GPIO says whether a byte is a command or a parameter.
U-Boot has no DBI layer at all, and seps525 is the only other video driver
that is an SPI child, so this takes its shape and none of its logic. It
also avoids two defects in it: plat->size computed in bits rather than
bytes, and a .plat_auto that allocates a second unused plat.
Transfers use spi_mem_exec_op() rather than dm_spi_xfer(). Every MediaTek
SPI driver in U-Boot implements only the flash oriented spi-mem API, so
dm_spi_xfer() returns -ENOSYS at the first byte. A spi_mem_op must carry
exactly one opcode byte, so the first byte of each burst rides in that
slot; on the wire it is indistinguishable from a raw transfer. Bursts of
one byte have to use NO_DATA, because exec_op takes the no-data register
flag from data.nbytes but its completion wait from data.dir.
mtk_spim_supports_op() accepts 1 to 65536 data bytes and then only exact
multiples of 65536, so a 153600 byte frame is split into three chunks
rather than per line, which would be 480 transactions instead of three.
The init sequence is the vendor one, transcribed from the generator for
the panel-mipi-dbi blob Linux loads. Command timing is far tighter than
pixel timing on this controller, so anything up to 64 bytes goes out at
10 MHz and only bulk pixel data runs at full speed, as
mipi_dbi_spi_cmd_max_speed() does. The software reset before the sequence
mirrors mipi_dbi_poweron_reset_conditional().
A required rotation property picks MADCTL: 90 gives MV|MX (0x60) and
270 gives MV|MY (0xa0). Both are 320x240 landscape, one turned 180
degrees against the other. A skip-init property says that an earlier
stage already brought the controller up, and the driver then leaves
out the reset and the init sequence.
The driver needs SPI_MEM and BACKLIGHT, so the symbol selects the one
and depends on the other.
Signed-off-by: John Crispin <john@phrozen.org>
On NETSYS v3 the built-in 2.5G PHY hangs off the XGMAC, not the plain
GMAC. Linux says so in mtk_interface_mode_is_xgmii(), which returns true
for PHY_INTERFACE_MODE_INTERNAL. mtk_eth in U-Boot tests the three XGMII
modes by hand at four sites and never lists INTERNAL, so the MAC took the
GMAC path and had the wrong MCR registers programmed throughout.
The PHY itself was fine: it linked, autoneg completed, and MDIO worked,
because MDIO is a separate bus. Nothing moved.
Add the same predicate and use it at all four sites, then give the XGMAC
path an INTERNAL case that clears the SGMII select for the MAC and points
the topmisc PCS mux at the PHY, as set_mux_gmac2_to_2p5gphy() does. Force
the link on that path too, matching mtk_xgdm_mac_link_up().
The mux offset needs to be per SoC. The register is at 0x11d10084 on
mt7988 and at 0x10021000 on mt7987. The topmisc syscon starts at
0x11d10000 and at 0x10021000, so the offset is 0x84 on mt7988 and 0
on mt7987. The existing USXGMII path
hardcoded 0x84, right for mt7988 and wrong for mt7987, so carry it in
mtk_soc_data.
Signed-off-by: John Crispin <john@phrozen.org>
The BE14000 carries the same ST7789P3 the BE10000 does, so the panel
driver, the logo blob and the PWM are already common. Add the pins and
the clocks, and give the board a BL2 variant of its own.
MT7988 differs from MT7987 throughout: SPI1 sits at 0x11008000 on GPIO28
to GPIO31, the backlight is PWM channel 3 on GPIO59, the PWM channels are
0x40 apart rather than 0x100, SPIM_MST moves to CLK_CFG_3 behind an
infracfg mux, and the PWM mux moves to CLK_CFG_4 and needs a mux and a
gate for pwm_ck4. The panel is mounted 180 degrees against the BE10000
one, so MADCTL is MV|MX.
The raw SPI transfer paths the panel driver uses ran in full duplex,
because mtk_spi_hw_init() zeroes SPI_CFG3_IPM_REG and only spi-mem set
it. On MT7988 SPI1 that stalls the engine once the 32 byte FIFO is full:
the init commands fit the FIFO and go through, and the first 5120 byte
pixel burst times out. Select the duplex mode per transfer in both raw
paths, as the kernel driver does on IPM hardware. MT7987 works either
way and takes the same change.
The variant is separate because mt7988-emmc-comb is shared with boards
that have no panel on SPI1. bl2.img is 242489 bytes, against a 508 KiB
SRAM window.
Signed-off-by: John Crispin <john@phrozen.org>
The panel only lights up in U-Boot's board_late_init() today, so the
screen stays dark through the BROM, all of BL2 and U-Boot's own startup.
Add an ST7789P3 driver and a small PWM driver to the MT7987 BL2, and run
them from an initcall placed before DRAM init, the FIP load, BL31 and
U-Boot. The logo ships as raw RGB565 that goes on the wire unchanged, so
BL2 needs no bitmap decoder, and eight lines at a time are built and sent
rather than composed in a framebuffer.
The flag rides on a variant of its own,
mt7987-spim-nand2-4k-ubi-comb-be10000, so that
mt7987-spim-nand2-4k-ubi-comb keeps a BL2 without panel code. The
panel node goes into mt7987-spi2-panel.dts, so that the DTB of every
other SPI2 variant stays as it is. bl2.img grows to 247952 bytes,
against a 512 KiB flash slot and a 508 KiB SRAM window.
Signed-off-by: John Crispin <john@phrozen.org>
The existing mt7987-spim-nand2-ubi-comb builds a BROM header for a 2k+64
NAND. Boards with a 4 KiB page part need spim:4k+256 instead, or the BROM
cannot read BL2.
Add a variant that keeps the SPI2 and UBI settings and selects the 4k+256
header, following the mt7986-spim-nand-4k-ddr3 and -ddr4 naming.
Signed-off-by: John Crispin <john@phrozen.org>
Buffalo WSR-1500AX2S is a dual-band router based on the Realtek RTL8198D
(RTL9607C family).
Specification:
- SoC : Realtek RTL8198D (RTL9607C family)
- RAM : DDR3 256 MiB
- Flash : SPI-NAND 128 MiB (Winbond W25N01GV)
- WLAN : 2.4 GHz 802.11n (RTL8192FE) / 5 GHz 802.11ax
(RTL8852AE), both 2T2R on PCIe, not supported yet
- Ethernet : 4x 10/100/1000 Mbps (integrated GPHYs, 3x LAN, 1x WAN)
- LEDs/Keys (GPIO): 6x/2x + 3-position mode switch
- UART : through-hole on PCB (JP1)
- assignment : VCC, GND, TX, RX from the arrow marking
- settings : 115200n8
Flash instruction using the initramfs image:
1. Prepare a TFTP server with 192.168.11.168 serving the initramfs image
2. Connect to the serial console, interrupt the U-Boot autoboot and run
tftp 83000000 <initramfs image>
bootm 83000000
3. After booting, back up the UBI volumes ubi_k0 and ubi_r0 and the
U-Boot variables kernel_sz, kernel0_crc, rootfs_sz and rootfs0_crc,
they are needed to go back to the stock firmware:
ubinfo -a
cat /dev/ubi0_1 > /tmp/ubi_k0.bin
cat /dev/ubi0_2 > /tmp/ubi_r0.bin
fw_printenv kernel_sz kernel0_crc rootfs_sz rootfs0_crc
and copy the files and the output off the device
4. Upload the sysupgrade image to the device and perform sysupgrade
with it
Reverting to stock firmware:
Sysupgrade re-creates ubi_k0 and ubi_r0 with the size of the OpenWrt
images and gives the remaining space to rootfs_data, so the volumes have
to be grown back before the backups fit. From the initramfs image:
ubirmvol /dev/ubi0 -N rootfs_data
ubirsvol /dev/ubi0 -N ubi_k0 -s <size of ubi_k0.bin>
ubirsvol /dev/ubi0 -N ubi_r0 -s <size of ubi_r0.bin>
ubiupdatevol /dev/ubi0_1 ubi_k0.bin
ubiupdatevol /dev/ubi0_2 ubi_r0.bin
fw_setenv kernel_sz <saved value>
(same for kernel0_crc, rootfs_sz and rootfs0_crc)
The volume IDs stay 1 and 2 as on the stock firmware. The bootloader
re-creates the slot 1 copies by itself.
Notes:
- The bootloader keeps two OS image slots, ubi_k0/ubi_r0 and
ubi_k1/ubi_r1, and boots the one selected by the sw_commit U-Boot
variable, but slot 0 is the master: at every boot it verifies the first
kernel_sz bytes of ubi_k0 against kernel0_crc and the first rootfs_sz
bytes of ubi_r0 against rootfs0_crc, copies a valid slot 0 over a
differing slot 1 and restores a broken slot 0 from slot 1. OpenWrt
therefore lives in slot 0 under the vendor volume names and updates the
sizes and CRCs on sysupgrade; ubi_r1 is removed to make room for
rootfs_data and ubi_k1 stays as the bootloader's kernel mirror. The
root filesystem is selected with "ubi.block=0,ubi_r0" and
"root=/dev/ubiblock0_2"; nand_do_upgrade keeps the volume IDs.
- The label MAC address is stored in the SDK's hardware settings XML on
the ubi_Config UBIFS volume (ELAN_MAC_ADDR); the u-boot env ethaddr is
a Realtek default. A preinit script mounts the volume read-only at
/tmp/ubi_Config and 02_network reads it from there. The wireless RF
data is in the same file, so the mount stays for the wireless scripts.
- The U-Boot environment is redundant, 128 KiB per copy, with a
big-endian CRC.
- The SoC is a rev A RTL9607C, so the device tree includes
rtl9607c-va.dtsi. Both PCIe ports link and the wireless cards
enumerate, but they are not supported yet: the RTL8852AE has a blank
efuse (the stock firmware keeps the RF data in the ubi_Config volume)
and the RTL8192FE has no mac80211 driver.
MAC addresses:
LAN : 00:2B:F5:xx:xx:xx (ubi_Config, config_hs.xml ELAN_MAC_ADDR)
WAN : 00:2B:F5:xx:xx:xx (same)
label: 00:2B:F5:xx:xx:xx (same, as on the stock firmware)
Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Taiga Ogawa <zectaiga@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/26133
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
The Xunison Exigo Hub D50 5G is a 5G/LTE router with Wi-Fi 6. It is also
sold as the Zearts D50 5G.
Specifications:
SoC: Qualcomm IPQ5018, dual-core Cortex-A53 @ 1.0 GHz
RAM: 512 MiB
Flash: 128 MiB SPI NAND (ESMT F50D1G41LB)
WLAN: IPQ5018 2.4 GHz, QCN9074 5 GHz (PCIe), both 802.11ax
Ethernet: 1x GbE WAN (IPQ5018 internal GE PHY, gmac0)
3x GbE LAN (QCA8337 switch, SGMII to gmac1)
WWAN: Quectel RM500Q-AE, 5G Sub-6 / LTE Cat 16, on USB 2.0 and
PCIe
Buttons: reset, WPS
LEDs: MESH (green/red), 5G (green/red), 4G, WiFi, Internet, WAN;
power is hardwired
Power: 12 V / 2 A DC
Serial: 115200 8N1, 4-pin header JP1 next to SW4 on the main board,
from pin 1: VCC, TX, RX, GND
Notes:
- WAN is gmac0 wired straight to the internal GE PHY, not a switch
port; its netdev is named wan by the label property.
- The console RX line (gpio20) is pulled up. Left floating with nothing
on the header it causes an interrupt storm and, on some units, a hang
at boot.
- USB is 2.0 only: the controller is limited to the HS PHY and clocks
its pipe from UTMI. The 5 V supply for the port and the modem is
switched by gpio24 (active low).
- MACs follow the stock firmware: LAN uses 0:art 0x0, WAN 0:art 0x6.
The label has no MAC printed, so there is no label-mac-device.
- Wi-Fi calibration data and MAC addresses come from 0:art through
nvmem cells on the Wi-Fi nodes (calibration: IPQ5018 at 0x1000,
QCN9074 at 0x26800). The caldata holds the Qualcomm placeholder MAC,
so the radios take the 0:art 0x0 MAC + 2 and + 3 instead.
- Board data for both radios is submitted separately to
firmware_qca-wireless under the calibration variant
Xunison-Exigo-Hub-D50-5G, both taken from the stock firmware:
bdwlan.b24-brax for the IPQ5018 and qcn9000/bdwlan.ba0 for the
QCN9074. The brax file is the vendor's board variant; on my unit it
outperformed the bdwlan.b24 that the stock firmware loads.
- The modem power line (gpio31) has no consumer and is kept high with a
GPIO hog.
- The Internet LED is lit while the modem's wwan0 is up. The WiFi LED
uses the network trigger in link mode, so it is lit while an AP is up
on either radio; the phyNradio triggers never light it with ath11k on
this board. The 4G and 5G LEDs have no trigger, as nothing in the
kernel reports the modem's access technology.
Modem:
The RM500Q-AE is wired to both USB and PCIe, and its data_interface
setting selects which one carries data. The stock firmware leaves it on
PCIe (data_interface 1,0) and this port uses it there, so no AT command
is needed after installing. It is driven by mhi-pci-generic with MBIM:
data on wwan0, control on /dev/wwan0mbim0 and AT commands on
/dev/wwan0at0. No modem interface is preconfigured; add one with the
"mbim" protocol on /dev/wwan0mbim0.
Installation:
The factory image is a raw UBI image for the U-Boot web recovery.
1. Power the router off, hold the reset button and power it on. Keep
holding until the Internet LED stays lit (about 10 seconds).
2. Set a computer on a LAN port to 192.168.1.2/24 and open
http://192.168.1.254
3. Upload openwrt-qualcommax-ipq50xx-xunison_exigo-hub-d50-5g-squashfs-factory.img
and wait for the router to reboot.
Later upgrades use the sysupgrade image.
The port started from George Moussalem's device support in the 4IceG
OpenWrt tree, with the device tree reworked by Lukasz Szczur (LS3434):
USB, the modem supply and the NAND/sysupgrade layout. Thanks to Hostle
for the flashing work on this board and to Rafał Wabik (4IceG) for the
tree it was developed in.
Link: https://forum.openwrt.org/t/adding-support-for-xunison-exigo-d50-5g-zearts-d50-5g-ipq5018/247016
Co-developed-by: George Moussalem <george.moussalem@outlook.com>
Signed-off-by: George Moussalem <george.moussalem@outlook.com>
Co-developed-by: Lukasz Szczur <8sdasfasfas@royaleplaysempire.com>
Signed-off-by: Lukasz Szczur <8sdasfasfas@royaleplaysempire.com>
Co-developed-by: Rafał Wabik <4rafal@gmail.com>
Signed-off-by: Rafał Wabik <4rafal@gmail.com>
Signed-off-by: Steve Meek <stevemeek82@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/25890
Signed-off-by: Robert Marko <robimarko@gmail.com>
To reduce code duplication across different AN7583 evaluation boards,
introduce a shared multi-EVB base device tree and utilize Device Tree
Overlays (DTSO) for board-specific configurations.
Signed-off-by: Yalei Zang <yalei.zang@airoha.com>
Link: https://github.com/openwrt/openwrt/pull/24926
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
To reduce code duplication across different AN7581 evaluation boards,
introduce a shared multi-EVB base device tree and utilize Device Tree
Overlays (DTSO) for board-specific configurations.
Signed-off-by: Yalei Zang <yalei.zang@airoha.com>
Link: https://github.com/openwrt/openwrt/pull/24926
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Replace the expanded fixed-partition 128M target with a dedicated
all-in-UBI target and OpenWrt U-Boot. Include bootloader configuration,
image generation and upgrade support together.
Share the fixed-partitions container and read-only 1 MiB BL2 range
in the common DTSI. Declare the remaining partitions and factory NVMEM
data in the variant DTS files. Keep NMBM on the legacy target and preserve
its stock partition map and 64 MiB UBI region.
The new layout uses a 1 MiB bl2 partition followed by a 127 MiB ubi
partition, with factory and fit NVMEM/rootdisk references and redundant
U-Boot environment volumes. Set the UBI variant boot arguments to
`root=/dev/fit0 rootwait` and identify its fit volume as the root disk.
The bootloader supplies memory and console parameters.
Add the U-Boot configuration, default environment and target, recovery
FIT and sysupgrade FIT images, BL2 and BL31/U-Boot artifacts, UBI
environment access and FIT upgrade checks. Recognise the new compatible
in board defaults. Bump the uboot-tools package release for the
new environment configuration support.
The installer creates fip, factory, ubootenv, ubootenv2, recovery and
initial fit volumes. U-Boot and sysupgrade manage the production FIT
and writable rootfs_data. DTS declarations identify volumes consumed
by Linux; they do not themselves create or populate factory data.
MAC address layout
------------------
Factory data is read from the legacy Factory MTD partition or the
factory UBI volume; the offsets within the data are unchanged.
Unit-specific address bytes are xx:xx:xx.
LAN: factory offset 0xe000, mac-base cell index 0.
WAN: factory offset 0xe000, mac-base cell index 1 (LAN MAC + 1).
2.4 GHz: factory offset 0x4, mac-base cell index 0.
5 GHz: factory offset 0x8000, mac-base cell index 0.
Flash instructions
------------------
Conversion requires an installer; the sysupgrade ITB alone cannot
convert the stock partition layout or preserve its factory data.
1. Start from the standard CF-WA933 OpenWrt target with stock MTD
partitions. Back up BL2, u-boot-env, Factory and FIP with mtd dump,
and copy all four files off the device before proceeding:
mtd dump BL2 > /tmp/BL2.bin
mtd dump u-boot-env > /tmp/u-boot-env.bin
mtd dump Factory > /tmp/Factory.bin
mtd dump FIP > /tmp/FIP.bin
2. Obtain the CF-WA933 installer from:
https://github.com/andros-ua/owrt-ubi-installer/releases
Its source and build script are available at:
https://github.com/andros-ua/owrt-ubi-installer/tree/cf-wa933
Connect the PC to a LAN port and use 192.168.1.254/24; the device
is at 192.168.1.1. Copy the resulting image to /tmp and run:
cd /tmp
sysupgrade -n \
openwrt-*-comfast_cf-wa933-ubi-initramfs-recovery-installer.itb
This external installer extracts calibration/MAC data from the old
Factory region before erasing it, creates and populates the static
factory UBI volume, writes BL2 and fip, and creates the redundant
environment, recovery and initial fit volumes. It copies one NAND
eraseblock of factory data; keep the full external Factory backup.
The blue WLAN LED blinks during installation and stays lit for five
seconds before reboot. Run the installer only for initial conversion.
3. Once recovery boots, copy the production image to /tmp and run:
cd /tmp
sysupgrade -n \
openwrt-*-comfast_cf-wa933-ubi-squashfs-sysupgrade.itb
To return to the legacy layout, boot the standard CF-WA933 initramfs
in RAM, restore the saved BL2/u-boot-env/Factory/FIP to their original
MTD partitions (using kmod-mtd-rw when needed), then sysupgrade to the
standard CF-WA933 image. The restored vendor bootloader's recovery
page can install vendor firmware. UART recovery of BL2/FIP is also
available using https://github.com/981213/mtk_uartboot.
Signed-off-by: Andrii Kuiukoff <andros.ua@gmail.com>
Signed-off-by: Guillaume RISCHARD <git@stereo.lu>
Link: https://github.com/openwrt/openwrt/pull/24590
Signed-off-by: Jonas Jelonek <jonas@jonasjelonek.de>
The Wallys DR5018S is an IPQ5018-based tri-band Wi-Fi 6E board.
Product specification:
https://www.wallystech.com/upload/DR5018S.pdf
Hardware:
- Qualcomm IPQ5018 SoC
- 512 MB DDR3L RAM
- 8 MB SPI NOR flash (Macronix MX25U6435F)
- 128 MB SPI NAND flash (GigaDevice GD5F1GM7REYIG)
- 1 x 1 GbE LAN port using the integrated GEPHY
- 1 x 2.5 GbE WAN port using a QCA8081 PHY
- 2x2 2.4 GHz Wi-Fi 6 using the integrated radio
- 2x2 5 GHz and 2x2 6 GHz Wi-Fi 6E using QCN6122 radios
- 1 x USB 2.0 pin-header interface
- 1 x reset button
- 4 x blue status LEDs
- UART: J3 next to the USB header, 115200 8N1
- pin 1: 3.3 V (do not connect)
- pin 2: TX
- pin 3: RX
- pin 4: GND
- Power: 12-52 V DC jack, or 802.3at/bt and passive 48 V PoE
(the manufacturer does not publish a DC current rating)
The SPI NOR contains the boot chain, U-Boot environment and ART
partitions. The SPI NAND contains the training area and two 62 MiB
rootfs slots.
Add the device tree, FIT/UBI image definitions, network defaults,
calibration extraction, U-Boot environment access and NAND sysupgrade
support.
MAC addresses:
- LAN: stored in ART at offset 0x0 and read through an NVMEM mac-base cell
- WAN: stored in ART at offset 0x6 and read through an NVMEM mac-base cell
- 2.4 GHz: stored in the ART calibration block at offset 0x100e
- 5 GHz: stored in the ART calibration block at offset 0x2680e
- 6 GHz: stored in the ART calibration block at offset 0x4c00e
The three Wi-Fi calibration blocks are extracted from ART and retain
their stored per-radio MAC addresses; they are not derived from the
Ethernet MAC addresses.
The sysupgrade handler removes OEM-only UBI volumes before creating the
OpenWrt kernel, rootfs and rootfs_data volumes.
Installation:
1. Connect to the J3 serial console and interrupt the vendor U-Boot.
Copy the generated initramfs-uImage.itb to the TFTP root as
initramfs.itb, then configure TFTP and boot it:
setenv serverip 192.168.1.10
setenv ipaddr 192.168.1.1
tftpboot 0x44000000 initramfs.itb
bootm 0x44000000
2. Transfer the generated squashfs-sysupgrade.bin to the device as
/tmp/sysupgrade.bin and install it:
sysupgrade -n /tmp/sysupgrade.bin
Reverting to the vendor firmware has not been tested. Back up the
complete SPI NOR and both SPI NAND rootfs slots before installing
OpenWrt.
Dependencies:
- CMN PLL boot fix: https://github.com/openwrt/openwrt/pull/24653
- Internal radio fix: https://github.com/openwrt/openwrt/pull/24909
- Board data: https://github.com/openwrt/firmware_qca-wireless/pull/149
Tested on a Wallys DR5018S with the dependencies above applied:
- initramfs boot from the vendor U-Boot
- installation to SPI NAND and subsequent sysupgrade
- repeated cold boots
- 1 GbE LAN and 2.5 GbE WAN
- 2.4 GHz, 5 GHz and 6 GHz AP interfaces
- USB 2.0 host-controller registration
- four blue status LED outputs
Signed-off-by: Alan Gao <1226010136@qq.com>
Link: https://github.com/openwrt/openwrt/pull/24910
Signed-off-by: Robert Marko <robimarko@gmail.com>
Add support for Linksys MR2000-family routers based on Qualcomm
IPQ5018, including the MR20WH (LN3111) and MR20EC variants.
Hardware:
- Qualcomm IPQ5018
- 512 MiB RAM
- GigaDevice GD5F2GQ5REYIH 256 MiB SPI-NAND
- QCA8337 switch with four Gigabit LAN ports over SGMII
- dedicated IPQ5018 internal Gigabit Ethernet PHY for WAN
- IPQ5018 2.4 GHz 802.11ax
- QCN6122 5 GHz 802.11ax
- USB host port
- RGB status LED
- reset and WPS buttons
- 12 V / 1.5 A power input
The MR20WH uses the same stock firmware as the MR2000 family, so use
MR2000 as the canonical OpenWrt board identity. The tested hardware
was an MR20WH (LN3111).
The board support was initially derived from the existing MX2000
support, but the MR2000 family differs from the MX2000 in Ethernet
topology, GPIO assignments and NAND partitioning.
UART is available on the four-pin header on the left PCB edge. With
the Ethernet ports facing down, the pins from top to bottom are RX,
TX, GND and +5V. The serial console uses 115200 8N1.
The base MAC address is stored as hw_mac_addr in the devinfo
partition. LAN and WAN use the base address. The 2.4 GHz and 5 GHz
radios use base +1 and base +2 respectively.
Use Qualcomm SMEM partition discovery instead of board-specific
fixed partitions. Retain Linksys dual-bank upgrade handling,
pending further validation of the NAND layout.
The factory image can be installed directly from the stock Linksys
firmware web interface. The factory image now inherits the
MR2000 Linksys image type from the common device recipe.
For recovery and development, initramfs can be loaded from stock
U-Boot using TFTP:
setenv ethact eth1
setenv ipaddr 192.168.1.1
setenv serverip 192.168.1.10
tftpboot 0x44000000 <initramfs-image>
bootm 0x44000000
After OpenWrt is installed, use the normal sysupgrade image for
subsequent upgrades.
USB 2.0 hotplug, mass storage and the USB status LED were verified
on hardware. USB 3.0 SuperSpeed was verified at 5000 Mbps using a
RAM-patched device tree with the upstream dual-PHY configuration.
The MR2000-specific IPQ5018 and QCN6122 board files were
extracted from stock Linksys firmware and submitted to
firmware_qca-wireless PR #169. Select the matching MR2000
calibration variants and ipq-wifi package. The firmware source
revision must be updated after the board files are merged.
Add the MR2000 uboot-envtools configuration and register the MR2000-specific ipq-wifi package.
Signed-off-by: Joe Aear <360alaska@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/25673
Signed-off-by: Robert Marko <robimarko@gmail.com>
Use RFC 6979 nonces with the staged LibreSSL host tool when
SOURCE_DATE_EPOCH is set. Retry deterministically for full-width
LAN969x signature scalars while preserving random signing otherwise.
Two clean builds produced identical FIP, FWU FIP and FWU HTML outputs.
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
Use SOURCE_DATE_EPOCH for X.509 validity and hash the unsigned
certificate fields to derive stable serial numbers. The hash includes
payload extensions, so changed firmware gets a new serial.
Retain the existing behavior when the variable is unset and reject
invalid values. ECDSA signatures remain nondeterministic.
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
Use the published P-256 example key from RFC 6979 for all seven
default development signing roles instead of generating new keys.
Keep role-specific filenames so TFA_KEY_DIR can supply distinct keys.
Pass all supplied keys to both regular and FWU cert_create runs.
Certificate times, serials, and ECDSA signatures still vary.
The public demo key must not be provisioned as a production trust root.
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
The vendor BL2 of the Wavlink WL-WNT100X3 initializes DDR3 at
1866 MT/s:
NOTICE: BL2: v2.7(release):292bca1-dirty
NOTICE: DDR3 1866MHZ
NOTICE: EMI: Using DDR3 settings
while the plain spim-nand-ddr3 BL2 used by the ubootmod variant runs
DDR3 at the default 2133 MT/s, which is above what the vendor
qualified on this board.
Switch the ubootmod BL2 to the existing DDR3 1866 MT/s build, in line
with the vendor firmware.
Tested on WL-WNT100X3: BL2 reports the ddr3-1866 build, the memory
test passes, U-Boot and OpenWrt boot from UBI.
Fixes: d2fabb974c ("mediatek: add support for Wavlink WL-WNT100X3 ubootmod")
Signed-off-by: Fil Dunsky <filipp.dunsky@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/25763
Signed-off-by: Robert Marko <robimarko@gmail.com>
The firmware images of Layerscape boards booting from QSPI, e.g. the
LS1046A-FRWY, differ between builds in 4 bytes at the end of the PBL:
-00009e80: 019f 1e98 0000 0000 0000 0000 0000 0000
+00009e80: e10f e4a8 0000 0000 0000 0000 0000 0000
byte_swap pads the PBL to a multiple of 8 bytes from a 4 byte variable,
so fwrite() reads up to 4 bytes of the stack past it, and an aligned
PBL always gets 8 bytes appended, 4 of them random.
Add a patch that pads with an 8 byte buffer of zeros. The output keeps
its length and layout: for an aligned input only the 4 former random
bytes become zeros, an unaligned input gives the same output as before.
Link: https://github.com/openwrt/openwrt/pull/25720
Signed-off-by: Paul Spooren <mail@aparcar.org>
The Adtran SDG-9000 is a 10G PoE router in a white steel case with
optional 19" rackmount brackets.
Specifications:
* MediaTek MT7988A (4x Cortex-A73)
* 32 GB eMMC
* 4 GiB DDR4 RAM
* 1x 10000M/5000M/2500M/1000M/100M combo WAN: RJ45 (Marvell
CUX3410 PHY) or SFP+ cage, selected at boot
* 1x 10000M/5000M/2500M/1000M/100M LAN port (Marvell CUX3410 PHY)
* 8x 2500M/1000M/100M/10M LAN ports with PoE+ (MaxLinear MxL86282
switch with built-in PHYs), 200 W total PoE budget, two Skyworks
Si3474 PSE controllers
* 1x 1000M/100M/10M management port (MT7988 built-in PHY)
* 240x240 TFT touchscreen (ST7789 SPI LCD with CST816S touch)
* 1 button (Reset)
* uC-controlled RGB LED via I2C
* RGBW LED for each PoE LAN port, 2x LED for the management port,
3x LED for each 10G port, 2x LED for the SFP+ cage
* 2x PWM fan (mainboard, power supply)
* USB 3.0 type A port
* USB-C console port, 115200 baud, Holtek HT42B534 USB-UART bridge
* 100-240V AC 50-60Hz power input, IEC 60320 C14 inlet
The WAN port is selected by a GPIO-controlled mux that has no runtime
control, so it is chosen by one of two device tree overlays, wan-phy
and wan-sfp, carried as configurations of the FIT image. The mux is
selected by setting boot_default_config in the U-Boot environment:
config-1 no WAN port
config-1#mt7988a-smartrg-sdg-9000-wan-phy RJ45 (CUX3410)
config-1#mt7988a-smartrg-sdg-9000-wan-sfp SFP+ cage
MAC addresses (base MFG_MAC from the mfginfo partition; the nvmem
cell index in the DTS is added to the base):
wan xx:xx:xx:xx:xx:x0 MFG_MAC
aux xx:xx:xx:xx:xx:x0 MFG_MAC
lan1-lan9 xx:xx:xx:xx:xx:x1 MFG_MAC + 0x1
br-lan xx:xx:xx:xx:xx:x1 MFG_MAC + 0x1
The label shows MFG_MAC. aux is the only port present when netifd
starts, as lan1-lan9 appear once the mxl862xx driver has loaded, so
br-lan would take the MAC of aux. board.d sets the MAC of br-lan to
that of lan1-lan9.
Installation:
1. Prepare a TFTP server at 192.168.1.254 and serve the OpenWrt
initramfs image, renamed to "openwrt.500".
2. Connect to the Management/Auxilary port.
3. Connect to the USB-C console port (USB CDC-ACM, 115200 8n1)
4. Power on the device and type "st" to enter the U-Boot command
line. The window to do that might be very short, so type it as
soon as the "U-Boot ..." string appears.
5. Run "setenv boot_mode openwrt; saveenv" to boot from OpenWrt
partition by default.
6. Run "bootmenu" and select option 6 (TFTP openwrt image and
boot); "run boot5" is a shortcut for the same. This downloads
openwrt.500 from the TFTP server and boots it.
7. After OpenWrt finishes booting, download the OpenWrt sysupgrade
image and write it to eMMC using "sysupgrade".
8. After sysupgrade finishes writing, the device reboots into
OpenWrt. When the System LED is solid white the device is ready
for configuration.
9. To use the WAN port, set boot_default_config to one of the values
above, e.g. from OpenWrt with
"fw_setenv boot_default_config config-1#mt7988a-smartrg-sdg-9000-wan-sfp".
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
The BT-PON BT-G711AX is a fiber modem (ONT) based on RTL9607C.
Specifications:
- SoC : Realtek RTL9607C
- RAM : DDR3 256 MiB
- Flash : SPI-NAND 128 MiB (Windbond)
- Ethernet : 4 port GbE Switch
- Fiber : 1x XPON SC/UPC (Semtech GN25L95)
- Phone : 1x RJ11 (Si32192)
- WIFI : RTL8192XBR + RTL8832BR
- LED : 12x (Power, PON, LOS, LAN1-4, TEL, USB, WPS, Wifi 2.4, Wifi 5)
- UART : 4 pin holes on PCB, 115200 8N1
- Button : 3x (WPS, WLAN, Reset)
- USB : 1x USB 2.0
- Power : 12V DC, 1.5A
This device, and many other devices of this platform, use a
dual-image layout inside a single ubi_device partition.
Intructions to boot initramfs can be found in the previous
commit message.
The networking on this device is not supported yet due to lack of DSA
driver support and thus no MAC addresses interfaces to assign in its
device tree file. But the mdio and cpu gmac are supported so the 4
PHYs and 3 GMAC are described along with 4 switch ports in preperation
for upcoming DSA.
Signed-off-by: Rustam Adilov <adilov@tutamail.com>
Link: https://github.com/openwrt/openwrt/pull/20064
Signed-off-by: John Crispin <john@phrozen.org>
TP-Link RE700X is a dual-band Wi-Fi 6 (AX3000) range extender based on
Qualcomm IPQ5018 (2.4 GHz) with a QCN6122 (5 GHz) companion radio.
Specifications:
- SoC: Qualcomm IPQ5018 (dual-core ARM Cortex-A53)
- RAM: 256 MiB
- Flash: 128 MiB SPI-NAND (ESMT F50D1G41LB)
- Wi-Fi: IPQ5018 2.4 GHz + QCN6122 5 GHz, both 802.11ax
- Ethernet: 1x Gigabit - IPQ5018 MAC1 (DWMAC) via SGMII/uniphy0 to a
Realtek RTL8211F (MDIO1 addr 6). The SoC internal GE PHY (MAC0/gmac0)
is not wired to any external port and stays disabled.
- LEDs: 5, Buttons: reset + WPS
- Power: 100-240 V AC, 50/60 Hz, 0.4 A (internal PSU, wall-plug)
- UART: 3.3 V serial console, 115200 8N1; on-board 4-pad header,
pinout from top: TX, RX, GND, VCC
MAC addresses (factory_data UBI volume, file default-mac, mounted
read-only in preinit like on the EAP650):
- LAN (label MAC): default-mac
- 2.4 GHz: default-mac + 1
- 5 GHz: default-mac + 2
Calibration data is extracted from the 0:art partition (IPQ5018 at
0x1000, QCN6122 at 0x26800).
Installation:
- From OpenWrt (or after a RAM-boot of the initramfs via U-Boot/TFTP):
sysupgrade.
- From the stock firmware: openwrt-...-squashfs-factory-webflash.bin via
the TP-Link web UI (System -> Firmware Upgrade).
scripts/tplink-re700x-factory.py wraps the rootfs UBI into the stock
"nvrammanager" upload container (the same "tplink2022"/safeloader
family as scripts/tplink-mkimage-2022.py); the stock flasher writes it
into the inactive dual-boot slot. This path has not been tested end to
end (no unit on stock firmware was left), so keep UART at hand for a
first install.
The stock U-Boot passes a slot-correct ubi.mtd= (rootfs / rootfs_1 per the
dual-boot index) but with an unmountable root=mtd:ubi_rootfs. The DTS /chosen
inherits ubi.mtd= and appends root=/dev/ubiblock0_1, so OpenWrt boots from
whichever slot the flasher wrote. Like on the EAP650, sysupgrade installs
into the inactive slot and then points tp_boot_idx at it, keeping the
running slot as a fallback; the U-Boot environment is on 0:appsblenv.
The QCN6122/IPQ5018 board-2.bin (BDF) data is supplied via
ipq-wifi-tplink_re700x (openwrt/firmware_qca-wireless).
Wi-Fi is disabled in the DTS for now: with the default ath11k DP ring
sizes both radios exhaust the 256 MiB of RAM. It will be enabled in a
follow-up together with the ath11k patch that selects smaller rings on
low-memory boards, once that has been accepted upstream.
Signed-off-by: Eduard Hart <eduard.hart@etik.com>
Link: https://github.com/openwrt/openwrt/pull/23982
Signed-off-by: Robert Marko <robimarko@gmail.com>
APBoot embeds the current time in both its version banner and generated
U-Boot timestamp header. This makes the AP-32x bootloader artifact
differ between otherwise identical builds.
Use SOURCE_DATE_EPOCH for these timestamps when it is set, while
retaining the wall-clock fallback for other builds.
Signed-off-by: Robert Marko <robimarko@gmail.com>
The FRITZ!Box 4040 U-Boot build embeds the current date and time.
This changes the U-Boot payload and causes the EVA factory image to
differ between otherwise identical builds.
Use SOURCE_DATE_EPOCH to generate the timestamp when it is set, while
retaining the current-time fallback for non-reproducible builds.
Signed-off-by: Robert Marko <robimarko@gmail.com>
Hardware:
SoC: Qualcomm IPQ5018 (2x Cortex-A53)
RAM: 256 MiB DDR3
Flash: 128 MiB SPI-NAND (ESMT)
Switch: Realtek RTL8367S, 4x GbE (3x LAN + 1x WAN), SGMII CPU port
WiFi: IPQ5018 2.4 GHz, QCN6122 5 GHz, both 802.11ax
LEDs: system (green/amber), WAN, LAN1-3
Button: reset
UART: 115200 8N1, 3.3V, on-board header
Wi-Fi is left disabled: 256 MiB is too few for ath11k, same as on the
ELECOM WRC-X3000GS2.
Notes:
- The label reads "Ver 2.20", but the vendor firmware only ever calls the
board V2: the GPL tree is GPL_MR80Xv2, PRODUCT_NAME is MR80Xv2, the
running system reports "MR80X V2" and the fwup support list carries
product_ver 2.0.0. The trailing digits are a production sub-revision,
so the port is named v2.
- MAC1 runs sgmii through the UNIPHY PCS to RTL8367S port 6. The link is
wired for HSGMII and 2500base-x does come up, but only when gmac1 and
the CPU port carry the same phy-mode: the UNIPHY PCS belongs to the
conduit (pcs-handle = <&uniphy0> in ipq5018-ess.dtsi), so setting the
CPU port alone leaves the switch running HSGMII into a SerDes still
clocked for SGMII.
With both ends at 2500base-x the trunk still dies on some boots: over
12 reboots, 2 came up with the CPU port passing no traffic at all -
eth0 transmitting while s00_p06_ifInOctets stayed at 0, no FCS errors,
the link reporting 2.5 Gbps. That matches the bring-up ordering race
described in openwrt/openwrt#25153, where the switch end of the trunk
is configured before the IPQ5018 UNIPHY resets and recalibrates its
PLL. sgmii has not reproduced it, so the port ships at sgmii until
that fix lands.
- MAC addresses come from default-mac in the vendor tp_data UBI volume,
6 raw bytes at offset 0, mounted read-only during preinit:
label default-mac
LAN default-mac
WAN default-mac + 1
2.4 GHz default-mac - 1
5 GHz default-mac - 2
- Sysupgrade A/B ping-pongs rootfs/rootfs_1 via tp_boot_idx, switched
only after the new slot is fully written. primaryboot stays 0, the
stock loader and the button recovery rely on it.
- factory.bin is wrapped in the Mercusys fwup container the stock web UI
accepts (scripts/mercusys-fwup.py). The generic tplink-image-2022
container is rejected: the loader picks its verification algorithm from
the fw-type string, which that container does not write.
- The board needs the backported spi-qpic-snand ECC context fix,
otherwise about half of the boots end in "Waiting for root device
/dev/ubiblock0_1".
Installation:
In the stock web UI go to Advanced -> System -> Firmware Update ->
Local Update, browse for
openwrt-qualcommax-ipq50xx-mercusys_mr80x-v2-squashfs-factory.bin
and press UPDATE.
Tested on stock firmware MR80X(EU)_V2.20_1.1.7 Build 20250415
(Multi-language).
The U-Boot web recovery does not accept this image: it verifies an
RSA1024 signature and has no keyless path. Use the stock web UI.
Signed-off-by: Johan Alvarado <contact@c127.dev>
Link: https://github.com/openwrt/openwrt/pull/24919
Signed-off-by: Robert Marko <robimarko@gmail.com>