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: Add PSA rng as the entropy provider for the nrf54h20 #17200

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

Vge0rge
Copy link
Contributor

@Vge0rge Vge0rge commented Sep 5, 2024

No description provided.

@github-actions github-actions bot added manifest changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. labels Sep 5, 2024
@NordicBuilder
Copy link
Contributor

NordicBuilder commented Sep 5, 2024

The following west manifest projects have been modified in this Pull Request:

Name Old Revision New Revision Diff
nrfxlib nrfconnect/sdk-nrfxlib@bcab5c5 (main) nrfconnect/sdk-nrfxlib#1593 nrfconnect/sdk-nrfxlib#1593/files
zephyr nrfconnect/sdk-zephyr@b257192 nrfconnect/sdk-zephyr#2008 nrfconnect/sdk-zephyr#2008/files

Note: This message is automatically posted and updated by the Manifest GitHub Action.

@NordicBuilder
Copy link
Contributor

NordicBuilder commented Sep 5, 2024

CI Information

To view the history of this post, clich the 'edited' button above
Build number: 73

Inputs:

Sources:

sdk-nrf: PR head: 3a115503a01b40c4d6aa065bd521c3ed0073dcd8
nrfxlib: PR head: 1351882cc0602bbfcec8c9d716ea36729933e9a2
zephyr: PR head: c741ec9b758fdc175dcaae678a079508285392d0

more details

sdk-nrf:

PR head: 3a115503a01b40c4d6aa065bd521c3ed0073dcd8
merge base: 046312b6f9c008541e996cf603bf518a02e6503a
target head (main): 6d9e2df3d4d3d9f3d695efcfb72fec85acc05780
Diff

nrfxlib:

PR head: 1351882cc0602bbfcec8c9d716ea36729933e9a2
merge base: bcab5c5f72c8953be2a45c4529e4a70e70ffa6ae
target head (main): bcab5c5f72c8953be2a45c4529e4a70e70ffa6ae
Diff

zephyr:

PR head: c741ec9b758fdc175dcaae678a079508285392d0
merge base: b2571927ed316e0ae110bffdc5f35311c80511aa
target head (main): b2571927ed316e0ae110bffdc5f35311c80511aa
Diff

Github labels

Enabled Name Description
ci-disabled Disable the ci execution
ci-all-test Run all of ci, no test spec filtering will be done
ci-force-downstream Force execution of downstream even if twister fails
ci-run-twister Force run twister
ci-run-zephyr-twister Force run zephyr twister
List of changed files detected by CI (34)
applications
│  ├── matter_bridge
│  │  ├── sysbuild
│  │  │  ├── ipc_radio
│  │  │  │  ├── boards
│  │  │  │  │  │ nrf54h20dk_nrf54h20_cpurad.conf
nrfxlib
│  ├── nrf_rpc
│  │  ├── include
│  │  │  │ nrf_rpc.h
│  │  │ nrf_rpc.c
samples
│  ├── matter
│  │  ├── common
│  │  │  ├── dts
│  │  │  │  ├── nrf54h20
│  │  │  │  │  │ nrf54h20_ram_allocation.dtsi
│  ├── suit
│  │  ├── flash_companion
│  │  │  ├── boards
│  │  │  │  │ nrf54h20dk_nrf54h20_cpuapp.overlay
│  │  ├── smp_transfer
│  │  │  ├── sysbuild
│  │  │  │  │ nrf54h20dk_nrf54h20_memory_map.dtsi
subsys
│  ├── CMakeLists.txt
│  ├── nrf_security
│  │  ├── CMakeLists.txt
│  │  ├── Kconfig
│  │  ├── Kconfig.psa
│  │  ├── include
│  │  │  │ ssf_crypto_config_empty.h
│  │  ├── src
│  │  │  ├── drivers
│  │  │  │  │ Kconfig
│  │  │  ├── ssf_secdom
│  │  │  │  │ Kconfig
│  ├── sdfw_services
│  │  ├── Kconfig
│  │  ├── os
│  │  │  │ ssf_client_zephyr.c
│  │  ├── services
│  │  │  ├── psa_crypto
│  │  │  │  │ psa_crypto_service.c
│  │  ├── transport
│  │  │  ├── nrf_rpc
│  │  │  │  │ ssf_client_nrf_rpc.c
tests
│  ├── benchmarks
│  │  ├── multicore
│  │  │  ├── idle
│  │  │  │  ├── boards
│  │  │  │  │  ├── nrf54h20dk_nrf54h20_cpuapp_ram_high_usage.overlay
│  │  │  │  │  ├── nrf54h20dk_nrf54h20_cpuapp_ram_low_usage.overlay
│  │  │  │  │  │ nrf54h20dk_nrf54h20_cpurad.overlay
│  ├── subsys
│  │  ├── dfu
│  │  │  ├── dfu_target
│  │  │  │  ├── suit
│  │  │  │  │  ├── boards
│  │  │  │  │  │  │ nrf54h20dk_nrf54h20_cpuapp.overlay
west.yml
zephyr
│  ├── boards
│  │  ├── nordic
│  │  │  ├── nrf54h20dk
│  │  │  │  ├── Kconfig.defconfig
│  │  │  │  ├── nrf54h20dk_nrf54h20-memory_map.dtsi
│  │  │  │  ├── nrf54h20dk_nrf54h20_cpuapp.dts
│  │  │  │  │ nrf54h20dk_nrf54h20_cpurad.dts
│  ├── drivers
│  │  ├── entropy
│  │  │  │ Kconfig.psa_crypto
│  ├── samples
│  │  ├── bluetooth
│  │  │  ├── hci_ipc
│  │  │  │  ├── boards
│  │  │  │  │  │ nrf54h20dk_nrf54h20_cpurad.conf
│  ├── soc
│  │  ├── nordic
│  │  │  ├── nrf54h
│  │  │  │  │ Kconfig
│  ├── tests
│  │  ├── arch
│  │  │  ├── arm
│  │  │  │  ├── arm_thread_swap
│  │  │  │  │  ├── boards
│  │  │  │  │  │  │ nrf54h20dk_nrf54h20_cpuapp.overlay
│  │  ├── crypto
│  │  │  ├── mbedtls
│  │  │  │  │ testcase.yaml
│  │  │  ├── mbedtls_psa
│  │  │  │  │ testcase.yaml
│  │  │  ├── secp256r1
│  │  │  │  │ testcase.yaml
│  │  ├── subsys
│  │  │  ├── portability
│  │  │  │  ├── cmsis_rtos_v2
│  │  │  │  │  │ prj.conf

Outputs:

Toolchain

Version: b77d8c1312
Build docker image: docker-dtr.nordicsemi.no/sw-production/ncs-build:b77d8c1312_912848a074

Test Spec & Results: ✅ Success; ❌ Failure; 🟠 Queued; 🟡 Progress; ◻️ Skipped; ⚠️ Quarantine

  • ◻️ Toolchain - Skipped: existing toolchain is used
  • ✅ Build twister
    • sdk-nrf test count: 1791
    • sdk-zephyr test count: 5944
  • ❌ Integration tests
    • ✅ test-sdk-audio
    • ✅ test-fw-nrfconnect-boot
    • ❌ test_ble_nrf_config
    • ✅ test-fw-nrfconnect-ble_samples
    • ✅ test-fw-nrfconnect-chip
    • ❌ test-fw-nrfconnect-nfc - Error: Error starting job: null
    • ✅ test-fw-nrfconnect-nrf_crypto
    • ✅ test-fw-nrfconnect-rpc
    • ❌ test-fw-nrfconnect-rs
    • ✅ test-fw-nrfconnect-fem
    • ✅ test-fw-nrfconnect-tfm
    • ✅ test-fw-nrfconnect-thread
    • ✅ test-sdk-find-my
    • ✅ test-sdk-sidewalk
    • ✅ test-low-level
    • ✅ test-sdk-mcuboot
    • ❌ test-sdk-dfu
    • ⚠️ test-fw-nrfconnect-fw-update
    • ⚠️ test-fw-nrfconnect-nrf-iot_cloud
    • ⚠️ test-sdk-dfu
Disabled integration tests
    • desktop52_verification
    • doc-internal
    • test-fw-nrfconnect-apps
    • test-fw-nrfconnect-ble_mesh
    • test-fw-nrfconnect-nrf-iot_libmodem-nrf
    • test-fw-nrfconnect-nrf-iot_lwm2m
    • test-fw-nrfconnect-nrf-iot_mosh
    • test-fw-nrfconnect-nrf-iot_nrf_provisioning
    • test-fw-nrfconnect-nrf-iot_positioning
    • test-fw-nrfconnect-nrf-iot_samples
    • test-fw-nrfconnect-nrf-iot_serial_lte_modem
    • test-fw-nrfconnect-nrf-iot_thingy91
    • test-fw-nrfconnect-nrf-iot_zephyr_lwm2m
    • test-fw-nrfconnect-ps
    • test-fw-nrfconnect-zigbee
    • test-sdk-pmic-samples
    • test-sdk-wifi
    • test-secdom-samples-public

Note: This message is automatically posted and updated by the CI

@Vge0rge Vge0rge marked this pull request as ready for review September 24, 2024 10:48
@Vge0rge Vge0rge requested review from a team as code owners September 24, 2024 10:48
@NordicBuilder
Copy link
Contributor

You can find the documentation preview for this PR at this link. It will be updated about 10 minutes after the documentation build succeeds.

Note: This comment is automatically posted by the Documentation Publishing GitHub Action.

@Vge0rge Vge0rge force-pushed the 54h20_psa_rng branch 7 times, most recently from 114059e to 6ed58b2 Compare September 27, 2024 12:24
@Vge0rge Vge0rge requested a review from a team as a code owner October 1, 2024 07:43
Copy link
Contributor

@tomi-font tomi-font left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again in this PR you have a commit that is later reverted (nrf_security: Enabled by default for nRF54H20)?

subsys/nrf_security/Kconfig Show resolved Hide resolved
subsys/nrf_security/Kconfig Outdated Show resolved Hide resolved
subsys/nrf_security/CMakeLists.txt Outdated Show resolved Hide resolved
@endre-nordic endre-nordic added this to the 2.8.0 milestone Oct 18, 2024
@frkv frkv self-requested a review October 18, 2024 08:08
Copy link
Contributor

@frkv frkv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are lots of complex additions in this PR that seem to be tailored towards a special case without PSA crypto which is the default enabled and default supported in nRF54H20 devices

@Vge0rge Vge0rge force-pushed the 54h20_psa_rng branch 4 times, most recently from b8fb7cd to 7e9300c Compare October 21, 2024 10:32
@ArekBalysNordic
Copy link
Contributor

I'm testing this PR in Matter and I can see that it introduces a regression and the application core doesn't boot anymore, even the GDB connection doesn't work. I'm getting boot_status: 0x0b8ffff2 which means "An error occurred while allocating global resources". Does somebody have an idea of how the change here may impact global resource allocation?

@jnsgsr
Copy link
Contributor

jnsgsr commented Nov 21, 2024

I'm testing this PR in Matter and I can see that it introduces a regression and the application core doesn't boot anymore, even the GDB connection doesn't work. I'm getting boot_status: 0x0b8ffff2 which means "An error occurred while allocating global resources". Does somebody have an idea of how the change here may impact global resource allocation?

The same results in DFU tests, application do not boot

@@ -20,3 +20,11 @@
&usbhs {
status = "disabled";
};

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does not help for high current consumption...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will revert this commit , the low level tests are passing now but the reason that they failed before was not that I enabled these dts entries.

Make all PSA drivers depend on the OBERON_PSA_CORE
since we cannot use the drivers without it.

Signed-off-by: Georgios Vasilakis <[email protected]>
Brings Zephyr changes which automatically enable
the PSA crypto as the entropy generator for Zephyr.

Signed-off-by: Georgios Vasilakis <[email protected]>
Add configuration to allow enabling the SSF PSA client
when nrf_security is not enabled.
This is particularly useful for the applications that only
want to use the PSA rng and no other crypto. Enabling
nrf_security in these applications will result to an
increased application footprint and configuration complexity
without any reason.

This configuration provides the PSA implementation
from the secure domain through the SSF client and
it has no configurability yet. So there is no need
to enforce NRF_SECURITY with this configuration.

Signed-off-by: Georgios Vasilakis <[email protected]>
Add overlay to reduce the footprint of the matter_bridge
application.

Signed-off-by: Georgios Vasilakis <[email protected]>
Remove prng dts node since this is removed from the
nrf54h20 board file.

Signed-off-by: Georgios Vasilakis <[email protected]>
tomi-font and others added 9 commits November 28, 2024 16:55
The changes to enable PSA RNG on 54H20 made
sample.suit.smp_transfer.recovery overflow ROM on recovery_hci_ipc.
Slightly increase the size of the cpurad_recovery_partition so that
everything fits.

Also add this offset to the cpuapp_rx_partitions since the
cpuapp_rx_partitions and the cpurad_rx_partitions cannot
overlap.

Signed-off-by: Tomi Fontanilles <[email protected]>
Signed-off-by: Georgios Vasilakis <[email protected]>
Remove the call to the ssf_psa_crypto_init since the
psa_crypto is initialiazed in SDFW and it doesn't need
to get initialized from the application.

Signed-off-by: Georgios Vasilakis <[email protected]>
Disable the IPC and bellboard nodes since these
tests don't use communication between domains.

Signed-off-by: Georgios Vasilakis <[email protected]>
In a comment, tHe -> The

Signed-off-by: Georgios Vasilakis <[email protected]>
Initialize the ssf_client earlier during the boot
process during post kernel.

ssf_client needs to be initialized before the
CONFIG_NRF_802154_SER_RADIO_INIT_PRIO since it is
used by the "nRF IEEE 802.15.4" protocol.

It also needs to be initialied after the IPC
IPC_SERVICE_REG_BACKEND_PRIORITY since the
IPC expects the protocol to be initialized.
Failing to do that will also trigger an assertion
in Zephyr.

Signed-off-by: Georgios Vasilakis <[email protected]>
Use nrf_rpc_init_group when ssf_client is being initalized
since it will happen before other nrf_rpc groups are initialized.

Signed-off-by: Georgios Vasilakis <[email protected]>
Disable the cpusec related nodes in the multicore benchmark
since it increases power consumption and IPC communication
with secure domain is not needed for this test.

Signed-off-by: Georgios Vasilakis <[email protected]>
The cpuapp_ram0x_region has been changed in the global dtsi file in
Zephyr and we need to align all dts overlay entries to that change.

Signed-off-by: Arkadiusz Balys <[email protected]>
Updates the nrf_rpc library to allow initialization
of single nrf_rpc groups.

Signed-off-by: Georgios Vasilakis <[email protected]>
@Vge0rge
Copy link
Contributor Author

Vge0rge commented Nov 29, 2024

FYI: The issue with the Matter and the DFU tests and the low level tests failing to boot was a configuration issue, there were regions owned by the application core and the radio core which overlapped. This was a misconfiguration and it is not allowed, secure domain fails to boot when it identifies this and thus any other application cannot boot as well.
This is now fixed in this PR.

@Vge0rge
Copy link
Contributor Author

Vge0rge commented Nov 29, 2024

@nrfconnect/ncs-charon @nrfconnect/ncs-matter @adamkondraciuk could you please review this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. DNM manifest manifest-nrfxlib manifest-zephyr
Projects
None yet
Development

Successfully merging this pull request may close these issues.