mirror of
https://github.com/openwrt/openwrt.git
synced 2026-10-13 21:58:06 +04:00
Add wired support and an eMMC A/B sysupgrade path for the Linksys LN6001.
Write and verify the inactive kernel/rootfs pair before changing the boot
selectors. Confirm an installed boot by clearing the s_env boot counter
and updating its checksum.
Identify the board as IPQ9554, using the shared ipq9574.dtsi and family
fallback compatible. Disable the absent UNIPHY1 block and provide the
board clocks required by eMMC, MDIO and PWM. Let U-Boot populate memory
size, use the default GPIO-key debounce and allow 10 ms for QCA8081 reset
assertion while retaining the 150 ms deassertion delay. Use decimal 28
for the QCA8081 PHY address. The assertion delay follows the QCA8081
precedent in 904aa43865.
Return to common upgrade cleanup and reboot after safe staging failures,
while stopping on uncertain boot selector state.
Hardware specification:
- SoC: Qualcomm IPQ9554
- RAM: 1 GiB DDR4
- Flash: 8 GB Samsung 8GTF4R eMMC
- Ethernet: four 1 GbE LAN ports through QCA8075 over PSGMII
- Ethernet: one 2.5 GbE WAN port through QCA8081
- LEDs: red, green, blue and white PWM status channels
- Buttons: reset and WPS GPIO keys
- UART: 115200 8N1
- Power: 12 V, 2.5 A
- Wireless and Bluetooth: not enabled
Installation:
The initial installation uses serial access and an OpenWrt RAM boot.
Keep a bootable stock slot and start with that slot selected. The updater
accepts only the observed retail GPT geometry, matching bootconfig copies,
boot_part_ready=3, auto_recovery=yes and matching Wi-Fi firmware slots.
It does not repair an inconsistent layout or selector state.
Copy this image to the TFTP server as ln6001-initramfs.itb:
openwrt-qualcommbe-ipq95xx-linksys_ln6001-initramfs-uImage.itb
Connect Ethernet to LAN4 and configure the TFTP server as 192.168.1.254/24.
Interrupt U-Boot autoboot through the serial console and run:
setenv ipaddr 192.168.1.1
setenv serverip 192.168.1.254
setenv netmask 255.255.255.0
tftp 0x4d100000 ln6001-initramfs.itb
bootm 0x4d100000#config@1
Do not save these temporary network settings or write the initramfs FIT
to eMMC. In RAM-booted OpenWrt, transfer the following image to
/tmp/ln6001-sysupgrade.bin:
openwrt-qualcommbe-ipq95xx-linksys_ln6001-squashfs-sysupgrade.bin
Check the selected slot and validate the image, then install:
fw_printenv boot_part boot_part_ready auto_recovery
sysupgrade -T /tmp/ln6001-sysupgrade.bin
sysupgrade -n /tmp/ln6001-sysupgrade.bin
Run the last command only after validation succeeds. boot_part=1 selects
A and installation writes B; boot_part=2 selects B and installation
writes A. Do not force a failed check. The sysupgrade archive is not a
Linksys web-update image. Subsequent OpenWrt sysupgrades use the same
inactive-slot path; omit -n to request preservation of OpenWrt settings.
Recovery:
The serial TFTP/bootm procedure remains available without depending on
the installed rootfs. Before installation, resetting a RAM-only session
returns to the selected existing firmware. After installation, a normal
reboot uses the newly selected slot and does not itself return to stock.
With consistent selector copies and environment, a recovery RAM boot can
run the same checked sysupgrade path. Inconsistent selectors are rejected;
do not bypass these checks. Keep serial access and a bootable other slot.
Partition and MAC address handling:
Discover the existing GPT at runtime and require the retail partition
labels, starts and sizes before writing. Preserve the GPT, bootloader,
devinfo and both Wi-Fi firmware payloads. The upgrade writes the inactive
HLOS/rootfs pair, then updates both bootconfig selector sectors and the
boot_part environment variable. Successful installed boots clear the
boot counter and update its checksum in s_env after verifying the active
slot. A stale checksum on an already-zero counter is repaired as well.
Read hw_mac_addr from devinfo through read-only block NVMEM. Stock LAN
and WAN use the same base address; assign offset zero to all five wired
ports. Configuration persists in a per-slot F2FS overlay.
Validation:
Retail-hardware testing passed RAM boot with U-Boot supplying 1
GiB RAM, and sysupgrade -n from stock-selected A into B followed
by two successful installed boots. The boot-count record
contained a zero count and valid checksum after both boots. F2FS
remained writable and a UCI setting persisted across reboot.
Kernel/rootfs readback matched the image; full stock A hashes and
non-selector protected partition hashes were unchanged.
LAN4 linked at 1 Gbps. WAN-to-WAN testing against a stock LN6001
negotiated 2500 Mbps full duplex at both ends and recovered to
that rate after cable replug without reboot or interface reset.
Normal and full-MTU IPv6 pings passed without loss before and
after replug. Separate four-stream TCP endpoint tests measured
2.313 Gbit/s received by this image and 2.311 Gbit/s by the peer,
then 2.316 Gbit/s received after replug. These are router-local
tests, not forwarding benchmarks. One RX error at the
disconnected checkpoint did not increase during subsequent
traffic; TX and peer RX/TX error counters remained zero.
Fifteen local synthetic tests cover boot-counter checksum
validation and repair, write/readback failures, upgrade guards
and safe return versus deliberate halt. Seven temporary-file
bootcount test groups also passed on the device. Real boot
selectors were not corrupted for failure tests. Image-macro
checks confirm sysupgrade.bin only with the size guard retained.
Signed-off-by: Satoshi Ikeuchi <satosan.ikm@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24736
Signed-off-by: Robert Marko <robimarko@gmail.com>