Conversation
Adds full OpenWRT target support for the Luckfox Pico Mini A (SD card boot) and initial support for the Luckfox Pico Mini B (SPI NAND boot). **Luckfox Pico Mini A — SD card boot: WORKING** The Mini A boots successfully from SD card into OpenWRT. The full image pipeline (idblock + U-Boot + kernel FIT + rootfs) generates correctly and the system reaches a login prompt. Sysupgrade is functional. Boot log fixes applied and verified on hardware: - Disabled CONFIG_USB_MASS_STORAGE (legacy gadget failed with -EINVAL at boot; USB gadget support retained via configfs) - nvmem/rockchip-otp: set add_legacy_fixed_of_cells=true so OTP sub-node cells register correctly in Linux 6.6 (fixes rockchip-cpuinfo -ENOENT) - sound/soc/rockchip: add rv1106-i2s-tdm to match table (fixes asoc-simple-card infinite -EPROBE_DEFER) - soc/rockchip: remove duplicate pm_domains.o from Makefile (fixes "Driver already registered" error; upstream moved to drivers/pmdomain/) - rv1103g-luckfox-pico-mini-a.dts: disable sc4336/sc530ai camera sensors (both claim i2c4 address 0x30, causing -EBUSY; Mini A has no camera) **Luckfox Pico Mini B — SPI NAND boot: NOT YET WORKING** The Mini B image pipeline is complete and generates a valid nand-flash.img (env + idblock + uboot + kernel FIT + UBI at correct offsets). The Thunderboot (TB) SPL loads the kernel FIT directly from the "boot" NAND partition; normal boot does not use the "uboot" partition. The kernel FIT includes uboot-ignore=1 in all hash nodes to bypass RSA signature verification. Boot has not yet been hardware-validated. Kernel patches (403–413): - 403: RV1103B clock driver and bindings (from linux-stable/Lukas Zeller) - 404: RV1103B pinctrl support (from linux-stable/Lukas Zeller) - 405: RV1103B OTP/NVMEM support + legacy OF cell fix - 406: GPIO v2.2 support for RV1103B - 407: RV1103B RMII ethernet + optional stmmaceth clock - 408: RV1103B FSPI support + unreachable code fix - 409: RV1103B/RK3576 PWM v4 support adapted for kernel 6.6 - 410: RV1103B I2C support (autostop, reset control, GRF, suspend/resume) - 411: ARM head UART diagnostics - 412: Remove duplicate pm-domains driver from drivers/soc/rockchip/ - 413: Add rv1106-i2s-tdm to I2S-TDM match table Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
NAND ended up being a lot harder to build than SD Card. At some point I ran Luckily it appears recoverable, but required a working Linux build or a SPI Flash programmer. I made Claude trudge through the former. If I can fix up the NAND on the Mini B, I'll follow-up with another commit on this PR. |
Suppress non-fatal U-Boot warnings and fix fw_printenv config on Mini A/B. uboot-luckfox: bump to a65a1782 which downgrades four non-fatal printf() calls to debug() -- DTB resource scan failures and SARADC download-key read failure are expected at runtime and should not appear as errors. Add PKG_SOURCE override with a commit-specific filename to prevent DL_DIR collisions with other u-boot-2017.09 packages reusing the default name. dts/rv1103g-luckfox-pico-mini-a: disable fiq_debugger node; the vendor fiq-debugger driver has no upstream equivalent so the node produces "Dropping the fwnode link to /interrupt-controller" on every boot. cortexa7/base-files: add preinit hook 05_fw_env_config that creates /tmp/fw_env.config from /proc/device-tree/compatible before board_detect runs. /etc/fw_env.config is a symlink to /tmp/fw_env.config so fw_printenv works correctly during preinit (before overlay mounts) on both Mini A (mmcblk1) and Mini B (mtd0). Replaces the uci-defaults approach which ran too late. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace three separate device profiles (mini-a, mini-b-sd, mini-b) with two profiles that reflect boot media rather than PCB variant: luckfox_pico-mini — SD card boot, works on both Mini A and Mini B. luckfox_pico-mini-nand — SPI NAND Thunderboot, Mini B only. Mini A and Mini B are hardware-identical except for the onboard SPI NAND chip. With SFC disabled in the SD DTS, the NAND's presence is invisible to the kernel and a single image boots either board. SUPPORTED_DEVICES lists both board compatibles so sysupgrade accepts the image on either variant. DTS changes: - rv1103g-luckfox-pico-mini.dts: combined SD DTS for both variants; SFC disabled, USB extcon/phy refs deleted (avoids EPROBE_DEFER), UART2 explicitly enabled (prevents UART2 clock gate after clk_disable_unused), camera sensors disabled, console at 1500000n8. - rv1103g-luckfox-pico-mini-nand.dts: renamed from mini-b.dts; primary compatible updated to luckfox,rv1103-luckfox-pico-mini-nand so the fw_env preinit hook can distinguish NAND from SD boot. - rv1103g-luckfox-pico-mini-a.dts: deleted (superseded by mini.dts). uboot-luckfox: bump to bc31674 which sets CONFIG_BAUDRATE=1500000 in the SD defconfig, matching the NAND defconfig and kernel console= setting so U-Boot, earlycon, and the kernel console all use a consistent baud rate. fw_env preinit hook: luckfox,rv1103-luckfox-pico-mini-b and -mini-a both route to SD env (/dev/mmcblk1); luckfox,rv1103-luckfox-pico-mini-nand routes to NAND env (/dev/mtd0). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Enable &sfc on the SD boot DTS so Mini B's NAND is accessible for
recovery and bad-block scanning when booted from SD; Mini A probe
failure ("unknown raw ID") is harmless. Add explicit fspi_pins/fspi_cs0
pinctrl since rkbin only muxes SFC pins for NAND boot, not SD boot.
Enable &uart2 on the NAND DTS so the 8250 driver claims the UART2 clock
before clk_disable_unused() runs, keeping the debug console alive.
Add nandtest to DEFAULT_PACKAGES for both Mini A and Mini B profiles.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
End-to-end fixes to get the Mini B booting from SPI NAND without manual intervention: - Bump uboot-luckfox to f230b8a7: brings in the evb_rv1106.h CONFIG_BOOTCOMMAND "reset" -> "boot_fit" fix (the rkbin TB NAND SPL falls through to U-Boot proper instead of booting the kernel directly, so "reset" produced a boot loop), and the matching SD CONFIG_BOOTDELAY=3 so both defconfigs share the same interrupt window. - Declare NAND partitions via fixed-partitions in the Mini B DTS. U-Boot hardcodes the parent SPI NAND as "spi-nand0" while Linux names it "spi2.0" from the SPI parent, so a single cmdline mtdparts=<id>:... cannot satisfy both (the mismatched side silently gets zero partitions). OF partitions let Linux create MTDs by label so ubi.mtd=ubi matches regardless of the parent name. - Disable adc-keys on the NAND DTS. Mini B has no buttons on SARADC channel 0; the floating pin reads below the keyup threshold, which U-Boot interprets as the volume-up (download) key being pressed and diverts boot into rockusb download mode. - Rework nand-combined-img layout: idblock size 256K -> 512K so the ~280K idblock fits without overlapping the uboot partition, uboot offset 512K -> 768K accordingly, drop the bad-block skip gap. - Update env.spi-nand.txt: mtdparts prefix spi2.0 -> spi-nand0 to match U-Boot's internal MTD name, widen idblock to 512K to match the new on-flash layout, and document the bootcmd=boot_fit override (the compiled-in CONFIG_BOOTCOMMAND is what actually takes effect since ENVF does not import bootcmd). Validated end-to-end on hardware 2026-04-19: full autoboot chain (BROM -> DDR -> HPMCU -> NAND SPL -> U-Boot -> boot_fit -> kernel -> UBI -> procd -> OpenWRT console) without manual interaction. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The RV1103 has an integrated 10/100 EPHY behind GMAC. The Mini carrier exposes the PHY's MDI differential pairs on castellated pads, so a physical link needs external magnetics + RJ45 — but the driver probes cleanly without them and the interface reports NO-CARRIER until one is attached. Verified on a bare Mini A: rk_gmac-dwmac binds, RK630 PHY attaches at MDIO addr 2, eth0 enumerates with a valid MAC in NO-CARRIER state. Signed-off-by: Robert Grizzell <robert@grizzell.me> Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
@plan44 I'm content enough with the branch to hand this over to you and everyone else for further testing. I've done my best to avoid any breaking changes for other devices, but the ones using Luckfox chips will probably want to rebase atop the new As for hardware testing, I only currently have the Mini A and Mini B. To test theses devices outside of the serial terminal, I had to create a branch that enables networking over USB. The Pico and Pico Mini A/B do not come with a physical Ethernet port, so this has allowed me to upload and test sysupgrades. https://github.com/rgrizzell/openwrt/tree/rgrizzell_24.10-usb_gadget It NOT included in this PR, but can be used for further validation if you need it. |
|
Thanks a lot for this work @rgrizzell! This certainly goes into the right direction regarding generic rv110x based device support in OpenWrt. My current problem is that I am in midst of a criticial (paying the rent) project eating all my time, and that one is using the rv1103b which is quite different from the rv1103/06. I lack the hardware and time to confirm your rv1103/6 changes do not confict with my rv1103b stuff right now. In particular, I noticed you took the step step from using the external patched kernel tree to kernel patches in 73ae38a. That's certainly the way to go! But in my current project, unfortunately, I'm not yet ready for that. Another problem, where I have no idea yet how to navigate cleanly, is that So maybe we should create a more generic |
I appreciate you taking the time to at least review the PR. Hardware validation is not a huge concern at the moment. My primary goal with this branch was to prove that the OpenWRT build-chain could produce a valid U-Boot and Linux Kernel on these chips. I feel that much of the foundation is laid and we can hopefully focus on implementing device profiles and fixing bugs. That said, I'll work on creating a "Support Matrix" separate from this so we can coordinate across the different SoCs. I don't yet have an rv1103b, but I'll also look into adding support for it into the uboot-luckfox package. It might just be a matter of adding the correct SPL.
Thanks for calling this out, it was probably a mistake to modify this file directly. I'll check into it.
Yes, please. If |
This is probably better off in a Wiki or a separate markdown file so that others can make changes to it. For now this will suffice: #10 |
…hardcoding Restore CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S" (multi-platform) and drop the hardcoded UART2 phys/virt at 0xff4c0000. The hardcoded address is correct for RV1103/RV1106 but wrong for the RV1103B-based Onion Omega4 EVB (UART at 0x20540000), which shares this subtarget. DT-based earlycon=uart8250,mmio32,0xff4c0000 in the Mini's bootargs provides the boot console independent of CONFIG_DEBUG_LL_*, so this revert is invisible on the Luckfox Pico Mini A/B. Incidental: kernel_oldconfig also stripped the explicit '# CONFIG_USB_MASS_STORAGE is not set' line because it now matches the generic baseline. Symbol stays disabled. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Two issues prevented sysupgrade from working on Mini A SD and Mini B
NAND:
1. board_name returns the DTS first compatible: SD image reports
luckfox,rv1103-luckfox-pico-mini-b and NAND image reports
luckfox,rv1103-luckfox-pico-mini-nand. The case statements in
platform_do_upgrade and platform_check_image previously routed
-mini-b to nand_do_upgrade and only -mini-a to the SD dd path. As a
result Mini A SD (which reports -mini-b) hit the NAND handler, and
Mini B NAND (-mini-nand) fell through to the default "not supported"
branch. Re-route by image identity:
-mini-nand -> NAND case (nand_do_upgrade)
-mini-a, -mini-b -> SD case (dd to disk)
2. nand_do_platform_check looks up sysupgrade-PLACEHOLDER/CONTROL
in the tar (where PLACEHOLDER is the runtime board_name with comma
replaced by underscore), but the device profile name
luckfox_pico-mini-nand does not match the vendor_model convention
OpenWRT expects (would need luckfox_rv1103-luckfox-pico-mini-nand).
Pass the tar directory name explicitly so the CONTROL file is found.
Verified end-to-end on Mini B hardware (2026-04-28): sysupgrade -T,
sysupgrade -n -v (clean), and config-preserve sysupgrade all succeed.
UBI rootfs and rootfs_data volumes attach cleanly post-reboot.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
patches 405-02, 411, 412, and 413 have been merged into linux-stable (plan44 fork) at commit 76819cc47: - 405-02: nvmem legacy-of-cells support for rockchip-otp - 411: temporary UART head.S diagnostic (never intended to persist) - 412: remove duplicate pm_domains driver from Makefile - 413: add rv1106 support to rockchip i2s-tdm driver The build uses CONFIG_KERNEL_GIT_CLONE_URI pointing to linux-stable, which applies no patches — these files were dead code. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@rgrizzell I now created |
Luckfox Pico Mini A/B
Adds full OpenWRT target support for the Luckfox Pico Mini A/B with SD card and SPI NAND booting, enabled by the new uboot-luckfox package.
uboot-luckfox
This new package was derived from the uboot-rockchip package with the necessary patches applied from the Luckfox Pico SDK. For specific details on the boot-chain, see LUCKFOX_BOOT.md.
SD Card Boot -- WORKING
The Mini A/B boots successfully from SD card into OpenWRT. The full image pipeline (idblock + U-Boot + kernel FIT + rootfs) generates correctly and the system reaches a login prompt. Sysupgrade is functional.
Flashing is easy. Uncompress and write the image to the card.
If using the SD card on the Luckfox Pico Mini B, the NAND chip is available for extra storage.
SPI NAND Boot -- WORKING
The Mini B image pipeline is complete and generates a valid nand-flash.img (env + idblock + uboot + kernel FIT + UBI at correct offsets). The Thunderboot (TB) SPL loads the kernel FIT directly from the "boot" NAND partition; normal boot does not use the "uboot" partition. The kernel FIT includes uboot-ignore=1 in all hash nodes to bypass RSA signature verification.
Flashing is more difficult, and may require shorting pins on the NAND to recover back into download mode.
Switching From NAND to SD Card Boot
DO NOT RUN⚠️ ⚠️ -- See comment below. Switching back to SD card booting requires replacing the boot partitions with zeros, NOT erasing flash.
rkdeveloptool efWhy is rkdeveloptool run as root?
The
rkdeveloptoolcommunicates with the USB device via the file system. The file is question is typically owned byroot, so the rkdeveloptool must also be run asrootto read/write to the file.To update the system so the USB device can be accessed without
root, run these steps (Linux-only):plugdevgroup.