Skip to content

Commit aab3bb7

Browse files
committed
radxa-nio-12l: include u-boot userspace to manipulate u-boot env from Linux
- u-boot stores env in UFS LUN 1 - point fw_printenv/setenv at it at the correct offset and size
1 parent 14ea5bd commit aab3bb7

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

config/boards/radxa-nio-12l.conf

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,17 @@ declare -g BOOTCONFIG="genio_1200_radxa_nio_12l_d8_defconfig" # d4/d8/d16 are ir
1313
declare -g BOOT_SOC="mt8395" # the NIO-12L is a MT8395, but everything is named mt8195 in OPTEE/TF-A/Libbase/etc.
1414
declare -g MEDIATEK_GENIO_SOC_PLATFORM="mt8195" # The actual PLAT= for TF-A, libbase, etc.
1515
# blobs live at https://github.com/armbian/mtkbin/tree/main/radxa-nio-12l
16+
17+
# Include fw_setenv, configured to point to the correct spot on the UFS LUN number 1 (0 is bootloader, 1 is env, 2 is rootfs)
18+
PACKAGE_LIST_BOARD="libubootenv-tool" # libubootenv-tool provides fw_printenv and fw_setenv, for talking to U-Boot environment
19+
function post_family_tweaks__config_radxa_nio_12l_fwenv() {
20+
display_alert "Configuring fw_printenv and fw_setenv" "for ${BOARD}" "info"
21+
# Addresses below come from CONFIG_ENV_OFFSET and CONFIG_ENV_SIZE in defconfig
22+
cat <<- 'FW_ENV_CONFIG' > "${SDCARD}"/etc/fw_env.config
23+
# UFS LUN 2 (scsi 1 in u-boot) u-boot env for the ${BOARD_NAME}
24+
# The correct way to access the device would be /dev/disk/by-path/platform-11270000.ufshci-scsi-0:0:0:1
25+
# but unfortunately libubootenv-tool can't handle the colons in that path; so use /dev/sdb instead
26+
# Device name Device offset Env. size Flash sector size Number of sectors
27+
/dev/sdb 0x0 0x2000
28+
FW_ENV_CONFIG
29+
}

0 commit comments

Comments
 (0)