From e40c8a3daa5820b984752197636a13b7599c053b Mon Sep 17 00:00:00 2001 From: Igor Opaniuk Date: Wed, 3 Jun 2020 11:03:33 +0300 Subject: toradex: imx8: enable BOOTCOUNT feature This introduces automatic boot counter that increases after every reset. After a power-on reset, it will be initialized with 1, and each reboot will increment the value by 1. By default it's disabled if bootlimit isn't set. To enable this feature you have set bootcount limit ("bootlimit"), alternate boot action ("altbootcmd") that will be performed if the new value of bootcount exceeds the value of bootlimit, and "upgrade_available" to let U-Boot automatically increase and save the counter value after every reset: > setenv bootlimit 5 > setenv upgrade_available 1 > setenv altbootcmd "bootm ..." In case the bootlimit exceeds, the message will be shown and albootcmd executed: Warning: Bootlimit (5) exceeded. Using altbootcmd. To reset bootcount run: > bootcount reset Print current value: > bootcount print Relates-to: ELB-2703 Signed-off-by: Igor Opaniuk --- configs/apalis-imx8_defconfig | 2 ++ configs/apalis-imx8x_defconfig | 2 ++ configs/colibri-imx8qxp_defconfig | 2 ++ configs/verdin-imx8mm_defconfig | 2 ++ 4 files changed, 8 insertions(+) diff --git a/configs/apalis-imx8_defconfig b/configs/apalis-imx8_defconfig index 4b4c948ede..4334afee64 100644 --- a/configs/apalis-imx8_defconfig +++ b/configs/apalis-imx8_defconfig @@ -33,6 +33,8 @@ CONFIG_CMD_USB_MASS_STORAGE=y CONFIG_CMD_CACHE=y CONFIG_CMD_EXT4_WRITE=y CONFIG_ENV_IS_IN_MMC=y +CONFIG_BOOTCOUNT_LIMIT=y +CONFIG_BOOTCOUNT_ENV=y CONFIG_CPU=y CONFIG_DM_GPIO=y CONFIG_MXC_GPIO=y diff --git a/configs/apalis-imx8x_defconfig b/configs/apalis-imx8x_defconfig index 9dce9863d0..d260098d95 100644 --- a/configs/apalis-imx8x_defconfig +++ b/configs/apalis-imx8x_defconfig @@ -34,6 +34,8 @@ CONFIG_CMD_USB_MASS_STORAGE=y CONFIG_CMD_CACHE=y CONFIG_CMD_EXT4_WRITE=y CONFIG_ENV_IS_IN_MMC=y +CONFIG_BOOTCOUNT_LIMIT=y +CONFIG_BOOTCOUNT_ENV=y CONFIG_CPU=y CONFIG_DM_GPIO=y CONFIG_MXC_GPIO=y diff --git a/configs/colibri-imx8qxp_defconfig b/configs/colibri-imx8qxp_defconfig index c0861a97b3..1928e11f03 100644 --- a/configs/colibri-imx8qxp_defconfig +++ b/configs/colibri-imx8qxp_defconfig @@ -35,6 +35,8 @@ CONFIG_CMD_USB_MASS_STORAGE=y CONFIG_CMD_CACHE=y CONFIG_CMD_EXT4_WRITE=y CONFIG_ENV_IS_IN_MMC=y +CONFIG_BOOTCOUNT_LIMIT=y +CONFIG_BOOTCOUNT_ENV=y CONFIG_CPU=y CONFIG_DM_GPIO=y CONFIG_MXC_GPIO=y diff --git a/configs/verdin-imx8mm_defconfig b/configs/verdin-imx8mm_defconfig index ea7b379c37..030398fef3 100644 --- a/configs/verdin-imx8mm_defconfig +++ b/configs/verdin-imx8mm_defconfig @@ -40,6 +40,8 @@ CONFIG_CMD_REGULATOR=y CONFIG_CMD_EXT4_WRITE=y CONFIG_OF_CONTROL=y CONFIG_ENV_IS_IN_MMC=y +CONFIG_BOOTCOUNT_LIMIT=y +CONFIG_BOOTCOUNT_ENV=y CONFIG_CPU=y CONFIG_DM_GPIO=y CONFIG_MXC_GPIO=y -- cgit v1.2.3