reComputer RK3576/RK3588: U-Boot fixes for SPI boot, NVMe, rockusb - #10471
Conversation
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one) (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (2)
Included review availability: Your plan provides up to 8 included reviews per hour; 4 remain after this review. 📝 WalkthroughWalkthroughThe changes update RK3576 and RK3588 U-Boot boot flows. FIT selection supports ChangesRockchip boot and recovery flow
Estimated code review effort: 4 (Complex) | ~45 minutes Merge Risk: ⚪ Minimal · up to The PR’s boot-chain fixes are merge-ready after normal checks and review; no actionable merge-blocking risk remains. Sequence Diagram(s)sequenceDiagram
participant ATAGS
participant UBoot
participant RKIMG
participant PCIeNVMe
participant FIT
ATAGS->>UBoot: report SPI NOR as mtd 2
UBoot->>RKIMG: continue OS-device scanning
RKIMG->>PCIeNVMe: enumerate PCIe and scan NVMe
PCIeNVMe-->>RKIMG: provide boot device
RKIMG->>FIT: load FIT from selected boot device
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
0421743 to
4bb3307
Compare
55a947e to
56ac035
Compare
|
✅ This PR has been reviewed and approved — all set for merge! |
Let the boot_fit command select a GPT partition through the boot_fit_part environment variable, falling back to boot_a when the legacy boot partition does not exist. Keeps non-A/B boot behaviour unchanged while allowing an A/B raw-FIT image to boot on first run, before its persistent U-Boot environment exists. No fallback when boot_fit_part was set explicitly, so a boot_b attempt never silently boots boot_a.
Let the boot_fit command select a GPT partition through the boot_fit_part environment variable, falling back to boot_a when the legacy boot partition does not exist. Keeps non-A/B boot behaviour unchanged while allowing an A/B raw-FIT image to boot on first run, before its persistent U-Boot environment exists. No fallback when boot_fit_part was set explicitly, so a boot_b attempt never silently boots boot_a.
SPI NOR contains the bootloader, not the operating system. When SPL reports mtd 2, continue to rkimg_bootdev so SD, NVMe, SCSI and eMMC remain available as OS boot targets, and enumerate PCIe before checking NVMe. Also fall back from android_get_bootdev() to rockchip_get_bootdev() at FIT-load time so recovery images can load from NVMe.
On boards with an empty or unpopulated eMMC (no GPT), rkusb_init() fails to find a partition table and aborts Loader entry, sending the board into a bootrom reboot loop. cmd/rockusb.c already appends ":0" to tolerate this on nvme/scsi devnum 0; extend the same fallback to mmc 0 for reComputer RK3576/RK3588 devkits.
rk_board_dm_fdt_fixup() lacks the android_get_bootdev() -> rockchip_get_bootdev() fallback that fit.c and vendor.c have, so on non-Android boots (e.g. NVMe) it dereferences a NULL desc and takes a Synchronous Abort right before jumping to the kernel. Add the fallback plus a NULL guard that skips the UFS fixup.
70fff25 to
88106d5
Compare
Description
U-Boot boot-chain fixes for reComputer RK3576 DevKit and reComputer RK3588 DevKit (
u-boot-radxa-rk35xx), for boards whose bootloader lives on SPI NOR while the OS lives on NVMe/SD/eMMC. Adds four new board patches (0006–0009) plus a defconfig cleanup; no existing board patches are modified.0006-rockchip-fit-allow-environment-selected-partition (both boards)
boot_fitcan now select a GPT partition through theboot_fit_partenvironment variable. When unset, the existing boot/recovery selection is preserved, with a fallback toboot_awhen the legacybootpartition does not exist. This allows an A/B raw-FIT image to boot on its first run, before a persistent U-Boot environment exists, without changing non-A/B behaviour. No fallback whenboot_fit_partwas set explicitly, so an attemptedboot_bboot never silently bootsboot_a.0007-...-scan-os-boot-devices-after-spi (both boards)
SPI NOR contains the bootloader, not the operating system. When SPL reports boot device
mtd 2, skipbootdev_init()and continue torkimg_bootdevso SD, NVMe, SCSI and eMMC remain available as OS boot targets. Enumerate PCIe before probing NVMe, and at FIT-load time fall back fromandroid_get_bootdev()torockchip_get_bootdev()so recovery FITs can load from NVMe.0008-...-rockusb-allow-empty-emmc (both boards)
cmd/rockusb.calready appends:0for nvme/scsi devnum 0 sorkusb_init()tolerates a missing partition table — mmc was left out. With an empty (or unpopulated) eMMC, entering rockusb failed and the board looped forever between U-Boot and the BootROM (Enter rockusb failed, fallback to bootrom...), so RKDevTool never saw a Loader. Extend the same:0fallback to mmc 0.0009-rk3576-fdt-fixup-fallback-bootdev (RK3576 only)
rk_board_dm_fdt_fixup()obtained the bootdev viaandroid_get_bootdev()without therockchip_get_bootdev()fallback thatfit.candvendor.calready have. On non-Android boots (e.g. Armbian from NVMe) this dereferenced NULL and raised a Synchronous Abort right before jumping to the kernel. Add the same fallback plus a NULL guard that simply skips the (irrelevant) UFS fixup.Also adds the missing trailing newline to both defconfigs.
How Has This Been Tested?
Checklist:
Summary by CodeRabbit
New Features
Bug Fixes