1- # Rockchip RK3576 SoC octa core 4-16GB RAM SoC 2xGbE UFS USB3 WIFI NvME
1+ # Rockchip RK3576 SoC octa core 4-16GB RAM SoC 2xGbE UFS USB3 WIFI NvMe
22BOARD_NAME="NanoPi M5"
33BOARD_VENDOR="friendlyelec"
44BOARDFAMILY="rk35xx"
5+ BOOT_SOC="rk3576"
56BOOTCONFIG="nanopi-m5-rk3576_defconfig"
6- # WIP: current kernel (no comments on same line as KERNEL_TARGET)
7- KERNEL_TARGET ="vendor,edge "
7+ KERNEL_TARGET="current,edge,vendor"
8+ KERNEL_TEST_TARGET ="vendor,current "
89FULL_DESKTOP="yes"
910ASOUND_STATE="asound.state.nanopi-m5"
1011BOOT_LOGO="desktop"
1112BOOT_FDT_FILE="rockchip/rk3576-nanopi-m5.dtb"
12- BOOT_SCENARIO="spl-blobs"
13- BOOT_SUPPORT_SPI="yes"
14- BOOT_SPI_RKSPI_LOADER="yes"
13+ BOOT_SCENARIO="vendor-spl-blobs"
1514IMAGE_PARTITION_TABLE="gpt"
1615BOARD_MAINTAINER="SuperKali"
1716INTRODUCED="2023"
@@ -25,3 +24,40 @@ function post_family_tweaks__nanopi-m5_naming_audios() {
2524 echo 'SUBSYSTEM=="sound", ENV{ID_PATH}=="platform-rt5616-sound", ENV{SOUND_DESCRIPTION}="RT5616 Audio"' >> $SDCARD/etc/udev/rules.d/90-naming-audios.rules
2625 return 0
2726}
27+
28+ function post_family_config__nanopi_m5_use_mainline_uboot() {
29+ display_alert "$BOARD" "Mainline U-Boot v2026.04 + vendor SPL hybrid" "info"
30+
31+ declare -g BOOTDELAY=1
32+ declare -g BOOTSOURCE="https://github.com/u-boot/u-boot.git"
33+ declare -g BOOTBRANCH="tag:v2026.04"
34+ declare -g BOOTPATCHDIR="v2026.04"
35+ unset BOOT_FDT_FILE
36+
37+ unset write_uboot_platform write_uboot_platform_mtd
38+
39+ # Bootloader on SD/eMMC.
40+ function write_uboot_platform() {
41+ dd "if=$1/idbloader.img" "of=$2" seek=64 conv=notrunc status=none
42+ dd "if=$1/u-boot.itb" "of=$2" seek=16384 conv=notrunc status=none
43+ }
44+
45+ # Bootloader on SPI NOR (mainline binman image).
46+ function write_uboot_platform_mtd() {
47+ flashcp -v -p "$1/u-boot-rockchip-spi.bin" /dev/mtd0
48+ }
49+
50+ # Bootloader on UFS: idblock on Boot LUN A, u-boot.itb on General LUN.
51+ function write_uboot_platform_ufs() {
52+ dd "if=$1/idbloader.img" "of=$2" bs=4096 seek=8 conv=notrunc,fsync status=none
53+ dd "if=$1/u-boot.itb" "of=$3" bs=4096 seek=2048 conv=notrunc,fsync status=none
54+ }
55+ }
56+
57+ # Boot order: SD → UFS (scsi uclass) → NVMe → net.
58+ function pre_config_uboot_target__nanopi_m5_patch_rockchip_common_boot_order() {
59+ declare -a rockchip_uboot_targets=("mmc0" "scsi" "nvme" "pxe" "dhcp")
60+ display_alert "u-boot for ${BOARD}/${BRANCH}" "boot order '${rockchip_uboot_targets[*]}'" "info"
61+ sed -i -e "s/#define BOOT_TARGETS.*/#define BOOT_TARGETS \"${rockchip_uboot_targets[*]}\"/" include/configs/rockchip-common.h
62+ regular_git diff -u include/configs/rockchip-common.h || true
63+ }
0 commit comments