Skip to content

Conversation

@SebastianBoe
Copy link
Contributor

…duplication

Configure the "cpunet" to be secure from the soc system initialization to avoid code duplication across all the boards.

cpunet is now configured to be secure earlier in the boot process, from POST_KERNEL to PRE_KERNEL, but AFAIK this is not a problem.

adamkondraciuk and others added 30 commits May 14, 2024 09:06
Upstream PR: zephyrproject-rtos/zephyr#71688

This commit aligns the GRTC driver to changes introduced in
hal_nordic. Some of the features regarding GRTC sleep/wakeup
functionality has been modified and moved out to the nrfx
driver's code.

Signed-off-by: Adam Kondraciuk <[email protected]>
(cherry picked from commit 88a50aa5ee0a01fe029676b916329dc75ca5deea)
Upstream PR: zephyrproject-rtos/zephyr#71688

The `z_nrf_grtc_timer_get_ticks()` function converts system ticks
to GRTC ticks. It gets the current system tick to calculate an
absolute GRTC value. The same does the test function to provide
an argument to be converted. If the system tick occurs between those
`sys_clock_tick_get()` calls the `z_nrf_grtc_timer_get_ticks()` will
take into account the newer tick while the test estimate bases on
the old tick value. Due to that the maximum result error is 1 system
tick minus 1 GRTC tick which equals (`CYC_PER_TICK` - 1) for GRTC
ticks.

Signed-off-by: Adam Kondraciuk <[email protected]>
(cherry picked from commit 57713428a84d4a86290bae9c636a5d0606b9798f)
Upstream PR: zephyrproject-rtos/zephyr#72273

Access to this region should no longer be requested via UICR, because it
will be statically allocated by secure domain firmware.

Signed-off-by: Grzegorz Swiderski <[email protected]>
(cherry picked from commit d95aa856e98b6561d534cbe36ffc6e87de3deab2)
Each local RESETINFO instance can be used in samples.
Applied as `noup` because of conflicts.

Signed-off-by: Grzegorz Swiderski <[email protected]>
…tection

!fixup: [nrf noup] boards: add nrf54l15/nrf54l15/cpuapp/ns as board variant

For initial support the Rollback protection was disabled as the NV
counters and encryption was not supported. Now both is available
therefor enabling the Rollback protection.

Ref: NCSDK-26634

Signed-off-by: Markus Swarowsky <[email protected]>
!fixup: [nrf noup] boards: add nrf54l15/nrf54l15/cpuapp/ns as board variant

Build in keys are now supported in TF-M so enabled them

Ref: NCSDK-22600
Signed-off-by: Markus Swarowsky <[email protected]>
Moved the busy flag and the GATT paramters to the
individual CSIP Set Coordinator instances.

This allows to use multiple instances in parallel,
and thus in turn allow CAP to do things in parallel.

This commit has been done with minimal amount of changes,
even if there are multiple pieces of code that could likely
be refactored to be better.

Signed-off-by: Emil Gydesen <[email protected]>
(cherry picked from commit d45b462)
The bt_cap_common_discover function relied on a global variable
used to  indicate that a discovery was in process.
This global variable prevented multiple discoveries to take place
on multiple ACL connections, where the intention was to stop
multiple discoveries on the same ACL.
This has been fixed by moving the variable into the
struct bt_cap_common_client, so that it applies per
connection, rather than a global check.

Signed-off-by: Emil Gydesen <[email protected]>
(cherry picked from commit 68ea1c4)
…ctions

Refactor som CAP commander test functions to perform operations
in parallel, rather than sequential.

The CAP initiator functions are kept sequential so that we are
testing both versions.

Signed-off-by: Emil Gydesen <[email protected]>
(cherry picked from commit 33c253c)
This function is used in many places, but just by reading its
name it is not obvious why it is needed.
By adding some documentation it will hopefully become a bit more
clear that this function is mainly used for auto connection
establishment.

Signed-off-by: Rubin Gerritsen <[email protected]>
(cherry picked from commit 0a19c18)
Signed-off-by: Rubin Gerritsen <[email protected]>
…n Coded PHY

As documented in bt_le_scan_update(), the host may start scanning
automatically for various reasons.

Until now scanning was only done on 1M PHY, making it impossible
to use auto-connect/sync establishment if the advertiser was using
Coded PHY as its primary PHY.

Auto-connection would never work. Sync establishment would work if
the scanner was started by the application.

This commit fixes this by instructing the controller to scan on
both 1M and Coded PHY if the controller supports Coded PHY.
The application may see increased power consumption as a result
of this change as the controller may now spend 2*scan_window
listening for advertising packets.

Signed-off-by: Rubin Gerritsen <[email protected]>
(cherry picked from commit 44199f3)
Signed-off-by: Rubin Gerritsen <[email protected]>
From here: zephyrproject-rtos/zephyr#71825

Non-secure images cannot reference NRF_RRAMC_NS because NRF_RRAMC_NS
does not exist.

TF-M will configure RRAMC according to these Kconfig's before booting
the non-secure image so we ifdef out this code.

Also, rewrite the implementation of commit_changes to also work when
the commit task is not available.

Signed-off-by: Sebastian Bøe <[email protected]>
(cherry picked from commit 99f9429)
Add overlay file that enables sample on nrf54h20 Application core.

Signed-off-by: Sebastian Głąb <[email protected]>
(cherry picked from commit f84e082)
…54h20

Add WDT instances no. 010, 011, 131, 132.

Signed-off-by: Sebastian Głąb <[email protected]>
(cherry picked from commit 2f17c46)
… nRF54H20

Add overaly files for Application and Radio cores.

Configure test according to watchdog features
available on nRF54H20.

Signed-off-by: Sebastian Głąb <[email protected]>
(cherry picked from commit 48ee6fc)
… Twister

Add SPI to list of supported periperals by
nrf54h20 Application and Radio core.

This is needed to run following tests in Twister

Signed-off-by: Sebastian Głąb <[email protected]>
(cherry picked from commit bb30a5d)
…Radio core

It is enough to test watchdog driver on the application core.
Otherwise, at least three samples/tests fail due to missing
overlay file for nrf54h20dk/nrf54h20/cpurad.

Upstream PR: zephyrproject-rtos/zephyr#72566

Signed-off-by: Sebastian Głąb <[email protected]>
… in controller mode

Extend coverage for the i2c master mode driver
This test suite uses external sensor BME688

Signed-off-by: Bartosz Miller <[email protected]>
(cherry picked from commit d8bffff)
…erent configuration

Conigure UART to use 2 stop bits and even parity
in 'dual transmission' case
to cover more driver code cases.

Signed-off-by: Bartosz Miller <[email protected]>
(cherry picked from commit 7b82235)
Add overlay that enables selected WDT instance on
nrf54h20 Application core.

Signed-off-by: Sebastian Głąb <[email protected]>
(cherry picked from commit 7b2e209)
Define alias watchdog0 for nrf54h20 Application core.

Signed-off-by: Sebastian Głąb <[email protected]>
(cherry picked from commit c41438c)
…4l15/cpuflpr

Both nrf54l15pdk/cpuflpr and nrf54l15pdk/cpuflpr_xip have
watchdog on the list of supported periperals.
As a result, Twister tries to build samples/drivers/watchdog
for these two targets.
Since overlays are missing, build is failing.

Add missing overlay files.

Signed-off-by: Sebastian Głąb <[email protected]>
(cherry picked from commit b3004be)
Add Kconfig file that makes the sample working
on nrf54h20 Application core.

Signed-off-by: Sebastian Głąb <[email protected]>
(cherry picked from commit 3a71114)
Fix 2 build warnings in posix/options/env:
The maximum length given to strncpy() matches the input
string length, which makes the call equivalent to strcpy().
As the destination buffer size has been ensured sufficient
(in the first case by chechking just before,
in the second case by allocating it big enough),
let's just use strcpy() instead.

lib/posix/options/env.c: In function 'getenv_r':
lib/posix/options/env.c:109:17: error: 'strncpy' specified bound
depends on the length of the source argument
[-Werror=stringop-truncation]
  109 |                 strncpy(buf, val, vsize);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~
lib/posix/options/env.c:104:25: note: length computed here
  104 |                 vsize = strlen(val) + 1;
      |                         ^~~~~~~~~~~
lib/posix/options/env.c: In function 'setenv':
lib/posix/options/env.c:191:17: error: 'strncpy' output truncated
before terminating nul copying as many bytes from a string as its
length [-Werror=stringop-truncation]
  191 |                 strncpy(environ[ret], name, nsize);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/posix/options/env.c:128:51: note: length computed here
  128 |         const size_t nsize = (name == NULL) ? 0 : strlen(name);
      |                                                   ^~~~~~~~~~~~

Signed-off-by: Alberto Escolar Piedras <[email protected]>
(cherry picked from commit 7c8d538)
…ed peripherals

Enable Twister tests for the counter driver for:
- nrf54h20/cpuapp;
- nrf54h20/cpurad.

Signed-off-by: Sebastian Głąb <[email protected]>
(cherry picked from commit faf6fd1)
The `z_nrf_grtc_timer_get_ticks()` function converts system ticks
to GRTC ticks. It gets the current system tick to calculate an
absolute GRTC value. The same does the test function to provide
an argument to be converted. If the system tick occurs between those
`sys_clock_tick_get()` calls the `z_nrf_grtc_timer_get_ticks()` will
take into account the newer tick while the test estimate bases on
the old tick value. Due to that the maximum result error is 1 system
tick minus 1 GRTC tick which equals (`CYC_PER_TICK` - 1) for GRTC
ticks.

Upstream PR: zephyrproject-rtos/zephyr#71688

Signed-off-by: Adam Kondraciuk <[email protected]>
…ized warning

If compiling with optimizations (-O2/-Ofast) gcc emits a
maybe-uninitialized warning for `size`.

As far as I can tell, `size` will always be initialized in the cases
where it is used and only left uninitialized in error cases.

Reproduced on main with the multi_endpoint sample on
nrf5340dk/nrf5340/cpuapp.

Signed-off-by: Herman Berget <[email protected]>
Signed-off-by: Jan Zyczkowski <[email protected]>

(cherry picked from commit 9729651)
Added DTS with partitioning which involves external flash
as place for slo1_partition.external slot1_partition

Signed-off-by: Andrzej Puzdrowski <[email protected]>
Added description of sample testcase for building smp_svr with
support of secondary partition in on PDK spi_nor flash uisng
DTS.

Signed-off-by: Andrzej Puzdrowski <[email protected]>
New nRF54H20 SoC series expose more ports, e.g. P9, so reserve more bits
for the Port+Pin field.

Upstream PR: zephyrproject-rtos/zephyr#73097

Signed-off-by: Gerard Marull-Paretas <[email protected]>
(cherry picked from commit 8ffa1fa4a89734ec78017ff5e05c335480f1daa8)
jfischer-no and others added 21 commits May 27, 2024 11:01
Return protocol error if bcdUSB is less than 0x0201. Fix typo in number
of capabilities.

Fixes: b0d7d70 ("usb: device_next: add initial BOS support")

Upstream PR: zephyrproject-rtos/zephyr#73018

Signed-off-by: Johann Fischer <[email protected]>
Signed-off-by: Robert Lubos <[email protected]>
Display diff of contents for large buffers is not quite helpful and
takes up huge RAM, and if a board has less RAM then this causes the test
module build failures.

So, disable display of diff and just log a failure, small buffer tests
can be used to debug such basic issues and large buffer tests can act as
a smoke test for debugging other issues. This saves about 80K of RAM.

Fixes #72792.

Upstream PR: zephyrproject-rtos/zephyr#72895

Signed-off-by: Chaitanya Tata <[email protected]>
Signed-off-by: Robert Lubos <[email protected]>
…W_SPLIT only

Build the vendor specific sample hci_vs_scan_req for
BT_LL_SW_SPLIT variant of the Controller only.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
(cherry picked from commit 68bd4da)
Signed-off-by: Robert Lubos <[email protected]>
PR #72592 made pylint to use json2 output format. However, this
format is introduced in pylint v3. This commit adds an appropriate
setting in the requirements file.

Signed-off-by: Maciej Perkowski <[email protected]>
(cherry picked from commit 3a3f25c)
Signed-off-by: Robert Lubos <[email protected]>
Use wdt31 instead of wdt30 as wdt30 is hardware fixed to secure.

Signed-off-by: Sebastian Bøe <[email protected]>
(cherry picked from commit 9ef16f5)
Signed-off-by: Robert Lubos <[email protected]>
Add missing nrf overlays to fix the sample at build time.

Copied from samples/drivers/watchdog/boards.

It is not clear why the build failure was not detected earlier.

Signed-off-by: Sebastian Bøe <[email protected]>
(cherry picked from commit afbaaf2)
Signed-off-by: Robert Lubos <[email protected]>
…e domain

Don't define wdt30 for the non-secure domain as it is hardware fixed
to secure.

Signed-off-by: Sebastian Bøe <[email protected]>
(cherry picked from commit 50aaaa3)
Signed-off-by: Robert Lubos <[email protected]>
… domain

Don't define UICR for the non-secure domain as it is hardware fixed to
secure.

Signed-off-by: Sebastian Bøe <[email protected]>
(cherry picked from commit 2c19d3e)
Signed-off-by: Robert Lubos <[email protected]>
…r ns

Define peripherals with the 0x4000_0000 address range when building
for non-secure.

Signed-off-by: Sebastian Bøe <[email protected]>
(cherry picked from commit 90332b9)
Signed-off-by: Robert Lubos <[email protected]>
Refactor the 54L board file to be able to better support out-of-tree
non-secure boards.

This aligns better with nrf53's DT.

Signed-off-by: Sebastian Bøe <[email protected]>
(cherry picked from commit 80209e4)
Signed-off-by: Robert Lubos <[email protected]>
Complete rewrite of the 54l_ns DT board definition.

Now the secure board and non-secure board re-use a lot more code,
giving us a more maintainable solution.

Signed-off-by: Sebastian Bøe <[email protected]>
… set

When opaque resources have post-write callback set, but
the write is not a Block-Wise write, there is no block_ctx
and the code causes null pointer dereference when calculating
the offset of the data.

Upstream PR: zephyrproject-rtos/zephyr#73162

Signed-off-by: Seppo Takalo <[email protected]>
Signed-off-by: Robert Lubos <[email protected]>
It made the build of
`samples/tfm_integration/tfm_psa_test/sample.tfm.psa_test_crypto`
break since the update of Mbed TLS to 3.6.0 (#71118), apparently because
`${ZEPHYR_BASE}` wasn't set, and the include doesn't seem to be needed.

Signed-off-by: Tomi Fontanilles <[email protected]>
(cherry picked from commit d830446)
Signed-off-by: Robert Lubos <[email protected]>
…eferences"

This reverts commit b876bd2.

That needs mbed TLS 3.6.0 to work, as pk_ecc.c was added in that
version.

To be reverted, when mbed TLS is updated to 3.6.0 in NCS.

Signed-off-by: Robert Lubos <[email protected]>
… lib is used

Socket service library uses eventfd, which does not work with
native_posix platform, hence need to exclude it from samples that now
rely on socket services.

Upstream PR: zephyrproject-rtos/zephyr#73256

Signed-off-by: Robert Lubos <[email protected]>
Upstream PR: zephyrproject-rtos/zephyr#73156

Adds channel 15 to the pool of grtc channels available
for allocation (i.e. with 'z_nrf_grtc_timer_chan_alloc')
on nRF54H20.

The change is motivated by lack of available channels
for the nrf_802154_timestamper when building for nRF54H20.

Signed-off-by: Piotr Koziar <[email protected]>
…ses when clock_control is not available.

Upstream PR: zephyrproject-rtos/zephyr#73156

Clock_control is currently not supported on nRF54H20.
This commit adds new way of handling the hfclk targeted for nRF54H20.

This solution shall be replaced once the clock_control is supported for nRF54H20.

Signed-off-by: Piotr Koziar <[email protected]>
Upstream PR: zephyrproject-rtos/zephyr#73156

This commit fixes the issue where a serialization
error was reported after properly sending a data with 'icbmsg' backend.

The icbmsg send function's return code is set to
the sent data's len as in other backends.
The related docs were fixed and updated.

Signed-off-by: Piotr Koziar <[email protected]>
…fault for nRF54H20.

Upstream PR: zephyrproject-rtos/zephyr#73156

Adds an appropriate condition to the Kconfig as
the temperature driver is not supported for nRF54H20 devices yet.

Without this change, a build with NRF 802.15.4 libraries produces Kconfig error.

Signed-off-by: Piotr Koziar <[email protected]>
… to create EUI64.

Upstream PR: zephyrproject-rtos/zephyr#73156

Use BLE.ADDR to create unique (to some extent) EUI64
on nRF54H20 in some cases inside the IEEE 802.15.4 driver.

The amount of EUI64-s available in such a way is very limited (~16 million).
However, currently there does not seem to be another feasible way to
get device identifiers on nRF54H20 (such are kept in SICR, to which the
radio core has no access).

Signed-off-by: Piotr Koziar <[email protected]>
When disconnect request is successful, the status
was taking as WIFI_REASON_DISCONN_UNSPECIFIED only.
Adding WIFI_REASON_DISCONN_SUCCESS which can be help
to determine status of disconnect request. If this status
is failed then reason can be useful.

Signed-off-by: Kapil Bhatt <[email protected]>
(cherry picked from commit cc42d16)
Signed-off-by: Robert Lubos <[email protected]>
Do not permit configuring clocks from non-secure as NRF_OSCILLATORS is
a not supported as a non-secure peripheral

Signed-off-by: Sebastian Bøe <[email protected]>
@SebastianBoe SebastianBoe force-pushed the refactor_extdomain_downsteam branch from d25f7da to 7ddb597 Compare May 29, 2024 08:52
…duplication

Configure the "cpunet" to be secure from the soc system initialization
to avoid code duplication across all the boards.

cpunet is now configured to be secure earlier in the boot process,
from POST_KERNEL to PRE_KERNEL, but AFAIK this is not a problem.

Signed-off-by: Sebastian Bøe <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.