diff --git a/boards/renesas/ek_ra2a1/doc/index.rst b/boards/renesas/ek_ra2a1/doc/index.rst index 6f58f6076242..0c7327a65fe6 100644 --- a/boards/renesas/ek_ra2a1/doc/index.rst +++ b/boards/renesas/ek_ra2a1/doc/index.rst @@ -84,6 +84,8 @@ hardware features: +-----------+------------+-------------------------------+ | PWM | on-chip | pwm | +-----------+------------+-------------------------------+ +| ENTROPY | on-chip | entropy | ++-----------+------------+-------------------------------+ The default configuration can be found in :zephyr_file:`boards/renesas/ek_ra2a1/ek_ra2a1_defconfig` diff --git a/boards/renesas/ek_ra2a1/ek_ra2a1.dts b/boards/renesas/ek_ra2a1/ek_ra2a1.dts index 9821c545d2e7..4de6e45dcbeb 100644 --- a/boards/renesas/ek_ra2a1/ek_ra2a1.dts +++ b/boards/renesas/ek_ra2a1/ek_ra2a1.dts @@ -20,6 +20,7 @@ zephyr,flash = &flash0; zephyr,console = &uart0; zephyr,shell-uart = &uart0; + zephyr,entropy = &trng; }; leds { @@ -93,3 +94,7 @@ interrupt-names = "gtioca", "overflow"; status = "okay"; }; + +&trng { + status = "okay"; +}; diff --git a/boards/renesas/ek_ra4e2/doc/index.rst b/boards/renesas/ek_ra4e2/doc/index.rst index d19e844c8123..27534c424228 100644 --- a/boards/renesas/ek_ra4e2/doc/index.rst +++ b/boards/renesas/ek_ra4e2/doc/index.rst @@ -104,6 +104,8 @@ The below features are currently supported on Zephyr OS for EK-RA4E2 board: +-----------+------------+----------------------+ | PWM | on-chip | pwm | +-----------+------------+----------------------+ +| ENTROPY | on-chip | entropy | ++-----------+------------+----------------------+ Other hardware features are currently not supported by the port. diff --git a/boards/renesas/ek_ra4e2/ek_ra4e2.dts b/boards/renesas/ek_ra4e2/ek_ra4e2.dts index bb181d1159c4..89bef3630d75 100644 --- a/boards/renesas/ek_ra4e2/ek_ra4e2.dts +++ b/boards/renesas/ek_ra4e2/ek_ra4e2.dts @@ -21,6 +21,7 @@ zephyr,console = &uart0; zephyr,shell-uart = &uart0; zephyr,canbus = &canfd0; + zephyr,entropy = &trng; }; leds { @@ -162,3 +163,7 @@ divider = ; status = "okay"; }; + +&trng { + status = "okay"; +}; diff --git a/boards/renesas/ek_ra6e2/doc/index.rst b/boards/renesas/ek_ra6e2/doc/index.rst index 35f27f7fbd7a..0ed53f9a4c08 100644 --- a/boards/renesas/ek_ra6e2/doc/index.rst +++ b/boards/renesas/ek_ra6e2/doc/index.rst @@ -104,6 +104,8 @@ The below features are currently supported on Zephyr OS for EK-RA6E2 board: +-----------+------------+----------------------+ | PWM | on-chip | pwm | +-----------+------------+----------------------+ +| ENTROPY | on-chip | entropy | ++-----------+------------+----------------------+ Other hardware features are currently not supported by the port. diff --git a/boards/renesas/ek_ra6e2/ek_ra6e2.dts b/boards/renesas/ek_ra6e2/ek_ra6e2.dts index b5d83f4b5ecb..741f9ff0c061 100644 --- a/boards/renesas/ek_ra6e2/ek_ra6e2.dts +++ b/boards/renesas/ek_ra6e2/ek_ra6e2.dts @@ -22,6 +22,7 @@ zephyr,console = &uart0; zephyr,shell-uart = &uart0; zephyr,canbus = &canfd0; + zephyr,entropy = &trng; }; leds { @@ -177,3 +178,7 @@ divider = ; status = "okay"; }; + +&trng { + status ="okay"; +}; diff --git a/boards/renesas/fpb_ra6e2/doc/index.rst b/boards/renesas/fpb_ra6e2/doc/index.rst index b953a787fdc2..d037dc20c42c 100644 --- a/boards/renesas/fpb_ra6e2/doc/index.rst +++ b/boards/renesas/fpb_ra6e2/doc/index.rst @@ -91,6 +91,8 @@ The below features are currently supported on Zephyr OS for FPB-RA6E2 board: +-----------+------------+----------------------+ | PWM | on-chip | pwm | +-----------+------------+----------------------+ +| ENTROPY | on-chip | entropy | ++-----------+------------+----------------------+ Other hardware features are currently not supported by the port. diff --git a/boards/renesas/fpb_ra6e2/fpb_ra6e2.dts b/boards/renesas/fpb_ra6e2/fpb_ra6e2.dts index 23b7f47f806c..dc6fe902bae4 100644 --- a/boards/renesas/fpb_ra6e2/fpb_ra6e2.dts +++ b/boards/renesas/fpb_ra6e2/fpb_ra6e2.dts @@ -21,6 +21,7 @@ zephyr,flash = &flash0; zephyr,console = &uart0; zephyr,shell-uart = &uart0; + zephyr,entropy = &trng; }; leds { @@ -123,3 +124,7 @@ divider = ; status = "okay"; }; + +&trng { + status ="okay"; +}; diff --git a/drivers/entropy/Kconfig.renesas_ra b/drivers/entropy/Kconfig.renesas_ra index 8d96f4097848..c6220f6cb0f8 100644 --- a/drivers/entropy/Kconfig.renesas_ra +++ b/drivers/entropy/Kconfig.renesas_ra @@ -7,7 +7,7 @@ config ENTROPY_RENESAS_RA bool "Renesas RA TRNG driver" default y depends on DT_HAS_RENESAS_RA_RSIP_E51A_TRNG_ENABLED || DT_HAS_RENESAS_RA_SCE7_RNG_ENABLED \ - || DT_HAS_RENESAS_RA_SCE5_RNG_ENABLED + || DT_HAS_RENESAS_RA_SCE5_RNG_ENABLED || DT_HAS_RENESAS_RA_TRNG_ENABLED select ENTROPY_HAS_DRIVER select USE_RA_FSP_SCE help diff --git a/drivers/entropy/entropy_renesas_ra.c b/drivers/entropy/entropy_renesas_ra.c index 7537d1c05f90..7510679e376e 100644 --- a/drivers/entropy/entropy_renesas_ra.c +++ b/drivers/entropy/entropy_renesas_ra.c @@ -50,3 +50,4 @@ static int entropy_renesas_ra_init(const struct device *dev) DT_FOREACH_STATUS_OKAY(renesas_ra_rsip_e51a_trng, RENESAS_RA_ENTROPY_INIT) DT_FOREACH_STATUS_OKAY(renesas_ra_sce5_rng, RENESAS_RA_ENTROPY_INIT) DT_FOREACH_STATUS_OKAY(renesas_ra_sce7_rng, RENESAS_RA_ENTROPY_INIT) +DT_FOREACH_STATUS_OKAY(renesas_ra_trng, RENESAS_RA_ENTROPY_INIT) diff --git a/dts/arm/renesas/ra/ra2/r7fa2a1xh.dtsi b/dts/arm/renesas/ra/ra2/r7fa2a1xh.dtsi index a3a40cc95880..f06f9e9965e8 100644 --- a/dts/arm/renesas/ra/ra2/r7fa2a1xh.dtsi +++ b/dts/arm/renesas/ra/ra2/r7fa2a1xh.dtsi @@ -86,6 +86,11 @@ #pwm-cells = <3>; status = "disabled"; }; + + trng: trng { + compatible = "renesas,ra-trng"; + status = "disabled"; + }; }; clocks: clocks { diff --git a/dts/arm/renesas/ra/ra4/r7fa4e2b93cfm.dtsi b/dts/arm/renesas/ra/ra4/r7fa4e2b93cfm.dtsi index 4877ac9ef713..7a92f21a3f6b 100644 --- a/dts/arm/renesas/ra/ra4/r7fa4e2b93cfm.dtsi +++ b/dts/arm/renesas/ra/ra4/r7fa4e2b93cfm.dtsi @@ -74,6 +74,11 @@ status = "disabled"; }; }; + + trng: trng { + compatible = "renesas,ra-trng"; + status = "disabled"; + }; }; clocks: clocks { diff --git a/dts/arm/renesas/ra/ra6/r7fa6e2bx.dtsi b/dts/arm/renesas/ra/ra6/r7fa6e2bx.dtsi index 109617a94e2c..30577ae11039 100644 --- a/dts/arm/renesas/ra/ra6/r7fa6e2bx.dtsi +++ b/dts/arm/renesas/ra/ra6/r7fa6e2bx.dtsi @@ -85,6 +85,11 @@ #pwm-cells = <3>; status = "disabled"; }; + + trng: trng { + compatible = "renesas,ra-trng"; + status = "disabled"; + }; }; clocks: clocks { diff --git a/dts/bindings/rng/renesas,ra-trng.yaml b/dts/bindings/rng/renesas,ra-trng.yaml new file mode 100644 index 000000000000..326624fe489f --- /dev/null +++ b/dts/bindings/rng/renesas,ra-trng.yaml @@ -0,0 +1,8 @@ +# Copyright (c) 2024 Renesas Electronics Corporation +# SPDX-License-Identifier: Apache-2.0 + +description: Renesas RA TRNG + +compatible: "renesas,ra-trng" + +include: base.yaml diff --git a/modules/Kconfig.renesas_fsp b/modules/Kconfig.renesas_fsp index 7e7acb3fe402..2a3756872ce9 100644 --- a/modules/Kconfig.renesas_fsp +++ b/modules/Kconfig.renesas_fsp @@ -73,6 +73,13 @@ config HAS_RENESAS_RA_SCE5 help Includes SCE5 implementation for SCE driver +config HAS_RENESAS_RA_TRNG + bool + default y + depends on DT_HAS_RENESAS_RA_TRNG_ENABLED + help + Includes TRNG implementation for SCE driver + endif config USE_RA_FSP_SPI_B diff --git a/west.yml b/west.yml index 58255875a850..7cd5b22d7358 100644 --- a/west.yml +++ b/west.yml @@ -219,7 +219,7 @@ manifest: - hal - name: hal_renesas path: modules/hal/renesas - revision: 3c68562411cfe2e4bfb8546854fe9a24cb83c71a + revision: 3a8466b2ceca87d05280a071b9b9aabda1915235 groups: - hal - name: hal_rpi_pico