Skip to content

Commit 36ac1ee

Browse files
blauretcarlescufi
authored andcommitted
drivers: entropy: add Renesas SmartBond entropy generator driver
This adds driver for SmartBond TRNG peripheral that with separate ISR an thread data pools. Co-authored-by: Jerzy Kasenberg <[email protected]> Signed-off-by: Ben Lauret <[email protected]>
1 parent d4e9e5f commit 36ac1ee

File tree

7 files changed

+455
-1
lines changed

7 files changed

+455
-1
lines changed

boards/arm/da1469x_dk_pro/da1469x_dk_pro.dts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022 Renesas Electronics Corporation
2+
* Copyright (c) 2022 Renesas Electronics Corporation and/or its affiliates
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

drivers/entropy/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ zephyr_library_sources_ifdef(CONFIG_ENTROPY_MCUX_CAAM entropy_mcux_caam
1212
zephyr_library_sources_ifdef(CONFIG_ENTROPY_MCUX_CSS entropy_mcux_css.c)
1313
zephyr_library_sources_ifdef(CONFIG_ENTROPY_NRF5_RNG entropy_nrf5.c)
1414
zephyr_library_sources_ifdef(CONFIG_ENTROPY_SAM_RNG entropy_sam.c)
15+
zephyr_library_sources_ifdef(CONFIG_ENTROPY_SMARTBOND_TRNG entropy_smartbond.c)
1516
zephyr_library_sources_ifdef(CONFIG_ENTROPY_STM32_RNG entropy_stm32.c)
1617
zephyr_library_sources_ifdef(CONFIG_ENTROPY_LITEX_RNG entropy_litex.c)
1718
zephyr_library_sources_ifdef(CONFIG_FAKE_ENTROPY_NATIVE_POSIX fake_entropy_native_posix.c)

drivers/entropy/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ source "drivers/entropy/Kconfig.stm32"
2727
source "drivers/entropy/Kconfig.esp32"
2828
source "drivers/entropy/Kconfig.nrf5"
2929
source "drivers/entropy/Kconfig.sam"
30+
source "drivers/entropy/Kconfig.smartbond"
3031
source "drivers/entropy/Kconfig.native_posix"
3132
source "drivers/entropy/Kconfig.rv32m1"
3233
source "drivers/entropy/Kconfig.litex"

drivers/entropy/Kconfig.smartbond

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Smartbond TRNG configuration
2+
3+
# Copyright (c) 2023 Renesas Electronics Corporation
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
7+
config ENTROPY_SMARTBOND_TRNG
8+
bool "Renesas Smartbond MCU Family True Random Number Generator (TRNG) Driver"
9+
default y
10+
depends on DT_HAS_RENESAS_SMARTBOND_TRNG_ENABLED
11+
select ENTROPY_HAS_DRIVER
12+
help
13+
Enable True Random Number Generator (TRNG) driver for Renesas Smartbond MCUs.
14+
15+
if ENTROPY_SMARTBOND_TRNG
16+
17+
config ENTROPY_SMARTBOND_THR_POOL_SIZE
18+
int "Thread-mode random number pool size"
19+
range ENTROPY_SMARTBOND_THR_THRESHOLD 256
20+
default 8
21+
help
22+
Buffer length in bytes used to store entropy bytes generated by the
23+
hardware to make them ready for thread mode consumers.
24+
Please note, that size of the pool must be a power of 2.
25+
26+
config ENTROPY_SMARTBOND_THR_THRESHOLD
27+
int "Thread-mode random number pool low-water threshold"
28+
range 4 255
29+
help
30+
Low water-mark threshold in bytes to trigger entropy generation for
31+
thread mode consumers. As soon as the number of available bytes in the
32+
buffer goes below this number hardware entropy generation will be
33+
started.
34+
35+
config ENTROPY_SMARTBOND_ISR_POOL_SIZE
36+
int "ISR-mode random number pool size"
37+
range ENTROPY_SMARTBOND_ISR_THRESHOLD 256
38+
default 16
39+
help
40+
Buffer length in bytes used to store entropy bytes generated by the
41+
hardware to make them ready for ISR consumers.
42+
Please note, that size of the pool must be a power of 2.
43+
44+
config ENTROPY_SMARTBOND_ISR_THRESHOLD
45+
int "ISR-mode random number pool low-water threshold"
46+
range 12 255
47+
help
48+
Low water-mark threshold in bytes to trigger entropy generation for
49+
ISR consumers. As soon as the number of available bytes in the
50+
buffer goes below this number hardware entropy generation will be
51+
started.
52+
53+
endif # ENTROPY_SMARTBOND_TRNG

0 commit comments

Comments
 (0)