nanopi-m6: add support for mainline uboot#8793
Conversation
WalkthroughAdds vendor-branch guards and multiple U-Boot hook functions to the NanoPi M6 board config. Updates Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
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.
Actionable comments posted: 1
🧹 Nitpick comments (2)
config/boards/nanopi-m6.conf (2)
68-68: Duplicate alert message - consider differentiating.The alert message "u-boot: hack bootconfig for spi image" is identical to the one at line 52. Consider using distinct messages like "u-boot: saving spi bootconfig" to better reflect this function's purpose.
Apply this diff:
- display_alert "u-boot for ${BOARD}" "u-boot: hack bootconfig for spi image" "info" + display_alert "u-boot for ${BOARD}" "u-boot: saving spi bootconfig" "info"
81-81: Consider verifying the destination directory exists.While
run_host_command_loggedwill likely fail gracefully if the directory doesn't exist, explicitly checking or creating the directory could make debugging easier.Consider adding a directory check before the copy:
if [[ -f "${uboottempdir}/.config.spi" ]]; then + mkdir -p "$uboottempdir/usr/lib/u-boot" run_host_command_logged cp ${uboottempdir}/.config.spi "$uboottempdir/usr/lib/u-boot/nanopi-m6-spi-rk3588s_defconfig" run_host_command_logged rm ${uboottempdir}/.config.spi fi
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (6)
patch/u-boot/v2025.10/defconfig/nanopi-m6-rk3588s_defconfigis excluded by!patch/**patch/u-boot/v2025.10/defconfig/nanopi-m6-spi-rk3588s_defconfigis excluded by!patch/**patch/u-boot/v2025.10/dt_uboot/rk3588s-nanopi-m6-spi-u-boot.dtsiis excluded by!patch/**patch/u-boot/v2025.10/dt_uboot/rk3588s-nanopi-m6-u-boot.dtsiis excluded by!patch/**patch/u-boot/v2025.10/dt_upstream_rockchip/rk3588s-nanopi-m6-spi.dtsis excluded by!patch/**patch/u-boot/v2025.10/dt_upstream_rockchip/rk3588s-nanopi-m6.dtsis excluded by!patch/**
📒 Files selected for processing (1)
config/boards/nanopi-m6.conf(2 hunks)
🔇 Additional comments (5)
config/boards/nanopi-m6.conf (5)
20-23: LGTM! Guard ensures vendor-only SPI boot mapping.The early return for current and edge branches correctly delegates SPI boot handling to the new mainline U-Boot functions.
94-100: LGTM! Mainline U-Boot configuration looks correct.The variable declarations properly override the defaults for mainline U-Boot v2025.10, with appropriate settings for bootdelay, source repository, and board-specific directories.
101-102: Fix multi-line string assignment for UBOOT_TARGET_MAP.The variable assignment spans two lines without proper line continuation. This will cause the second line to be interpreted as a separate command, leading to syntax errors or unexpected behavior.
Apply this diff to properly format the multi-line string:
- declare -g UBOOT_TARGET_MAP="BL31=${RKBIN_DIR}/${BL31_BLOB} ROCKCHIP_TPL=${RKBIN_DIR}/${DDR_BLOB} $BOOTCONFIG_SPI;;u-boot-rockchip-spi.bin - BL31=${RKBIN_DIR}/${BL31_BLOB} ROCKCHIP_TPL=${RKBIN_DIR}/${DDR_BLOB} $BOOTCONFIG;;u-boot-rockchip.bin" + declare -g UBOOT_TARGET_MAP="BL31=${RKBIN_DIR}/${BL31_BLOB} ROCKCHIP_TPL=${RKBIN_DIR}/${DDR_BLOB} $BOOTCONFIG_SPI;;u-boot-rockchip-spi.bin \ +BL31=${RKBIN_DIR}/${BL31_BLOB} ROCKCHIP_TPL=${RKBIN_DIR}/${DDR_BLOB} $BOOTCONFIG;;u-boot-rockchip.bin"⛔ Skipped due to learnings
Learnt from: Grippy98 PR: armbian/build#8622 File: config/sources/families/k3.conf:66-66 Timestamp: 2025-09-12T19:28:38.491Z Learning: In the Armbian k3 family build system (config/sources/families/k3.conf), builds do not fail when TIBOOT3_BOOTCONFIG is unset, even though tiboot3.bin is still listed in UBOOT_TARGET_MAP. The gating mechanism in pre_config_uboot_target__build_first_stage function works as intended to conditionally build/copy tiboot3.bin only when TIBOOT3_BOOTCONFIG is defined.
54-56: The original review comment is incorrect.The variable
target_makeis properly set before the hook is invoked. It is declared as global at line 331 oflib/functions/compilation/uboot.sh(declare -g target_make target_patchdir target_files), and assigned its value at line 332 (target_make=$(cut -d';' -f1 <<< "${target}")) within the processing loop. Thepre_config_uboot_targethook is then invoked viacall_extension_methodat line 85, within thecompile_uboot_targetfunction. Sincetarget_makeis declared globally before the function is called, it is available to the board config'spre_config_uboot_targetimplementation inconfig/boards/nanopi-m6.conf.Likely an incorrect or invalid review comment.
71-71: The variableuboottempdiris properly available in thepost_config_uboot_targethook context.The variable is declared as global within
loop_over_uboot_targets_and_doat line 329, and is initialized in the parent function viaprepare_temp_dir_in_workdir_and_schedule_cleanupat lines 428-429. Thepost_config_uboot_targethook is invoked at line 192 withincompile_uboot_target, which is called from within the loop whereuboottempdirhas been declared global. The hook function at config/boards/nanopi-m6.conf:71 correctly uses the variable with proper Bash syntax${uboottempdir}/.config.spi.
igorpecovnik
left a comment
There was a problem hiding this comment.
Fix indentation inconsistency
34db990 to
e550f88
Compare
There was a problem hiding this comment.
Actionable comments posted: 0
♻️ Duplicate comments (1)
config/boards/nanopi-m6.conf (1)
54-60: Fix indentation inconsistency.Lines 55 and 58 use space indentation instead of tabs, which is inconsistent with the rest of the file.
Apply this diff to fix the indentation:
if [[ $target_make == *"nanopi-m6-spi-rk3588s_defconfig"* ]]; then - BOOTCONFIG="nanopi-m6-spi-rk3588s_defconfig" + BOOTCONFIG="nanopi-m6-spi-rk3588s_defconfig" target_make=${target_make/nanopi-m6-spi-rk3588s_defconfig/} else - BOOTCONFIG="nanopi-m6-rk3588s_defconfig" + BOOTCONFIG="nanopi-m6-rk3588s_defconfig" target_make=${target_make/nanopi-m6-rk3588s_defconfig/} fi
🧹 Nitpick comments (2)
config/boards/nanopi-m6.conf (2)
68-68: Update the display_alert message to accurately reflect the function's purpose.The message "hack bootconfig for spi image" is misleading for this function, which saves/preserves the SPI configuration rather than modifying it. Consider a more descriptive message.
Apply this diff:
- display_alert "u-boot for ${BOARD}" "u-boot: hack bootconfig for spi image" "info" + display_alert "u-boot for ${BOARD}" "u-boot: preserving spi bootconfig" "info"
85-86: Consider using single blank line between functions.Two consecutive blank lines before the function declaration is inconsistent with typical style conventions, though not a functional issue.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (6)
patch/u-boot/v2025.10/defconfig/nanopi-m6-rk3588s_defconfigis excluded by!patch/**patch/u-boot/v2025.10/defconfig/nanopi-m6-spi-rk3588s_defconfigis excluded by!patch/**patch/u-boot/v2025.10/dt_uboot/rk3588s-nanopi-m6-spi-u-boot.dtsiis excluded by!patch/**patch/u-boot/v2025.10/dt_uboot/rk3588s-nanopi-m6-u-boot.dtsiis excluded by!patch/**patch/u-boot/v2025.10/dt_upstream_rockchip/rk3588s-nanopi-m6-spi.dtsis excluded by!patch/**patch/u-boot/v2025.10/dt_upstream_rockchip/rk3588s-nanopi-m6.dtsis excluded by!patch/**
📒 Files selected for processing (1)
config/boards/nanopi-m6.conf(2 hunks)
🔇 Additional comments (3)
config/boards/nanopi-m6.conf (3)
20-22: LGTM!The guard correctly skips vendor-specific SPI boot mapping for mainline branches (current/edge), allowing the new mainline U-Boot configuration to take precedence.
87-104: LGTM! Mainline U-Boot configuration is well-structured.The function properly configures mainline U-Boot for current/edge branches with appropriate guards, version tags, and target mappings. The multi-line UBOOT_TARGET_MAP declaration correctly handles both SPI and standard boot configurations.
81-81: ****The destination directory
$uboottempdir/usr/lib/u-boot/is guaranteed to exist when this function executes. Thecompile_ubootfunction inlib/functions/compilation/uboot.shcreates the directory at line 431 withmkdir -p "$uboottempdir/usr/lib/u-boot", which executes before thepre_package_uboot_imageextension methods are called at line 459. Additionally, the function already includes a file existence check for the source file at line 80, providing defensive handling.Likely an incorrect or invalid review comment.
|
✅ This PR has been reviewed and approved — all set for merge! |
|
Nice, null-patch-free ✅ |
* live_main_upstream/main: (236 commits)
qemu-uboot-{x86|arm64}: bump u-boot to v2025.10 final
mixtile-blade3: bump edge u-boot to v2025.10 final
cm3588-nas: bump u-boot to v2025.10 final
cm3588-nas: u-boot: bump 2025.01 -> 2025.10-rc4
nanopct6(-lts): bump u-boot to v2025.10 final
nanopct6(-lts): u-boot: bump 2025.04 -> 2025.10-rc4
nanopi-r3s-lts: board config maint
bsp armbian-ramlog - move HDD_LOG declaration before sourcing /etc/default/armbian-ramlog don't do clever things when using overridden HDD_LOG
`Automatic` board configs status synchronise
nanopi-m6: add support for mainline uboot (armbian#8793)
mainline uboot doesnt work with vendor kernel
get rid of vendor uboot, adjust aic8800
fix typo and brackets
bump uboot to latest stable, simplify logic
opi5plus - board config maintenance (armbian#8787)
rk35xx, rockchip-rk3588: fix pre_config_uboot_target prevent board-specific hooks from running
`Automatic` board configs status synchronise
rockchip64-6.18: add DT patches for NPU on T6(-LTS) and CM3588-NAS
rockchip64-6.18: fix `net-phy-realtek-add-rtl8211x-LED-configuration-from-OF` for v6.18-rc2
rockchip64-6.18: drop upstreamed DT changes for R6*, T6, CM3588-NAS (USB3/HDMI-RX)
rockchip64-6.18: rewrite/rebase patches - no changes - vs v6.18-rc2
mainline-kernel: bump 6.18 to `-rc2`
Add warning for rockchip uboot on modern hosts
SpacemiT: Update `EDGE` to linux-6.17.y
Move to supported, drop device tree as it was merged to the kernel repository
add r58-4x4
meson64-6.18: rewrite patches
meson64: bump edge 6.17 -> 6.18
meson64-6.18: bump 6.17 -> 6.18 via rename
rockchip64-6.18: .config: `CONFIG_DRM_ACCEL_ROCKET=m`
drivers_network: update `rtl8723DS` with amazingfate's fix for 6.18
drivers_network: update `rtl8852bs` with amazingfate's fix for 6.18
rockchip64-6.18: rewrite/rebase patches - no changes
rockchip64-6.18: media-0001-Add-rkvdec-Support-v5: drop upstreamed patch (:12)
rockchip64-6.18: update patches
rockchip64_common: bump edge to 6.18
uefi-arm64-6.18: fix net-stmicro-stmmac-Phytium-onboard-ethernet-drivers-and-ACPI-glue
uefi-arm64-edge: bump edge 6.17 -> 6.18 via rename
uefi-loong64-edge: bump to 6.18
uefi: bump edge to 6.18
Add wget to prepare-host.sh (armbian#8779)
armsom-forge1: add uboot patch to enable booting from btrfs partition
armsom-forge1: change BOOTCONFIG to its own
partitioning: allow single root partition for all filesystem type
remove wget from build-host basic-deps
build machinery - replace wget with curl cuz reasons
qcs6490-edge: bump to 6.18
qcs6490-edge: bump to 6.17
armbian-kernel.sh enable zram compression backends: LZ4, LZ4HC, ZSTD, DEFLATE, 842, and LZO
rockchip: Add CSC board Luckfox Lyra Zero W
filogic patches - tweak 0000.patching_config.yaml
filogic - fix for openwrt kernel tree's lack of bpi-r4 sd dtb
filogic - enable more kernel modules
potential edge kernel for filogic/bananapi BPI-Router-Linux v6.12 as current, chainsx as legacy
armsom-forge1: rename dtb name to match mainline
build machinery - fixup compilation for uboot/atf BRANCH=edge, pass --no-warn-rwx-segments to linker, not compiler
build(deps): bump peter-evans/create-pull-request from 6 to 7
build(deps): bump actions/download-artifact from 4 to 5
build(deps): bump github/codeql-action from 3 to 4
build(deps): bump rich from 14.1.0 to 14.2.0
build(deps): bump actions/checkout from 4 to 5
update rtl88x2cs external driver for kernel 6.18+
`Automatic` board configs status synchronise
`Automatic` board configs status synchronise
meson64-6.17: edge: .config: enable a bunch of RTL/RTW88
meson64-6.17: edge: .config update, no changes
meson64-6.17: arm64: dts: amlogic: Enable the npu node for Radxa Zero 2
meson64-6.17: rewrite/rebase against v6.17.1, no changes
meson64-6.17: rework g12b pinmux/pinctrl; thanks to retro98boy
meson64-6.17: rework `jethome-0001-Fix-meson64-add-gpio-irq-patch-from-https-lkml.org-l.patch`
meson64-6.17: reworked hwmon-emc2305-fixups-for-driver.patch; thanks to pyavitz
meson64-6.17: borrow drv-spi-spidev-remove-warnings.patch from rockchip64
meson64: bump edge to 6.17
meson64: bump to 6.17 via rename
meson64-6.16: rewrite/rebase patches vs v6.16.10
linux-uefi-arm64-cloud.config: enable CONFIG_SND_VIRTIO so virtual desktop has sound
linux-uefi-arm64-cloud.config: enable CONFIG_INPUT_UINPUT for spice agent
Bump u-boot to v2025.10-rc5 for orangepi4-lts
Bump u-boot to v2025.10-rc5 for Radxa rockpi-e
`Automatic` board configs status synchronise
Add Wi-Fi injection patch for Linux 6.12 kernels.
bsp: armbian-install: Correct the eMMC indication for some devices.
sunxi-6.12: Switch to v6.12.51
sunxi-6.12: re-extract megous patches
mixtile-blade3: u-boot: edge: v2025.10-rc3; add dts/u-boot.dtsi/defconfig
u-boot: v2025.10: prepare 0000.patching_config.yaml for null-patch-free u-boot
mixtile-blade3: use vendor uboot also for legacy branch
mixtile-blade3: generic mainline uboot for edge branch
Automatic: kernel config rewrite
GHA: rewrite kernel configs and open a PR if there are changes
Use Debian SID when generating JSONs
Add Kernel overlay to reduce eMMC frequency for FriendlyElec NanoPC-T6 boards
SMART AM40: Enable native HDMI interface in OPS slot
mainline-kernel.conf: let 6.17 update further than v6.17 (eg v6.17.1) (armbian#8737)
Update rtl88x2cs driver commit hash for kernel 6.17+
don't fail distro agnostic sshd adjustments when config is not found (armbian#8729)
`Automatic` board configs status synchronise
rockchip64-6.17: add rkvdec patch for rk35xx back
extensions: radxa-aic8800: allow 6.17; skip DKMS only on >= 6.18
rockchip64: current: fix display mode patches for rk3588 boards
...
Signed-off-by: Jonas Wood <jw@ti.com>
Description
This PR adds mainline uboot support to Nanopi M6 for current and edge branches.
GitHub issue reference:
Jira reference number [AR-9999]
How Has This Been Tested?
Checklist:
Please delete options that are not relevant.