1# nRF5 entropy generator driver configuration
2
3# Copyright (c) 2018 Nordic Semiconductor ASA
4# Copyright (c) 2017 Exati Tecnologia Ltda.
5# SPDX-License-Identifier: Apache-2.0
6
7config ENTROPY_NRF_FORCE_ALT
8	bool
9	depends on SOC_COMPATIBLE_NRF
10	help
11	  This option can be enabled to force an alternative implementation
12	  of the entropy driver.
13
14menuconfig ENTROPY_NRF5_RNG
15	bool "nRF5 RNG driver"
16	default y
17	depends on !ENTROPY_NRF_FORCE_ALT
18	depends on DT_HAS_NORDIC_NRF_RNG_ENABLED
19	select ENTROPY_HAS_DRIVER
20	help
21	  This option enables the RNG peripheral, which is a random number
22	  generator, based on internal thermal noise, that provides a
23	  random 8-bit value to the host when read.
24
25if ENTROPY_NRF5_RNG
26
27config ENTROPY_NRF5_BIAS_CORRECTION
28	bool "Bias correction (uniform distribution)"
29	help
30	  This option enables the RNG bias correction, which guarantees a
31	  uniform distribution of 0 and 1. When this option is enabled, the time
32	  to generate a byte cannot be guaranteed.
33
34config ENTROPY_NRF5_THR_POOL_SIZE
35	int "Thread-mode random number pool size"
36	range ENTROPY_NRF5_THR_THRESHOLD 256
37	default 8
38	help
39	  Buffer length in bytes used to store entropy bytes generated by the
40	  hardware to make them ready for thread mode consumers.
41	  Please note, that size of the pool must be a power of 2.
42
43config ENTROPY_NRF5_THR_THRESHOLD
44	int "Thread-mode random number pool low-water threshold"
45	range 4 255
46	help
47	  Low water-mark threshold in bytes to trigger entropy generation for
48	  thread mode consumers. As soon as the number of available bytes in the
49	  buffer goes below this number hardware entropy generation will be
50	  started.
51
52config ENTROPY_NRF5_ISR_POOL_SIZE
53	int "ISR-mode random number pool size"
54	range ENTROPY_NRF5_ISR_THRESHOLD 256
55	default 16
56	help
57	  Buffer length in bytes used to store entropy bytes generated by the
58	  hardware to make them ready for ISR consumers.
59	  Please note, that size of the pool must be a power of 2.
60
61config ENTROPY_NRF5_ISR_THRESHOLD
62	int "ISR-mode random number pool low-water threshold"
63	range 12 255
64	help
65	  Low water-mark threshold in bytes to trigger entropy generation for
66	  ISR consumers. As soon as the number of available bytes in the
67	  buffer goes below this number hardware entropy generation will be
68	  started.
69
70endif # ENTROPY_NRF5_RNG
71