From a01555a69039fa02665d4089e9c80236d872752e Mon Sep 17 00:00:00 2001 From: Ming Liu Date: Thu, 21 Jul 2022 12:46:46 +0200 Subject: libubootenv: move in fw_env.config Currently we have downstream/upstream Toradex uboot recipes and we dont want to add fw_env.config for both of them to avoid code redundant. Let's add fw_env.config to libubootenv, which will be installed for both donwstream/upstream distros. Change libubootenv to a machine arch recipe since now it has machine specific fw_env.config files. Related-to: ELB-4536 Signed-off-by: Ming Liu --- .../u-boot/libubootenv/colibri-imx6ull/fw_env.config | 10 ++++++++++ .../u-boot/libubootenv/colibri-imx7/fw_env.config | 10 ++++++++++ recipes-bsp/u-boot/libubootenv/fw_env.config | 18 ++++++++++++++++++ recipes-bsp/u-boot/libubootenv/vf/fw_env.config | 10 ++++++++++ recipes-bsp/u-boot/libubootenv_%.bbappend | 12 ++++++++++++ 5 files changed, 60 insertions(+) create mode 100644 recipes-bsp/u-boot/libubootenv/colibri-imx6ull/fw_env.config create mode 100644 recipes-bsp/u-boot/libubootenv/colibri-imx7/fw_env.config create mode 100644 recipes-bsp/u-boot/libubootenv/fw_env.config create mode 100644 recipes-bsp/u-boot/libubootenv/vf/fw_env.config create mode 100644 recipes-bsp/u-boot/libubootenv_%.bbappend (limited to 'recipes-bsp') diff --git a/recipes-bsp/u-boot/libubootenv/colibri-imx6ull/fw_env.config b/recipes-bsp/u-boot/libubootenv/colibri-imx6ull/fw_env.config new file mode 100644 index 0000000..930bcee --- /dev/null +++ b/recipes-bsp/u-boot/libubootenv/colibri-imx6ull/fw_env.config @@ -0,0 +1,10 @@ +# Configuration file for fw_(printenv/setenv) utility. +# Up to two entries are valid, in this case the redundant +# environment sector is assumed present. +# Notice, that the "Number of sectors" is not required on NOR and SPI-dataflash. +# Futhermore, if the Flash sector size is ommitted, this value is assumed to +# be the same as the Environment size, which is valid for NOR and SPI-dataflash + +# MTD device name Device offset Env. size Flash sector size Number of sectors +# Colibri iMX6ULL +/dev/mtd3 0x00000000 0x00020000 0x20000 4 diff --git a/recipes-bsp/u-boot/libubootenv/colibri-imx7/fw_env.config b/recipes-bsp/u-boot/libubootenv/colibri-imx7/fw_env.config new file mode 100644 index 0000000..b59116d --- /dev/null +++ b/recipes-bsp/u-boot/libubootenv/colibri-imx7/fw_env.config @@ -0,0 +1,10 @@ +# Configuration file for fw_(printenv/setenv) utility. +# Up to two entries are valid, in this case the redundant +# environment sector is assumed present. +# Notice, that the "Number of sectors" is not required on NOR and SPI-dataflash. +# Futhermore, if the Flash sector size is ommitted, this value is assumed to +# be the same as the Environment size, which is valid for NOR and SPI-dataflash + +# MTD device name Device offset Env. size Flash sector size Number of sectors +# Colibri iMX7 +/dev/mtd3 0x00000000 0x00020000 0x20000 4 diff --git a/recipes-bsp/u-boot/libubootenv/fw_env.config b/recipes-bsp/u-boot/libubootenv/fw_env.config new file mode 100644 index 0000000..d22acde --- /dev/null +++ b/recipes-bsp/u-boot/libubootenv/fw_env.config @@ -0,0 +1,18 @@ +# Configuration file for fw_(printenv/setenv) utility. +# Up to two entries are valid, in this case the redundant +# environment sector is assumed present. +# Device offset must be prefixed with 0x to be parsed as a hexadecimal value. +# On a block device a negative offset is treated as a backwards offset from the +# end of the device/partition, rather than a forwards offset from the start. + +# Toradex modules with eMMC +# The U-Boot environment is stored at the end of the first eMMC boot partition +# hence use a negative value. The environment is just in front of the config +# block which occupies the last sector (hence -0x200) +# Note that the eMMC boot areas (e.g. /dev/mmcblk0boot0) by default is read +# only. To make it writeable, execute on the cmdline e.g. +# $ echo 0 > /sys/block/mmcblk0boot0/force_ro +# The fw_setenv tool provided by libubootenv does this automatically. + +# Block device name Device offset Env. size +/dev/emmc-boot0 -0x2200 0x2000 diff --git a/recipes-bsp/u-boot/libubootenv/vf/fw_env.config b/recipes-bsp/u-boot/libubootenv/vf/fw_env.config new file mode 100644 index 0000000..51f09d1 --- /dev/null +++ b/recipes-bsp/u-boot/libubootenv/vf/fw_env.config @@ -0,0 +1,10 @@ +# Configuration file for fw_(printenv/setenv) utility. +# Up to two entries are valid, in this case the redundant +# environment sector is assumed present. +# Notice, that the "Number of sectors" is not required on NOR and SPI-dataflash. +# Futhermore, if the Flash sector size is ommitted, this value is assumed to +# be the same as the Environment size, which is valid for NOR and SPI-dataflash + +# MTD device name Device offset Env. size Flash sector size Number of sectors +# Colibri VF61 +/dev/mtd2 0x00000000 0x00020000 0x20000 4 diff --git a/recipes-bsp/u-boot/libubootenv_%.bbappend b/recipes-bsp/u-boot/libubootenv_%.bbappend new file mode 100644 index 0000000..3f8a71b --- /dev/null +++ b/recipes-bsp/u-boot/libubootenv_%.bbappend @@ -0,0 +1,12 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:" + +SRC_URI:append = " file://fw_env.config" + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +RRECOMMENDS:${PN} += "u-boot-default-env" + +do_install:append() { + install -d ${D}/${sysconfdir} + install -m 0644 ${WORKDIR}/fw_env.config ${D}/${sysconfdir}/ +} -- cgit v1.2.3