Skip to contentSkip to conversation

Convert bootcount drivers to Kconfig

PATCH Superseded Alex Kiernan 2 participants 20 messages Feb 15, 2018 – Feb 16, 2018 Arm i.MX and Layerscape

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover 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(-)
Signature · 1 line
2.7.4
#1 lore raw

PATCH v2 1/13 Merge CONFIG_BOOTCOUNT and CONFIG_BOOTCOUNT_LIMIT

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

---

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(-)
configs/mx53ppd_defconfig +0 -1
index 90df425..7e3dd6d 100644
@@ -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"
drivers/bootcount/Kconfig +1 -8
index d82289f..da2ccab 100644
@@ -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"
scripts/config_whitelist.txt +0 -1
index 38ce88e..b3a5d93 100644
@@ -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
Signature · 1 line
2.7.4
#2 lore raw

PATCH v2 1/13 Merge CONFIG_BOOTCOUNT and CONFIG_BOOTCOUNT_LIMIT

Hi Alex,

Quoted 5 lines

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.

Quoted 68 lines

---

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(-)
configs/mx53ppd_defconfig +0 -1
index 90df425..7e3dd6d 100644
@@ -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"
drivers/bootcount/Kconfig +0 -4
index d82289f..da2ccab 100644
@@ -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

drivers/bootcount/Kconfig +0 -1
-	  number of times the board has booted on a number of

different

drivers/bootcount/Kconfig +0 -2
-	  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).

drivers/bootcount/Kconfig +1 -1
-if BOOTCOUNT
+if BOOTCOUNT_LIMIT
 
 config BOOTCOUNT_EXT
 	bool "Boot counter on EXT filesystem"
(quoted diff) +0 -0

b/scripts/config_whitelist.txt index 38ce88e..b3a5d93 100644

scripts/config_whitelist.txt CONFIG_BOOTCOUNT_ALEN · line 156

Quoted 7 lines
scripts/config_whitelist.txt +0 -1
@@ -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 at denx.de -------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180216/e7a1f318/attachment.sig>

#3 lore raw

PATCH v2 2/13 Prepare for multiple bootcount drivers

In reply to Alex Kiernan

---

Changes in v2: None

 drivers/bootcount/Kconfig | 25 +++++++++++--------------
 1 file changed, 11 insertions(+), 14 deletions(-)
drivers/bootcount/Kconfig +11 -14
index da2ccab..26fec89 100644
@@ -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
Signature · 1 line
2.7.4
#4 lore raw

PATCH v2 3/13 Convert CONFIG_BOOTCOUNT_AM33XX to Kconfig

In reply to Alex Kiernan

This converts the following to Kconfig:
CONFIG_BOOTCOUNT_AM33XX

---

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(-)
README +0 -2
index dc4c329..cc341ac 100644
@@ -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
drivers/bootcount/Kconfig +9 -0
index 26fec89..e905295 100644
@@ -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
drivers/bootcount/Makefile +0 -1
index 45445d2..62bf55e 100644
@@ -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
include/configs/am335x_evm.h +0 -1
index cacc262..442f6c4 100644
@@ -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 */
include/configs/am335x_sl50.h +0 -1
index 1cb3578..4bcbaee 100644
@@ -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)
include/configs/baltos.h +0 -2
index 440dbf5..10979c7 100644
@@ -230,8 +230,6 @@
 
 /* SPL */
 #ifndef CONFIG_NOR_BOOT
-/* Bootcount using the RTC block */
-#define CONFIG_BOOTCOUNT_AM33XX
 
 /* USB gadget RNDIS */
 
include/configs/bav335x.h +0 -1
index 5ea7658..48cd285 100644
@@ -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 */
include/configs/brppt1.h +0 -1
index fb2845f..30ea2d2 100644
@@ -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)
include/configs/chiliboard.h +0 -1
index 234cd6a..92e0479 100644
@@ -123,7 +123,6 @@
 
 /* SPL */
 /* Bootcount using the RTC block */
-#define CONFIG_BOOTCOUNT_AM33XX
 #define CONFIG_SYS_BOOTCOUNT_BE
 
 /* NAND: device related configs */
scripts/config_whitelist.txt +0 -1
index b3a5d93..ccaac48 100644
@@ -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
Signature · 1 line
2.7.4
#5 lore raw

PATCH v2 4/13 Convert CONFIG_BOOTCOUNT_ENV to Kconfig

In reply to Alex Kiernan

This converts the following to Kconfig:
CONFIG_BOOTCOUNT_ENV

---

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(-)
README +0 -11
index cc341ac..da77484 100644
@@ -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
configs/draco_defconfig +1 -0
index 693d91c..0416daa 100644
@@ -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
configs/etamin_defconfig +1 -0
index e7a3d22..7d639ea 100644
@@ -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
configs/pxm2_defconfig +1 -0
index 6063259..90783b4 100644
@@ -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
configs/rastaban_defconfig +1 -0
index ce6981e..c0947e9 100644
@@ -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
configs/rut_defconfig +1 -0
index b31eb97..685b4c8 100644
@@ -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
configs/thuban_defconfig +1 -0
index 4a3c0cd..f5d1077 100644
@@ -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
drivers/bootcount/Kconfig +12 -0
index e905295..40a0755 100644
@@ -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
include/configs/siemens-am33x-common.h +0 -2
index 838e8d0..ed4b6cd 100644
@@ -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 */
scripts/config_whitelist.txt +0 -1
index ccaac48..1559a29 100644
@@ -148,7 +148,6 @@ CONFIG_BOOGER
 CONFIG_BOOM
 CONFIG_BOOTBLOCK
 CONFIG_BOOTCOUNT_ALEN
-CONFIG_BOOTCOUNT_ENV
 CONFIG_BOOTCOUNT_I2C
 CONFIG_BOOTCOUNT_RAM
 CONFIG_BOOTFILE
Signature · 1 line
2.7.4
#6 lore raw

PATCH v2 5/13 Convert CONFIG_BOOTCOUNT_RAM to Kconfig

In reply to Alex Kiernan

This converts the following to Kconfig:
CONFIG_BOOTCOUNT_RAM

---

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(-)
README +0 -2
index da77484..d28a576 100644
@@ -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
configs/km_kirkwood_128m16_defconfig +1 -0
index 54c22a7..5f378f7 100644
@@ -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
configs/km_kirkwood_defconfig +1 -0
index 20ea24b..ae20d24 100644
@@ -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
configs/km_kirkwood_pci_defconfig +1 -0
index 402610c..22bc6cd 100644
@@ -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
configs/kmcoge5un_defconfig +1 -0
index 72aee04..5c123a4 100644
@@ -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
configs/kmnusa_defconfig +1 -0
index ac82780..4749ead 100644
@@ -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
configs/kmsugp1_defconfig +1 -0
index af2c93e3..de68d41 100644
@@ -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
configs/kmsuv31_defconfig +1 -0
index 09d75ab..892f212 100644
@@ -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
configs/mgcoge3un_defconfig +1 -0
index 3e90e70..89a83fd 100644
@@ -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
configs/portl2_defconfig +1 -0
index 1c6dad9..8a6d996 100644
@@ -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
configs/theadorable_debug_defconfig +1 -0
index aa6e5e1..918447a 100644
@@ -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
drivers/bootcount/Kconfig +6 -0
index 40a0755..eabfd13 100644
@@ -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
include/configs/km/km_arm.h +0 -2
index faa3d94..cc36a68 100644
@@ -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)
include/configs/theadorable.h +0 -1
index 1504fd6..93ff65d 100644
@@ -82,7 +82,6 @@
 /*
  * Bootcounter
  */
-#define CONFIG_BOOTCOUNT_RAM
 /* Max size of RAM minus BOOTCOUNT_ADDR is the bootcounter address */
 #define BOOTCOUNT_ADDR			0x1000
 
scripts/config_whitelist.txt +0 -1
index 1559a29..312d4bb 100644
@@ -149,7 +149,6 @@ CONFIG_BOOM
 CONFIG_BOOTBLOCK
 CONFIG_BOOTCOUNT_ALEN
 CONFIG_BOOTCOUNT_I2C
-CONFIG_BOOTCOUNT_RAM
 CONFIG_BOOTFILE
 CONFIG_BOOTMAPSZ
 CONFIG_BOOTMODE
Signature · 1 line
2.7.4
#7 lore raw

PATCH v2 6/13 Convert CONFIG_BOOTCOUNT_I2C to Kconfig

In reply to Alex Kiernan

This converts the following to Kconfig:
CONFIG_BOOTCOUNT_I2C

---

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(-)
README +0 -6
index d28a576..0157f0b 100644
@@ -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
configs/ids8313_defconfig +1 -0
index b754758..ca14815 100644
@@ -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
drivers/bootcount/Kconfig +9 -0
index eabfd13..8c19ae6 100644
@@ -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
include/configs/ids8313.h +0 -1
index 628e0a2..099d7bd 100644
@@ -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
 
scripts/config_whitelist.txt +0 -1
index 312d4bb..a8380c6 100644
@@ -148,7 +148,6 @@ CONFIG_BOOGER
 CONFIG_BOOM
 CONFIG_BOOTBLOCK
 CONFIG_BOOTCOUNT_ALEN
-CONFIG_BOOTCOUNT_I2C
 CONFIG_BOOTFILE
 CONFIG_BOOTMAPSZ
 CONFIG_BOOTMODE
Signature · 1 line
2.7.4
#8 lore raw

PATCH v2 7/13 Convert CONFIG_BOOTCOUNT_EXT to Kconfig

In reply to Alex Kiernan

This converts the following to Kconfig:
CONFIG_BOOTCOUNT_EXT

---

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(-)
README +0 -7
index 0157f0b..9eb4f5a 100644
@@ -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
configs/ge_b450v3_defconfig +2 -0
index a5beefe..32f07ab 100644
@@ -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
configs/ge_b650v3_defconfig +2 -0
index cbf83b1..188238e 100644
@@ -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
configs/ge_b850v3_defconfig +2 -0
index 953681f..96ac173 100644
@@ -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
include/configs/ge_bx50v3.h +0 -4
index 8dc0a7f..0a72b58 100644
@@ -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 */
Signature · 1 line
2.7.4
#9 lore raw

PATCH v2 8/13 Integrate AT91 bootcount driver

In reply to Alex Kiernan

Integrate Boot counter for Atmel AT91SAM9XE into Kconfig

---

Changes in v2: None

 README                     | 4 ----
 drivers/bootcount/Kconfig  | 5 +++++
 drivers/bootcount/Makefile | 2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)
README +0 -4
index 9eb4f5a..2222aee 100644
@@ -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
 
drivers/bootcount/Kconfig +5 -0
index 8c19ae6..e0d1fc2 100644
@@ -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
drivers/bootcount/Makefile +1 -1
index 62bf55e..a3658c1 100644
@@ -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
Signature · 1 line
2.7.4
#10 lore raw

PATCH v2 9/13 Migrate generic bootcount to Kconfig

In reply to Alex Kiernan

Make generate boot counter selected in the same way as other boot count drivers

---

Changes in v2: None

 drivers/bootcount/Kconfig  | 11 +++++++++++
 drivers/bootcount/Makefile |  2 +-
 2 files changed, 12 insertions(+), 1 deletion(-)
drivers/bootcount/Kconfig +11 -0
index e0d1fc2..9fde2f2 100644
@@ -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).
drivers/bootcount/Makefile +1 -1
index a3658c1..3e1ae8c 100644
@@ -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
Signature · 1 line
2.7.4
#11 lore raw

PATCH v2 10/13 Remove SYS_BOOTCOUNT_ADDR from Kconfig

In reply to Alex Kiernan

The only user of SYS_BOOTCOUNT_ADDR is mx53ppd; remove it from Kconfig in preparation for renaming SYS_BOOTCOUNT_ADDR.

---

Changes in v2: None

 drivers/bootcount/Kconfig | 7 -------
 include/configs/mx53ppd.h | 2 ++
 2 files changed, 2 insertions(+), 7 deletions(-)
drivers/bootcount/Kconfig +0 -7
index 9fde2f2..583d6a6 100644
@@ -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
include/configs/mx53ppd.h +2 -0
index 79c97b5..aa1480c 100644
@@ -241,4 +241,6 @@
 	#define CONFIG_VIDEO_IPUV3
 #endif
 
+#define CONFIG_SYS_BOOTCOUNT_ADDR	0x7000A000
+
 #endif				/* __CONFIG_H */
Signature · 1 line
2.7.4
#12 lore raw

PATCH v2 10/13 Remove SYS_BOOTCOUNT_ADDR from Kconfig

Quoted 34 lines · On Thu, 15 Feb 2018 13:55:23 +0000 Alex Kiernan <[email protected]> wrote:

The only user of SYS_BOOTCOUNT_ADDR is mx53ppd; remove it from Kconfig in preparation for renaming SYS_BOOTCOUNT_ADDR.

---

Changes in v2: None

 drivers/bootcount/Kconfig | 7 -------
 include/configs/mx53ppd.h | 2 ++
 2 files changed, 2 insertions(+), 7 deletions(-)
drivers/bootcount/Kconfig +0 -0
index 9fde2f2..583d6a6 100644
@@ -102,11 +102,4 @@ config SYS_BOOTCOUNT_EXT_NAME
 	help
 	  Set the filename and path of the file used to store the

boot counter.

drivers/bootcount/Kconfig +0 -2
-config SYS_BOOTCOUNT_ADDR
-	hex "RAM address used for reading and writing the boot

counter"

drivers/bootcount/Kconfig +0 -4
-	default 0x7000A000
-	depends on BOOTCOUNT_EXT
-	help
-	  Set the address used for reading and writing the boot

counter. -
endif

include/configs/mx53ppd.h +0 -0
index 79c97b5..aa1480c 100644

include/configs/mx53ppd.h line 246

Quoted 6 lines
include/configs/mx53ppd.h +2 -0
@@ -241,4 +241,6 @@
 	#define CONFIG_VIDEO_IPUV3
 #endif
 
+#define CONFIG_SYS_BOOTCOUNT_ADDR	0x7000A000
+
 #endif				/* __CONFIG_H */

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 at denx.de -------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180216/0b9f7ee6/attachment.sig>

#13 lore raw

PATCH v2 11/13 Rename CONFIG_SYS_BOOTCOUNT_ADDR to BOOTCOUNT_ADDR

In reply to Alex Kiernan

Remove CONFIG_SYS_BOOTCOUNT_ADDR from Kconfig.

---

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(-)
drivers/bootcount/Kconfig +6 -4
index 583d6a6..ce26e38 100644
@@ -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
drivers/bootcount/bootcount.c +8 -8
index 8b499fe..82ef426 100644
@@ -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) */
drivers/bootcount/bootcount_davinci.c +2 -2
index 17829be..d00fd7a 100644
@@ -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(&reg->scratch2);
 	if ((val & 0xffff0000) != (BOOTCOUNT_MAGIC & 0xffff0000))
drivers/bootcount/bootcount_ext.c +4 -4
index e0dd21b..e176ec1 100644
@@ -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];
 
drivers/bootcount/bootcount_i2c.c +3 -3
index e27b168..1dba141 100644
@@ -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");
include/configs/brppt1.h +1 -1
index 30ea2d2..e32ac7d 100644
@@ -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)
include/configs/calimain.h +1 -1
index 4c47617..255036d 100644
@@ -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);
include/configs/dh_imx6.h +1 -1
index 464b8d7..474511d 100644
@@ -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 */
include/configs/ge_bx50v3.h +1 -1
index 0a72b58..1db9bad 100644
@@ -267,6 +267,6 @@
 
 #define CONFIG_BCH
 
-#define CONFIG_SYS_BOOTCOUNT_ADDR		0x7000A000
+#define BOOTCOUNT_ADDR		0x7000A000
 
 #endif	/* __GE_BX50V3_CONFIG_H */
include/configs/highbank.h +1 -1
index 9dc0c6c..a734181 100644
@@ -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
include/configs/ids8313.h +1 -1
index 099d7bd..4449e27 100644
@@ -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
 
include/configs/km/kmp204x-common.h +1 -1
index 7f735e0..19627ff 100644
@@ -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
include/configs/mx53ppd.h +1 -1
index aa1480c..c73d73a 100644
@@ -241,6 +241,6 @@
 	#define CONFIG_VIDEO_IPUV3
 #endif
 
-#define CONFIG_SYS_BOOTCOUNT_ADDR	0x7000A000
+#define BOOTCOUNT_ADDR		0x7000A000
 
 #endif				/* __CONFIG_H */
include/configs/socfpga_is1.h +1 -1
index 883ffb7..70ff295 100644
@@ -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__ */
include/configs/socfpga_sr1500.h +1 -1
index 8c9069c..1fe1d60 100644
@@ -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 */
include/configs/ti_am335x_common.h +1 -1
index 66cacdf..d204809 100644
@@ -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
include/configs/tqma6_wru4.h +1 -1
index d94f790..00a2dea 100644
@@ -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 */
include/configs/x600.h +1 -1
index 80e5b1c..a13f7e1 100644
@@ -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
Signature · 1 line
2.7.4
#14 lore raw

PATCH v2 11/13 Rename CONFIG_SYS_BOOTCOUNT_ADDR to BOOTCOUNT_ADDR

Hi Alex,

Please extend the commit message, as for example presented below:

Quoted 1 line

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.

Quoted 358 lines

---

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(-)
drivers/bootcount/Kconfig +2 -2
index 583d6a6..ce26e38 100644
@@ -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.

drivers/bootcount/Kconfig +3 -0
@@ -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

drivers/bootcount/Kconfig +1 -2
-	  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

(quoted diff) +0 -0

b/drivers/bootcount/bootcount.c index 8b499fe..82ef426 100644

drivers/bootcount/bootcount.c +0 -1
@@ -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. */

drivers/bootcount/bootcount.c +2 -2
-#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) */

drivers/bootcount/bootcount.c +5 -5
-#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) */
(quoted diff) +0 -0

b/drivers/bootcount/bootcount_davinci.c index 17829be..d00fd7a 100644

drivers/bootcount/bootcount_davinci.c +2 -2
@@ -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(&reg->scratch2);
 	if ((val & 0xffff0000) != (BOOTCOUNT_MAGIC & 0xffff0000))
(quoted diff) +0 -0

b/drivers/bootcount/bootcount_ext.c index e0dd21b..e176ec1 100644

drivers/bootcount/bootcount_ext.c +4 -4
@@ -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];
(quoted diff) +0 -0

b/drivers/bootcount/bootcount_i2c.c index e27b168..1dba141 100644

drivers/bootcount/bootcount_i2c.c +2 -2
@@ -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");

}

drivers/bootcount/bootcount_i2c.c +1 -1
@@ -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) {
drivers/bootcount/bootcount_i2c.c +0 -0
 		puts("Error loading bootcount\n");
include/configs/brppt1.h +1 -1
index 30ea2d2..e32ac7d 100644
@@ -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)
include/configs/calimain.h +0 -0
index 4c47617..255036d 100644
@@ -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);

include/configs/dh_imx6.h +1 -1
index 464b8d7..474511d 100644
@@ -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 */
include/configs/ge_bx50v3.h +1 -1
index 0a72b58..1db9bad 100644
@@ -267,6 +267,6 @@
 
 #define CONFIG_BCH
 
-#define CONFIG_SYS_BOOTCOUNT_ADDR		0x7000A000
+#define BOOTCOUNT_ADDR		0x7000A000
 
 #endif	/* __GE_BX50V3_CONFIG_H */
include/configs/highbank.h +0 -0
index 9dc0c6c..a734181 100644
@@ -27,7 +27,7 @@
 #define CONFIG_CONS_INDEX		0
 
 #define CONFIG_SYS_BOOTCOUNT_LE		/* Use little-endian

accessors */ -#define CONFIG_SYS_BOOTCOUNT_ADDR 0xfff3cf0c

include/configs/highbank.h +1 -0
+#define BOOTCOUNT_ADDR	0xfff3cf0c
 
 #define CONFIG_MISC_INIT_R
 #define CONFIG_SCSI_AHCI_PLAT
include/configs/ids8313.h +1 -1
index 099d7bd..4449e27 100644
@@ -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
 
(quoted diff) +0 -0

b/include/configs/km/kmp204x-common.h index 7f735e0..19627ff 100644

include/configs/km/kmp204x-common.h +0 -0
@@ -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

include/configs/mx53ppd.h +1 -1
index aa1480c..c73d73a 100644
@@ -241,6 +241,6 @@
 	#define CONFIG_VIDEO_IPUV3
 #endif
 
-#define CONFIG_SYS_BOOTCOUNT_ADDR	0x7000A000
+#define BOOTCOUNT_ADDR		0x7000A000
 
 #endif				/* __CONFIG_H */
(quoted diff) +0 -0

b/include/configs/socfpga_is1.h index 883ffb7..70ff295 100644

include/configs/socfpga_is1.h +1 -1
@@ -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__ */
(quoted diff) +0 -0

b/include/configs/socfpga_sr1500.h index 8c9069c..1fe1d60 100644

include/configs/socfpga_sr1500.h +1 -1
@@ -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 */
(quoted diff) +0 -0

b/include/configs/ti_am335x_common.h index 66cacdf..d204809 100644

include/configs/ti_am335x_common.h +1 -1
@@ -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

include/configs/tqma6_wru4.h +1 -1
@@ -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 */
include/configs/x600.h +0 -0
index 80e5b1c..a13f7e1 100644

include/configs/x600.h line 126

Quoted 8 lines
include/configs/x600.h +0 -1
@@ -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 at denx.de -------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180216/29102c82/attachment.sig>

#15 lore raw

PATCH v2 11/13 Rename CONFIG_SYS_BOOTCOUNT_ADDR to BOOTCOUNT_ADDR

Quoted 4 lines · Lukasz Majewski

Hi Alex,

Please extend the commit message, as for example presented below:

Quoted 9 lines
Quoted 1 line

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!

Signature · 1 line
Alex Kiernan
#16 lore raw

PATCH v2 12/13 Migrate CONFIG_BOOTCOUNT_ALEN to Kconfig

In reply to Alex Kiernan

---

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(-)
drivers/bootcount/Kconfig +8 -1
index ce26e38..1a037f2 100644
@@ -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"
include/configs/ids8313.h +0 -1
index 4449e27..fb891a3 100644
@@ -515,7 +515,6 @@
 #define CONFIG_MTD_PARTITIONS
 
 /* bootcount support */
-#define CONFIG_BOOTCOUNT_ALEN	1
 #define BOOTCOUNT_ADDR	0x9
 
 #define CONFIG_IMAGE_FORMAT_LEGACY
scripts/config_whitelist.txt +0 -1
index a8380c6..e16085b 100644
@@ -147,7 +147,6 @@ CONFIG_BOARD_TYPES
 CONFIG_BOOGER
 CONFIG_BOOM
 CONFIG_BOOTBLOCK
-CONFIG_BOOTCOUNT_ALEN
 CONFIG_BOOTFILE
 CONFIG_BOOTMAPSZ
 CONFIG_BOOTMODE
Signature · 1 line
2.7.4
#17 lore raw

PATCH v2 12/13 Migrate CONFIG_BOOTCOUNT_ALEN to Kconfig

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

Quoted 48 lines

---

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(-)
drivers/bootcount/Kconfig +0 -0
index ce26e38..1a037f2 100644
@@ -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.

drivers/bootcount/Kconfig +8 -1
-	  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"
include/configs/ids8313.h +0 -1
index 4449e27..fb891a3 100644
@@ -515,7 +515,6 @@
 #define CONFIG_MTD_PARTITIONS
 
 /* bootcount support */
-#define CONFIG_BOOTCOUNT_ALEN	1
 #define BOOTCOUNT_ADDR	0x9
 
 #define CONFIG_IMAGE_FORMAT_LEGACY
(quoted diff) +0 -0

b/scripts/config_whitelist.txt index a8380c6..e16085b 100644

scripts/config_whitelist.txt CONFIG_BOARD_TYPES · line 152

Quoted 7 lines
scripts/config_whitelist.txt +0 -1
@@ -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 at denx.de -------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180216/3bd3a918/attachment.sig>

#18 lore raw

PATCH v2 12/13 Migrate CONFIG_BOOTCOUNT_ALEN to Kconfig

Quoted 5 lines · Lukasz Majewski

Hi Alex,

Please add at least one sentence to the commit message (not only the topic).

Sure.

Quoted 11 lines

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.

Signature · 1 line
Alex Kiernan
#19 lore raw

PATCH v2 13/13 Remove CONFIG_SYS_BOOTCOUNT_SINGLEWORD

In reply to Alex Kiernan

Tidy up CONFIG_SYS_BOOTCOUNT_SINGLEWORD from the whitelist as there's no remaining uses of it left.

---

Changes in v2: None

 scripts/config_whitelist.txt | 1 -
 1 file changed, 1 deletion(-)
scripts/config_whitelist.txt +0 -1
index e16085b..1e18488 100644
@@ -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
Signature · 1 line
2.7.4