2017-09-19 16:01:27 +08:00
|
|
|
# Kconfig.nrf5 - nRF5 entropy generator driver configuration
|
|
|
|
#
|
2018-02-21 04:24:07 +08:00
|
|
|
# Copyright (c) 2018 Nordic Semiconductor ASA
|
2017-09-19 16:01:27 +08:00
|
|
|
# Copyright (c) 2017 Exati Tecnologia Ltda.
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
2019-02-21 23:02:16 +08:00
|
|
|
config ENTROPY_NRF_FORCE_ALT
|
|
|
|
bool
|
|
|
|
depends on SOC_COMPATIBLE_NRF
|
|
|
|
help
|
|
|
|
This option can be enabled to force an alternative implementation
|
|
|
|
of the entropy driver.
|
|
|
|
|
|
|
|
if !ENTROPY_NRF_FORCE_ALT
|
|
|
|
|
2017-09-19 16:01:27 +08:00
|
|
|
menuconfig ENTROPY_NRF5_RNG
|
|
|
|
bool "nRF5 RNG driver"
|
2019-08-08 16:52:20 +08:00
|
|
|
depends on HAS_HW_NRF_RNG
|
2017-09-19 16:01:27 +08:00
|
|
|
select ENTROPY_HAS_DRIVER
|
2019-02-21 22:53:29 +08:00
|
|
|
default y
|
2017-09-19 16:01:27 +08:00
|
|
|
help
|
|
|
|
This option enables the RNG peripheral, which is a random number
|
|
|
|
generator, based on internal thermal noise, that provides a
|
|
|
|
random 8-bit value to the host when read.
|
|
|
|
|
2018-02-21 04:24:07 +08:00
|
|
|
if ENTROPY_NRF5_RNG
|
|
|
|
|
2017-09-19 16:01:27 +08:00
|
|
|
config ENTROPY_NRF5_BIAS_CORRECTION
|
|
|
|
bool "Enable bias correction (uniform distribution)"
|
|
|
|
help
|
|
|
|
This option enables the RNG bias correction, which guarantees a
|
|
|
|
uniform distribution of 0 and 1. When this option is enabled, the time
|
|
|
|
to generate a byte cannot be guaranteed.
|
2018-02-21 04:24:07 +08:00
|
|
|
|
2018-10-04 19:11:37 +08:00
|
|
|
config ENTROPY_NRF5_THR_POOL_SIZE
|
|
|
|
int "Thread-mode random number pool size"
|
|
|
|
range ENTROPY_NRF5_THR_THRESHOLD 256
|
|
|
|
default 8
|
|
|
|
help
|
|
|
|
Buffer length in bytes used to store entropy bytes generated by the
|
|
|
|
hardware to make them ready for thread mode consumers.
|
|
|
|
Please note, that size of the pool must be a power of 2.
|
|
|
|
|
2018-02-21 04:24:07 +08:00
|
|
|
config ENTROPY_NRF5_THR_THRESHOLD
|
2018-10-04 19:11:37 +08:00
|
|
|
int "Thread-mode random number pool low-water threshold"
|
2018-02-21 04:24:07 +08:00
|
|
|
range 4 255
|
|
|
|
help
|
2018-04-04 20:15:43 +08:00
|
|
|
Low water-mark threshold in bytes to trigger entropy generation for
|
|
|
|
thread mode consumers. As soon as the number of available bytes in the
|
|
|
|
buffer goes below this number hardware entropy generation will be
|
|
|
|
started.
|
2018-02-21 04:24:07 +08:00
|
|
|
|
2018-10-04 19:11:37 +08:00
|
|
|
config ENTROPY_NRF5_ISR_POOL_SIZE
|
|
|
|
int "ISR-mode random number pool size"
|
|
|
|
range ENTROPY_NRF5_ISR_THRESHOLD 256
|
|
|
|
default 16
|
|
|
|
help
|
|
|
|
Buffer length in bytes used to store entropy bytes generated by the
|
|
|
|
hardware to make them ready for ISR consumers.
|
|
|
|
Please note, that size of the pool must be a power of 2.
|
|
|
|
|
2018-02-21 04:24:07 +08:00
|
|
|
config ENTROPY_NRF5_ISR_THRESHOLD
|
2018-10-04 19:11:37 +08:00
|
|
|
int "ISR-mode random number pool low-water threshold"
|
2018-02-21 04:24:07 +08:00
|
|
|
range 12 255
|
|
|
|
help
|
2018-04-04 20:15:43 +08:00
|
|
|
Low water-mark threshold in bytes to trigger entropy generation for
|
|
|
|
ISR consumers. As soon as the number of available bytes in the
|
|
|
|
buffer goes below this number hardware entropy generation will be
|
|
|
|
started.
|
2018-02-21 04:24:07 +08:00
|
|
|
|
|
|
|
config ENTROPY_NRF5_PRI
|
|
|
|
int "RNG interrupt priority"
|
|
|
|
range 0 2 if SOC_SERIES_NRF51X
|
2018-10-03 22:36:53 +08:00
|
|
|
range 0 5 if SOC_COMPATIBLE_NRF52X
|
2018-02-21 04:24:07 +08:00
|
|
|
default 2 if SOC_SERIES_NRF51X
|
2018-10-03 22:36:53 +08:00
|
|
|
default 5 if SOC_COMPATIBLE_NRF52X
|
2018-02-21 04:24:07 +08:00
|
|
|
help
|
|
|
|
nRF5X RNG IRQ priority.
|
|
|
|
|
2019-03-07 16:31:33 +08:00
|
|
|
endif # ENTROPY_NRF5_RNG
|
2019-02-21 23:02:16 +08:00
|
|
|
|
|
|
|
endif # !ENTROPY_NRF_FORCE_ALT
|