Skip to content

Commit f149a11

Browse files
committed
nanopct6(-lts): switch to mainline A-TF; use mainline u-boot also for 'current' branch
- keep vendor u-boot for vendor branch (with rk's BL31)
1 parent 166b786 commit f149a11

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

config/boards/nanopct6.conf

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,22 @@ function post_family_tweaks__nanopct6_naming_audios() {
3030
}
3131

3232
# Mainline u-boot
33-
function post_family_config_branch_edge__nanopct6_use_mainline_uboot() {
34-
display_alert "$BOARD" "mainline (next branch) u-boot overrides for $BOARD / $BRANCH" "info"
33+
function post_family_config__nanopct6_use_mainline_uboot() {
34+
[[ "${BRANCH}" == "vendor" ]] && return 0 # Not for 'vendor' branch, which uses 2017.09 vendor u-boot from Radxa
35+
36+
display_alert "$BOARD" "u-boot overrides for $BOARD / $BRANCH" "info"
37+
38+
# To reuse ATF code in rockchip64_common, let's change the BOOT_SCENARIO and call prepare_boot_configuration() again
39+
BOOT_SCENARIO="tpl-blob-atf-mainline"
40+
prepare_boot_configuration
3541

3642
declare -g BOOTCONFIG="nanopc-t6-rk3588_defconfig"
3743
declare -g BOOTDELAY=1 # Wait for UART interrupt to enter UMS/RockUSB mode etc
3844
declare -g BOOTSOURCE="https://github.com/u-boot/u-boot.git" # We ❤️ Mainline
3945
declare -g BOOTBRANCH="tag:v2025.04"
4046
declare -g BOOTPATCHDIR="v2025.04"
4147
declare -g BOOTDIR="u-boot-${BOARD}" # do not share u-boot directory
42-
declare -g UBOOT_TARGET_MAP="BL31=${RKBIN_DIR}/${BL31_BLOB} ROCKCHIP_TPL=${RKBIN_DIR}/${DDR_BLOB};;u-boot-rockchip.bin u-boot-rockchip-spi.bin"
48+
declare -g UBOOT_TARGET_MAP="BL31=bl31.elf ROCKCHIP_TPL=${RKBIN_DIR}/${DDR_BLOB};;u-boot-rockchip.bin u-boot-rockchip-spi.bin"
4349
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
4450

4551
# Just use the binman-provided u-boot-rockchip.bin, which is ready-to-go
@@ -55,12 +61,13 @@ function post_family_config_branch_edge__nanopct6_use_mainline_uboot() {
5561
# U-boot 2025.04+ can detect and set fdtfile automatically across T6 and T6-LTS boards.
5662
# So if using mainline u-boot, unset BOOT_FDT_FILE to let u-boot handle it.
5763
# That way, both variants can boot from the same image; lets keep the -lts board file for vendor kernel/u-boot.
58-
function post_family_config_branch_edge__t6_and_t6_lts_auto_dtb_name_via_uboot_detection() {
64+
function post_family_config__t6_and_t6_lts_auto_dtb_name_via_uboot_detection() {
65+
[[ "${BRANCH}" == "vendor" ]] && return 0 # Not for 'vendor' branch, which uses 2017.09 vendor u-boot from Radxa
5966
unset BOOT_FDT_FILE
6067
}
6168

6269
function pre_config_uboot_target__nanoptc6_patch_uboot_dtsi_for_ums() {
63-
[[ "${BRANCH}" != "edge" ]] && return 0
70+
[[ "${BRANCH}" == "vendor" ]] && return 0 # Not for 'vendor' branch, which uses 2017.09 vendor u-boot from Radxa
6471

6572
display_alert "u-boot for ${BOARD}" "u-boot: add to u-boot dtsi for UMS" "info" # avoid a patch, just append to the dtsi file
6673
cat <<- EOD >> arch/arm/dts/rk3588-nanopc-t6-u-boot.dtsi # Append to the t6 u-boot dtsi file with stuff for enabling gadget/otg/peripheral mode
@@ -69,6 +76,9 @@ function pre_config_uboot_target__nanoptc6_patch_uboot_dtsi_for_ums() {
6976
&usbdp_phy0 { status = "okay"; };
7077
&usb_host0_xhci { dr_mode = "peripheral"; maximum-speed = "high-speed"; status = "okay"; };
7178
EOD
79+
# Append to the t6 u-boot dtsi file with stuff for enabling gadget/otg/peripheral mode
80+
# Append to the t6 u-boot dtsi file with stuff for enabling gadget/otg/peripheral mode
81+
# Append to the t6 u-boot dtsi file with stuff for enabling gadget/otg/peripheral mode
7282

7383
}
7484

@@ -85,7 +95,7 @@ function pre_config_uboot_target__nanopct6_patch_rockchip_common_boot_order() {
8595
}
8696

8797
function post_config_uboot_target__extra_configs_for_nanopct6_mainline_environment_in_spi() {
88-
[[ "${BRANCH}" != "edge" ]] && return 0
98+
[[ "${BRANCH}" == "vendor" ]] && return 0 # Not for 'vendor' branch, which uses 2017.09 vendor u-boot from Radxa
8999

90100
display_alert "u-boot for ${BOARD}/${BRANCH}" "u-boot: enable board-specific configs (env in SPI)" "info"
91101
run_host_command_logged scripts/config --enable CONFIG_DM_PMIC_FAN53555
@@ -134,7 +144,7 @@ function post_config_uboot_target__extra_configs_for_nanopct6_mainline_environme
134144
# Include fw_setenv, configured to point to the correct spot on the SPI Flash
135145
PACKAGE_LIST_BOARD="libubootenv-tool" # libubootenv-tool provides fw_printenv and fw_setenv, for talking to U-Boot environment
136146
function post_family_tweaks__config_nanopct6_fwenv() {
137-
[[ "${BRANCH}" != "edge" ]] && return 0
147+
[[ "${BRANCH}" == "vendor" ]] && return 0 # Not for 'vendor' branch, which uses 2017.09 vendor u-boot from Radxa
138148
display_alert "Configuring fw_printenv and fw_setenv" "for ${BOARD} and u-boot ${BOOTBRANCH}" "info"
139149
# Addresses below come from CONFIG_ENV_OFFSET and CONFIG_ENV_SIZE in defconfig
140150
cat <<- 'FW_ENV_CONFIG' > "${SDCARD}"/etc/fw_env.config

0 commit comments

Comments
 (0)