Commit 954baea9 authored by Marcus Shawcroft's avatar Marcus Shawcroft Committed by Anas Nashif
Browse files

random: Restructure RANDOM Kconfig



Restructure the RANDOM Kconfig to match the structure used in other
drivers with a single top level menu.  Move the true random number
generators to appear first in the menu, with pseudo generators at the
bottom.  Do not present pseudo generators if a true random generator
is presented.

This change implies that tests, samples and applications that require
the random driver interface must now select CONFIG_RANDOM_GENERATOR.

In order for tests and samples to build (and run) on platforms that
have no random driver it remains necessary to select
the CONFIG_TEST_RANDOM_GENERATOR.

Note that CONFIG_TEST_RANDOM_GENERATOR retains its original purpose of
enabling a random driver that delivers non random numbers for the
purpose of testing only.

Change-Id: I2e28e44b4adf800e64a885aefe36a52da8aa455a
Signed-off-by: default avatarMarcus Shawcroft <marcus.shawcroft@arm.com>
parent fe8d044d
Loading
Loading
Loading
Loading
+16 −16
Original line number Diff line number Diff line
@@ -16,19 +16,28 @@
# limitations under the License.
#

menu "Random Generation Configuration"
config RANDOM_GENERATOR
menuconfig RANDOM_GENERATOR
	bool
	prompt "Custom random generator"
	prompt "Random Drivers"
	default n
	help
	  This option signifies that the target uses a real random number
	  generator.
	  Include RANDOM drivers in system config.

if RANDOM_GENERATOR

source "drivers/random/Kconfig.ksdk"

config RANDOM_HAS_DRIVER
	bool
	default n
	help
	  This is an option to be enabled by individual random driver
	  to signal that there is a true random driver.

config TEST_RANDOM_GENERATOR
	bool
	prompt "Non-random number generator"
	depends on !RANDOM_GENERATOR
	depends on RANDOM_GENERATOR && ! RANDOM_HAS_DRIVER
	default n
	help
	  This option signifies that the kernel's random number APIs are
@@ -56,13 +65,4 @@ config TIMER_RANDOM_GENERATOR
	  clock. This number generator is not random and used for
	  testing only.

config RANDOM_KSDK
	bool
	prompt "KSDK Random driver"
	depends on RANDOM_GENERATOR && HAS_RNGA
	default n
	help
	  This option enables the random number generator accelerator (RNGA)
	  driver based on the KSDK RNGA driver.

endmenu
endif
+24 −0
Original line number Diff line number Diff line
# Kconfig.ksdk - ksdk random generator driver configuration
#
# Copyright (c) 2016 ARM Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

menuconfig RANDOM_KSDK
	bool "KSDK Random driver"
	depends on RANDOM_GENERATOR && HAS_RNGA
	default n
	select RANDOM_HAS_DRIVER
	help
	  This option enables the random number generator accelerator (RNGA)
	  driver based on the KSDK RNGA driver.
+1 −0
Original line number Diff line number Diff line
CONFIG_RANDOM_GENERATOR=y
CONFIG_TEST_RANDOM_GENERATOR=y
CONFIG_BLUETOOTH=y
CONFIG_BLUETOOTH_PERIPHERAL=y
+1 −0
Original line number Diff line number Diff line
CONFIG_MINIMAL_LIBC_EXTENDED=y
CONFIG_RANDOM_GENERATOR=y
CONFIG_TEST_RANDOM_GENERATOR=y
CONFIG_BLUETOOTH=y
CONFIG_BLUETOOTH_CUSTOM=y
+1 −0
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@ CONFIG_NETWORKING=y
CONFIG_NET_IPV4=y
CONFIG_NET_UDP=y
CONFIG_NANO_TIMEOUTS=y
CONFIG_RANDOM_GENERATOR=y
CONFIG_TEST_RANDOM_GENERATOR=y
CONFIG_NET_ARP=y
CONFIG_NET_L2_ETHERNET=y
Loading