From ff5410d34b1ce3fa3785ecfd785704cfccc30938 Mon Sep 17 00:00:00 2001 From: Alex Kiernan Date: Fri, 16 Feb 2018 15:50:42 +0000 Subject: [PATCH] Convert CONFIG_BOOTCOUNT_RAM to Kconfig This converts the following to Kconfig: CONFIG_BOOTCOUNT_RAM Signed-off-by: Alex Kiernan Reviewed-by: Lukasz Majewski --- 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 4478bad6ef..5ab683de64 100644 --- a/README +++ b/README @@ -2270,8 +2270,6 @@ The following options need to be configured: - bootcount support: CONFIG_AT91SAM9XE enable special bootcounter support on at91sam9xe 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 3c7709dbdc..653dc92ca3 100644 --- a/configs/km_kirkwood_128m16_defconfig +++ b/configs/km_kirkwood_128m16_defconfig @@ -30,6 +30,7 @@ CONFIG_BOOTP_BOOTPATH=y CONFIG_BOOTP_GATEWAY=y CONFIG_BOOTP_HOSTNAME=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 04513a44b6..0a55ed407a 100644 --- a/configs/km_kirkwood_defconfig +++ b/configs/km_kirkwood_defconfig @@ -30,6 +30,7 @@ CONFIG_BOOTP_BOOTPATH=y CONFIG_BOOTP_GATEWAY=y CONFIG_BOOTP_HOSTNAME=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 1e8f51135c..dba9eb7b7d 100644 --- a/configs/km_kirkwood_pci_defconfig +++ b/configs/km_kirkwood_pci_defconfig @@ -30,6 +30,7 @@ CONFIG_BOOTP_BOOTPATH=y CONFIG_BOOTP_GATEWAY=y CONFIG_BOOTP_HOSTNAME=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 c7c0021131..63654c35cd 100644 --- a/configs/kmcoge5un_defconfig +++ b/configs/kmcoge5un_defconfig @@ -30,6 +30,7 @@ CONFIG_BOOTP_BOOTPATH=y CONFIG_BOOTP_GATEWAY=y CONFIG_BOOTP_HOSTNAME=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 960ca12cb3..0dd32016a1 100644 --- a/configs/kmnusa_defconfig +++ b/configs/kmnusa_defconfig @@ -30,6 +30,7 @@ CONFIG_BOOTP_BOOTPATH=y CONFIG_BOOTP_GATEWAY=y CONFIG_BOOTP_HOSTNAME=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 d5d5cd7b06..ed6540fed4 100644 --- a/configs/kmsugp1_defconfig +++ b/configs/kmsugp1_defconfig @@ -30,6 +30,7 @@ CONFIG_BOOTP_BOOTPATH=y CONFIG_BOOTP_GATEWAY=y CONFIG_BOOTP_HOSTNAME=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 33335cd408..b662077ef9 100644 --- a/configs/kmsuv31_defconfig +++ b/configs/kmsuv31_defconfig @@ -30,6 +30,7 @@ CONFIG_BOOTP_BOOTPATH=y CONFIG_BOOTP_GATEWAY=y CONFIG_BOOTP_HOSTNAME=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 5c0946af7b..6a96b62eb5 100644 --- a/configs/mgcoge3un_defconfig +++ b/configs/mgcoge3un_defconfig @@ -30,6 +30,7 @@ CONFIG_BOOTP_BOOTPATH=y CONFIG_BOOTP_GATEWAY=y CONFIG_BOOTP_HOSTNAME=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 e3cf6378b7..6dc270a035 100644 --- a/configs/portl2_defconfig +++ b/configs/portl2_defconfig @@ -30,6 +30,7 @@ CONFIG_BOOTP_BOOTPATH=y CONFIG_BOOTP_GATEWAY=y CONFIG_BOOTP_HOSTNAME=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 aa6e5e11ef..918447a296 100644 --- a/configs/theadorable_debug_defconfig +++ b/configs/theadorable_debug_defconfig @@ -45,6 +45,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 40a07555af..eabfd132ad 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 faa3d94a95..cc36a68c0b 100644 --- a/include/configs/km/km_arm.h +++ b/include/configs/km/km_arm.h @@ -276,8 +276,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 a213e7e0a2..e4ec2c00f8 100644 --- a/include/configs/theadorable.h +++ b/include/configs/theadorable.h @@ -82,7 +82,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 80a38763fa..deb3c0c8c3 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -147,7 +147,6 @@ CONFIG_BOOGER CONFIG_BOOTBLOCK CONFIG_BOOTCOUNT_ALEN CONFIG_BOOTCOUNT_I2C -CONFIG_BOOTCOUNT_RAM CONFIG_BOOTFILE CONFIG_BOOTMAPSZ CONFIG_BOOTMODE -- 2.25.1