Skip to content

Commit 53fae56

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]> Signed-off-by: Robert Lubos <[email protected]> Signed-off-by: Rubin Gerritsen <[email protected]> (cherry picked from commit d1f4662)
1 parent bc11d5d commit 53fae56

File tree

5 files changed

+12
-9
lines changed

5 files changed

+12
-9
lines changed

dts/arm/nordic/nrf52840.dtsi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
/ {
99
chosen {
1010
zephyr,bt-hci = &bt_hci_controller;
11-
zephyr,entropy = &rng;
11+
zephyr,entropy = &cryptocell;
1212
zephyr,flash-controller = &flash_controller;
1313
};
1414

@@ -572,7 +572,7 @@
572572
reg = <0x5002a000 0x1000>, <0x5002b000 0x1000>;
573573
reg-names = "wrapper", "core";
574574
interrupts = <42 NRF_DEFAULT_IRQ_PRIORITY>;
575-
status = "disabled";
575+
status = "okay";
576576
};
577577
};
578578
};

dts/arm/nordic/nrf5340_cpuapp.dtsi

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

3636
chosen {
37-
zephyr,entropy = &rng_hci;
37+
zephyr,entropy = &cryptocell;
3838
zephyr,flash-controller = &flash_controller;
3939
};
4040

@@ -104,7 +104,7 @@
104104
reg = <0x50844000 0x1000>, <0x50845000 0x1000>;
105105
reg-names = "wrapper", "core";
106106
interrupts = <68 NRF_DEFAULT_IRQ_PRIORITY>;
107-
status = "disabled";
107+
status = "okay";
108108
};
109109
};
110110

dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ nvic: &cpuapp_nvic {};
1616
/ {
1717
chosen {
1818
zephyr,bt-hci = &bt_hci_controller;
19-
zephyr,entropy = &rng;
19+
zephyr,entropy = &psa_rng;
2020
};
2121

2222
soc {
@@ -32,7 +32,7 @@ nvic: &cpuapp_nvic {};
3232

3333
psa_rng: psa-rng {
3434
compatible = "zephyr,psa-crypto-rng";
35-
status = "disabled";
35+
status = "okay";
3636
};
3737
};
3838

dts/arm/nordic/nrf91.dtsi

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

3030
chosen {
31+
zephyr,entropy = &cryptocell;
3132
zephyr,flash-controller = &flash_controller;
3233
};
3334

@@ -51,7 +52,7 @@
5152
reg = <0x50840000 0x1000>, <0x50841000 0x1000>;
5253
reg-names = "wrapper", "core";
5354
interrupts = <64 NRF_DEFAULT_IRQ_PRIORITY>;
54-
status = "disabled";
55+
status = "okay";
5556
};
5657

5758
ctrlap: ctrlap@50006000 {

soc/nordic/common/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)