[U-Boot] [PATCH 5/8] Convert CONFIG_BOOTCOUNT_RAM to Kconfig

Alex Kiernan alex.kiernan at gmail.com
Sun Feb 11 12:06:50 UTC 2018


This converts the following to Kconfig:
  CONFIG_BOOTCOUNT_RAM

Signed-off-by: Alex Kiernan <alex.kiernan at gmail.com>
---

 README                               | 2 --
 configs/km_kirkwood_128m16_defconfig | 1 +
 configs/km_kirkwood_defconfig        | 1 +
 configs/km_kirkwood_pci_defconfig    | 1 +
 configs/kmcoge5un_defconfig          | 1 +
 configs/kmnusa_defconfig             | 1 +
 configs/kmsugp1_defconfig            | 1 +
 configs/kmsuv31_defconfig            | 1 +
 configs/mgcoge3un_defconfig          | 1 +
 configs/portl2_defconfig             | 1 +
 configs/theadorable_debug_defconfig  | 1 +
 drivers/bootcount/Kconfig            | 6 ++++++
 include/configs/km/km_arm.h          | 2 --
 include/configs/theadorable.h        | 1 -
 scripts/config_whitelist.txt         | 1 -
 15 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/README b/README
index 0581b58..20637e0 100644
--- a/README
+++ b/README
@@ -2321,8 +2321,6 @@ The following options need to be configured:
 		enable special bootcounter support on at91sam9xe based boards.
 		CONFIG_SOC_DA8XX
 		enable special bootcounter support on da850 based boards.
-		CONFIG_BOOTCOUNT_RAM
-		enable support for the bootcounter in RAM
 		CONFIG_BOOTCOUNT_I2C
 		enable support for the bootcounter on an i2c (like RTC) device.
 			CONFIG_SYS_I2C_RTC_ADDR = i2c chip address
diff --git a/configs/km_kirkwood_128m16_defconfig b/configs/km_kirkwood_128m16_defconfig
index 075b4b3..a257275 100644
--- a/configs/km_kirkwood_128m16_defconfig
+++ b/configs/km_kirkwood_128m16_defconfig
@@ -26,6 +26,7 @@ CONFIG_CMD_UBI=y
 # CONFIG_CMD_UBIFS is not set
 CONFIG_ENV_IS_IN_EEPROM=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_BOOTCOUNT_RAM=y
 # CONFIG_MMC is not set
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
diff --git a/configs/km_kirkwood_defconfig b/configs/km_kirkwood_defconfig
index 4ed097d..0d8c642 100644
--- a/configs/km_kirkwood_defconfig
+++ b/configs/km_kirkwood_defconfig
@@ -26,6 +26,7 @@ CONFIG_CMD_UBI=y
 # CONFIG_CMD_UBIFS is not set
 CONFIG_ENV_IS_IN_EEPROM=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_BOOTCOUNT_RAM=y
 # CONFIG_MMC is not set
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
diff --git a/configs/km_kirkwood_pci_defconfig b/configs/km_kirkwood_pci_defconfig
index b47c1ad..112344d 100644
--- a/configs/km_kirkwood_pci_defconfig
+++ b/configs/km_kirkwood_pci_defconfig
@@ -26,6 +26,7 @@ CONFIG_CMD_UBI=y
 # CONFIG_CMD_UBIFS is not set
 CONFIG_ENV_IS_IN_EEPROM=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_BOOTCOUNT_RAM=y
 # CONFIG_MMC is not set
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
diff --git a/configs/kmcoge5un_defconfig b/configs/kmcoge5un_defconfig
index 96c4ad0..3db48bc 100644
--- a/configs/kmcoge5un_defconfig
+++ b/configs/kmcoge5un_defconfig
@@ -26,6 +26,7 @@ CONFIG_CMD_UBI=y
 # CONFIG_CMD_UBIFS is not set
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_BOOTCOUNT_RAM=y
 # CONFIG_MMC is not set
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
diff --git a/configs/kmnusa_defconfig b/configs/kmnusa_defconfig
index fec4017..b602932 100644
--- a/configs/kmnusa_defconfig
+++ b/configs/kmnusa_defconfig
@@ -26,6 +26,7 @@ CONFIG_CMD_UBI=y
 # CONFIG_CMD_UBIFS is not set
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_BOOTCOUNT_RAM=y
 # CONFIG_MMC is not set
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
diff --git a/configs/kmsugp1_defconfig b/configs/kmsugp1_defconfig
index d1f1900..91bed21 100644
--- a/configs/kmsugp1_defconfig
+++ b/configs/kmsugp1_defconfig
@@ -26,6 +26,7 @@ CONFIG_CMD_UBI=y
 # CONFIG_CMD_UBIFS is not set
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_BOOTCOUNT_RAM=y
 # CONFIG_MMC is not set
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
diff --git a/configs/kmsuv31_defconfig b/configs/kmsuv31_defconfig
index 9d4fbfe..a920664 100644
--- a/configs/kmsuv31_defconfig
+++ b/configs/kmsuv31_defconfig
@@ -26,6 +26,7 @@ CONFIG_CMD_UBI=y
 # CONFIG_CMD_UBIFS is not set
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_BOOTCOUNT_RAM=y
 # CONFIG_MMC is not set
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
diff --git a/configs/mgcoge3un_defconfig b/configs/mgcoge3un_defconfig
index 250513d..6dff78b 100644
--- a/configs/mgcoge3un_defconfig
+++ b/configs/mgcoge3un_defconfig
@@ -26,6 +26,7 @@ CONFIG_CMD_UBI=y
 # CONFIG_CMD_UBIFS is not set
 CONFIG_ENV_IS_IN_EEPROM=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_BOOTCOUNT_RAM=y
 # CONFIG_MMC is not set
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
diff --git a/configs/portl2_defconfig b/configs/portl2_defconfig
index 857dec1..4ca0094 100644
--- a/configs/portl2_defconfig
+++ b/configs/portl2_defconfig
@@ -26,6 +26,7 @@ CONFIG_CMD_UBI=y
 # CONFIG_CMD_UBIFS is not set
 CONFIG_ENV_IS_IN_EEPROM=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_BOOTCOUNT_RAM=y
 # CONFIG_MMC is not set
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
diff --git a/configs/theadorable_debug_defconfig b/configs/theadorable_debug_defconfig
index b62645e..43c6e2c 100644
--- a/configs/theadorable_debug_defconfig
+++ b/configs/theadorable_debug_defconfig
@@ -44,6 +44,7 @@ CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_SPL_OF_TRANSLATE=y
 CONFIG_SATA_MV=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_BOOTCOUNT_RAM=y
 CONFIG_FPGA_ALTERA=y
 CONFIG_DM_GPIO=y
 # CONFIG_MMC is not set
diff --git a/drivers/bootcount/Kconfig b/drivers/bootcount/Kconfig
index 40a0755..eabfd13 100644
--- a/drivers/bootcount/Kconfig
+++ b/drivers/bootcount/Kconfig
@@ -40,6 +40,12 @@ config BOOTCOUNT_ENV
 	  So the Userspace Application must set the "upgrade_available"
 	  and "bootcount" variable to 0, if a boot was successfully.
 
+config BOOTCOUNT_RAM
+	bool "Boot counter in RAM"
+	help
+	  Store the bootcount in DRAM protected against against bit errors
+	  due to short power loss or holding a system in RESET.
+
 endchoice
 
 config SYS_BOOTCOUNT_SINGLEWORD
diff --git a/include/configs/km/km_arm.h b/include/configs/km/km_arm.h
index ed58d1e..ca23952 100644
--- a/include/configs/km/km_arm.h
+++ b/include/configs/km/km_arm.h
@@ -277,8 +277,6 @@ int get_scl(void);
 #define CONFIG_KM_RESERVED_PRAM 0x801000
 /* address for the bootcount (taken from end of RAM) */
 #define BOOTCOUNT_ADDR          (CONFIG_KM_RESERVED_PRAM)
-/* Use generic bootcount RAM driver */
-#define CONFIG_BOOTCOUNT_RAM
 
 /* enable POST tests */
 #define CONFIG_POST	(CONFIG_SYS_POST_MEM_REGIONS)
diff --git a/include/configs/theadorable.h b/include/configs/theadorable.h
index ec9dc2e..a3b5c87 100644
--- a/include/configs/theadorable.h
+++ b/include/configs/theadorable.h
@@ -83,7 +83,6 @@
 /*
  * Bootcounter
  */
-#define CONFIG_BOOTCOUNT_RAM
 /* Max size of RAM minus BOOTCOUNT_ADDR is the bootcounter address */
 #define BOOTCOUNT_ADDR			0x1000
 
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index 0fd4ad6..487c790 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -150,7 +150,6 @@ CONFIG_BOOTBLOCK
 CONFIG_BOOTCOUNT_ALEN
 CONFIG_BOOTCOUNT_I2C
 CONFIG_BOOTCOUNT_LIMIT
-CONFIG_BOOTCOUNT_RAM
 CONFIG_BOOTFILE
 CONFIG_BOOTMAPSZ
 CONFIG_BOOTMODE
-- 
2.7.4



More information about the U-Boot mailing list