Skip to content

Commit

Permalink
[nrf noup] dts: choose a crypto accelerator for entropy
Browse files Browse the repository at this point in the history
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 d643f17)
  • Loading branch information
joerchan authored and carlescufi committed Nov 22, 2024
1 parent 787a64f commit 4d768de
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
4 changes: 2 additions & 2 deletions dts/arm/nordic/nrf52840.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/ {
chosen {
zephyr,bt-hci = &bt_hci_controller;
zephyr,entropy = &rng;
zephyr,entropy = &cryptocell;
zephyr,flash-controller = &flash_controller;
};

Expand Down Expand Up @@ -562,7 +562,7 @@
reg = <0x5002a000 0x1000>, <0x5002b000 0x1000>;
reg-names = "wrapper", "core";
interrupts = <42 NRF_DEFAULT_IRQ_PRIORITY>;
status = "disabled";
status = "okay";
};
};
};
Expand Down
4 changes: 2 additions & 2 deletions dts/arm/nordic/nrf5340_cpuapp.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
};

chosen {
zephyr,entropy = &rng_hci;
zephyr,entropy = &cryptocell;
zephyr,flash-controller = &flash_controller;
};

Expand Down Expand Up @@ -103,7 +103,7 @@
reg = <0x50844000 0x1000>, <0x50845000 0x1000>;
reg-names = "wrapper", "core";
interrupts = <68 NRF_DEFAULT_IRQ_PRIORITY>;
status = "disabled";
status = "okay";
};
};

Expand Down
3 changes: 2 additions & 1 deletion dts/arm/nordic/nrf54l_05_10_15_cpuapp.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ nvic: &cpuapp_nvic {};
/ {
chosen {
zephyr,bt-hci = &bt_hci_controller;
zephyr,entropy = &psa_rng;
};

soc {
Expand All @@ -26,7 +27,7 @@ nvic: &cpuapp_nvic {};

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

Expand Down
3 changes: 2 additions & 1 deletion dts/arm/nordic/nrf91.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
};

chosen {
zephyr,entropy = &cryptocell;
zephyr,flash-controller = &flash_controller;
};

Expand All @@ -51,7 +52,7 @@
reg = <0x50840000 0x1000>, <0x50841000 0x1000>;
reg-names = "wrapper", "core";
interrupts = <64 NRF_DEFAULT_IRQ_PRIORITY>;
status = "disabled";
status = "okay";
};

ctrlap: ctrlap@50006000 {
Expand Down
6 changes: 4 additions & 2 deletions soc/nordic/common/Kconfig.peripherals
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ config HAS_HW_NRF_BPROT
def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_BPROT))

config HAS_HW_NRF_CC310
def_bool $(dt_compat_enabled,$(DT_COMPAT_ARM_CRYPTOCELL_310))
def_bool $(dt_compat_enabled,$(DT_COMPAT_ARM_CRYPTOCELL_310)) || \
($(dt_nodelabel_enabled,psa_rng) && SOC_SERIES_NRF91X)

config HAS_HW_NRF_CC312
def_bool $(dt_compat_enabled,$(DT_COMPAT_ARM_CRYPTOCELL_312))
def_bool $(dt_compat_enabled,$(DT_COMPAT_ARM_CRYPTOCELL_312)) || \
($(dt_nodelabel_enabled,psa_rng) && SOC_NRF5340_CPUAPP)

config HAS_HW_NRF_CCM
def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_CCM))
Expand Down

0 comments on commit 4d768de

Please sign in to comment.