Skip to content

reComputer RK3576/RK3588: U-Boot fixes for SPI boot, NVMe, rockusb - #10471

Merged
rpardini merged 7 commits into
armbian:mainfrom
Seeed-Studio:fix/recomputer-rk35xx-uboot
Aug 20, 2026
Merged

reComputer RK3576/RK3588: U-Boot fixes for SPI boot, NVMe, rockusb#10471
rpardini merged 7 commits into
armbian:mainfrom
Seeed-Studio:fix/recomputer-rk35xx-uboot

Conversation

@Mkiring

@Mkiring Mkiring commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

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_fit can now select a GPT partition through the boot_fit_part environment variable. When unset, the existing boot/recovery selection is preserved, with a fallback to boot_a when the legacy boot partition 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 when boot_fit_part was set explicitly, so an attempted boot_b boot never silently boots boot_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, skip bootdev_init() and continue to rkimg_bootdev so SD, NVMe, SCSI and eMMC remain available as OS boot targets. Enumerate PCIe before probing NVMe, and at FIT-load time fall back from android_get_bootdev() to rockchip_get_bootdev() so recovery FITs can load from NVMe.

0008-...-rockusb-allow-empty-emmc (both boards)
cmd/rockusb.c already appends :0 for nvme/scsi devnum 0 so rkusb_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 :0 fallback to mmc 0.

0009-rk3576-fdt-fixup-fallback-bootdev (RK3576 only)
rk_board_dm_fdt_fixup() obtained the bootdev via android_get_bootdev() without the rockchip_get_bootdev() fallback that fit.c and vendor.c already 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?

  • reComputer RK3576 DevKit (secure-boot + A/B OTA): boot from NVMe no longer crashes with a Synchronous Abort before kernel entry; A/B raw-FIT image boots on first run without a pre-existing environment
  • reComputer RK3576/RK3588 DevKit: with empty/unpopulated eMMC, holding the recovery key enters Loader mode (visible to RKDevTool) instead of reboot-looping
  • SPI NOR bootloader + NVMe rootfs: OS is found via device scan after SPI boot

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes generate no new warnings

Summary by CodeRabbit

  • New Features

    • Added support for selecting FIT boot partitions through boot configuration.
    • Added automatic fallback to the standard boot partition when appropriate.
    • Enabled continued boot-device scanning after SPI startup, including NVMe discovery.
    • Added support for entering Loader mode on eMMC devices without partition tables.
  • Bug Fixes

    • Improved recovery and boot-device detection across supported storage devices.
    • Prevented boot failures when Android boot-device information is unavailable.
    • Added safeguards for missing boot devices during hardware configuration.

@github-actions github-actions Bot added size/large PR with 250 lines or more 08 Milestone: Third quarter release labels Aug 19, 2026
@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • Needs review

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 9317969a-5968-4d55-910b-27bbac153bb2

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 5b18eaa9-47d5-452d-809f-97d56f6beae4

📥 Commits

Reviewing files that changed from the base of the PR and between 55a947e and 56ac035.

📒 Files selected for processing (3)
  • patch/u-boot/legacy/u-boot-radxa-rk35xx/board_recomputer-rk3576-devkit/0006-rockchip-fit-allow-environment-selected-partition.patch
  • patch/u-boot/legacy/u-boot-radxa-rk35xx/board_recomputer-rk3576-devkit/0009-rk3576-fdt-fixup-fallback-bootdev.patch
  • patch/u-boot/legacy/u-boot-radxa-rk35xx/board_recomputer-rk3588-devkit/0006-rockchip-fit-allow-environment-selected-partition.patch
🚧 Files skipped from review as they are similar to previous changes (2)
  • patch/u-boot/legacy/u-boot-radxa-rk35xx/board_recomputer-rk3588-devkit/0006-rockchip-fit-allow-environment-selected-partition.patch
  • patch/u-boot/legacy/u-boot-radxa-rk35xx/board_recomputer-rk3576-devkit/0006-rockchip-fit-allow-environment-selected-partition.patch

Included review availability: Your plan provides up to 8 included reviews per hour; 4 remain after this review.


📝 Walkthrough

Walkthrough

The changes update RK3576 and RK3588 U-Boot boot flows. FIT selection supports boot_fit_part and conditional boot_a fallback. SPI NOR boot continues OS-device scanning. Boot-device fallback, NVMe scanning, RockUSB handling, and RK3576 FDT fixup are updated.

Changes

Rockchip boot and recovery flow

Layer / File(s) Summary
FIT partition selection
patch/u-boot/legacy/u-boot-radxa-rk35xx/board_recomputer-rk3576-devkit/0006-rockchip-fit-allow-environment-selected-partition.patch, patch/u-boot/legacy/u-boot-radxa-rk35xx/board_recomputer-rk3588-devkit/0006-rockchip-fit-allow-environment-selected-partition.patch
FIT loading uses boot_fit_part when set. The default boot path can fall back to boot_a. Explicit and recovery selections do not fall back.
OS boot-device scanning and fallback
patch/u-boot/legacy/u-boot-radxa-rk35xx/board_recomputer-rk3576-devkit/0007-rk3576-scan-os-boot-devices-after-spi.patch, patch/u-boot/legacy/u-boot-radxa-rk35xx/board_recomputer-rk3588-devkit/0007-rk3588-scan-os-boot-devices-after-spi.patch, patch/u-boot/legacy/u-boot-radxa-rk35xx/board_recomputer-rk3576-devkit/0009-rk3576-fdt-fixup-fallback-bootdev.patch
SPI NOR boot continues OS-device scanning. FIT loading and FDT fixup use the RKIMG-selected boot device when Android boot-device data is unavailable. NVMe selection enumerates PCIe and scans NVMe first.
RockUSB empty-eMMC handling and board configuration
patch/u-boot/legacy/u-boot-radxa-rk35xx/board_recomputer-rk3576-devkit/0008-rk3576-rockusb-allow-empty-emmc.patch, patch/u-boot/legacy/u-boot-radxa-rk35xx/board_recomputer-rk3588-devkit/0008-rk3588-rockusb-allow-empty-emmc.patch, patch/u-boot/legacy/u-boot-radxa-rk35xx/defconfig/*
RockUSB treats empty mmc 0 like nvme 0 and scsi 0. mmc 1 remains rejected. Both defconfigs retain CONFIG_CMD_I2C=y.

Estimated code review effort: 4 (Complex) | ~45 minutes

Merge Risk: ⚪ Minimal · up to 56ac0

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
Loading

Possibly related PRs

  • armbian/build#10030: Extends related RK3576 and RK3588 SPI, NVMe, partition-selection, and RockUSB boot flows.
  • armbian/build#10281: Reorganizes related RK35xx U-Boot patches into a version-specific directory.

Suggested reviewers: igorpecovnik, rpardini, amazingfate

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main U-Boot fixes for SPI boot, NVMe boot, and rockusb across both RK3576 and RK3588 boards.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added Needs review Seeking for review Hardware Hardware related like kernel, U-Boot, ... Patches Patches related to kernel, U-Boot, ... labels Aug 19, 2026
@Mkiring
Mkiring force-pushed the fix/recomputer-rk35xx-uboot branch from 0421743 to 4bb3307 Compare August 19, 2026 04:20
@github-actions

Copy link
Copy Markdown
Contributor

✅ This PR has been reviewed and approved — all set for merge!

@github-actions github-actions Bot added Ready to merge Reviewed, tested and ready for merge and removed Needs review Seeking for review Ready to merge Reviewed, tested and ready for merge labels Aug 20, 2026
@github-actions github-actions Bot added the Needs review Seeking for review label Aug 20, 2026
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.
@rpardini
rpardini force-pushed the fix/recomputer-rk35xx-uboot branch from 70fff25 to 88106d5 Compare August 20, 2026 10:54
@rpardini rpardini added Ready to merge Reviewed, tested and ready for merge and removed Needs review Seeking for review labels Aug 20, 2026
@rpardini
rpardini merged commit ae15649 into armbian:main Aug 20, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

08 Milestone: Third quarter release Hardware Hardware related like kernel, U-Boot, ... Patches Patches related to kernel, U-Boot, ... Ready to merge Reviewed, tested and ready for merge size/large PR with 250 lines or more

Development

Successfully merging this pull request may close these issues.

4 participants