Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

entropy: Enable the PSA RNG for nRF54H20 #2008

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
zephyr,bt-hci = &bt_hci_ipc0;
nordic,802154-spinel-ipc = &ipc0;
zephyr,canbus = &can120;
zephyr,entropy = &prng;
zephyr,entropy = &psa_rng;
};

aliases {
Expand Down Expand Up @@ -109,8 +109,8 @@
};
};

prng: prng {
compatible = "nordic,entropy-prng";
psa_rng: psa-rng {
compatible = "zephyr,psa-crypto-rng";
status = "okay";
};
};
Expand Down Expand Up @@ -150,11 +150,16 @@
};

&cpusec_cpuapp_ipc {
status = "okay";
mbox-names = "tx", "rx";
tx-region = <&cpuapp_cpusec_ipc_shm>;
rx-region = <&cpusec_cpuapp_ipc_shm>;
};

&cpusec_bellboard {
status = "okay";
};

ipc0: &cpuapp_cpurad_ipc {
status = "okay";
mbox-names = "rx", "tx";
Expand Down
2 changes: 2 additions & 0 deletions boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,5 @@ CONFIG_EXTERNAL_CACHE=y

# Enable GPIO
CONFIG_GPIO=y

CONFIG_MAX_THREAD_BYTES=3
20 changes: 15 additions & 5 deletions boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,27 @@
zephyr,ieee802154 = &cpurad_ieee802154;
zephyr,bt-hci-ipc = &ipc0;
nordic,802154-spinel-ipc = &ipc0;
zephyr,entropy = &prng;
};
prng: prng {
compatible = "nordic,entropy-prng";
status = "okay";
zephyr,entropy = &psa_rng;
};
aliases {
ipc-to-cpusys = &cpurad_cpusys_ipc;
resetinfo = &cpurad_resetinfo;
};

psa_rng: psa-rng {
compatible = "zephyr,psa-crypto-rng";
status = "okay";
};
};

&cpuapp_cpurad_ram0x_region {
status = "okay";
};

&cpurad_ram0x_region {
status = "okay";
};

&cpurad_bellboard {
status = "okay";
interrupts = <96 NRF_DEFAULT_IRQ_PRIORITY>;
Expand All @@ -60,11 +65,16 @@
};

&cpusec_cpurad_ipc {
status = "okay";
mbox-names = "tx", "rx";
tx-region = <&cpurad_cpusec_ipc_shm>;
rx-region = <&cpusec_cpurad_ipc_shm>;
};

&cpusec_bellboard {
status = "okay";
};

ipc0: &cpuapp_cpurad_ipc {
status = "okay";
mbox-names = "tx", "rx";
Expand Down
2 changes: 2 additions & 0 deletions boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ CONFIG_NULL_POINTER_EXCEPTION_DETECTION_NONE=y
# Enable cache
CONFIG_CACHE_MANAGEMENT=y
CONFIG_EXTERNAL_CACHE=y

CONFIG_MAX_THREAD_BYTES=3
1 change: 1 addition & 0 deletions drivers/entropy/Kconfig.psa_crypto
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ config ENTROPY_PSA_CRYPTO_RNG
depends on DT_HAS_ZEPHYR_PSA_CRYPTO_RNG_ENABLED
select ENTROPY_HAS_DRIVER
select PSA_WANT_GENERATE_RANDOM
select SSF_PSA_CRYPTO_SERVICE_ENABLED if (SOC_SERIES_NRF54HX && !RISCV_CORE_NORDIC_VPR)
default y
help
Enable the PSA Crypto source Entropy driver.
4 changes: 2 additions & 2 deletions soc/nordic/nrf54h/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ config SOC_NRF54H20_CPUAPP_COMMON
select CPU_CORTEX_M33
select CPU_HAS_ARM_MPU
select CPU_HAS_ARM_SAU
select CPU_HAS_DCACHE
select CPU_HAS_DCACHE if !SSF_PSA_CRYPTO_SERVICE_ENABLED
select CPU_HAS_ICACHE
select CPU_HAS_FPU
select CPU_HAS_CUSTOM_FIXED_SOC_MPU_REGIONS
Expand Down Expand Up @@ -44,7 +44,7 @@ config SOC_NRF54H20_CPURAD_COMMON
select CPU_CORTEX_M33
select CPU_HAS_ARM_MPU
select CPU_HAS_ARM_SAU
select CPU_HAS_DCACHE
select CPU_HAS_DCACHE if !SSF_PSA_CRYPTO_SERVICE_ENABLED
select CPU_HAS_ICACHE
select CPU_HAS_FPU
select CPU_HAS_CUSTOM_FIXED_SOC_MPU_REGIONS
Expand Down
5 changes: 4 additions & 1 deletion tests/crypto/mbedtls/testcase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ common:
timeout: 400
tests:
crypto.mbedtls:
platform_exclude: m2gl025_miv
platform_exclude:
- m2gl025_miv
- nrf54h20dk/nrf54h20/cpuapp
- nrf54h20dk/nrf54h20/cpurad
extra_configs:
- CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE=0
- arch:riscv64:CONFIG_ZTEST_STACK_SIZE=8192
Expand Down
3 changes: 2 additions & 1 deletion tests/crypto/mbedtls_psa/testcase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
# latter case will allow to test
# CONFIG_MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG_ALLOW_NON_CSPRNG.
common:
filter: not CONFIG_BUILD_WITH_TFM
filter: not CONFIG_BUILD_WITH_TFM and
not CONFIG_PSA_SSF_CRYPTO_CLIENT
tags:
- mbedtls
- psa
Expand Down
4 changes: 3 additions & 1 deletion tests/crypto/secp256r1/testcase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ common:
CONFIG_CSPRNG_ENABLED and
CONFIG_HARDWARE_DEVICE_CS_GENERATOR and
not CONFIG_BUILD_WITH_TFM and
not (CONFIG_MBEDTLS and CONFIG_TINYCRYPT)
not (CONFIG_MBEDTLS and CONFIG_TINYCRYPT) and
not CONFIG_PSA_SSF_CRYPTO_CLIENT

tags:
- mbedtls
- tinycrypt
Expand Down
1 change: 0 additions & 1 deletion tests/subsys/portability/cmsis_rtos_v2/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ CONFIG_SCHED_SCALABLE=y
CONFIG_CMSIS_V2_MEM_SLAB_MAX_DYNAMIC_SIZE=128
CONFIG_CMSIS_V2_THREAD_MAX_COUNT=23
CONFIG_CMSIS_V2_THREAD_DYNAMIC_MAX_COUNT=10
CONFIG_TIMEOUT_64BIT=n
CONFIG_CMSIS_V2_THREAD_MAX_STACK_SIZE=1024
CONFIG_CMSIS_V2_THREAD_DYNAMIC_STACK_SIZE=1024
CONFIG_MP_MAX_NUM_CPUS=1
Loading