Skip to content

Commit 2aba137

Browse files
joerchanrlubos
authored andcommitted
[nrf noup] dts: choose a crypto accelerator for entropy
This is a long-term noup patch because crypto driver support is NCS-only for both cryptocell and CRACEN. Set HAS_HW_NRF_CC3XX to be defined in NS build when cryptocell is accessed through the PSA API. We need to know which CC3XX features are available. Set PSA as the entropy source for 54L. PSA is the only NCS-supported interface to CRACEN. Signed-off-by: Georgios Vasilakis <[email protected]> Signed-off-by: Joakim Andersson <[email protected]> Signed-off-by: Dominik Ermel <[email protected]> Signed-off-by: Sebastian Bøe <[email protected]> (cherry picked from commit 499041d) (cherry picked from commit baa4ee7) (cherry picked from commit 4fa3cc9) Signed-off-by: Robert Lubos <[email protected]>
1 parent 3959842 commit 2aba137

File tree

5 files changed

+16
-7
lines changed

5 files changed

+16
-7
lines changed

dts/arm/nordic/nrf52840.dtsi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
/ {
77
chosen {
8-
zephyr,entropy = &rng;
8+
zephyr,entropy = &cryptocell;
99
zephyr,flash-controller = &flash_controller;
1010
};
1111

@@ -547,7 +547,7 @@
547547
reg = <0x5002a000 0x1000>, <0x5002b000 0x1000>;
548548
reg-names = "wrapper", "core";
549549
interrupts = <42 NRF_DEFAULT_IRQ_PRIORITY>;
550-
status = "disabled";
550+
status = "okay";
551551
};
552552
};
553553
};

dts/arm/nordic/nrf5340_cpuapp.dtsi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
};
3434

3535
chosen {
36-
zephyr,entropy = &rng_hci;
36+
zephyr,entropy = &cryptocell;
3737
zephyr,flash-controller = &flash_controller;
3838
};
3939

@@ -102,7 +102,7 @@
102102
reg = <0x50844000 0x1000>, <0x50845000 0x1000>;
103103
reg-names = "wrapper", "core";
104104
interrupts = <68 NRF_DEFAULT_IRQ_PRIORITY>;
105-
status = "disabled";
105+
status = "okay";
106106
};
107107
};
108108

dts/arm/nordic/nrf54l_common.dtsi

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@
2525

2626
chosen {
2727
zephyr,flash-controller = &rram_controller;
28+
zephyr,entropy = &psa_rng;
29+
};
30+
31+
psa_rng: psa-rng {
32+
compatible = "zephyr,psa-crypto-rng";
33+
status = "okay";
2834
};
2935

3036
sw_pwm: sw-pwm {

dts/arm/nordic/nrf91.dtsi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
};
2828

2929
chosen {
30+
zephyr,entropy = &cryptocell;
3031
zephyr,flash-controller = &flash_controller;
3132
};
3233

@@ -50,7 +51,7 @@
5051
reg = <0x50840000 0x1000>, <0x50841000 0x1000>;
5152
reg-names = "wrapper", "core";
5253
interrupts = <64 NRF_DEFAULT_IRQ_PRIORITY>;
53-
status = "disabled";
54+
status = "okay";
5455
};
5556

5657
ctrlap: ctrlap@50006000 {

soc/common/nordic_nrf/Kconfig.peripherals

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ config HAS_HW_NRF_BPROT
1313
def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_BPROT))
1414

1515
config HAS_HW_NRF_CC310
16-
def_bool $(dt_compat_enabled,$(DT_COMPAT_ARM_CRYPTOCELL_310))
16+
def_bool $(dt_compat_enabled,$(DT_COMPAT_ARM_CRYPTOCELL_310)) || \
17+
($(dt_nodelabel_enabled,psa_rng) && SOC_SERIES_NRF91X)
1718

1819
config HAS_HW_NRF_CC312
19-
def_bool $(dt_compat_enabled,$(DT_COMPAT_ARM_CRYPTOCELL_312))
20+
def_bool $(dt_compat_enabled,$(DT_COMPAT_ARM_CRYPTOCELL_312)) || \
21+
($(dt_nodelabel_enabled,psa_rng) && SOC_NRF5340_CPUAPP)
2022

2123
config HAS_HW_NRF_CCM
2224
def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_CCM))

0 commit comments

Comments
 (0)