Skip to content

DNM: Testing out PSA init in PRE_KERNEL_1 ncs #2447

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

Open
wants to merge 2,228 commits into
base: main
Choose a base branch
from

Conversation

frkv
Copy link
Contributor

@frkv frkv commented Jan 24, 2025

Built on top of pull/2411

@NordicBuilder
Copy link
Contributor

NordicBuilder commented Jan 24, 2025

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

Name Old Revision New Revision Diff
cmsis-dsp zephyrproject-rtos/cmsis-dsp@6489e77 (zephyr-3.6) zephyrproject-rtos/cmsis-dsp@d80a49b (zephyr-4.0) zephyrproject-rtos/cmsis-dsp@6489e771..d80a49b2
cmsis_6 N/A zephyrproject-rtos/CMSIS_6@783317a (main) N/A
hal_adi zephyrproject-rtos/hal_adi@de5dadb zephyrproject-rtos/hal_adi@b1a1023 zephyrproject-rtos/hal_adi@de5dadb5..b1a10239
hal_ambiq zephyrproject-rtos/hal_ambiq@df4a986 zephyrproject-rtos/hal_ambiq@87a188b zephyrproject-rtos/hal_ambiq@df4a9863..87a188b9
hal_espressif zephyrproject-rtos/hal_espressif@aa6a967 zephyrproject-rtos/hal_espressif@e523710 zephyrproject-rtos/hal_espressif@aa6a967d..e5237102
hal_ethos_u zephyrproject-rtos/hal_ethos_u@8e2cf75 zephyrproject-rtos/hal_ethos_u@50ddffc (main) zephyrproject-rtos/hal_ethos_u@8e2cf756..50ddffca
hal_infineon zephyrproject-rtos/hal_infineon@88d2529 zephyrproject-rtos/hal_infineon@a9b75e0 zephyrproject-rtos/hal_infineon@88d2529a..a9b75e0d
hal_intel zephyrproject-rtos/hal_intel@0905a52 zephyrproject-rtos/hal_intel@0355bb8 (main) zephyrproject-rtos/hal_intel@0905a528..0355bb81
hal_nordic zephyrproject-rtos/hal_nordic@fae1542 zephyrproject-rtos/hal_nordic@ecea8cd zephyrproject-rtos/hal_nordic@fae15426..ecea8cdb
hal_nxp zephyrproject-rtos/hal_nxp@f4e26fa zephyrproject-rtos/hal_nxp@0ac8302 zephyrproject-rtos/hal_nxp@f4e26fad..0ac83023
hal_renesas zephyrproject-rtos/hal_renesas@1ec8891 zephyrproject-rtos/hal_renesas@64fce2e zephyrproject-rtos/hal_renesas@1ec88911..64fce2e5
hal_rpi_pico zephyrproject-rtos/hal_rpi_pico@fba7162 zephyrproject-rtos/hal_rpi_pico@79ee0f9 zephyrproject-rtos/hal_rpi_pico@fba7162c..79ee0f9e
hal_silabs zephyrproject-rtos/hal_silabs@4c813a1 zephyrproject-rtos/hal_silabs@6371fa8 zephyrproject-rtos/hal_silabs@4c813a1f..6371fa82
hal_st zephyrproject-rtos/hal_st@b2f548f zephyrproject-rtos/hal_st@05fd453 (master) zephyrproject-rtos/hal_st@b2f548fe..05fd4533
hal_stm32 zephyrproject-rtos/hal_stm32@c4099c2 zephyrproject-rtos/hal_stm32@3784237 zephyrproject-rtos/hal_stm32@c4099c22..37842371
hal_tdk N/A zephyrproject-rtos/hal_tdk@e0ade95 N/A
hal_wch N/A zephyrproject-rtos/hal_wch@1de9d3e (main) N/A
hal_wurthelektronik zephyrproject-rtos/hal_wurthelektronik@e5bcb2e zephyrproject-rtos/hal_wurthelektronik@e3e2797 (zephyr) zephyrproject-rtos/hal_wurthelektronik@e5bcb2ea..e3e2797b
hal_xtensa zephyrproject-rtos/hal_xtensa@a2d6585 zephyrproject-rtos/hal_xtensa@baa56aa zephyrproject-rtos/hal_xtensa@a2d65852..baa56aa3
hostap zephyrproject-rtos/hostap@4428531 zephyrproject-rtos/hostap#76 zephyrproject-rtos/hostap#76/files
liblc3 zephyrproject-rtos/liblc3@1a5938e zephyrproject-rtos/liblc3@bb85f7d (main) zephyrproject-rtos/liblc3@1a5938eb..bb85f7dd
libmetal zephyrproject-rtos/libmetal@a6851ba zephyrproject-rtos/libmetal@3e8781a (main) zephyrproject-rtos/libmetal@a6851ba6..3e8781aa
lvgl zephyrproject-rtos/lvgl@2b498e6 zephyrproject-rtos/lvgl@6decbb7 (master) zephyrproject-rtos/lvgl@2b498e6f..6decbb7f
mbedtls zephyrproject-rtos/mbedtls@fb36f3f zephyrproject-rtos/mbedtls@4952e13 (zephyr) zephyrproject-rtos/mbedtls@fb36f3fe..4952e132
mcuboot zephyrproject-rtos/mcuboot@e890df7 zephyrproject-rtos/mcuboot@a2bc982 (main) zephyrproject-rtos/mcuboot@e890df7a..a2bc982b
nanopb zephyrproject-rtos/nanopb@4474bd3 zephyrproject-rtos/nanopb@7307ce3 (master) zephyrproject-rtos/nanopb@4474bd35..7307ce39
nrf_wifi zephyrproject-rtos/nrf_wifi@f6b950a zephyrproject-rtos/nrf_wifi@0f53c9e zephyrproject-rtos/nrf_wifi@f6b950a3..0f53c9eb
open-amp zephyrproject-rtos/open-amp@b735edb zephyrproject-rtos/open-amp@52bb178 (main) zephyrproject-rtos/open-amp@b735edbc..52bb1783
percepio zephyrproject-rtos/percepio@b68d179 zephyrproject-rtos/percepio@0d44033 zephyrproject-rtos/percepio@b68d1799..0d44033c
picolibc zephyrproject-rtos/picolibc@27746bb zephyrproject-rtos/picolibc@82d62ed (zephyr-no-lto) zephyrproject-rtos/picolibc@27746bbc..82d62ed1
segger zephyrproject-rtos/segger@b011c45 zephyrproject-rtos/segger@cf56b1d (master) zephyrproject-rtos/segger@b011c45b..cf56b1d9
sof zephyrproject-rtos/sof@0e4c4ef zephyrproject-rtos/sof@bc08c9c (zephyr) zephyrproject-rtos/sof@0e4c4efc..bc08c9c6
tf-m-tests zephyrproject-rtos/tf-m-tests@d552e4f zephyrproject-rtos/tf-m-tests@502ea90 (main,v3.7-branch) zephyrproject-rtos/tf-m-tests@d552e4f1..502ea901
trusted-firmware-m zephyrproject-rtos/trusted-firmware-m@a11cd27 zephyrproject-rtos/trusted-firmware-m@fa020a8 zephyrproject-rtos/trusted-firmware-m@a11cd279..fa020a8b
zcbor zephyrproject-rtos/zcbor@47f34dd zephyrproject-rtos/zcbor@9b07780 (main) zephyrproject-rtos/zcbor@47f34dd7..9b07780a
zephyr-lang-rust N/A zephyrproject-rtos/zephyr-lang-rust@7af3db4 (v4.0-branch) N/A

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

nashif and others added 28 commits January 29, 2025 12:27
Allowed toolchains was not set in 'board' metadata causing those to not
build and get filtered.

Fixes #83792

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
(cherry picked from commit 1f48740)
… handling

Move enabling of counter to the test instead of test setup. Test may be
skipped in some configurations and in that case counter shall not be
started so by moving setup to the test code allows skipping test before
counter is started.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
(cherry picked from commit 1ee434a)
…e PM

uart120 requires device runtime to be enable. Enable it for nrf54h20dk.

When device runtime PM is used for interrupt driven and polling API
then UART device is initially suspended. It means that RX is disabled.
In order to enable RX device must be explicitly resumed using PM API.

Test is enabling UART RX (uart_rx_enable) from counter callback
(interrupt handler context). For fast instance on nrf54h20dk (uart120)
it is not allowed because PM resume can only be called from the thread
context. Because of that, test is skipped for uart120 and asynchronous
API.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
(cherry picked from commit cc12f65)
Add check for MBO feature before including the source file.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
(cherry picked from commit 0953ea0)
Zephyr introduced postive feature flags to make advanced features
conditional but the upstream has followed a negative feature flag
for advanced features, and during upmerge these two weren't reconciled.

Fix the build in case advanced features are disabled.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
(cherry picked from commit d909634)
…ed features

This feature is handy to free up some memory, so, make sure it always
builds.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
(cherry picked from commit 7532e73)
Default is always disabled.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
(cherry picked from commit 819acf1)
Fixes build issue when WMM AC feature is disabled.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
(cherry picked from commit 2350b6b)
Remove the HCI command & event emulation layer for ECDH commands and
events. This means that we always do the necessary operations in the host.
The existing BT_ECC Kconfig option stays, but now gets automatically
enabled when necessary (e.g. based on the BT_SMP option), which is why this
commit removes so many explicit assignments in prj.conf files.

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
(cherry picked from commit 09e86f3)
This option only exposes internal APIs, so there should be no need to allow
applications to set an explicit value. Instead, users of the API should
select it through Kconfig.

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
(cherry picked from commit d3c8cb4)
Mention the removed prompt for BT_ECC in the migration guide, and also add
a note about the removed HCI emulation layer to the release notes.

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
(cherry picked from commit b3c6151)
…got deprecated

This is a follow-up to commit 8cfad44.

Replace the deprecated BT_LE_ADV_CONN macro with BT_LE_ADV_CONN_FAST_2.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
(cherry picked from commit f930739)
-liblc3 added a library-internal path to zephyr_interface containing
 a file that collides with common.h required e.g. by Mbed TLS
 This commit fixes build-issues by making this include-folder
 PRIVATE to the named library liblc3

Signed-off-by: Frank Audun Kvamtrø <frank.kvamtro@nordicsemi.no>
(cherry picked from commit 2ca64a3)
-Mbed TLS requires common.h to build. The sample provides common.h
 in sample folder level but included the path to zephyr_interface.
 This commit changes the include to be sample-specific

Signed-off-by: Frank Audun Kvamtrø <frank.kvamtro@nordicsemi.no>
(cherry picked from commit 627d2f9)
…rm_zeroize

-Adding explicit include for mbedtls/platform_util.h to get acces
 to mbedtls_platform_zeroize in ITS. Somehow not visibile in Zephyr but
 it caused build issues in nRF Connect SDK.

Signed-off-by: Frank Audun Kvamtrø <frank.kvamtro@nordicsemi.no>
(cherry picked from commit 202c2c4)
…he boards

Bring the change that was already in place for the qemu_cortex_m3 board
to all the other ones, since also nrf52840 had a similar problem
(see issue #82812).

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
(cherry picked from commit 9d0b124)
The BT Host module also uses import/export PSA functions alongside the
generate one, so these PSA_WANT should be added as well.

Previously it happened to work only because Mbed TLS is enabling
IMPORT/EXPORT internally whenever GENERATE/DERIVE is set. However the
same might not be true for all PSA Crypto providers.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
(cherry picked from commit 222f8d8)
…rver

The unicast server does not need GATT caching and it was likely
incorrectly added earlier as a dependency.

Upstream PR #: 84232

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
… updates

-Update hostap to PR nrfconnect#76 which adds support for
 CONFIG_MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG instead of relying on legacy
 Mbed TLS ctr_drbg and entropy APIs. This change is in line with
 PSA crypto entropy changes in Zephyr happening with TinyCrypt
 deprecation and advancement of PSA crypto mechanisms
-Remove defconfigs for currently sets the Kconfigs:
 -CONFIG_MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG
 -CONFIG_MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG_ALLOW_NON_CSPRNG

Upstream PR #: 84517

Signed-off-by: Frank Audun Kvamtrø <frank.kvamtro@nordicsemi.no>
…endencies

-PSA_WANT_ALG_CMAC must be set for PSA_WANT_ALG_PBKDF2_AES_CMAC_PRF_128
 to be valid. This commit fixes this mismatch for hostap

Upstream PR #: 84517

Signed-off-by: Frank Audun Kvamtrø <frank.kvamtro@nordicsemi.no>
…nfigurations

-Mbed TLS has come up with its own naming-convention with regards
 to certain Mbed TLS configurations for TLS/DTLS and X.509. This
 commit fixes a couple of them by depending on MBEDTLS_BUILTIN
 which is set when Kconfig.tls-generic is used
 1. Make MBEDTLS_PEM_CERTIFICATE_FORMAT depend on MBEDTLS_BUILTIN
    The proper name for this functionaity is MBEDTL_PEM_PARSE_C and
    MBEDTLS_PEM_WRITE_C
 2. Make MBEDTLS_SERVER_NAME_INDICATION depend on MBEDTLS_BUILTIN
    The proper name for this is MBEDTLS_SSL_SERVER_NAME_INDICATION

Upstream PR #: 84517

Signed-off-by: Frank Audun Kvamtrø <frank.kvamtro@nordicsemi.no>
This is a follow-up to commit 12eee61.

Explicitly enable "PSA_WANT_ALG_ECB_NO_PADDING" to select the AES ECB
mode that it is used in CMAC operation.

This is done because CMAC uses AES-ECB, so both AES and ECB must
be explicitly enabled. Previously it worked because Mbed TLS is
not currently performing any check internally on this and it's
just enabling ECB automatically.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
(cherry picked from commit dff78b4)
There's no point building the sample for platforms that do not support
networking, hence add netif dependency to reduce the CI execution
scope.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
(cherry picked from commit 3df9b5f)
Non-secure variants for nRF7002 DK were removed from upstream
in commit 10d4973. Revert these
changes downstream, so that the NS variants are still available.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
…en built-in in PSA"

This reverts commit ac6d834.

Temporarily revert an upstream change that leads to a Kconfig dependency
loop with MBEDTLS_CIPHER_AES_ENABLED. This is supposed to be replaced
with a better fix later.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
This needs to be revisited but the newly added dependency on
the entropy_generator doesn't work with nrf_security.

Signed-off-by: Georgios Vasilakis <georgios.vasilakis@nordicsemi.no>
This test cannot be executed with the SDFW Service Framework client
started, so disable its initialization.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
-This commit adds psa_init.c that contains a SYS_INIT to enforce
 early initialization of PSA crypto by calling psa_crypto_init() in
 PRE_KERNEL_1, before any other users (include entropy_psa_crypto).
-This is separated from CONFIG_MBEDTLS_INIT which has a SYS_INIT that
 happens in POST_KERNEL and include initializing the Mbed TLS heap
 if this is enabled.
-Removing unneeded doxygen @file entry for zephyr_init.c

Signed-off-by: Frank Audun Kvamtrø <frank.kvamtro@nordicsemi.no>
(Cherry-picked from commit 7b92773a7f71e17d21fe8c8f65aebe22ad2a115b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment