[U-Boot] [PATCH v2 00/13] Convert bootcount drivers to Kconfig

This patch set converts bootcount drivers to Kconfig, it also merges CONFIG_BOOTCOUNT and CONFIG_BOOTCOUNT_LIMIT.
Green Travis build:
https://travis-ci.org/akiernan/u-boot/builds/341811354
This patch has been applied on top of u-boot/master: SHA1: 7d531e8a4f9265ade08bc1d35135ff8888381a15
This patch series shall be applied on top of: [U-Boot,1/2] Convert CONFIG_BOOTCOUNT_LIMIT to Kconfig http://patchwork.ozlabs.org/patch/871585/
[U-Boot,2/2] Convert CONFIG_SYS_BOOTCOUNT_SINGLEWORD to Kconfig http://patchwork.ozlabs.org/patch/871586/
Changes in v2: - Fix erroneously removed line in README - Convert CONFIG_BOOTCOUNT_EXT too - it had only been partially done - Reword CONFIG_BOOTCOUNT_DRAM - Update README for AT91 driver - Remove CONFIG_BOOTCOUNT_LIMIT and CONFIG_SYS_BOOTCOUNT_SINGLEWORD from whitelist - Rename CONFIG_SYS_BOOTCOUNT_ADDR to BOOTCOUNT_ADDR and remove from Kconfig - Migrate CONFIG_BOOTCOUNT_ALEN to Kconfig
Alex Kiernan (13): Merge CONFIG_BOOTCOUNT and CONFIG_BOOTCOUNT_LIMIT Prepare for multiple bootcount drivers Convert CONFIG_BOOTCOUNT_AM33XX to Kconfig Convert CONFIG_BOOTCOUNT_ENV to Kconfig Convert CONFIG_BOOTCOUNT_RAM to Kconfig Convert CONFIG_BOOTCOUNT_I2C to Kconfig Convert CONFIG_BOOTCOUNT_EXT to Kconfig Integrate AT91 bootcount driver Migrate generic bootcount to Kconfig Remove SYS_BOOTCOUNT_ADDR from Kconfig Rename CONFIG_SYS_BOOTCOUNT_ADDR to BOOTCOUNT_ADDR Migrate CONFIG_BOOTCOUNT_ALEN to Kconfig Remove CONFIG_SYS_BOOTCOUNT_SINGLEWORD
README | 32 ----------- configs/draco_defconfig | 1 + configs/etamin_defconfig | 1 + configs/ge_b450v3_defconfig | 2 + configs/ge_b650v3_defconfig | 2 + configs/ge_b850v3_defconfig | 2 + configs/ids8313_defconfig | 1 + 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/mx53ppd_defconfig | 1 - configs/portl2_defconfig | 1 + configs/pxm2_defconfig | 1 + configs/rastaban_defconfig | 1 + configs/rut_defconfig | 1 + configs/theadorable_debug_defconfig | 1 + configs/thuban_defconfig | 1 + drivers/bootcount/Kconfig | 98 ++++++++++++++++++++++++---------- drivers/bootcount/Makefile | 5 +- drivers/bootcount/bootcount.c | 16 +++--- drivers/bootcount/bootcount_davinci.c | 4 +- drivers/bootcount/bootcount_ext.c | 8 +-- drivers/bootcount/bootcount_i2c.c | 6 +-- include/configs/am335x_evm.h | 1 - include/configs/am335x_sl50.h | 1 - include/configs/baltos.h | 2 - include/configs/bav335x.h | 1 - include/configs/brppt1.h | 3 +- include/configs/calimain.h | 2 +- include/configs/chiliboard.h | 1 - include/configs/dh_imx6.h | 2 +- include/configs/ge_bx50v3.h | 6 +-- include/configs/highbank.h | 2 +- include/configs/ids8313.h | 4 +- include/configs/km/km_arm.h | 2 - include/configs/km/kmp204x-common.h | 2 +- include/configs/mx53ppd.h | 2 + include/configs/siemens-am33x-common.h | 2 - include/configs/socfpga_is1.h | 2 +- include/configs/socfpga_sr1500.h | 2 +- include/configs/theadorable.h | 1 - include/configs/ti_am335x_common.h | 2 +- include/configs/tqma6_wru4.h | 2 +- include/configs/x600.h | 2 +- scripts/config_whitelist.txt | 7 --- 50 files changed, 127 insertions(+), 117 deletions(-)

CONFIG_BOOTCOUNT was only used in mx53ppd, merge it with CONFIG_BOOTCOUNT_LIMIT
CONFIG_BOOTCOUNT was only used in mx53ppd, merge it with CONFIG_BOOTCOUNT_LIMIT
Signed-off-by: Alex Kiernan alex.kiernan@gmail.com Reviewed-by: Lukasz Majewski lukma@denx.de Reviewed-by: Ian Ray ian.ray@ge.com ---
Changes in v2: - Fix erroneously removed line in README - Convert CONFIG_BOOTCOUNT_EXT too - it had only been partially done - Reword CONFIG_BOOTCOUNT_DRAM - Update README for AT91 driver - Remove CONFIG_BOOTCOUNT_LIMIT and CONFIG_SYS_BOOTCOUNT_SINGLEWORD from whitelist - Rename CONFIG_SYS_BOOTCOUNT_ADDR to BOOTCOUNT_ADDR and remove from Kconfig - Migrate CONFIG_BOOTCOUNT_ALEN to Kconfig
configs/mx53ppd_defconfig | 1 - drivers/bootcount/Kconfig | 9 +-------- scripts/config_whitelist.txt | 1 - 3 files changed, 1 insertion(+), 10 deletions(-)
diff --git a/configs/mx53ppd_defconfig b/configs/mx53ppd_defconfig index 90df425..7e3dd6d 100644 --- a/configs/mx53ppd_defconfig +++ b/configs/mx53ppd_defconfig @@ -21,7 +21,6 @@ CONFIG_CMD_EXT4=y CONFIG_CMD_EXT4_WRITE=y CONFIG_CMD_FAT=y CONFIG_CMD_FS_GENERIC=y -CONFIG_BOOTCOUNT=y CONFIG_BOOTCOUNT_LIMIT=y CONFIG_BOOTCOUNT_EXT=y CONFIG_SYS_BOOTCOUNT_EXT_DEVPART="0:5" diff --git a/drivers/bootcount/Kconfig b/drivers/bootcount/Kconfig index d82289f..da2ccab 100644 --- a/drivers/bootcount/Kconfig +++ b/drivers/bootcount/Kconfig @@ -4,13 +4,6 @@
menu "Boot count support"
-config BOOTCOUNT - bool "Enable Boot count support" - help - Enable boot count support, which provides the ability to store the - number of times the board has booted on a number of different - persistent storage mediums. - config BOOTCOUNT_LIMIT bool "Enable support for checking boot count limit" help @@ -23,7 +16,7 @@ config SYS_BOOTCOUNT_SINGLEWORD This option enables packing boot count magic value and boot count into single word (32 bits).
-if BOOTCOUNT +if BOOTCOUNT_LIMIT
config BOOTCOUNT_EXT bool "Boot counter on EXT filesystem" diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index 38ce88e..b3a5d93 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -151,7 +151,6 @@ CONFIG_BOOTCOUNT_ALEN CONFIG_BOOTCOUNT_AM33XX CONFIG_BOOTCOUNT_ENV CONFIG_BOOTCOUNT_I2C -CONFIG_BOOTCOUNT_LIMIT CONFIG_BOOTCOUNT_RAM CONFIG_BOOTFILE CONFIG_BOOTMAPSZ

Hi Alex,
CONFIG_BOOTCOUNT was only used in mx53ppd, merge it with CONFIG_BOOTCOUNT_LIMIT
CONFIG_BOOTCOUNT was only used in mx53ppd, merge it with CONFIG_BOOTCOUNT_LIMIT
Please remove one instance.
Signed-off-by: Alex Kiernan alex.kiernan@gmail.com Reviewed-by: Lukasz Majewski lukma@denx.de Reviewed-by: Ian Ray ian.ray@ge.com
Changes in v2:
- Fix erroneously removed line in README
- Convert CONFIG_BOOTCOUNT_EXT too - it had only been partially done
- Reword CONFIG_BOOTCOUNT_DRAM
- Update README for AT91 driver
- Remove CONFIG_BOOTCOUNT_LIMIT and CONFIG_SYS_BOOTCOUNT_SINGLEWORD from whitelist
- Rename CONFIG_SYS_BOOTCOUNT_ADDR to BOOTCOUNT_ADDR and remove from Kconfig
- Migrate CONFIG_BOOTCOUNT_ALEN to Kconfig
configs/mx53ppd_defconfig | 1 - drivers/bootcount/Kconfig | 9 +-------- scripts/config_whitelist.txt | 1 - 3 files changed, 1 insertion(+), 10 deletions(-)
diff --git a/configs/mx53ppd_defconfig b/configs/mx53ppd_defconfig index 90df425..7e3dd6d 100644 --- a/configs/mx53ppd_defconfig +++ b/configs/mx53ppd_defconfig @@ -21,7 +21,6 @@ CONFIG_CMD_EXT4=y CONFIG_CMD_EXT4_WRITE=y CONFIG_CMD_FAT=y CONFIG_CMD_FS_GENERIC=y -CONFIG_BOOTCOUNT=y CONFIG_BOOTCOUNT_LIMIT=y CONFIG_BOOTCOUNT_EXT=y CONFIG_SYS_BOOTCOUNT_EXT_DEVPART="0:5" diff --git a/drivers/bootcount/Kconfig b/drivers/bootcount/Kconfig index d82289f..da2ccab 100644 --- a/drivers/bootcount/Kconfig +++ b/drivers/bootcount/Kconfig @@ -4,13 +4,6 @@
menu "Boot count support"
-config BOOTCOUNT
- bool "Enable Boot count support"
- help
Enable boot count support, which provides the ability to
store the
number of times the board has booted on a number of
different
persistent storage mediums.
config BOOTCOUNT_LIMIT bool "Enable support for checking boot count limit" help @@ -23,7 +16,7 @@ config SYS_BOOTCOUNT_SINGLEWORD This option enables packing boot count magic value and boot count into single word (32 bits).
-if BOOTCOUNT +if BOOTCOUNT_LIMIT
config BOOTCOUNT_EXT bool "Boot counter on EXT filesystem" diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index 38ce88e..b3a5d93 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -151,7 +151,6 @@ CONFIG_BOOTCOUNT_ALEN CONFIG_BOOTCOUNT_AM33XX CONFIG_BOOTCOUNT_ENV CONFIG_BOOTCOUNT_I2C -CONFIG_BOOTCOUNT_LIMIT CONFIG_BOOTCOUNT_RAM CONFIG_BOOTFILE CONFIG_BOOTMAPSZ
Best regards,
Lukasz Majewski
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de

Reviewed-by: Lukasz Majewski lukma@denx.de Signed-off-by: Alex Kiernan alex.kiernan@gmail.com ---
Changes in v2: None
drivers/bootcount/Kconfig | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-)
diff --git a/drivers/bootcount/Kconfig b/drivers/bootcount/Kconfig index da2ccab..26fec89 100644 --- a/drivers/bootcount/Kconfig +++ b/drivers/bootcount/Kconfig @@ -2,29 +2,30 @@ # Boot count configuration #
-menu "Boot count support" - -config BOOTCOUNT_LIMIT +menuconfig BOOTCOUNT_LIMIT bool "Enable support for checking boot count limit" help Enable checking for exceeding the boot count limit. More information: http://www.denx.de/wiki/DULG/UBootBootCountLimit
-config SYS_BOOTCOUNT_SINGLEWORD - bool "Use single word to pack boot count and magic value" - help - This option enables packing boot count magic value and boot count - into single word (32 bits). - if BOOTCOUNT_LIMIT
+choice + prompt "Boot count device" + config BOOTCOUNT_EXT bool "Boot counter on EXT filesystem" help Add support for maintaining boot count in a file on an EXT filesystem.
-if BOOTCOUNT_EXT +endchoice + +config SYS_BOOTCOUNT_SINGLEWORD + bool "Use single word to pack boot count and magic value" + help + This option enables packing boot count magic value and boot count + into single word (32 bits).
config SYS_BOOTCOUNT_EXT_INTERFACE string "Interface on which to find boot counter EXT filesystem" @@ -57,7 +58,3 @@ config SYS_BOOTCOUNT_ADDR Set the address used for reading and writing the boot counter.
endif - -endif - -endmenu

This converts the following to Kconfig: CONFIG_BOOTCOUNT_AM33XX
Reviewed-by: Lukasz Majewski lukma@denx.de Reviewed-by: Hannes Schmelzer hannes.schmelzer@br-automation.com Acked-by: Hannes Schmelzer hannes.schmelzer@br-automation.com Signed-off-by: Alex Kiernan alex.kiernan@gmail.com ---
Changes in v2: None
README | 2 -- drivers/bootcount/Kconfig | 9 +++++++++ drivers/bootcount/Makefile | 1 - include/configs/am335x_evm.h | 1 - include/configs/am335x_sl50.h | 1 - include/configs/baltos.h | 2 -- include/configs/bav335x.h | 1 - include/configs/brppt1.h | 1 - include/configs/chiliboard.h | 1 - scripts/config_whitelist.txt | 1 - 10 files changed, 9 insertions(+), 11 deletions(-)
diff --git a/README b/README index dc4c329..cc341ac 100644 --- a/README +++ b/README @@ -2320,8 +2320,6 @@ The following options need to be configured: - bootcount support: CONFIG_AT91SAM9XE 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 diff --git a/drivers/bootcount/Kconfig b/drivers/bootcount/Kconfig index 26fec89..e905295 100644 --- a/drivers/bootcount/Kconfig +++ b/drivers/bootcount/Kconfig @@ -12,6 +12,7 @@ if BOOTCOUNT_LIMIT
choice prompt "Boot count device" + default BOOTCOUNT_AM33XX if AM33XX || SOC_DA8XX
config BOOTCOUNT_EXT bool "Boot counter on EXT filesystem" @@ -19,6 +20,14 @@ config BOOTCOUNT_EXT Add support for maintaining boot count in a file on an EXT filesystem.
+config BOOTCOUNT_AM33XX + bool "Boot counter in AM33XX RTC IP block" + depends on AM33XX || SOC_DA8XX + help + A bootcount driver for the RTC IP block found on many TI platforms. + This requires the RTC clocks, etc, to be enabled prior to use and + not all boards with this IP block on it will have the RTC in use. + endchoice
config SYS_BOOTCOUNT_SINGLEWORD diff --git a/drivers/bootcount/Makefile b/drivers/bootcount/Makefile index 45445d2..62bf55e 100644 --- a/drivers/bootcount/Makefile +++ b/drivers/bootcount/Makefile @@ -4,7 +4,6 @@
obj-y += bootcount.o obj-$(CONFIG_AT91SAM9XE) += bootcount_at91.o -obj-$(CONFIG_SOC_DA8XX) += bootcount_davinci.o obj-$(CONFIG_BOOTCOUNT_AM33XX) += bootcount_davinci.o obj-$(CONFIG_BOOTCOUNT_RAM) += bootcount_ram.o obj-$(CONFIG_BOOTCOUNT_ENV) += bootcount_env.o diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h index cacc262..442f6c4 100644 --- a/include/configs/am335x_evm.h +++ b/include/configs/am335x_evm.h @@ -177,7 +177,6 @@ /* SPL */ #ifndef CONFIG_NOR_BOOT /* Bootcount using the RTC block */ -#define CONFIG_BOOTCOUNT_AM33XX #define CONFIG_SYS_BOOTCOUNT_BE
/* USB gadget RNDIS */ diff --git a/include/configs/am335x_sl50.h b/include/configs/am335x_sl50.h index 1cb3578..4bcbaee 100644 --- a/include/configs/am335x_sl50.h +++ b/include/configs/am335x_sl50.h @@ -74,7 +74,6 @@ /* SPL */
/* Bootcount using the RTC block */ -#define CONFIG_BOOTCOUNT_AM33XX #define CONFIG_SYS_BOOTCOUNT_BE
#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_USBETH_SUPPORT) diff --git a/include/configs/baltos.h b/include/configs/baltos.h index 440dbf5..10979c7 100644 --- a/include/configs/baltos.h +++ b/include/configs/baltos.h @@ -230,8 +230,6 @@
/* SPL */ #ifndef CONFIG_NOR_BOOT -/* Bootcount using the RTC block */ -#define CONFIG_BOOTCOUNT_AM33XX
/* USB gadget RNDIS */
diff --git a/include/configs/bav335x.h b/include/configs/bav335x.h index 5ea7658..48cd285 100644 --- a/include/configs/bav335x.h +++ b/include/configs/bav335x.h @@ -339,7 +339,6 @@ DEFAULT_LINUX_BOOT_ENV \ /* SPL */ #ifndef CONFIG_NOR_BOOT /* Bootcount using the RTC block */ -#define CONFIG_BOOTCOUNT_AM33XX #define CONFIG_SYS_BOOTCOUNT_BE
/* USB gadget RNDIS */ diff --git a/include/configs/brppt1.h b/include/configs/brppt1.h index fb2845f..30ea2d2 100644 --- a/include/configs/brppt1.h +++ b/include/configs/brppt1.h @@ -22,7 +22,6 @@
/* Bootcount using the RTC block */ #define CONFIG_SYS_BOOTCOUNT_ADDR 0x44E3E000 -#define CONFIG_BOOTCOUNT_AM33XX
/* memory */ #define CONFIG_SYS_MALLOC_LEN (5 * 1024 * 1024) diff --git a/include/configs/chiliboard.h b/include/configs/chiliboard.h index 234cd6a..92e0479 100644 --- a/include/configs/chiliboard.h +++ b/include/configs/chiliboard.h @@ -123,7 +123,6 @@
/* SPL */ /* Bootcount using the RTC block */ -#define CONFIG_BOOTCOUNT_AM33XX #define CONFIG_SYS_BOOTCOUNT_BE
/* NAND: device related configs */ diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index b3a5d93..ccaac48 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -148,7 +148,6 @@ CONFIG_BOOGER CONFIG_BOOM CONFIG_BOOTBLOCK CONFIG_BOOTCOUNT_ALEN -CONFIG_BOOTCOUNT_AM33XX CONFIG_BOOTCOUNT_ENV CONFIG_BOOTCOUNT_I2C CONFIG_BOOTCOUNT_RAM

This converts the following to Kconfig: CONFIG_BOOTCOUNT_ENV
Signed-off-by: Alex Kiernan alex.kiernan@gmail.com Reviewed-by: Lukasz Majewski lukma@denx.de ---
Changes in v2: None
README | 11 ----------- configs/draco_defconfig | 1 + configs/etamin_defconfig | 1 + configs/pxm2_defconfig | 1 + configs/rastaban_defconfig | 1 + configs/rut_defconfig | 1 + configs/thuban_defconfig | 1 + drivers/bootcount/Kconfig | 12 ++++++++++++ include/configs/siemens-am33x-common.h | 2 -- scripts/config_whitelist.txt | 1 - 10 files changed, 18 insertions(+), 14 deletions(-)
diff --git a/README b/README index cc341ac..da77484 100644 --- a/README +++ b/README @@ -714,17 +714,6 @@ The following options need to be configured: RAM and NFS.
- Bootcount: - CONFIG_BOOTCOUNT_ENV - If no softreset save registers are found on the hardware - "bootcount" is stored in the environment. To prevent a - saveenv on all reboots, the environment variable - "upgrade_available" is used. If "upgrade_available" is - 0, "bootcount" is always 0, if "upgrade_available" is - 1 "bootcount" is incremented in the environment. - So the Userspace Applikation must set the "upgrade_available" - and "bootcount" variable to 0, if a boot was successfully. - -- Pre-Boot Commands: CONFIG_PREBOOT
When this option is #defined, the existence of the diff --git a/configs/draco_defconfig b/configs/draco_defconfig index 693d91c..0416daa 100644 --- a/configs/draco_defconfig +++ b/configs/draco_defconfig @@ -52,6 +52,7 @@ CONFIG_OF_CONTROL=y CONFIG_OF_EMBED=y CONFIG_ENV_IS_IN_NAND=y CONFIG_BOOTCOUNT_LIMIT=y +CONFIG_BOOTCOUNT_ENV=y CONFIG_DFU_NAND=y CONFIG_MMC_OMAP_HS=y CONFIG_NAND=y diff --git a/configs/etamin_defconfig b/configs/etamin_defconfig index e7a3d22..7d639ea 100644 --- a/configs/etamin_defconfig +++ b/configs/etamin_defconfig @@ -52,6 +52,7 @@ CONFIG_OF_CONTROL=y CONFIG_OF_EMBED=y CONFIG_ENV_IS_IN_NAND=y CONFIG_BOOTCOUNT_LIMIT=y +CONFIG_BOOTCOUNT_ENV=y CONFIG_DFU_NAND=y CONFIG_MMC_OMAP_HS=y CONFIG_NAND=y diff --git a/configs/pxm2_defconfig b/configs/pxm2_defconfig index 6063259..90783b4 100644 --- a/configs/pxm2_defconfig +++ b/configs/pxm2_defconfig @@ -55,6 +55,7 @@ CONFIG_OF_CONTROL=y CONFIG_OF_EMBED=y CONFIG_ENV_IS_IN_NAND=y CONFIG_BOOTCOUNT_LIMIT=y +CONFIG_BOOTCOUNT_ENV=y CONFIG_DFU_NAND=y CONFIG_MMC_OMAP_HS=y CONFIG_NAND=y diff --git a/configs/rastaban_defconfig b/configs/rastaban_defconfig index ce6981e..c0947e9 100644 --- a/configs/rastaban_defconfig +++ b/configs/rastaban_defconfig @@ -52,6 +52,7 @@ CONFIG_OF_CONTROL=y CONFIG_OF_EMBED=y CONFIG_ENV_IS_IN_NAND=y CONFIG_BOOTCOUNT_LIMIT=y +CONFIG_BOOTCOUNT_ENV=y CONFIG_DFU_NAND=y CONFIG_MMC_OMAP_HS=y CONFIG_NAND=y diff --git a/configs/rut_defconfig b/configs/rut_defconfig index b31eb97..685b4c8 100644 --- a/configs/rut_defconfig +++ b/configs/rut_defconfig @@ -56,6 +56,7 @@ CONFIG_OF_CONTROL=y CONFIG_OF_EMBED=y CONFIG_ENV_IS_IN_NAND=y CONFIG_BOOTCOUNT_LIMIT=y +CONFIG_BOOTCOUNT_ENV=y CONFIG_DFU_NAND=y CONFIG_MMC_OMAP_HS=y CONFIG_NAND=y diff --git a/configs/thuban_defconfig b/configs/thuban_defconfig index 4a3c0cd..f5d1077 100644 --- a/configs/thuban_defconfig +++ b/configs/thuban_defconfig @@ -52,6 +52,7 @@ CONFIG_OF_CONTROL=y CONFIG_OF_EMBED=y CONFIG_ENV_IS_IN_NAND=y CONFIG_BOOTCOUNT_LIMIT=y +CONFIG_BOOTCOUNT_ENV=y CONFIG_DFU_NAND=y CONFIG_MMC_OMAP_HS=y CONFIG_NAND=y diff --git a/drivers/bootcount/Kconfig b/drivers/bootcount/Kconfig index e905295..40a0755 100644 --- a/drivers/bootcount/Kconfig +++ b/drivers/bootcount/Kconfig @@ -28,6 +28,18 @@ config BOOTCOUNT_AM33XX This requires the RTC clocks, etc, to be enabled prior to use and not all boards with this IP block on it will have the RTC in use.
+config BOOTCOUNT_ENV + bool "Boot counter in environment" + help + If no softreset save registers are found on the hardware + "bootcount" is stored in the environment. To prevent a + saveenv on all reboots, the environment variable + "upgrade_available" is used. If "upgrade_available" is + 0, "bootcount" is always 0, if "upgrade_available" is + 1 "bootcount" is incremented in the environment. + So the Userspace Application must set the "upgrade_available" + and "bootcount" variable to 0, if a boot was successfully. + endchoice
config SYS_BOOTCOUNT_SINGLEWORD diff --git a/include/configs/siemens-am33x-common.h b/include/configs/siemens-am33x-common.h index 838e8d0..ed4b6cd 100644 --- a/include/configs/siemens-am33x-common.h +++ b/include/configs/siemens-am33x-common.h @@ -499,6 +499,4 @@ #define CONFIG_RESET_TO_RETRY #define CONFIG_BOOT_RETRY_TIME 60
-#define CONFIG_BOOTCOUNT_ENV - #endif /* ! __CONFIG_SIEMENS_AM33X_COMMON_H */ diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index ccaac48..1559a29 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -148,7 +148,6 @@ CONFIG_BOOGER CONFIG_BOOM CONFIG_BOOTBLOCK CONFIG_BOOTCOUNT_ALEN -CONFIG_BOOTCOUNT_ENV CONFIG_BOOTCOUNT_I2C CONFIG_BOOTCOUNT_RAM CONFIG_BOOTFILE

This converts the following to Kconfig: CONFIG_BOOTCOUNT_RAM
Signed-off-by: Alex Kiernan alex.kiernan@gmail.com Reviewed-by: Lukasz Majewski lukma@denx.de ---
Changes in v2: None
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 da77484..d28a576 100644 --- a/README +++ b/README @@ -2309,8 +2309,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 54c22a7..5f378f7 100644 --- a/configs/km_kirkwood_128m16_defconfig +++ b/configs/km_kirkwood_128m16_defconfig @@ -27,6 +27,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 20ea24b..ae20d24 100644 --- a/configs/km_kirkwood_defconfig +++ b/configs/km_kirkwood_defconfig @@ -27,6 +27,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 402610c..22bc6cd 100644 --- a/configs/km_kirkwood_pci_defconfig +++ b/configs/km_kirkwood_pci_defconfig @@ -27,6 +27,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 72aee04..5c123a4 100644 --- a/configs/kmcoge5un_defconfig +++ b/configs/kmcoge5un_defconfig @@ -27,6 +27,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 ac82780..4749ead 100644 --- a/configs/kmnusa_defconfig +++ b/configs/kmnusa_defconfig @@ -27,6 +27,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 af2c93e3..de68d41 100644 --- a/configs/kmsugp1_defconfig +++ b/configs/kmsugp1_defconfig @@ -27,6 +27,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 09d75ab..892f212 100644 --- a/configs/kmsuv31_defconfig +++ b/configs/kmsuv31_defconfig @@ -27,6 +27,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 3e90e70..89a83fd 100644 --- a/configs/mgcoge3un_defconfig +++ b/configs/mgcoge3un_defconfig @@ -27,6 +27,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 1c6dad9..8a6d996 100644 --- a/configs/portl2_defconfig +++ b/configs/portl2_defconfig @@ -27,6 +27,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 aa6e5e1..918447a 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 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 faa3d94..cc36a68 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 1504fd6..93ff65d 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 1559a29..312d4bb 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -149,7 +149,6 @@ CONFIG_BOOM CONFIG_BOOTBLOCK CONFIG_BOOTCOUNT_ALEN CONFIG_BOOTCOUNT_I2C -CONFIG_BOOTCOUNT_RAM CONFIG_BOOTFILE CONFIG_BOOTMAPSZ CONFIG_BOOTMODE

This converts the following to Kconfig: CONFIG_BOOTCOUNT_I2C
Signed-off-by: Alex Kiernan alex.kiernan@gmail.com Reviewed-by: Lukasz Majewski lukma@denx.de ---
Changes in v2: None
README | 6 ------ configs/ids8313_defconfig | 1 + drivers/bootcount/Kconfig | 9 +++++++++ include/configs/ids8313.h | 1 - scripts/config_whitelist.txt | 1 - 5 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/README b/README index d28a576..0157f0b 100644 --- a/README +++ b/README @@ -2309,12 +2309,6 @@ The following options need to be configured: - bootcount support: CONFIG_AT91SAM9XE enable special bootcounter support on at91sam9xe based boards. - CONFIG_BOOTCOUNT_I2C - enable support for the bootcounter on an i2c (like RTC) device. - CONFIG_SYS_I2C_RTC_ADDR = i2c chip address - CONFIG_SYS_BOOTCOUNT_ADDR = i2c addr which is used for - the bootcounter. - CONFIG_BOOTCOUNT_ALEN = address len CONFIG_BOOTCOUNT_EXT enable support for the bootcounter in EXT filesystem CONFIG_SYS_BOOTCOUNT_ADDR = RAM address used for read diff --git a/configs/ids8313_defconfig b/configs/ids8313_defconfig index b754758..ca14815 100644 --- a/configs/ids8313_defconfig +++ b/configs/ids8313_defconfig @@ -30,6 +30,7 @@ CONFIG_MTDIDS_DEFAULT="nor0=ff800000.flash,nand0=e1000000.flash" CONFIG_MTDPARTS_DEFAULT="mtdparts=ff800000.flash:7m(dum),768k(BOOT-BIN),128k(BOOT-ENV),128k(BOOT-REDENV);e1000000.flash:-(ubi)" CONFIG_CMD_UBI=y CONFIG_BOOTCOUNT_LIMIT=y +CONFIG_BOOTCOUNT_I2C=y # CONFIG_MMC is not set CONFIG_MTD_NOR_FLASH=y CONFIG_PHYLIB=y diff --git a/drivers/bootcount/Kconfig b/drivers/bootcount/Kconfig index eabfd13..8c19ae6 100644 --- a/drivers/bootcount/Kconfig +++ b/drivers/bootcount/Kconfig @@ -46,6 +46,15 @@ config BOOTCOUNT_RAM Store the bootcount in DRAM protected against against bit errors due to short power loss or holding a system in RESET.
+config BOOTCOUNT_I2C + bool "Boot counter on I2C device" + help + Enable support for the bootcounter on an i2c (like RTC) device. + CONFIG_SYS_I2C_RTC_ADDR = i2c chip address + CONFIG_SYS_BOOTCOUNT_ADDR = i2c addr which is used for + the bootcounter. + CONFIG_BOOTCOUNT_ALEN = address len + endchoice
config SYS_BOOTCOUNT_SINGLEWORD diff --git a/include/configs/ids8313.h b/include/configs/ids8313.h index 628e0a2..099d7bd 100644 --- a/include/configs/ids8313.h +++ b/include/configs/ids8313.h @@ -515,7 +515,6 @@ #define CONFIG_MTD_PARTITIONS
/* bootcount support */ -#define CONFIG_BOOTCOUNT_I2C #define CONFIG_BOOTCOUNT_ALEN 1 #define CONFIG_SYS_BOOTCOUNT_ADDR 0x9
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index 312d4bb..a8380c6 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -148,7 +148,6 @@ CONFIG_BOOGER CONFIG_BOOM CONFIG_BOOTBLOCK CONFIG_BOOTCOUNT_ALEN -CONFIG_BOOTCOUNT_I2C CONFIG_BOOTFILE CONFIG_BOOTMAPSZ CONFIG_BOOTMODE

This converts the following to Kconfig: CONFIG_BOOTCOUNT_EXT
Signed-off-by: Alex Kiernan alex.kiernan@gmail.com ---
Changes in v2: None
README | 7 ------- configs/ge_b450v3_defconfig | 2 ++ configs/ge_b650v3_defconfig | 2 ++ configs/ge_b850v3_defconfig | 2 ++ include/configs/ge_bx50v3.h | 4 ---- 5 files changed, 6 insertions(+), 11 deletions(-)
diff --git a/README b/README index 0157f0b..9eb4f5a 100644 --- a/README +++ b/README @@ -2309,13 +2309,6 @@ The following options need to be configured: - bootcount support: CONFIG_AT91SAM9XE enable special bootcounter support on at91sam9xe based boards. - CONFIG_BOOTCOUNT_EXT - enable support for the bootcounter in EXT filesystem - CONFIG_SYS_BOOTCOUNT_ADDR = RAM address used for read - and write. - CONFIG_SYS_BOOTCOUNT_EXT_INTERFACE = interface - CONFIG_SYS_BOOTCOUNT_EXT_DEVPART = device and part - CONFIG_SYS_BOOTCOUNT_EXT_NAME = filename
- Show boot progress: CONFIG_SHOW_BOOT_PROGRESS diff --git a/configs/ge_b450v3_defconfig b/configs/ge_b450v3_defconfig index a5beefe..32f07ab 100644 --- a/configs/ge_b450v3_defconfig +++ b/configs/ge_b450v3_defconfig @@ -26,6 +26,8 @@ CONFIG_CMD_FS_GENERIC=y CONFIG_DOS_PARTITION=y CONFIG_ENV_IS_IN_SPI_FLASH=y CONFIG_BOOTCOUNT_LIMIT=y +CONFIG_BOOTCOUNT_EXT=y +CONFIG_SYS_BOOTCOUNT_EXT_DEVPART="1:5" CONFIG_SPI_FLASH=y CONFIG_SPI_FLASH_STMICRO=y CONFIG_NETDEVICES=y diff --git a/configs/ge_b650v3_defconfig b/configs/ge_b650v3_defconfig index cbf83b1..188238e 100644 --- a/configs/ge_b650v3_defconfig +++ b/configs/ge_b650v3_defconfig @@ -26,6 +26,8 @@ CONFIG_CMD_FS_GENERIC=y CONFIG_DOS_PARTITION=y CONFIG_ENV_IS_IN_SPI_FLASH=y CONFIG_BOOTCOUNT_LIMIT=y +CONFIG_BOOTCOUNT_EXT=y +CONFIG_SYS_BOOTCOUNT_EXT_DEVPART="1:5" CONFIG_SPI_FLASH=y CONFIG_SPI_FLASH_STMICRO=y CONFIG_NETDEVICES=y diff --git a/configs/ge_b850v3_defconfig b/configs/ge_b850v3_defconfig index 953681f..96ac173 100644 --- a/configs/ge_b850v3_defconfig +++ b/configs/ge_b850v3_defconfig @@ -26,6 +26,8 @@ CONFIG_CMD_FS_GENERIC=y CONFIG_DOS_PARTITION=y CONFIG_ENV_IS_IN_SPI_FLASH=y CONFIG_BOOTCOUNT_LIMIT=y +CONFIG_BOOTCOUNT_EXT=y +CONFIG_SYS_BOOTCOUNT_EXT_DEVPART="1:5" CONFIG_SPI_FLASH=y CONFIG_SPI_FLASH_STMICRO=y CONFIG_NETDEVICES=y diff --git a/include/configs/ge_bx50v3.h b/include/configs/ge_bx50v3.h index 8dc0a7f..0a72b58 100644 --- a/include/configs/ge_bx50v3.h +++ b/include/configs/ge_bx50v3.h @@ -267,10 +267,6 @@
#define CONFIG_BCH
-#define CONFIG_BOOTCOUNT_EXT -#define CONFIG_SYS_BOOTCOUNT_EXT_INTERFACE "mmc" -#define CONFIG_SYS_BOOTCOUNT_EXT_DEVPART "1:5" -#define CONFIG_SYS_BOOTCOUNT_EXT_NAME "/boot/failures" #define CONFIG_SYS_BOOTCOUNT_ADDR 0x7000A000
#endif /* __GE_BX50V3_CONFIG_H */

Integrate Boot counter for Atmel AT91SAM9XE into Kconfig
Reviewed-by: Lukasz Majewski lukma@denx.de Signed-off-by: Alex Kiernan alex.kiernan@gmail.com ---
Changes in v2: None
README | 4 ---- drivers/bootcount/Kconfig | 5 +++++ drivers/bootcount/Makefile | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/README b/README index 9eb4f5a..2222aee 100644 --- a/README +++ b/README @@ -2306,10 +2306,6 @@ The following options need to be configured: A better solution is to properly configure the firewall, but sometimes that is not allowed.
-- bootcount support: - CONFIG_AT91SAM9XE - enable special bootcounter support on at91sam9xe based boards. - - Show boot progress: CONFIG_SHOW_BOOT_PROGRESS
diff --git a/drivers/bootcount/Kconfig b/drivers/bootcount/Kconfig index 8c19ae6..e0d1fc2 100644 --- a/drivers/bootcount/Kconfig +++ b/drivers/bootcount/Kconfig @@ -13,6 +13,7 @@ if BOOTCOUNT_LIMIT choice prompt "Boot count device" default BOOTCOUNT_AM33XX if AM33XX || SOC_DA8XX + default BOOTCOUNT_AT91 if AT91SAM9XE
config BOOTCOUNT_EXT bool "Boot counter on EXT filesystem" @@ -55,6 +56,10 @@ config BOOTCOUNT_I2C the bootcounter. CONFIG_BOOTCOUNT_ALEN = address len
+config BOOTCOUNT_AT91 + bool "Boot counter for Atmel AT91SAM9XE" + depends on AT91SAM9XE + endchoice
config SYS_BOOTCOUNT_SINGLEWORD diff --git a/drivers/bootcount/Makefile b/drivers/bootcount/Makefile index 62bf55e..a3658c1 100644 --- a/drivers/bootcount/Makefile +++ b/drivers/bootcount/Makefile @@ -3,7 +3,7 @@ #
obj-y += bootcount.o -obj-$(CONFIG_AT91SAM9XE) += bootcount_at91.o +obj-$(CONFIG_BOOTCOUNT_AT91) += bootcount_at91.o obj-$(CONFIG_BOOTCOUNT_AM33XX) += bootcount_davinci.o obj-$(CONFIG_BOOTCOUNT_RAM) += bootcount_ram.o obj-$(CONFIG_BOOTCOUNT_ENV) += bootcount_env.o

Make generate boot counter selected in the same way as other boot count drivers
Reviewed-by: Lukasz Majewski lukma@denx.de Signed-off-by: Alex Kiernan alex.kiernan@gmail.com ---
Changes in v2: None
drivers/bootcount/Kconfig | 11 +++++++++++ drivers/bootcount/Makefile | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/drivers/bootcount/Kconfig b/drivers/bootcount/Kconfig index e0d1fc2..9fde2f2 100644 --- a/drivers/bootcount/Kconfig +++ b/drivers/bootcount/Kconfig @@ -14,6 +14,16 @@ choice prompt "Boot count device" default BOOTCOUNT_AM33XX if AM33XX || SOC_DA8XX default BOOTCOUNT_AT91 if AT91SAM9XE + default BOOTCOUNT_GENERIC + +config BOOTCOUNT_GENERIC + bool "Generic default boot counter" + help + Generic bootcount stored at SYS_BOOTCOUNT_ADDR. + + SYS_BOOTCOUNT_ADDR: + Set to the address where the bootcount and bootcount magic + will be stored.
config BOOTCOUNT_EXT bool "Boot counter on EXT filesystem" @@ -64,6 +74,7 @@ endchoice
config SYS_BOOTCOUNT_SINGLEWORD bool "Use single word to pack boot count and magic value" + depends on BOOTCOUNT_GENERIC help This option enables packing boot count magic value and boot count into single word (32 bits). diff --git a/drivers/bootcount/Makefile b/drivers/bootcount/Makefile index a3658c1..3e1ae8c 100644 --- a/drivers/bootcount/Makefile +++ b/drivers/bootcount/Makefile @@ -2,7 +2,7 @@ # SPDX-License-Identifier: GPL-2.0+ #
-obj-y += bootcount.o +obj-$(CONFIG_BOOTCOUNT_GENERIC) += bootcount.o obj-$(CONFIG_BOOTCOUNT_AT91) += bootcount_at91.o obj-$(CONFIG_BOOTCOUNT_AM33XX) += bootcount_davinci.o obj-$(CONFIG_BOOTCOUNT_RAM) += bootcount_ram.o

The only user of SYS_BOOTCOUNT_ADDR is mx53ppd; remove it from Kconfig in preparation for renaming SYS_BOOTCOUNT_ADDR.
Signed-off-by: Alex Kiernan alex.kiernan@gmail.com ---
Changes in v2: None
drivers/bootcount/Kconfig | 7 ------- include/configs/mx53ppd.h | 2 ++ 2 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/drivers/bootcount/Kconfig b/drivers/bootcount/Kconfig index 9fde2f2..583d6a6 100644 --- a/drivers/bootcount/Kconfig +++ b/drivers/bootcount/Kconfig @@ -102,11 +102,4 @@ config SYS_BOOTCOUNT_EXT_NAME help Set the filename and path of the file used to store the boot counter.
-config SYS_BOOTCOUNT_ADDR - hex "RAM address used for reading and writing the boot counter" - default 0x7000A000 - depends on BOOTCOUNT_EXT - help - Set the address used for reading and writing the boot counter. - endif diff --git a/include/configs/mx53ppd.h b/include/configs/mx53ppd.h index 79c97b5..aa1480c 100644 --- a/include/configs/mx53ppd.h +++ b/include/configs/mx53ppd.h @@ -241,4 +241,6 @@ #define CONFIG_VIDEO_IPUV3 #endif
+#define CONFIG_SYS_BOOTCOUNT_ADDR 0x7000A000 + #endif /* __CONFIG_H */

On Thu, 15 Feb 2018 13:55:23 +0000 Alex Kiernan alex.kiernan@gmail.com wrote:
The only user of SYS_BOOTCOUNT_ADDR is mx53ppd; remove it from Kconfig in preparation for renaming SYS_BOOTCOUNT_ADDR.
Signed-off-by: Alex Kiernan alex.kiernan@gmail.com
Changes in v2: None
drivers/bootcount/Kconfig | 7 ------- include/configs/mx53ppd.h | 2 ++ 2 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/drivers/bootcount/Kconfig b/drivers/bootcount/Kconfig index 9fde2f2..583d6a6 100644 --- a/drivers/bootcount/Kconfig +++ b/drivers/bootcount/Kconfig @@ -102,11 +102,4 @@ config SYS_BOOTCOUNT_EXT_NAME help Set the filename and path of the file used to store the boot counter. -config SYS_BOOTCOUNT_ADDR
- hex "RAM address used for reading and writing the boot
counter"
- default 0x7000A000
- depends on BOOTCOUNT_EXT
- help
Set the address used for reading and writing the boot
counter. - endif diff --git a/include/configs/mx53ppd.h b/include/configs/mx53ppd.h index 79c97b5..aa1480c 100644 --- a/include/configs/mx53ppd.h +++ b/include/configs/mx53ppd.h @@ -241,4 +241,6 @@ #define CONFIG_VIDEO_IPUV3 #endif
+#define CONFIG_SYS_BOOTCOUNT_ADDR 0x7000A000
#endif /* __CONFIG_H */
Reviewed-by: Lukasz Majewski lukma@denx.de
Best regards,
Lukasz Majewski
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de

Remove CONFIG_SYS_BOOTCOUNT_ADDR from Kconfig.
Signed-off-by: Alex Kiernan alex.kiernan@gmail.com ---
Changes in v2: None
drivers/bootcount/Kconfig | 10 ++++++---- drivers/bootcount/bootcount.c | 16 ++++++++-------- drivers/bootcount/bootcount_davinci.c | 4 ++-- drivers/bootcount/bootcount_ext.c | 8 ++++---- drivers/bootcount/bootcount_i2c.c | 6 +++--- include/configs/brppt1.h | 2 +- include/configs/calimain.h | 2 +- include/configs/dh_imx6.h | 2 +- include/configs/ge_bx50v3.h | 2 +- include/configs/highbank.h | 2 +- include/configs/ids8313.h | 2 +- include/configs/km/kmp204x-common.h | 2 +- include/configs/mx53ppd.h | 2 +- include/configs/socfpga_is1.h | 2 +- include/configs/socfpga_sr1500.h | 2 +- include/configs/ti_am335x_common.h | 2 +- include/configs/tqma6_wru4.h | 2 +- include/configs/x600.h | 2 +- 18 files changed, 36 insertions(+), 34 deletions(-)
diff --git a/drivers/bootcount/Kconfig b/drivers/bootcount/Kconfig index 583d6a6..ce26e38 100644 --- a/drivers/bootcount/Kconfig +++ b/drivers/bootcount/Kconfig @@ -19,9 +19,9 @@ choice config BOOTCOUNT_GENERIC bool "Generic default boot counter" help - Generic bootcount stored at SYS_BOOTCOUNT_ADDR. + Generic bootcount stored at BOOTCOUNT_ADDR.
- SYS_BOOTCOUNT_ADDR: + BOOTCOUNT_ADDR: Set to the address where the bootcount and bootcount magic will be stored.
@@ -31,6 +31,9 @@ config BOOTCOUNT_EXT Add support for maintaining boot count in a file on an EXT filesystem.
+ BOOTCOUNT_ADDR + Set to the RAM address used for read and write. + config BOOTCOUNT_AM33XX bool "Boot counter in AM33XX RTC IP block" depends on AM33XX || SOC_DA8XX @@ -62,8 +65,7 @@ config BOOTCOUNT_I2C help Enable support for the bootcounter on an i2c (like RTC) device. CONFIG_SYS_I2C_RTC_ADDR = i2c chip address - CONFIG_SYS_BOOTCOUNT_ADDR = i2c addr which is used for - the bootcounter. + BOOTCOUNT_ADDR = i2c addr which is used for the bootcounter. CONFIG_BOOTCOUNT_ALEN = address len
config BOOTCOUNT_AT91 diff --git a/drivers/bootcount/bootcount.c b/drivers/bootcount/bootcount.c index 8b499fe..82ef426 100644 --- a/drivers/bootcount/bootcount.c +++ b/drivers/bootcount/bootcount.c @@ -9,24 +9,24 @@ #include <linux/compiler.h>
/* - * Only override CONFIG_SYS_BOOTCOUNT_ADDR if not already defined. This + * Only override BOOTCOUNT_ADDR if not already defined. This * way, some boards can define it directly in their config header. */ -#if !defined(CONFIG_SYS_BOOTCOUNT_ADDR) +#if !defined(BOOTCOUNT_ADDR)
#if defined(CONFIG_QE) #include <linux/immap_qe.h> -#define CONFIG_SYS_BOOTCOUNT_ADDR (CONFIG_SYS_IMMR + 0x110000 + \ +#define BOOTCOUNT_ADDR (CONFIG_SYS_IMMR + 0x110000 + \ QE_MURAM_SIZE - 2 * sizeof(u32)) #endif /* defined(CONFIG_QE) */
-#endif /* !defined(CONFIG_SYS_BOOTCOUNT_ADDR) */ +#endif /* !defined(BOOTCOUNT_ADDR) */
/* Now implement the generic default functions */ -#if defined(CONFIG_SYS_BOOTCOUNT_ADDR) +#if defined(BOOTCOUNT_ADDR) __weak void bootcount_store(ulong a) { - void *reg = (void *)CONFIG_SYS_BOOTCOUNT_ADDR; + void *reg = (void *)BOOTCOUNT_ADDR;
#if defined(CONFIG_SYS_BOOTCOUNT_SINGLEWORD) raw_bootcount_store(reg, (BOOTCOUNT_MAGIC & 0xffff0000) | a); @@ -38,7 +38,7 @@ __weak void bootcount_store(ulong a)
__weak ulong bootcount_load(void) { - void *reg = (void *)CONFIG_SYS_BOOTCOUNT_ADDR; + void *reg = (void *)BOOTCOUNT_ADDR;
#if defined(CONFIG_SYS_BOOTCOUNT_SINGLEWORD) u32 tmp = raw_bootcount_load(reg); @@ -54,4 +54,4 @@ __weak ulong bootcount_load(void) return raw_bootcount_load(reg); #endif /* defined(CONFIG_SYS_BOOTCOUNT_SINGLEWORD) */ } -#endif /* defined(CONFIG_SYS_BOOTCOUNT_ADDR) */ +#endif /* defined(BOOTCOUNT_ADDR) */ diff --git a/drivers/bootcount/bootcount_davinci.c b/drivers/bootcount/bootcount_davinci.c index 17829be..d00fd7a 100644 --- a/drivers/bootcount/bootcount_davinci.c +++ b/drivers/bootcount/bootcount_davinci.c @@ -15,7 +15,7 @@ void bootcount_store(ulong a) { struct davinci_rtc *reg = - (struct davinci_rtc *)CONFIG_SYS_BOOTCOUNT_ADDR; + (struct davinci_rtc *)BOOTCOUNT_ADDR;
/* * write RTC kick registers to enable write @@ -32,7 +32,7 @@ ulong bootcount_load(void) { unsigned long val; struct davinci_rtc *reg = - (struct davinci_rtc *)CONFIG_SYS_BOOTCOUNT_ADDR; + (struct davinci_rtc *)BOOTCOUNT_ADDR;
val = raw_bootcount_load(®->scratch2); if ((val & 0xffff0000) != (BOOTCOUNT_MAGIC & 0xffff0000)) diff --git a/drivers/bootcount/bootcount_ext.c b/drivers/bootcount/bootcount_ext.c index e0dd21b..e176ec1 100644 --- a/drivers/bootcount/bootcount_ext.c +++ b/drivers/bootcount/bootcount_ext.c @@ -22,13 +22,13 @@ void bootcount_store(ulong a) return; }
- buf = map_sysmem(CONFIG_SYS_BOOTCOUNT_ADDR, 2); + buf = map_sysmem(BOOTCOUNT_ADDR, 2); buf[0] = BC_MAGIC; buf[1] = (a & 0xff); unmap_sysmem(buf);
ret = fs_write(CONFIG_SYS_BOOTCOUNT_EXT_NAME, - CONFIG_SYS_BOOTCOUNT_ADDR, 0, 2, &len); + BOOTCOUNT_ADDR, 0, 2, &len); if (ret != 0) puts("Error storing bootcount\n"); } @@ -45,14 +45,14 @@ ulong bootcount_load(void) return 0; }
- ret = fs_read(CONFIG_SYS_BOOTCOUNT_EXT_NAME, CONFIG_SYS_BOOTCOUNT_ADDR, + ret = fs_read(CONFIG_SYS_BOOTCOUNT_EXT_NAME, BOOTCOUNT_ADDR, 0, 2, &len_read); if (ret != 0 || len_read != 2) { puts("Error loading bootcount\n"); return 0; }
- buf = map_sysmem(CONFIG_SYS_BOOTCOUNT_ADDR, 2); + buf = map_sysmem(BOOTCOUNT_ADDR, 2); if (buf[0] == BC_MAGIC) ret = buf[1];
diff --git a/drivers/bootcount/bootcount_i2c.c b/drivers/bootcount/bootcount_i2c.c index e27b168..1dba141 100644 --- a/drivers/bootcount/bootcount_i2c.c +++ b/drivers/bootcount/bootcount_i2c.c @@ -18,8 +18,8 @@ void bootcount_store(ulong a)
buf[0] = BC_MAGIC; buf[1] = (a & 0xff); - ret = i2c_write(CONFIG_SYS_I2C_RTC_ADDR, CONFIG_SYS_BOOTCOUNT_ADDR, - CONFIG_BOOTCOUNT_ALEN, buf, 2); + ret = i2c_write(CONFIG_SYS_I2C_RTC_ADDR, BOOTCOUNT_ADDR, + CONFIG_BOOTCOUNT_ALEN, buf, 2); if (ret != 0) puts("Error writing bootcount\n"); } @@ -29,7 +29,7 @@ ulong bootcount_load(void) unsigned char buf[3]; int ret;
- ret = i2c_read(CONFIG_SYS_I2C_RTC_ADDR, CONFIG_SYS_BOOTCOUNT_ADDR, + ret = i2c_read(CONFIG_SYS_I2C_RTC_ADDR, BOOTCOUNT_ADDR, CONFIG_BOOTCOUNT_ALEN, buf, 2); if (ret != 0) { puts("Error loading bootcount\n"); diff --git a/include/configs/brppt1.h b/include/configs/brppt1.h index 30ea2d2..e32ac7d 100644 --- a/include/configs/brppt1.h +++ b/include/configs/brppt1.h @@ -21,7 +21,7 @@ #define LCD_BPP LCD_COLOR32
/* Bootcount using the RTC block */ -#define CONFIG_SYS_BOOTCOUNT_ADDR 0x44E3E000 +#define BOOTCOUNT_ADDR 0x44E3E000
/* memory */ #define CONFIG_SYS_MALLOC_LEN (5 * 1024 * 1024) diff --git a/include/configs/calimain.h b/include/configs/calimain.h index 4c47617..255036d 100644 --- a/include/configs/calimain.h +++ b/include/configs/calimain.h @@ -278,7 +278,7 @@ #define CONFIG_SYS_INIT_SP_ADDR (0x8001ff00)
#define CONFIG_SYS_BOOTCOUNT_LE /* Use little-endian accessors */ -#define CONFIG_SYS_BOOTCOUNT_ADDR DAVINCI_RTC_BASE +#define BOOTCOUNT_ADDR DAVINCI_RTC_BASE
#ifndef __ASSEMBLY__ int calimain_get_osc_freq(void); diff --git a/include/configs/dh_imx6.h b/include/configs/dh_imx6.h index 464b8d7..474511d 100644 --- a/include/configs/dh_imx6.h +++ b/include/configs/dh_imx6.h @@ -47,7 +47,7 @@ #define CONFIG_SYS_MALLOC_LEN (4 * SZ_1M)
/* Bootcounter */ -#define CONFIG_SYS_BOOTCOUNT_ADDR IRAM_BASE_ADDR +#define BOOTCOUNT_ADDR IRAM_BASE_ADDR #define CONFIG_SYS_BOOTCOUNT_BE
/* FEC ethernet */ diff --git a/include/configs/ge_bx50v3.h b/include/configs/ge_bx50v3.h index 0a72b58..1db9bad 100644 --- a/include/configs/ge_bx50v3.h +++ b/include/configs/ge_bx50v3.h @@ -267,6 +267,6 @@
#define CONFIG_BCH
-#define CONFIG_SYS_BOOTCOUNT_ADDR 0x7000A000 +#define BOOTCOUNT_ADDR 0x7000A000
#endif /* __GE_BX50V3_CONFIG_H */ diff --git a/include/configs/highbank.h b/include/configs/highbank.h index 9dc0c6c..a734181 100644 --- a/include/configs/highbank.h +++ b/include/configs/highbank.h @@ -27,7 +27,7 @@ #define CONFIG_CONS_INDEX 0
#define CONFIG_SYS_BOOTCOUNT_LE /* Use little-endian accessors */ -#define CONFIG_SYS_BOOTCOUNT_ADDR 0xfff3cf0c +#define BOOTCOUNT_ADDR 0xfff3cf0c
#define CONFIG_MISC_INIT_R #define CONFIG_SCSI_AHCI_PLAT diff --git a/include/configs/ids8313.h b/include/configs/ids8313.h index 099d7bd..4449e27 100644 --- a/include/configs/ids8313.h +++ b/include/configs/ids8313.h @@ -516,7 +516,7 @@
/* bootcount support */ #define CONFIG_BOOTCOUNT_ALEN 1 -#define CONFIG_SYS_BOOTCOUNT_ADDR 0x9 +#define BOOTCOUNT_ADDR 0x9
#define CONFIG_IMAGE_FORMAT_LEGACY
diff --git a/include/configs/km/kmp204x-common.h b/include/configs/km/kmp204x-common.h index 7f735e0..19627ff 100644 --- a/include/configs/km/kmp204x-common.h +++ b/include/configs/km/kmp204x-common.h @@ -189,7 +189,7 @@ unsigned long get_board_sys_clk(unsigned long dummy); #define CONFIG_SYS_OR1_PRELIM CONFIG_SYS_QRIO_OR_PRELIM /* QRIO Options */
/* bootcounter in QRIO */ -#define CONFIG_SYS_BOOTCOUNT_ADDR (CONFIG_SYS_QRIO_BASE + 0x20) +#define BOOTCOUNT_ADDR (CONFIG_SYS_QRIO_BASE + 0x20)
#define CONFIG_BOARD_EARLY_INIT_R /* call board_early_init_r function */ #define CONFIG_MISC_INIT_F diff --git a/include/configs/mx53ppd.h b/include/configs/mx53ppd.h index aa1480c..c73d73a 100644 --- a/include/configs/mx53ppd.h +++ b/include/configs/mx53ppd.h @@ -241,6 +241,6 @@ #define CONFIG_VIDEO_IPUV3 #endif
-#define CONFIG_SYS_BOOTCOUNT_ADDR 0x7000A000 +#define BOOTCOUNT_ADDR 0x7000A000
#endif /* __CONFIG_H */ diff --git a/include/configs/socfpga_is1.h b/include/configs/socfpga_is1.h index 883ffb7..70ff295 100644 --- a/include/configs/socfpga_is1.h +++ b/include/configs/socfpga_is1.h @@ -33,7 +33,7 @@ * Bootcounter */ /* last 2 lwords in OCRAM */ -#define CONFIG_SYS_BOOTCOUNT_ADDR 0xfffffff8 +#define BOOTCOUNT_ADDR 0xfffffff8 #define CONFIG_SYS_BOOTCOUNT_BE
#endif /* __CONFIG_SOCFPGA_IS1_H__ */ diff --git a/include/configs/socfpga_sr1500.h b/include/configs/socfpga_sr1500.h index 8c9069c..1fe1d60 100644 --- a/include/configs/socfpga_sr1500.h +++ b/include/configs/socfpga_sr1500.h @@ -32,7 +32,7 @@ * Bootcounter */ /* last 2 lwords in OCRAM */ -#define CONFIG_SYS_BOOTCOUNT_ADDR 0xfffffff8 +#define BOOTCOUNT_ADDR 0xfffffff8 #define CONFIG_SYS_BOOTCOUNT_BE
/* Environment setting for SPI flash */ diff --git a/include/configs/ti_am335x_common.h b/include/configs/ti_am335x_common.h index 66cacdf..d204809 100644 --- a/include/configs/ti_am335x_common.h +++ b/include/configs/ti_am335x_common.h @@ -45,7 +45,7 @@ * environment to a non-zero value and enable CONFIG_BOOTCOUNT_LIMIT * in the board config. */ -#define CONFIG_SYS_BOOTCOUNT_ADDR 0x44E3E000 +#define BOOTCOUNT_ADDR 0x44E3E000
/* * SPL related defines. The Public RAM memory map the ROM defines the diff --git a/include/configs/tqma6_wru4.h b/include/configs/tqma6_wru4.h index d94f790..00a2dea 100644 --- a/include/configs/tqma6_wru4.h +++ b/include/configs/tqma6_wru4.h @@ -34,7 +34,7 @@ /* LED */
/* Bootcounter */ -#define CONFIG_SYS_BOOTCOUNT_ADDR IRAM_BASE_ADDR +#define BOOTCOUNT_ADDR IRAM_BASE_ADDR #define CONFIG_SYS_BOOTCOUNT_BE
#endif /* __CONFIG_TQMA6_WRU4_H */ diff --git a/include/configs/x600.h b/include/configs/x600.h index 80e5b1c..a13f7e1 100644 --- a/include/configs/x600.h +++ b/include/configs/x600.h @@ -120,7 +120,7 @@ #define CONFIG_SYS_LOAD_ADDR 0x00800000
/* Use last 2 lwords in internal SRAM for bootcounter */ -#define CONFIG_SYS_BOOTCOUNT_ADDR (CONFIG_SRAM_BASE + \ +#define BOOTCOUNT_ADDR (CONFIG_SRAM_BASE + \ CONFIG_SRAM_SIZE)
#define CONFIG_HOSTNAME x600

Hi Alex,
Please extend the commit message, as for example presented below:
Remove CONFIG_SYS_BOOTCOUNT_ADDR from Kconfig.
and also introduce BOOTCOUNT_ADDR as a replacement. After this change the CONFIG_SYS_BOOTCOUNT_ADDR is completely removed from the u-boot code base.
It has been replaced with BOOTCOUNT_ADDR to preserve current behaviour. This variable is not (yet) introduced to Kconfig.
Signed-off-by: Alex Kiernan alex.kiernan@gmail.com
Changes in v2: None
drivers/bootcount/Kconfig | 10 ++++++---- drivers/bootcount/bootcount.c | 16 ++++++++-------- drivers/bootcount/bootcount_davinci.c | 4 ++-- drivers/bootcount/bootcount_ext.c | 8 ++++---- drivers/bootcount/bootcount_i2c.c | 6 +++--- include/configs/brppt1.h | 2 +- include/configs/calimain.h | 2 +- include/configs/dh_imx6.h | 2 +- include/configs/ge_bx50v3.h | 2 +- include/configs/highbank.h | 2 +- include/configs/ids8313.h | 2 +- include/configs/km/kmp204x-common.h | 2 +- include/configs/mx53ppd.h | 2 +- include/configs/socfpga_is1.h | 2 +- include/configs/socfpga_sr1500.h | 2 +- include/configs/ti_am335x_common.h | 2 +- include/configs/tqma6_wru4.h | 2 +- include/configs/x600.h | 2 +- 18 files changed, 36 insertions(+), 34 deletions(-)
diff --git a/drivers/bootcount/Kconfig b/drivers/bootcount/Kconfig index 583d6a6..ce26e38 100644 --- a/drivers/bootcount/Kconfig +++ b/drivers/bootcount/Kconfig @@ -19,9 +19,9 @@ choice config BOOTCOUNT_GENERIC bool "Generic default boot counter" help
Generic bootcount stored at SYS_BOOTCOUNT_ADDR.
Generic bootcount stored at BOOTCOUNT_ADDR.
SYS_BOOTCOUNT_ADDR:
BOOTCOUNT_ADDR: Set to the address where the bootcount and bootcount
magic will be stored.
@@ -31,6 +31,9 @@ config BOOTCOUNT_EXT Add support for maintaining boot count in a file on an EXT filesystem.
BOOTCOUNT_ADDR
Set to the RAM address used for read and write.
config BOOTCOUNT_AM33XX bool "Boot counter in AM33XX RTC IP block" depends on AM33XX || SOC_DA8XX @@ -62,8 +65,7 @@ config BOOTCOUNT_I2C help Enable support for the bootcounter on an i2c (like RTC) device. CONFIG_SYS_I2C_RTC_ADDR = i2c chip address
CONFIG_SYS_BOOTCOUNT_ADDR = i2c addr which is used for
the bootcounter.
BOOTCOUNT_ADDR = i2c addr which is used for the
bootcounter. CONFIG_BOOTCOUNT_ALEN = address len
config BOOTCOUNT_AT91 diff --git a/drivers/bootcount/bootcount.c b/drivers/bootcount/bootcount.c index 8b499fe..82ef426 100644 --- a/drivers/bootcount/bootcount.c +++ b/drivers/bootcount/bootcount.c @@ -9,24 +9,24 @@ #include <linux/compiler.h>
/*
- Only override CONFIG_SYS_BOOTCOUNT_ADDR if not already defined.
This
*/
- Only override BOOTCOUNT_ADDR if not already defined. This
- way, some boards can define it directly in their config header.
-#if !defined(CONFIG_SYS_BOOTCOUNT_ADDR) +#if !defined(BOOTCOUNT_ADDR)
#if defined(CONFIG_QE) #include <linux/immap_qe.h> -#define CONFIG_SYS_BOOTCOUNT_ADDR (CONFIG_SYS_IMMR + 0x110000
- \ +#define BOOTCOUNT_ADDR (CONFIG_SYS_IMMR + 0x110000 + \ QE_MURAM_SIZE - 2 *
sizeof(u32)) #endif /* defined(CONFIG_QE) */
-#endif /* !defined(CONFIG_SYS_BOOTCOUNT_ADDR) */ +#endif /* !defined(BOOTCOUNT_ADDR) */
/* Now implement the generic default functions */ -#if defined(CONFIG_SYS_BOOTCOUNT_ADDR) +#if defined(BOOTCOUNT_ADDR) __weak void bootcount_store(ulong a) {
- void *reg = (void *)CONFIG_SYS_BOOTCOUNT_ADDR;
- void *reg = (void *)BOOTCOUNT_ADDR;
#if defined(CONFIG_SYS_BOOTCOUNT_SINGLEWORD) raw_bootcount_store(reg, (BOOTCOUNT_MAGIC & 0xffff0000) | a); @@ -38,7 +38,7 @@ __weak void bootcount_store(ulong a)
__weak ulong bootcount_load(void) {
- void *reg = (void *)CONFIG_SYS_BOOTCOUNT_ADDR;
- void *reg = (void *)BOOTCOUNT_ADDR;
#if defined(CONFIG_SYS_BOOTCOUNT_SINGLEWORD) u32 tmp = raw_bootcount_load(reg); @@ -54,4 +54,4 @@ __weak ulong bootcount_load(void) return raw_bootcount_load(reg); #endif /* defined(CONFIG_SYS_BOOTCOUNT_SINGLEWORD) */ } -#endif /* defined(CONFIG_SYS_BOOTCOUNT_ADDR) */ +#endif /* defined(BOOTCOUNT_ADDR) */ diff --git a/drivers/bootcount/bootcount_davinci.c b/drivers/bootcount/bootcount_davinci.c index 17829be..d00fd7a 100644 --- a/drivers/bootcount/bootcount_davinci.c +++ b/drivers/bootcount/bootcount_davinci.c @@ -15,7 +15,7 @@ void bootcount_store(ulong a) { struct davinci_rtc *reg =
(struct davinci_rtc *)CONFIG_SYS_BOOTCOUNT_ADDR;
(struct davinci_rtc *)BOOTCOUNT_ADDR;
/*
- write RTC kick registers to enable write
@@ -32,7 +32,7 @@ ulong bootcount_load(void) { unsigned long val; struct davinci_rtc *reg =
(struct davinci_rtc *)CONFIG_SYS_BOOTCOUNT_ADDR;
(struct davinci_rtc *)BOOTCOUNT_ADDR;
val = raw_bootcount_load(®->scratch2); if ((val & 0xffff0000) != (BOOTCOUNT_MAGIC & 0xffff0000))
diff --git a/drivers/bootcount/bootcount_ext.c b/drivers/bootcount/bootcount_ext.c index e0dd21b..e176ec1 100644 --- a/drivers/bootcount/bootcount_ext.c +++ b/drivers/bootcount/bootcount_ext.c @@ -22,13 +22,13 @@ void bootcount_store(ulong a) return; }
- buf = map_sysmem(CONFIG_SYS_BOOTCOUNT_ADDR, 2);
buf = map_sysmem(BOOTCOUNT_ADDR, 2); buf[0] = BC_MAGIC; buf[1] = (a & 0xff); unmap_sysmem(buf);
ret = fs_write(CONFIG_SYS_BOOTCOUNT_EXT_NAME,
CONFIG_SYS_BOOTCOUNT_ADDR, 0, 2, &len);
if (ret != 0) puts("Error storing bootcount\n");BOOTCOUNT_ADDR, 0, 2, &len);
} @@ -45,14 +45,14 @@ ulong bootcount_load(void) return 0; }
- ret = fs_read(CONFIG_SYS_BOOTCOUNT_EXT_NAME,
CONFIG_SYS_BOOTCOUNT_ADDR,
- ret = fs_read(CONFIG_SYS_BOOTCOUNT_EXT_NAME, BOOTCOUNT_ADDR, 0, 2, &len_read); if (ret != 0 || len_read != 2) { puts("Error loading bootcount\n"); return 0; }
- buf = map_sysmem(CONFIG_SYS_BOOTCOUNT_ADDR, 2);
- buf = map_sysmem(BOOTCOUNT_ADDR, 2); if (buf[0] == BC_MAGIC) ret = buf[1];
diff --git a/drivers/bootcount/bootcount_i2c.c b/drivers/bootcount/bootcount_i2c.c index e27b168..1dba141 100644 --- a/drivers/bootcount/bootcount_i2c.c +++ b/drivers/bootcount/bootcount_i2c.c @@ -18,8 +18,8 @@ void bootcount_store(ulong a)
buf[0] = BC_MAGIC; buf[1] = (a & 0xff);
- ret = i2c_write(CONFIG_SYS_I2C_RTC_ADDR,
CONFIG_SYS_BOOTCOUNT_ADDR,
CONFIG_BOOTCOUNT_ALEN, buf, 2);
- ret = i2c_write(CONFIG_SYS_I2C_RTC_ADDR, BOOTCOUNT_ADDR,
if (ret != 0) puts("Error writing bootcount\n");CONFIG_BOOTCOUNT_ALEN, buf, 2);
} @@ -29,7 +29,7 @@ ulong bootcount_load(void) unsigned char buf[3]; int ret;
- ret = i2c_read(CONFIG_SYS_I2C_RTC_ADDR,
CONFIG_SYS_BOOTCOUNT_ADDR,
- ret = i2c_read(CONFIG_SYS_I2C_RTC_ADDR, BOOTCOUNT_ADDR, CONFIG_BOOTCOUNT_ALEN, buf, 2); if (ret != 0) { puts("Error loading bootcount\n");
diff --git a/include/configs/brppt1.h b/include/configs/brppt1.h index 30ea2d2..e32ac7d 100644 --- a/include/configs/brppt1.h +++ b/include/configs/brppt1.h @@ -21,7 +21,7 @@ #define LCD_BPP LCD_COLOR32
/* Bootcount using the RTC block */ -#define CONFIG_SYS_BOOTCOUNT_ADDR 0x44E3E000 +#define BOOTCOUNT_ADDR 0x44E3E000
/* memory */ #define CONFIG_SYS_MALLOC_LEN (5 * 1024 * 1024) diff --git a/include/configs/calimain.h b/include/configs/calimain.h index 4c47617..255036d 100644 --- a/include/configs/calimain.h +++ b/include/configs/calimain.h @@ -278,7 +278,7 @@ #define CONFIG_SYS_INIT_SP_ADDR (0x8001ff00)
#define CONFIG_SYS_BOOTCOUNT_LE /* Use little-endian accessors */ -#define CONFIG_SYS_BOOTCOUNT_ADDR DAVINCI_RTC_BASE +#define BOOTCOUNT_ADDR DAVINCI_RTC_BASE
#ifndef __ASSEMBLY__ int calimain_get_osc_freq(void); diff --git a/include/configs/dh_imx6.h b/include/configs/dh_imx6.h index 464b8d7..474511d 100644 --- a/include/configs/dh_imx6.h +++ b/include/configs/dh_imx6.h @@ -47,7 +47,7 @@ #define CONFIG_SYS_MALLOC_LEN (4 * SZ_1M)
/* Bootcounter */ -#define CONFIG_SYS_BOOTCOUNT_ADDR IRAM_BASE_ADDR +#define BOOTCOUNT_ADDR IRAM_BASE_ADDR #define CONFIG_SYS_BOOTCOUNT_BE
/* FEC ethernet */ diff --git a/include/configs/ge_bx50v3.h b/include/configs/ge_bx50v3.h index 0a72b58..1db9bad 100644 --- a/include/configs/ge_bx50v3.h +++ b/include/configs/ge_bx50v3.h @@ -267,6 +267,6 @@
#define CONFIG_BCH
-#define CONFIG_SYS_BOOTCOUNT_ADDR 0x7000A000 +#define BOOTCOUNT_ADDR 0x7000A000
#endif /* __GE_BX50V3_CONFIG_H */ diff --git a/include/configs/highbank.h b/include/configs/highbank.h index 9dc0c6c..a734181 100644 --- a/include/configs/highbank.h +++ b/include/configs/highbank.h @@ -27,7 +27,7 @@ #define CONFIG_CONS_INDEX 0
#define CONFIG_SYS_BOOTCOUNT_LE /* Use little-endian accessors */ -#define CONFIG_SYS_BOOTCOUNT_ADDR 0xfff3cf0c +#define BOOTCOUNT_ADDR 0xfff3cf0c
#define CONFIG_MISC_INIT_R #define CONFIG_SCSI_AHCI_PLAT diff --git a/include/configs/ids8313.h b/include/configs/ids8313.h index 099d7bd..4449e27 100644 --- a/include/configs/ids8313.h +++ b/include/configs/ids8313.h @@ -516,7 +516,7 @@
/* bootcount support */ #define CONFIG_BOOTCOUNT_ALEN 1 -#define CONFIG_SYS_BOOTCOUNT_ADDR 0x9 +#define BOOTCOUNT_ADDR 0x9
#define CONFIG_IMAGE_FORMAT_LEGACY
diff --git a/include/configs/km/kmp204x-common.h b/include/configs/km/kmp204x-common.h index 7f735e0..19627ff 100644 --- a/include/configs/km/kmp204x-common.h +++ b/include/configs/km/kmp204x-common.h @@ -189,7 +189,7 @@ unsigned long get_board_sys_clk(unsigned long dummy); #define CONFIG_SYS_OR1_PRELIM CONFIG_SYS_QRIO_OR_PRELIM /* QRIO Options */ /* bootcounter in QRIO */ -#define CONFIG_SYS_BOOTCOUNT_ADDR (CONFIG_SYS_QRIO_BASE + 0x20) +#define BOOTCOUNT_ADDR (CONFIG_SYS_QRIO_BASE + 0x20)
#define CONFIG_BOARD_EARLY_INIT_R /* call board_early_init_r function */ #define CONFIG_MISC_INIT_F diff --git a/include/configs/mx53ppd.h b/include/configs/mx53ppd.h index aa1480c..c73d73a 100644 --- a/include/configs/mx53ppd.h +++ b/include/configs/mx53ppd.h @@ -241,6 +241,6 @@ #define CONFIG_VIDEO_IPUV3 #endif
-#define CONFIG_SYS_BOOTCOUNT_ADDR 0x7000A000 +#define BOOTCOUNT_ADDR 0x7000A000
#endif /* __CONFIG_H */ diff --git a/include/configs/socfpga_is1.h b/include/configs/socfpga_is1.h index 883ffb7..70ff295 100644 --- a/include/configs/socfpga_is1.h +++ b/include/configs/socfpga_is1.h @@ -33,7 +33,7 @@
- Bootcounter
*/ /* last 2 lwords in OCRAM */ -#define CONFIG_SYS_BOOTCOUNT_ADDR 0xfffffff8 +#define BOOTCOUNT_ADDR 0xfffffff8 #define CONFIG_SYS_BOOTCOUNT_BE
#endif /* __CONFIG_SOCFPGA_IS1_H__ */ diff --git a/include/configs/socfpga_sr1500.h b/include/configs/socfpga_sr1500.h index 8c9069c..1fe1d60 100644 --- a/include/configs/socfpga_sr1500.h +++ b/include/configs/socfpga_sr1500.h @@ -32,7 +32,7 @@
- Bootcounter
*/ /* last 2 lwords in OCRAM */ -#define CONFIG_SYS_BOOTCOUNT_ADDR 0xfffffff8 +#define BOOTCOUNT_ADDR 0xfffffff8 #define CONFIG_SYS_BOOTCOUNT_BE
/* Environment setting for SPI flash */ diff --git a/include/configs/ti_am335x_common.h b/include/configs/ti_am335x_common.h index 66cacdf..d204809 100644 --- a/include/configs/ti_am335x_common.h +++ b/include/configs/ti_am335x_common.h @@ -45,7 +45,7 @@
- environment to a non-zero value and enable CONFIG_BOOTCOUNT_LIMIT
- in the board config.
*/ -#define CONFIG_SYS_BOOTCOUNT_ADDR 0x44E3E000 +#define BOOTCOUNT_ADDR 0x44E3E000
/*
- SPL related defines. The Public RAM memory map the ROM defines
the diff --git a/include/configs/tqma6_wru4.h b/include/configs/tqma6_wru4.h index d94f790..00a2dea 100644 --- a/include/configs/tqma6_wru4.h +++ b/include/configs/tqma6_wru4.h @@ -34,7 +34,7 @@ /* LED */
/* Bootcounter */ -#define CONFIG_SYS_BOOTCOUNT_ADDR IRAM_BASE_ADDR +#define BOOTCOUNT_ADDR IRAM_BASE_ADDR #define CONFIG_SYS_BOOTCOUNT_BE
#endif /* __CONFIG_TQMA6_WRU4_H */ diff --git a/include/configs/x600.h b/include/configs/x600.h index 80e5b1c..a13f7e1 100644 --- a/include/configs/x600.h +++ b/include/configs/x600.h @@ -120,7 +120,7 @@ #define CONFIG_SYS_LOAD_ADDR 0x00800000
/* Use last 2 lwords in internal SRAM for bootcounter */ -#define CONFIG_SYS_BOOTCOUNT_ADDR (CONFIG_SRAM_BASE + \ +#define BOOTCOUNT_ADDR (CONFIG_SRAM_BASE + \ CONFIG_SRAM_SIZE)
#define CONFIG_HOSTNAME x600
Best regards,
Lukasz Majewski
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de

On Fri, Feb 16, 2018 at 9:31 AM, Lukasz Majewski lukma@denx.de wrote:
Hi Alex,
Please extend the commit message, as for example presented below:
Remove CONFIG_SYS_BOOTCOUNT_ADDR from Kconfig.
and also introduce BOOTCOUNT_ADDR as a replacement. After this change the CONFIG_SYS_BOOTCOUNT_ADDR is completely removed from the u-boot code base.
It has been replaced with BOOTCOUNT_ADDR to preserve current behaviour. This variable is not (yet) introduced to Kconfig.
Thanks for the words... I think I was getting a bit tired of the fight with it by that point!

Signed-off-by: Alex Kiernan alex.kiernan@gmail.com ---
Changes in v2: None
drivers/bootcount/Kconfig | 9 ++++++++- include/configs/ids8313.h | 1 - scripts/config_whitelist.txt | 1 - 3 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/bootcount/Kconfig b/drivers/bootcount/Kconfig index ce26e38..1a037f2 100644 --- a/drivers/bootcount/Kconfig +++ b/drivers/bootcount/Kconfig @@ -66,7 +66,14 @@ config BOOTCOUNT_I2C Enable support for the bootcounter on an i2c (like RTC) device. CONFIG_SYS_I2C_RTC_ADDR = i2c chip address BOOTCOUNT_ADDR = i2c addr which is used for the bootcounter. - CONFIG_BOOTCOUNT_ALEN = address len + +config BOOTCOUNT_ALEN + int "I2C address length" + default 1 + depends on BOOTCOUNT_I2C + help + Length of the the I2C address at BOOTCOUNT_ADDR for storing + the boot counter.
config BOOTCOUNT_AT91 bool "Boot counter for Atmel AT91SAM9XE" diff --git a/include/configs/ids8313.h b/include/configs/ids8313.h index 4449e27..fb891a3 100644 --- a/include/configs/ids8313.h +++ b/include/configs/ids8313.h @@ -515,7 +515,6 @@ #define CONFIG_MTD_PARTITIONS
/* bootcount support */ -#define CONFIG_BOOTCOUNT_ALEN 1 #define BOOTCOUNT_ADDR 0x9
#define CONFIG_IMAGE_FORMAT_LEGACY diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index a8380c6..e16085b 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -147,7 +147,6 @@ CONFIG_BOARD_TYPES CONFIG_BOOGER CONFIG_BOOM CONFIG_BOOTBLOCK -CONFIG_BOOTCOUNT_ALEN CONFIG_BOOTFILE CONFIG_BOOTMAPSZ CONFIG_BOOTMODE

Hi Alex,
Please add at least one sentence to the commit message (not only the topic).
A side note - I did not received patch 13/13,
It can be found here: http://patchwork.ozlabs.org/patch/873845/
It is also Ok (as I forgotten to remove SINGLEWORD from whitelist)..
Above patches seems to be eligible to current mailing (rc2+).
The BOOTCOUNT_ADDR conversion would need to wait for merge window, IMHO.
Thanks for your effort,
Best regards, Łukasz
Signed-off-by: Alex Kiernan alex.kiernan@gmail.com
Changes in v2: None
drivers/bootcount/Kconfig | 9 ++++++++- include/configs/ids8313.h | 1 - scripts/config_whitelist.txt | 1 - 3 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/bootcount/Kconfig b/drivers/bootcount/Kconfig index ce26e38..1a037f2 100644 --- a/drivers/bootcount/Kconfig +++ b/drivers/bootcount/Kconfig @@ -66,7 +66,14 @@ config BOOTCOUNT_I2C Enable support for the bootcounter on an i2c (like RTC) device. CONFIG_SYS_I2C_RTC_ADDR = i2c chip address BOOTCOUNT_ADDR = i2c addr which is used for the bootcounter.
CONFIG_BOOTCOUNT_ALEN = address len
+config BOOTCOUNT_ALEN
- int "I2C address length"
- default 1
- depends on BOOTCOUNT_I2C
- help
Length of the the I2C address at BOOTCOUNT_ADDR for storing
the boot counter.
config BOOTCOUNT_AT91 bool "Boot counter for Atmel AT91SAM9XE" diff --git a/include/configs/ids8313.h b/include/configs/ids8313.h index 4449e27..fb891a3 100644 --- a/include/configs/ids8313.h +++ b/include/configs/ids8313.h @@ -515,7 +515,6 @@ #define CONFIG_MTD_PARTITIONS
/* bootcount support */ -#define CONFIG_BOOTCOUNT_ALEN 1 #define BOOTCOUNT_ADDR 0x9
#define CONFIG_IMAGE_FORMAT_LEGACY diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index a8380c6..e16085b 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -147,7 +147,6 @@ CONFIG_BOARD_TYPES CONFIG_BOOGER CONFIG_BOOM CONFIG_BOOTBLOCK -CONFIG_BOOTCOUNT_ALEN CONFIG_BOOTFILE CONFIG_BOOTMAPSZ CONFIG_BOOTMODE
Best regards,
Lukasz Majewski
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de

On Fri, Feb 16, 2018 at 9:36 AM, Lukasz Majewski lukma@denx.de wrote:
Hi Alex,
Please add at least one sentence to the commit message (not only the topic).
Sure.
A side note - I did not received patch 13/13,
It can be found here: http://patchwork.ozlabs.org/patch/873845/
It is also Ok (as I forgotten to remove SINGLEWORD from whitelist)..
Above patches seems to be eligible to current mailing (rc2+).
The BOOTCOUNT_ADDR conversion would need to wait for merge window, IMHO.
I'll split the pieces apart and get the non-BOOTCOUNT_ADDR part out.

Tidy up CONFIG_SYS_BOOTCOUNT_SINGLEWORD from the whitelist as there's no remaining uses of it left.
Signed-off-by: Alex Kiernan alex.kiernan@gmail.com ---
Changes in v2: None
scripts/config_whitelist.txt | 1 - 1 file changed, 1 deletion(-)
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index e16085b..1e18488 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -2222,7 +2222,6 @@ CONFIG_SYS_BOARD_VERSION CONFIG_SYS_BOOK3E_HV CONFIG_SYS_BOOTCOUNT_BE CONFIG_SYS_BOOTCOUNT_LE -CONFIG_SYS_BOOTCOUNT_SINGLEWORD CONFIG_SYS_BOOTFILE_PREFIX CONFIG_SYS_BOOTMAPSZ CONFIG_SYS_BOOTM_LEN
participants (2)
-
Alex Kiernan
-
Lukasz Majewski