diff mbox series

[U-Boot,4/8] Convert CONFIG_BOOTCOUNT_ENV to Kconfig

Message ID 1518350813-3418-5-git-send-email-alex.kiernan@gmail.com
State Superseded
Delegated to: Tom Rini
Headers show
Series [U-Boot,1/8] Merge CONFIG_BOOTCOUNT and CONFIG_BOOTCOUNT_LIMIT | expand

Commit Message

Alex Kiernan Feb. 11, 2018, 12:06 p.m. UTC
This converts the following to Kconfig:
  CONFIG_BOOTCOUNT_ENV

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

 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(-)

Comments

Lukasz Majewski Feb. 11, 2018, 7:09 p.m. UTC | #1
On Sun, 11 Feb 2018 12:06:49 +0000
Alex Kiernan <alex.kiernan@gmail.com> wrote:

> This converts the following to Kconfig:
>   CONFIG_BOOTCOUNT_ENV
> 
> Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
> ---
> 
>  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 f51f670..0581b58 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 eb4b1f6..a7b427f 100644
> --- a/include/configs/siemens-am33x-common.h
> +++ b/include/configs/siemens-am33x-common.h
> @@ -500,6 +500,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 46d9d5c..0fd4ad6 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_LIMIT
>  CONFIG_BOOTCOUNT_RAM

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
Lukasz Majewski Feb. 13, 2018, 9:30 a.m. UTC | #2
Hi Alex,

>  - 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:
	^^^^^^^^^^^ - This line shall be keep. The "- Bootcount:" Above
	shall be deleted instead. 

>  		CONFIG_PREBOOT



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
Alex Kiernan Feb. 13, 2018, 9:52 a.m. UTC | #3
On Tue, Feb 13, 2018 at 9:30 AM, Lukasz Majewski <lukma@denx.de> wrote:
> Hi Alex,
>
>>  - 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:
>         ^^^^^^^^^^^ - This line shall be keep. The "- Bootcount:" Above
>         shall be deleted instead.
>

Ooh, good spot!
diff mbox series

Patch

diff --git a/README b/README
index f51f670..0581b58 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 eb4b1f6..a7b427f 100644
--- a/include/configs/siemens-am33x-common.h
+++ b/include/configs/siemens-am33x-common.h
@@ -500,6 +500,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 46d9d5c..0fd4ad6 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_LIMIT
 CONFIG_BOOTCOUNT_RAM