[U-Boot,v1,3/5] spl: bootcount: Enable bootcount support in SPL

Message ID 20180210102032.315-4-lukma@denx.de
State Superseded
Delegated to: Tom Rini
Headers show
  • Provide SPL support for bootcount (in the case of using falcon boot mode)
Related show

Commit Message

Lukasz Majewski Feb. 10, 2018, 10:20 a.m.
New, SPL related config option - CONFIG_SPL_BOOTCOUNT_LIMIT has been
added to allow drivers/bootcount code re-usage in SPL.

This code is necessary to use and setup bootcount in SPL in the case of
falcon boot mode.

Signed-off-by: Lukasz Majewski <lukma@denx.de>

 common/spl/Kconfig | 9 +++++++++
 drivers/Makefile   | 1 +
 2 files changed, 10 insertions(+)


diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index 65b3aff244..37354e262e 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -46,6 +46,15 @@  config SPL_BOOTROM_SUPPORT
 	  BOOT_DEVICE_BOOTROM (or fall-through to the next boot device in the
 	  boot device list, if not implemented for a given board)
+	bool "Support bootcount in SPL"
+	depends on SPL_ENV_SUPPORT
+	help
+	  On some boards, which use 'falcon' mode, it is necessary to check
+	  and increment the number of boot attempts. Such boards do not
+	  use proper U-Boot for normal boot flow and hence needs those
+	  adjustments to be done in the SPL.
 	bool "Support SPL loading and booting of RAW images"
 	default n if (ARCH_MX6 && (SPL_MMC_SUPPORT || SPL_SATA_SUPPORT))
diff --git a/drivers/Makefile b/drivers/Makefile
index e6062a5683..2a988360a0 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -20,6 +20,7 @@  obj-$(CONFIG_$(SPL_TPL_)TIMER) += timer/
+obj-$(CONFIG_SPL_BOOTCOUNT_LIMIT) += bootcount/
 obj-$(CONFIG_SPL_CPU_SUPPORT) += cpu/
 obj-$(CONFIG_SPL_CRYPTO_SUPPORT) += crypto/
 obj-$(CONFIG_SPL_GPIO_SUPPORT) += gpio/