Skip to content

Commit

Permalink
Convert CONFIG LIB_HW_RAND to Kconfig
Browse files Browse the repository at this point in the history
config_fallbacks.h had some logic to automatically select
LIB_RAND if RANDOM_UUID or CMD_UUID were set if LIB_HW_RAND wasn't
already selected.  By migrating LIB_HW_RAND to Kconfig, we can
remove this check from config_fallbacks.h and put it into Kconfig

Signed-off-by: Adam Ford <[email protected]>
Reviewed-by: Lukasz Majewski <[email protected]>
[trini: Turn into a choice, add NET_RANDOM_ETHADDR]
Signed-off-by: Tom Rini <[email protected]>
  • Loading branch information
aford173 authored and trini committed Feb 8, 2018
1 parent 99bec1a commit a5a3756
Show file tree
Hide file tree
Showing 13 changed files with 19 additions and 20 deletions.
1 change: 1 addition & 0 deletions configs/ds414_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ CONFIG_CMD_FAT=y
CONFIG_CMD_JFFS2=y
CONFIG_CMD_UBI=y
CONFIG_ISO_PARTITION=y
CONFIG_NET_RANDOM_ETHADDR=y
CONFIG_SPL_OF_TRANSLATE=y
# CONFIG_MMC is not set
CONFIG_SPI_FLASH=y
Expand Down
1 change: 1 addition & 0 deletions configs/odroid_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,5 @@ CONFIG_USB_GADGET_DOWNLOAD=y
CONFIG_USB_FUNCTION_THOR=y
CONFIG_USB_HOST_ETHER=y
CONFIG_USB_ETHER_SMSC95XX=y
CONFIG_LIB_HW_RAND=y
CONFIG_ERRNO_STR=y
1 change: 1 addition & 0 deletions configs/trats2_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,4 @@ CONFIG_USB_GADGET_PRODUCT_NUM=0x6601
CONFIG_USB_GADGET_DWC2_OTG=y
CONFIG_USB_GADGET_DOWNLOAD=y
CONFIG_USB_FUNCTION_THOR=y
CONFIG_LIB_HW_RAND=y
1 change: 1 addition & 0 deletions configs/trats_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,4 @@ CONFIG_USB_GADGET_PRODUCT_NUM=0x6601
CONFIG_USB_GADGET_DWC2_OTG=y
CONFIG_USB_GADGET_DOWNLOAD=y
CONFIG_USB_FUNCTION_THOR=y
CONFIG_LIB_HW_RAND=y
7 changes: 0 additions & 7 deletions include/config_fallbacks.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,6 @@
#define CONFIG_LIB_UUID
#endif

#if (defined(CONFIG_RANDOM_UUID) || \
defined(CONFIG_CMD_UUID)) && \
(!defined(CONFIG_LIB_RAND) && \
!defined(CONFIG_LIB_HW_RAND))
#define CONFIG_LIB_RAND
#endif

/* Console I/O Buffer Size */
#ifndef CONFIG_SYS_CBSIZE
#if defined(CONFIG_CMD_KGDB)
Expand Down
4 changes: 0 additions & 4 deletions include/configs/ds414.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,6 @@
/* DS414 bus width is 32bits */
#define CONFIG_DDR_32BIT

/* Use random ethernet address if not configured */
#define CONFIG_LIB_RAND
#define CONFIG_NET_RANDOM_ETHADDR

/* Default Environment */
#define CONFIG_BOOTCOMMAND "sf read ${loadaddr} 0xd0000 0x700000; bootm"
#define CONFIG_LOADADDR 0x80000
Expand Down
1 change: 0 additions & 1 deletion include/configs/odroid.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@

/* Security subsystem - enable hw_rand() */
#define CONFIG_EXYNOS_ACE_SHA
#define CONFIG_LIB_HW_RAND

/* USB */
#define CONFIG_USB_EHCI_EXYNOS
Expand Down
1 change: 0 additions & 1 deletion include/configs/thunderx_88xx.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@
#define CONFIG_CMDLINE_EDITING 1
#define CONFIG_SYS_MAXARGS 64 /* max command args */
#define CONFIG_NO_RELOCATION 1
#define CONFIG_LIB_RAND
#define PLL_REF_CLK 50000000 /* 50 MHz */
#define NS_PER_REF_CLK_TICK (1000000000/PLL_REF_CLK)

Expand Down
1 change: 0 additions & 1 deletion include/configs/trats.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@

/* Security subsystem - enable hw_rand() */
#define CONFIG_EXYNOS_ACE_SHA
#define CONFIG_LIB_HW_RAND

/* Common misc for Samsung */
#define CONFIG_MISC_COMMON
Expand Down
1 change: 0 additions & 1 deletion include/configs/trats2.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@

/* Security subsystem - enable hw_rand() */
#define CONFIG_EXYNOS_ACE_SHA
#define CONFIG_LIB_HW_RAND

/* Common misc for Samsung */
#define CONFIG_MISC_COMMON
Expand Down
18 changes: 15 additions & 3 deletions lib/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,22 @@ config REGEX
regex support to some commands, for example "env grep" and
"setexpr".

config LIB_RAND
bool "Pseudo-random library support "
choice
prompt "Pseudo-random library support type"
depends on NET_RANDOM_ETHADDR || RANDOM_UUID || CMD_UUID
default LIB_RAND
help
This library provides pseudo-random number generator functions.
Select the library to provide pseudo-random number generator
functions. LIB_HW_RAND supports certain hardware engines that
provide this functionality. If in doubt, select LIB_RAND.

config LIB_RAND
bool "Pseudo-random library support"

config LIB_HW_RAND
bool "HW Engine for random libray support"

endchoice

config SPL_TINY_MEMSET
bool "Use a very small memset() in SPL"
Expand Down
1 change: 0 additions & 1 deletion net/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ if NET

config NET_RANDOM_ETHADDR
bool "Random ethaddr if unset"
select LIB_RAND
help
Selecting this will allow the Ethernet interface to function
even when the ethaddr variable for that interface is unset.
Expand Down
1 change: 0 additions & 1 deletion scripts/config_whitelist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1217,7 +1217,6 @@ CONFIG_LEGACY_BOOTCMD_ENV
CONFIG_LG4573
CONFIG_LG4573_BUS
CONFIG_LG4573_CS
CONFIG_LIB_HW_RAND
CONFIG_LIB_UUID
CONFIG_LINUX
CONFIG_LINUX_RESET_VEC
Expand Down

0 comments on commit a5a3756

Please sign in to comment.