[U-Boot] [PATCH 29/47] Convert CONFIG_CMD_HASH to Kconfig

Simon Glass sjg at chromium.org
Mon May 15 10:57:44 UTC 2017


This converts the following to Kconfig:
   CONFIG_CMD_HASH

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 README                                    | 6 ------
 arch/Kconfig                              | 1 +
 arch/arm/Kconfig                          | 1 +
 arch/arm/cpu/armv7/ls102xa/Kconfig        | 1 +
 arch/arm/cpu/armv8/fsl-layerscape/Kconfig | 4 ++++
 arch/arm/include/asm/fsl_secure_boot.h    | 1 -
 arch/arm/mach-exynos/Kconfig              | 1 +
 arch/powerpc/Kconfig                      | 1 +
 cmd/Kconfig                               | 8 ++++++++
 configs/bcm958622hr_defconfig             | 1 +
 configs/ids8313_defconfig                 | 1 +
 include/config_cmd_all.h                  | 1 -
 include/configs/B4860QDS.h                | 1 -
 include/configs/BSC9131RDB.h              | 1 -
 include/configs/BSC9132QDS.h              | 1 -
 include/configs/C29XPCIE.h                | 1 -
 include/configs/P1010RDB.h                | 1 -
 include/configs/P2041RDB.h                | 1 -
 include/configs/T102xQDS.h                | 1 -
 include/configs/T102xRDB.h                | 1 -
 include/configs/T1040QDS.h                | 1 -
 include/configs/T104xRDB.h                | 1 -
 include/configs/T208xQDS.h                | 1 -
 include/configs/T208xRDB.h                | 1 -
 include/configs/T4240QDS.h                | 1 -
 include/configs/T4240RDB.h                | 1 -
 include/configs/bcm_ep_board.h            | 1 -
 include/configs/corenet_ds.h              | 1 -
 include/configs/exynos5-common.h          | 3 ---
 include/configs/ids8313.h                 | 1 -
 include/configs/ls1021aiot.h              | 3 ---
 include/configs/ls1021aqds.h              | 1 -
 include/configs/ls1021atwr.h              | 1 -
 include/configs/ls1043a_common.h          | 1 -
 include/configs/ls1046a_common.h          | 1 -
 include/configs/ls2080a_common.h          | 1 -
 include/configs/sandbox.h                 | 1 -
 scripts/config_whitelist.txt              | 1 -
 38 files changed, 19 insertions(+), 38 deletions(-)

diff --git a/README b/README
index 630986ddc0..aee991cd23 100644
--- a/README
+++ b/README
@@ -846,7 +846,6 @@ The following options need to be configured:
 		CONFIG_CMD_FPGA		  FPGA device initialization support
 		CONFIG_CMD_GO		* the 'go' command (exec code)
 		CONFIG_CMD_GREPENV	* search environment
-		CONFIG_CMD_HASH		* calculate hash / digest
 		CONFIG_CMD_I2C		* I2C serial bus support
 		CONFIG_CMD_IDE		* IDE harddisk support
 		CONFIG_CMD_IMI		  iminfo
@@ -2772,11 +2771,6 @@ The following options need to be configured:
 		but sometimes that is not allowed.
 
 - Hashing support:
-		CONFIG_CMD_HASH
-
-		This enables a generic 'hash' command which can produce
-		hashes / digests from a few algorithms (e.g. SHA1, SHA256).
-
 		CONFIG_HASH_VERIFY
 
 		Enable the hash verify command (hash -v). This adds to code
diff --git a/arch/Kconfig b/arch/Kconfig
index 4eb6f777b6..13f661fc0d 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -68,6 +68,7 @@ config SANDBOX
 	select DM_SPI
 	select DM_GPIO
 	select DM_MMC
+	imply CMD_HASH
 
 config SH
 	bool "SuperH architecture"
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index bac8c2ff94..46f70cc2e5 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -502,6 +502,7 @@ config TARGET_BCM28155_AP
 config TARGET_BCMCYGNUS
 	bool "Support bcmcygnus"
 	select CPU_V7
+	imply CMD_HASH
 
 config TARGET_BCMNSP
 	bool "Support bcmnsp"
diff --git a/arch/arm/cpu/armv7/ls102xa/Kconfig b/arch/arm/cpu/armv7/ls102xa/Kconfig
index b61f3cdcde..690a31b486 100644
--- a/arch/arm/cpu/armv7/ls102xa/Kconfig
+++ b/arch/arm/cpu/armv7/ls102xa/Kconfig
@@ -14,6 +14,7 @@ config ARCH_LS1021A
 	select SYS_FSL_HAS_SEC
 	select SYS_FSL_SEC_COMPAT_5
 	select SYS_FSL_SEC_LE
+	imply CMD_HASH
 
 menu "LS102xA architecture"
 	depends on ARCH_LS1021A
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/Kconfig b/arch/arm/cpu/armv8/fsl-layerscape/Kconfig
index 4c16c4cd0c..8f537f8cde 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/Kconfig
+++ b/arch/arm/cpu/armv8/fsl-layerscape/Kconfig
@@ -7,6 +7,7 @@ config ARCH_LS1012A
 	select SYS_FSL_ERRATUM_A010315
 	select ARCH_EARLY_INIT_R
 	select BOARD_EARLY_INIT_F
+	imply CMD_HASH
 
 config ARCH_LS1043A
 	bool
@@ -26,6 +27,7 @@ config ARCH_LS1043A
 	select SYS_FSL_HAS_DDR4
 	select ARCH_EARLY_INIT_R
 	select BOARD_EARLY_INIT_F
+	imply CMD_HASH
 
 config ARCH_LS1046A
 	bool
@@ -46,6 +48,7 @@ config ARCH_LS1046A
 	select SYS_FSL_SRDS_2
 	select ARCH_EARLY_INIT_R
 	select BOARD_EARLY_INIT_F
+	imply CMD_HASH
 
 config ARCH_LS2080A
 	bool
@@ -79,6 +82,7 @@ config ARCH_LS2080A
 	select SYS_FSL_ERRATUM_A009203
 	select ARCH_EARLY_INIT_R
 	select BOARD_EARLY_INIT_F
+	imply CMD_HASH
 
 config FSL_LSCH2
 	bool
diff --git a/arch/arm/include/asm/fsl_secure_boot.h b/arch/arm/include/asm/fsl_secure_boot.h
index 3212defcf0..0410f7f14e 100644
--- a/arch/arm/include/asm/fsl_secure_boot.h
+++ b/arch/arm/include/asm/fsl_secure_boot.h
@@ -29,7 +29,6 @@
 #define CONFIG_KEY_REVOCATION
 
 #ifndef CONFIG_SPL_BUILD
-#define CONFIG_CMD_HASH
 #ifndef CONFIG_SYS_RAMBOOT
 /* The key used for verification of next level images
  * is picked up from an Extension Table which has
diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index 46981a5933..849f199fb9 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -17,6 +17,7 @@ config ARCH_EXYNOS5
 	bool "Exynos5 SoC family"
 	select CPU_V7
 	select BOARD_EARLY_INIT_F
+	imply CMD_HASH
 	help
 	  Samsung Exynos5 SoC family are based on ARM Cortex-A15 CPU (and
 	  Cortex-A7 CPU in big.LITTLE configuration). There are multiple SoCs
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 0033c35261..2ec26d7b01 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -32,6 +32,7 @@ config MPC85xx
 	select CREATE_ARCH_SYMLINK
 	select SYS_FSL_DDR
 	select SYS_FSL_DDR_BE
+	imply CMD_HASH
 
 config MPC86xx
 	bool "MPC86xx"
diff --git a/cmd/Kconfig b/cmd/Kconfig
index 7243f78d1e..b05e69a8b7 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -996,6 +996,14 @@ config CMD_BLOB
 	  generation/use as key for cryptographic operation. Key
 	  modifier should be 16 byte long.
 
+config CMD_HASH
+	bool "Support 'hash' command"
+	help
+	  This provides a way to hash data in memory using various supported
+	  algorithms (such as SHA1, MD5, CRC32). The computed digest can be
+	  saved to memory or to an environment variable. It is also possible
+	  to verify a hash against data in memory.
+
 config CMD_TPM
 	bool "Enable the 'tpm' command"
 	depends on TPM
diff --git a/configs/bcm958622hr_defconfig b/configs/bcm958622hr_defconfig
index a639336d94..ccfbcc4783 100644
--- a/configs/bcm958622hr_defconfig
+++ b/configs/bcm958622hr_defconfig
@@ -13,6 +13,7 @@ CONFIG_CMD_ASKENV=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_TIME=y
+CONFIG_CMD_HASH=y
 CONFIG_CMD_FAT=y
 # CONFIG_MMC is not set
 CONFIG_SYS_NS16550=y
diff --git a/configs/ids8313_defconfig b/configs/ids8313_defconfig
index 2accd31229..a6dbe029a7 100644
--- a/configs/ids8313_defconfig
+++ b/configs/ids8313_defconfig
@@ -22,6 +22,7 @@ CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_SNTP=y
 CONFIG_CMD_DATE=y
+CONFIG_CMD_HASH=y
 CONFIG_CMD_UBI=y
 # CONFIG_MMC is not set
 CONFIG_MTD_NOR_FLASH=y
diff --git a/include/config_cmd_all.h b/include/config_cmd_all.h
index 2c633e6727..3c238d929f 100644
--- a/include/config_cmd_all.h
+++ b/include/config_cmd_all.h
@@ -13,7 +13,6 @@
  * Alphabetical list of all possible commands.
  */
 
-#define CONFIG_CMD_HASH		/* calculate hash / digest	*/
 #define CONFIG_CMD_IDE		/* IDE harddisk support		*/
 #define CONFIG_CMD_IMMAP	/* IMMR dump support		*/
 #define CONFIG_CMD_IO		/* Access to X86 IO space	*/
diff --git a/include/configs/B4860QDS.h b/include/configs/B4860QDS.h
index 2d1e080df8..214e047c46 100644
--- a/include/configs/B4860QDS.h
+++ b/include/configs/B4860QDS.h
@@ -711,7 +711,6 @@ unsigned long get_board_ddr_clk(void);
 
 /* Hash command with SHA acceleration supported in hardware */
 #ifdef CONFIG_FSL_CAAM
-#define CONFIG_CMD_HASH
 #define CONFIG_SHA_HW_ACCEL
 #endif
 
diff --git a/include/configs/BSC9131RDB.h b/include/configs/BSC9131RDB.h
index 1b342b6d14..1645ecc87b 100644
--- a/include/configs/BSC9131RDB.h
+++ b/include/configs/BSC9131RDB.h
@@ -328,7 +328,6 @@ extern unsigned long get_sdram_size(void);
 
 /* Hash command with SHA acceleration supported in hardware */
 #ifdef CONFIG_FSL_CAAM
-#define CONFIG_CMD_HASH
 #define CONFIG_SHA_HW_ACCEL
 #endif
 
diff --git a/include/configs/BSC9132QDS.h b/include/configs/BSC9132QDS.h
index 3f51625f9b..e497f729b9 100644
--- a/include/configs/BSC9132QDS.h
+++ b/include/configs/BSC9132QDS.h
@@ -526,7 +526,6 @@ combinations. this should be removed later
 
 /* Hash command with SHA acceleration supported in hardware */
 #ifdef CONFIG_FSL_CAAM
-#define CONFIG_CMD_HASH
 #define CONFIG_SHA_HW_ACCEL
 #endif
 
diff --git a/include/configs/C29XPCIE.h b/include/configs/C29XPCIE.h
index c6afb9a208..eaa42545fc 100644
--- a/include/configs/C29XPCIE.h
+++ b/include/configs/C29XPCIE.h
@@ -441,7 +441,6 @@
 
 /* Hash command with SHA acceleration supported in hardware */
 #ifdef CONFIG_FSL_CAAM
-#define CONFIG_CMD_HASH
 #define CONFIG_SHA_HW_ACCEL
 #endif
 
diff --git a/include/configs/P1010RDB.h b/include/configs/P1010RDB.h
index 3e1378b866..4272b5ef4a 100644
--- a/include/configs/P1010RDB.h
+++ b/include/configs/P1010RDB.h
@@ -737,7 +737,6 @@ extern unsigned long get_sdram_size(void);
 
 /* Hash command with SHA acceleration supported in hardware */
 #ifdef CONFIG_FSL_CAAM
-#define CONFIG_CMD_HASH
 #define CONFIG_SHA_HW_ACCEL
 #endif
 
diff --git a/include/configs/P2041RDB.h b/include/configs/P2041RDB.h
index a8cdfe1ea8..da0656b8c8 100644
--- a/include/configs/P2041RDB.h
+++ b/include/configs/P2041RDB.h
@@ -606,7 +606,6 @@ unsigned long get_board_sys_clk(unsigned long dummy);
 
 /* Hash command with SHA acceleration supported in hardware */
 #ifdef CONFIG_FSL_CAAM
-#define CONFIG_CMD_HASH
 #define CONFIG_SHA_HW_ACCEL
 #endif
 
diff --git a/include/configs/T102xQDS.h b/include/configs/T102xQDS.h
index 7e4f097927..06940f6719 100644
--- a/include/configs/T102xQDS.h
+++ b/include/configs/T102xQDS.h
@@ -866,7 +866,6 @@ unsigned long get_board_ddr_clk(void);
 
 /* Hash command with SHA acceleration supported in hardware */
 #ifdef CONFIG_FSL_CAAM
-#define CONFIG_CMD_HASH
 #define CONFIG_SHA_HW_ACCEL
 #endif
 
diff --git a/include/configs/T102xRDB.h b/include/configs/T102xRDB.h
index 8bb6eb57f6..2ed73dcf4c 100644
--- a/include/configs/T102xRDB.h
+++ b/include/configs/T102xRDB.h
@@ -885,7 +885,6 @@ unsigned long get_board_ddr_clk(void);
 
 /* Hash command with SHA acceleration supported in hardware */
 #ifdef CONFIG_FSL_CAAM
-#define CONFIG_CMD_HASH
 #define CONFIG_SHA_HW_ACCEL
 #endif
 
diff --git a/include/configs/T1040QDS.h b/include/configs/T1040QDS.h
index 148de50f59..e14981fcd0 100644
--- a/include/configs/T1040QDS.h
+++ b/include/configs/T1040QDS.h
@@ -669,7 +669,6 @@ unsigned long get_board_ddr_clk(void);
 
 /* Hash command with SHA acceleration supported in hardware */
 #ifdef CONFIG_FSL_CAAM
-#define CONFIG_CMD_HASH
 #define CONFIG_SHA_HW_ACCEL
 #endif
 
diff --git a/include/configs/T104xRDB.h b/include/configs/T104xRDB.h
index 5a3c113a57..936847c477 100644
--- a/include/configs/T104xRDB.h
+++ b/include/configs/T104xRDB.h
@@ -782,7 +782,6 @@ $(SRCTREE)/board/freescale/t104xrdb/t1042d4_sd_rcw.cfg
 
 /* Hash command with SHA acceleration supported in hardware */
 #ifdef CONFIG_FSL_CAAM
-#define CONFIG_CMD_HASH
 #define CONFIG_SHA_HW_ACCEL
 #endif
 
diff --git a/include/configs/T208xQDS.h b/include/configs/T208xQDS.h
index 27693e19b9..8628e35e60 100644
--- a/include/configs/T208xQDS.h
+++ b/include/configs/T208xQDS.h
@@ -754,7 +754,6 @@ unsigned long get_board_ddr_clk(void);
 
 /* Hash command with SHA acceleration supported in hardware */
 #ifdef CONFIG_FSL_CAAM
-#define CONFIG_CMD_HASH
 #define CONFIG_SHA_HW_ACCEL
 #endif
 
diff --git a/include/configs/T208xRDB.h b/include/configs/T208xRDB.h
index 2ebfbb5b76..43b2c6932f 100644
--- a/include/configs/T208xRDB.h
+++ b/include/configs/T208xRDB.h
@@ -699,7 +699,6 @@ unsigned long get_board_ddr_clk(void);
 
 /* Hash command with SHA acceleration supported in hardware */
 #ifdef CONFIG_FSL_CAAM
-#define CONFIG_CMD_HASH
 #define CONFIG_SHA_HW_ACCEL
 #endif
 
diff --git a/include/configs/T4240QDS.h b/include/configs/T4240QDS.h
index 9d4baaa79f..74936d6d9d 100644
--- a/include/configs/T4240QDS.h
+++ b/include/configs/T4240QDS.h
@@ -500,7 +500,6 @@ unsigned long get_board_ddr_clk(void);
 
 /* Hash command with SHA acceleration supported in hardware */
 #ifdef CONFIG_FSL_CAAM
-#define CONFIG_CMD_HASH
 #define CONFIG_SHA_HW_ACCEL
 #endif
 
diff --git a/include/configs/T4240RDB.h b/include/configs/T4240RDB.h
index 8b2a232405..d6b4132d2c 100644
--- a/include/configs/T4240RDB.h
+++ b/include/configs/T4240RDB.h
@@ -698,7 +698,6 @@ unsigned long get_board_ddr_clk(void);
 
 /* Hash command with SHA acceleration supported in hardware */
 #ifdef CONFIG_FSL_CAAM
-#define CONFIG_CMD_HASH
 #define CONFIG_SHA_HW_ACCEL
 #endif
 
diff --git a/include/configs/bcm_ep_board.h b/include/configs/bcm_ep_board.h
index d9b88fa2d3..14a7638aef 100644
--- a/include/configs/bcm_ep_board.h
+++ b/include/configs/bcm_ep_board.h
@@ -67,7 +67,6 @@
 #define CONFIG_FAT_WRITE
 
 /* SHA hashing */
-#define CONFIG_CMD_HASH
 #define CONFIG_HASH_VERIFY
 #define CONFIG_SHA1
 #define CONFIG_SHA256
diff --git a/include/configs/corenet_ds.h b/include/configs/corenet_ds.h
index 85c51ed58b..c0ea195639 100644
--- a/include/configs/corenet_ds.h
+++ b/include/configs/corenet_ds.h
@@ -620,7 +620,6 @@
 
 /* Hash command with SHA acceleration supported in hardware */
 #ifdef CONFIG_FSL_CAAM
-#define CONFIG_CMD_HASH
 #define CONFIG_SHA_HW_ACCEL
 #endif
 
diff --git a/include/configs/exynos5-common.h b/include/configs/exynos5-common.h
index 91976a75bc..ed9d713eef 100644
--- a/include/configs/exynos5-common.h
+++ b/include/configs/exynos5-common.h
@@ -42,8 +42,6 @@
 /* select serial console configuration */
 #define EXYNOS5_DEFAULT_UART_OFFSET	0x010000
 
-#define CONFIG_CMD_HASH
-
 /* Thermal Management Unit */
 #define CONFIG_EXYNOS_TMU
 
@@ -135,7 +133,6 @@
 #endif /*CONFIG_CMD_NET*/
 
 /* SHA hashing */
-#define CONFIG_CMD_HASH
 #define CONFIG_HASH_VERIFY
 #define CONFIG_SHA1
 #define CONFIG_SHA256
diff --git a/include/configs/ids8313.h b/include/configs/ids8313.h
index 7644f09411..9803595e0b 100644
--- a/include/configs/ids8313.h
+++ b/include/configs/ids8313.h
@@ -541,7 +541,6 @@
 #define CONFIG_SYS_BOOTCOUNT_ADDR	0x9
 
 #define CONFIG_IMAGE_FORMAT_LEGACY
-#define CONFIG_CMD_HASH
 #define CONFIG_SHA1
 #define CONFIG_SHA256
 
diff --git a/include/configs/ls1021aiot.h b/include/configs/ls1021aiot.h
index 35d17b96f4..48186f525b 100644
--- a/include/configs/ls1021aiot.h
+++ b/include/configs/ls1021aiot.h
@@ -308,9 +308,6 @@
 /* Hash command with SHA acceleration supported in hardware */
 
 #ifdef CONFIG_FSL_CAAM
-
-#define CONFIG_CMD_HASH
-
 #define CONFIG_SHA_HW_ACCEL
 
 #endif
diff --git a/include/configs/ls1021aqds.h b/include/configs/ls1021aqds.h
index 373de40d29..d2193323ad 100644
--- a/include/configs/ls1021aqds.h
+++ b/include/configs/ls1021aqds.h
@@ -573,7 +573,6 @@ unsigned long get_board_ddr_clk(void);
 
 /* Hash command with SHA acceleration supported in hardware */
 #ifdef CONFIG_FSL_CAAM
-#define CONFIG_CMD_HASH
 #define CONFIG_SHA_HW_ACCEL
 #endif
 
diff --git a/include/configs/ls1021atwr.h b/include/configs/ls1021atwr.h
index 1ff3d9ee9e..a818f12d05 100644
--- a/include/configs/ls1021atwr.h
+++ b/include/configs/ls1021atwr.h
@@ -437,7 +437,6 @@
 
 /* Hash command with SHA acceleration supported in hardware */
 #ifdef CONFIG_FSL_CAAM
-#define CONFIG_CMD_HASH
 #define CONFIG_SHA_HW_ACCEL
 #endif
 
diff --git a/include/configs/ls1043a_common.h b/include/configs/ls1043a_common.h
index 78c34eba3e..3cd8554ae9 100644
--- a/include/configs/ls1043a_common.h
+++ b/include/configs/ls1043a_common.h
@@ -300,7 +300,6 @@
 
 /* Hash command with SHA acceleration supported in hardware */
 #ifdef CONFIG_FSL_CAAM
-#define CONFIG_CMD_HASH
 #define CONFIG_SHA_HW_ACCEL
 #endif
 
diff --git a/include/configs/ls1046a_common.h b/include/configs/ls1046a_common.h
index c380fedf27..d1df75ab78 100644
--- a/include/configs/ls1046a_common.h
+++ b/include/configs/ls1046a_common.h
@@ -229,7 +229,6 @@
 
 /* Hash command with SHA acceleration supported in hardware */
 #ifdef CONFIG_FSL_CAAM
-#define CONFIG_CMD_HASH
 #define CONFIG_SHA_HW_ACCEL
 #endif
 
diff --git a/include/configs/ls2080a_common.h b/include/configs/ls2080a_common.h
index 53686e3412..b5c3495dfb 100644
--- a/include/configs/ls2080a_common.h
+++ b/include/configs/ls2080a_common.h
@@ -231,7 +231,6 @@ unsigned long long get_qixis_addr(void);
 
 /* Hash command with SHA acceleration supported in hardware */
 #ifdef CONFIG_FSL_CAAM
-#define CONFIG_CMD_HASH
 #define CONFIG_SHA_HW_ACCEL
 #endif
 
diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h
index da547c5bb2..cd7a82630e 100644
--- a/include/configs/sandbox.h
+++ b/include/configs/sandbox.h
@@ -102,7 +102,6 @@
 
 /* Can't boot elf images */
 
-#define CONFIG_CMD_HASH
 #define CONFIG_HASH_VERIFY
 #define CONFIG_SHA1
 #define CONFIG_SHA256
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index 0fcdb8d9a6..e2a8e78c4c 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -384,7 +384,6 @@ CONFIG_CM922T_XA10
 CONFIG_CMDLINE_EDITING
 CONFIG_CMDLINE_PS_SUPPORT
 CONFIG_CMDLINE_TAG
-CONFIG_CMD_HASH
 CONFIG_CMD_HD44760
 CONFIG_CMD_HD44780
 CONFIG_CMD_HDMIDETECT
-- 
2.13.0.rc2.291.g57267f2277-goog



More information about the U-Boot mailing list