Skip to content

Commit 0ce3fd5

Browse files
authored
nanopi-r76s: fix SD boot and storage stability on eMMC-less units (#9908)
* nanopi-r76s: build u-boot with the SD boost to fix no-UART SD boot eMMC-less units printed nothing on serial and would not boot from SD: the binman u-boot-rockchip.bin image omits the Rockchip SD boost the BootROM needs. Assemble idbloader.img through boot_merger so the boost is included, writing idbloader and u-boot.itb at the standard offsets. Signed-off-by: SuperKali <hello@superkali.me> * nanopi-r76s: drop sdmmc0_pwren pinctrl to fix SD SDR104 instability The SD node inherited the SoC default pinctrl, which claims the card power-enable pin and lets the controller power-cycle the card during error recovery, causing an endless SDR104 re-tune loop and I/O errors. Drop that pin from the SD pinctrl, as Rockchip did upstream for rk3576. Signed-off-by: SuperKali <hello@superkali.me> --------- Signed-off-by: SuperKali <hello@superkali.me>
1 parent fe38268 commit 0ce3fd5

4 files changed

Lines changed: 11 additions & 6 deletions

File tree

config/boards/nanopi-r76s.conf

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,14 @@ function post_family_config__nanopi_r76s_use_mainline_uboot() {
3131
declare -g BOOTPATCHDIR="v2026.04"
3232
unset BOOT_FDT_FILE
3333

34-
# Don't set BOOTDIR, allow shared U-Boot source directory for disk space efficiency
35-
declare -g UBOOT_TARGET_MAP="BL31=${RKBIN_DIR}/${BL31_BLOB} ROCKCHIP_TPL=${RKBIN_DIR}/${DDR_BLOB};;u-boot-rockchip.bin"
34+
# boot_merger (uboot_custom_postprocess) injects the rk3576 SD boost; binman's u-boot-rockchip.bin lacks it
35+
declare -g UBOOT_TARGET_MAP="BL31=${RKBIN_DIR}/${BL31_BLOB} ROCKCHIP_TPL=${RKBIN_DIR}/${DDR_BLOB};;idbloader.img u-boot.itb"
3636

37-
# Disable stuff from rockchip64_common; we're using binman here which does all the work already
38-
unset uboot_custom_postprocess write_uboot_platform write_uboot_platform_mtd # disable stuff from rockchip64_common; we're using binman here which does all the work already
37+
unset write_uboot_platform write_uboot_platform_mtd
3938

40-
# Just use the binman-provided u-boot-rockchip.bin, which is ready-to-go
4139
function write_uboot_platform() {
42-
dd "if=$1/u-boot-rockchip.bin" "of=$2" bs=32k seek=1 conv=notrunc status=none
40+
dd "if=$1/idbloader.img" "of=$2" seek=64 conv=notrunc status=none
41+
dd "if=$1/u-boot.itb" "of=$2" seek=16384 conv=notrunc status=none
4342
}
4443
}
4544

patch/kernel/archive/rockchip64-6.18/dt/rk3576-nanopi-r76s.dts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -793,6 +793,8 @@
793793
vmmc-supply = <&vcc_3v3_s3>;
794794
vqmmc-supply = <&vccio_sd_s0>;
795795
pinctrl-names = "default";
796+
/* drop sdmmc0_pwren from SoC default pinctrl: unstable SDR104 re-init */
797+
pinctrl-0 = <&sdmmc0_clk &sdmmc0_cmd &sdmmc0_det &sdmmc0_bus4>;
796798
status = "okay";
797799
};
798800

patch/kernel/archive/rockchip64-7.0/dt/rk3576-nanopi-r76s.dts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -793,6 +793,8 @@
793793
vmmc-supply = <&vcc_3v3_s3>;
794794
vqmmc-supply = <&vccio_sd_s0>;
795795
pinctrl-names = "default";
796+
/* drop sdmmc0_pwren from SoC default pinctrl: unstable SDR104 re-init */
797+
pinctrl-0 = <&sdmmc0_clk &sdmmc0_cmd &sdmmc0_det &sdmmc0_bus4>;
796798
status = "okay";
797799
};
798800

patch/kernel/archive/rockchip64-7.1/dt/rk3576-nanopi-r76s.dts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -793,6 +793,8 @@
793793
vmmc-supply = <&vcc_3v3_s3>;
794794
vqmmc-supply = <&vccio_sd_s0>;
795795
pinctrl-names = "default";
796+
/* drop sdmmc0_pwren from SoC default pinctrl: unstable SDR104 re-init */
797+
pinctrl-0 = <&sdmmc0_clk &sdmmc0_cmd &sdmmc0_det &sdmmc0_bus4>;
796798
status = "okay";
797799
};
798800

0 commit comments

Comments
 (0)