odroidm1: enable working userland fw_setenv, so users can go back to Petitboot & otherwise tweak u-boot env from Armbian

This commit is contained in:
Ricardo Pardini
2023-01-14 19:06:08 +01:00
parent 64f9cf9b46
commit 3ea6da8c7a

View File

@@ -11,3 +11,21 @@ DDR_BLOB="rk35/rk3568_ddr_1560MHz_v1.10.bin" # Real blob, is actually used. i
BL31_BLOB="rk35/rk356x_usbplug_v1.10.bin--FAKE" # Not really used for anything, as the name proves.
FULL_DESKTOP="yes"
BOOT_LOGO="desktop"
# Include fw_setenv, configured to point to Petitboot's u-env mtd partition, so users can re-enable Petitboot
# with `fw_setenv skip_spiboot false` in Armbian.
PACKAGE_LIST_BOARD="libubootenv-tool" # libubootenv-tool provides fw_printenv and fw_setenv, for talking to U-Boot environment / Petitboot
function post_family_tweaks__config_odroidm1_fwenv() {
display_alert "Configuring fw_printenv and fw_setenv" "for Odroid M1" "info"
# Addresses below come from
# - https://github.com/hardkernel/u-boot/blob/356906e6445378a45ac14ec184fc6e666b22338a/configs/odroid_rk3568_defconfig#L212-L213
# - https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/rockchip/rk3568-odroid-m1.dts#L637-L662
# The kernel DT has a convenient partition table, so mtd1 is ready to use, just gotta set the size.
cat <<- 'FW_ENV_CONFIG' > "${SDCARD}"/etc/fw_env.config
# MTD on the SPI for the Odroid-M1; this requires the MTD partition table in the board kernel DTS
# MTD device name Device offset Env. size Flash sector size Number of sectors
/dev/mtd1 0x0000 0x20000
FW_ENV_CONFIG
}