[PATCH v2 06/19] imx: kontron-sl-mx8mm: Add redundant environment and SPI NOR partitions
Frieder Schrempf
frieder at fris.de
Mon Aug 1 12:30:08 CEST 2022
From: Frieder Schrempf <frieder.schrempf at kontron.de>
Enable the redundant environment feature to allow falling back in case of
storage corruption. The partition layout for the SPI NOR device is added
to the devicetree.
Signed-off-by: Frieder Schrempf <frieder.schrempf at kontron.de>
---
Changes in v2:
* describe SPI NOR partitions in devicetree
* move environment to end of SPI NOR
---
arch/arm/dts/imx8mm-kontron-n801x-som.dtsi | 21 +++++++++++++++++++++
configs/kontron-sl-mx8mm_defconfig | 4 +++-
2 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/arch/arm/dts/imx8mm-kontron-n801x-som.dtsi b/arch/arm/dts/imx8mm-kontron-n801x-som.dtsi
index 8f90eb02550..f651b093d49 100644
--- a/arch/arm/dts/imx8mm-kontron-n801x-som.dtsi
+++ b/arch/arm/dts/imx8mm-kontron-n801x-som.dtsi
@@ -70,6 +70,27 @@
compatible = "mxicy,mx25r1635f", "jedec,spi-nor";
spi-max-frequency = <80000000>;
reg = <0>;
+
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ partition at 0 {
+ label = "u-boot";
+ reg = <0x0 0x1E0000>;
+ };
+
+ partition at 1 {
+ label = "env";
+ reg = <0x1E0000 0x10000>;
+ };
+
+ partition at 2 {
+ label = "env_redundant";
+ reg = <0x1F0000 0x10000>;
+ };
+ };
};
};
diff --git a/configs/kontron-sl-mx8mm_defconfig b/configs/kontron-sl-mx8mm_defconfig
index b67ab8668db..5c1dc754967 100644
--- a/configs/kontron-sl-mx8mm_defconfig
+++ b/configs/kontron-sl-mx8mm_defconfig
@@ -6,7 +6,7 @@ CONFIG_SPL_GPIO=y
CONFIG_SPL_LIBCOMMON_SUPPORT=y
CONFIG_SPL_LIBGENERIC_SUPPORT=y
CONFIG_ENV_SIZE=0x10000
-CONFIG_ENV_OFFSET=0x1f0000
+CONFIG_ENV_OFFSET=0x1E0000
CONFIG_ENV_SECT_SIZE=0x10000
CONFIG_IMX_CONFIG="board/kontron/sl-mx8mm/imximage.cfg"
CONFIG_DM_GPIO=y
@@ -19,6 +19,7 @@ CONFIG_SPL_SERIAL=y
CONFIG_SPL_DRIVERS_MISC=y
CONFIG_BOOTCOUNT_BOOTLIMIT=3
CONFIG_SPL=y
+CONFIG_ENV_OFFSET_REDUND=0x1F0000
CONFIG_SPL_SPI_FLASH_SUPPORT=y
CONFIG_SPL_SPI=y
CONFIG_SYS_LOAD_ADDR=0x42000000
@@ -72,6 +73,7 @@ CONFIG_CMD_EXT4_WRITE=y
CONFIG_OF_CONTROL=y
CONFIG_SPL_OF_CONTROL=y
CONFIG_ENV_IS_IN_SPI_FLASH=y
+CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
CONFIG_NET_RANDOM_ETHADDR=y
CONFIG_SPL_DM=y
--
2.37.1
More information about the U-Boot
mailing list