-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Orange Pi 3B: Generate alternate SPI image for booting from SATA #9388
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughAdd SATA boot support for Orange Pi 3B: new BOOTCONFIG_SATA and build hooks in the board config, device-tree/binman changes to gate AHCI/SATA, and a new u-boot defconfig enabling AHCI/SCSI/PCI and related drivers for SATA boot. Changes
Sequence Diagram(s)sequenceDiagram
participant Builder as Build System
participant Hooks as orangepi3b.csc hooks
participant UBoot as U-Boot build
participant DT as Device Tree / binman
participant Pack as Packaging
Builder->>Hooks: start pre-config
Hooks->>Hooks: detect target_make for orangepi-3b-sata
Hooks-->>Builder: set BOOTCONFIG_SATA and adjust target_make
Builder->>UBoot: build U-Boot with chosen BOOTCONFIG
UBoot->>DT: include SATA/binman entries if CONFIG_DWC_AHCI
UBoot-->>Hooks: post-config (save .config or .config.sata)
Builder->>Hooks: pre-package
Hooks->>Pack: copy .config.sata into package (if present)
Pack-->>Builder: produce final u-boot package
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 🧹 Recent nitpick comments
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@config/boards/orangepi3b.csc`:
- Around line 30-40: In function
pre_config_uboot_target__orangepi3b_patch_uboot_bootconfig_hack_for_sata, fix
the whitespace on the BOOTCONFIG assignment line so it uses tabs only (matching
the rest of the function) instead of the current leading spaces+tab; ensure all
lines that set BOOTCONFIG and modify target_make use consistent tab indentation
to remove the minor whitespace inconsistency.
🧹 Nitpick comments (2)
config/boards/orangepi3b.csc (2)
42-48: Post-config hook saves SATA.config— consider quoting the path.The
cp .config ${uboottempdir}/.config.sataon Line 46 leaves${uboottempdir}unquoted. If the path ever contains spaces, this would break. Minor defensive coding suggestion.Suggested fix
- cp .config ${uboottempdir}/.config.sata + cp .config "${uboottempdir}/.config.sata"
50-55: Packaging hook: same quoting concern for${uboottempdir}.Both
cpandrmcommands on Lines 51-53 leave${uboottempdir}unquoted. For consistency and robustness:Suggested fix
- if [[ -f "${uboottempdir}/.config.sata" ]]; then - run_host_command_logged cp ${uboottempdir}/.config.sata "$uboottempdir/usr/lib/u-boot/orangepi-3b-sata-rk3566_defconfig" - run_host_command_logged rm ${uboottempdir}/.config.sata + if [[ -f "${uboottempdir}/.config.sata" ]]; then + run_host_command_logged cp "${uboottempdir}/.config.sata" "${uboottempdir}/usr/lib/u-boot/orangepi-3b-sata-rk3566_defconfig" + run_host_command_logged rm "${uboottempdir}/.config.sata" fi
This commit enables generation of `u-boot-rockchip-spi-sata.bin`. Flashing this to SPI flash enables U-Boot to communicate with an attached SATA m.2 SSD, thereby allowing booting directly from SPI flash to SATA SSD.
Description
This PR enables generation of
u-boot-rockchip-spi-sata.bin. Flashing this to SPI flash enables U-Boot to communicate with an attached SATA m.2 SSD, thereby allowing booting directly from SPI flash to SATA SSD.The method for creating the secondary spi image is copied from orangepi5.conf.
The only change in the SATA defconfig is the addition of
CONFIG_DWC_AHCI=y.Quickstart for SATA SSD users
rockchip-rk3566-sata2overlay and reboot.nand-sata-install.Boot from MTD Flash - system on SATA, USB or NVMe.u-boot-rockchip-spi-sata.bin.How Has This Been Tested?
bootflow scansucccessfully detects boot.scr on SCSI bootdev.Checklist:
Summary by CodeRabbit