Commit graph

230 commits

Author SHA1 Message Date
Grzegorz Swiderski
56d241bd48 soc: nordic: Validate PPR CLIC address
Add a missing entry in `validate_base_addresses.c`.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2024-08-07 19:01:55 -04:00
Gerard Marull-Paretas
4bc55acaff soc: nordic: vpr: allow building VPR launcher for FLPR
VPR launcher can also be used for FLPR.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-08-06 14:32:40 +02:00
Gerard Marull-Paretas
3f3ffb91ad soc: nordic: nrf54h20: define CPUFLPR core
So that FLPR core can be used.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-08-06 14:32:40 +02:00
Gerard Marull-Paretas
5e3188605e drivers: pinctrl: nrf: add support for nordic,clock-enable
Driver will be capable of retrieving such property from DT and apply it
accordingly.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-08-06 14:32:40 +02:00
Gerard Marull-Paretas
1eddb047f9 soc: nordic: nrf53: deprecate SOC_DCDC_NRF53X*
Regulators can now be configured using DT.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-08-06 09:17:10 +01:00
Gerard Marull-Paretas
2c3270db43 soc: nordic: nrf53: allow configuring regulators using DT
Instead of Kconfig options which are about to be deprecated.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-08-06 09:17:10 +01:00
Gerard Marull-Paretas
aaacd682cc soc: nordic: nrf52: deprecate SOC_DCDC_NRF52X[_HV]
Main supply can now be configured using DT.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-08-06 09:17:10 +01:00
Gerard Marull-Paretas
e189fb0720 soc: nordic: nrf52: add support for DT-based regulators config
In addition to Kconfig options (soon to be deprecated), allow
configuring the regulators using DT.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-08-06 09:17:10 +01:00
Markus Lassila
c44968486d soc: nordic: Fix APPROTECT with TF-M
Allow CONFIG_NRF_APPROTECT_LOCK and
CONFIG_NRF_SECURE_APPROTECT_LOCK with TF-M with all the SOC's
that support TF-M.

Signed-off-by: Markus Lassila <markus.lassila@nordicsemi.no>
2024-08-02 18:50:11 -05:00
Krzysztof Chruściński
c84c2fc37d soc: nordic: common: dmm: Initialize dmm as early as possible
DMM shall be initialized as early as possible to allow drivers to
use it. For example, uart may need it early since it starts
RX during initilization in some configurations.

Making dmm_init() public and calling it in soc init function.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-08-01 12:38:44 +02:00
Gerard Marull-Paretas
4c84a6f658 soc: nordic: nrf53: introduce deprecated BOARD_ENABLE_CPUNET
So that existing code does not break when this option gets removed from
boards.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-08-01 08:56:56 +01:00
Gerard Marull-Paretas
f611fdd6ad soc: nordic: nrf53: add option to enable cpunet
When not using BT, users may want to enable the cpunet core. Until now,
this has been done at board level (so duplicating unnecessary code)
using CONFIG_BOARD_ENABLE_CPUNET. The board-level options were usually
enabled automatically for BT, however, this was unnecessary as BT driver
already takes care of the setup.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-08-01 08:56:56 +01:00
Rubin Gerritsen
893c4ed4f9 modules: hal_nordic: Support EGU130 driver instance
Adds the glue code to enable this.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2024-07-27 15:15:07 +03:00
Tomi Fontanilles
2e012668e9 modules: tf-m: nordic: fix unused CMake variable warning
Follow-up to d830446c91 that removed
the use of ${ZEPHYR_BASE}.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-07-12 20:39:26 -04:00
Nikodem Kastelik
c0d508a142 soc: nordic: common: dmm: fix region alignment getter
Getting the required alignment size for memory region node
and device node needs to be handled by a separate macro.
Otherwise alignment of single byte is reported for any region.
Add a test that checks for this particular issue.

Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
2024-07-10 08:42:40 -04:00
Jamie McCrae
8924d563bb soc: nordic: Fix run once regex issue and add missing entries
Fixes an issue whereby multiple boards would be grouped when using
a regex to group them, and adds missing nRF91 entries to the list

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-07-03 09:33:21 -04:00
Yong Cong Sin
5ee20e11ef soc: nordic: vpr: select INCLUDE_RESET_VECTOR for default implementation
For SOCs that do not implement a custom `__reset` function,
select `INCLUDE_RESET_VECTOR` so that Zephyr provides a default
implementation that simply jumps to `__initialize`

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-07-02 09:24:44 +02:00
Krzysztof Chruściński
0825f24910 soc: nordic: nrf54h: DMM shall be applied only to rad&app
cpuppr can only use slow peripherals and uses RAM3 as RAM so
it does not need to use DMM.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-07-01 16:08:39 -04:00
Krzysztof Chruściński
5f32265459 soc: nordic: common: dmm: Fix memory utilization
DMM was enforcing cache line alignment all memory regions, including
those which were not cacheable. Fixing it by using memory attribute
from the device tree to determine if alignment needs to be applied.

Because of that memory usage was significantly increased because
even 1 byte buffers (e.g. for uart_poll_out) was consuming 32 bytes
(cache line size).

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-07-01 16:08:39 -04:00
Piotr Pryga
37e5b1055e soc: nrf54l15: Fix HFXO INTCAP code calculation rounding error
The implementation of formula, to calculate HFXO INTCAP code,
had a rounding error. That may lead so small deviation of HFXO
clock accuracy.

The IPS formula uses capacitance values in piko Fartd units.
That requires use of floating point data types. To avoid that
implementation of the formula uses femto Farats (1000 smaller unit).

In the former implementation conversion from femto Farad to piko Farad
was done just after reading of the desired capacitance from DTS.

To make sure the calculations are correct the change of unit must be
done at very end. Also rounding must be applied.

Also the formula was split and more comments were added to make the
implementation clear.

The commit fixes the implementation of the IPS formula.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2024-06-25 10:26:11 -04:00
Piotr Pryga
f0f5f28f99 soc: nrf54l15: Fix LFXO INTCAP code calculations
There were two errors in calculations of LFXO INTCAP code:
- The value provided by DTS files is internal desired capacitance.
  The value from DTS has to be "encoded" before use in INTCAP
  calculations formula. The formula for encoding is:
  CAPACITANCE_CODE = (<desired_value> - 4pF) / 0.5
  Subtract of 4 is related with lowest value in the allowed range.
  Division by 0.5 is related with change to steps size.
  In former code the subtration of 4pF was missing.

- The mid_val calcuation was wrong due offset_k left shift by 4.
  It should be left shift by 3 to get total left shift of 9.
  That matches the left shift of former part of the equation.
  Final integer value was calculated by right shift 10, it should
  be right shift 9. Then rounding was done by use of mod by (1 << 10)
  It should be mod by (1 << 9) and compared with (1 << 8), that is
  half of 0-512 range.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2024-06-25 10:26:11 -04:00
Martin Tverdal
78d2ed5428 soc/nordic/nr54l: increase flash erase time define
Time it takes to "erase" one "page" of rram is too low.
Where getting timeouts.
"erase" of rram is done by writing all the words.
one "page" is 4096 bytes meaning 1024 32bit words.
worstcase time it takes to write one 32bit word from
0x00000000 to 0xffffffff is about 42us, giving 42ms
to write 1024 words.

Signed-off-by: Martin Tverdal <martin.tverdal@nordicsemi.no>
2024-06-24 08:28:13 -04:00
Jordan Yates
07870934e3 everywhere: replace double words
Treewide search and replace on a range of double word combinations:
    * `the the`
    * `to to`
    * `if if`
    * `that that`
    * `on on`
    * `is is`
    * `from from`

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-06-22 05:40:22 -04:00
Rafał Kuźnia
f7d7cb885f soc: nordic: configure recover run once for nrf54h20
The nrfutil device v2.4.x now supports the recover operation. Configure
run once to ensure that domains are not unnecessarily erased.

Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
2024-06-19 13:24:23 -04:00
Grzegorz Swiderski
f908b41154 soc: nordic: Resolve z_arm_platform_init in the linker generator
Fixes #72673
Follow-up to #70977 and #71590

The CMake linker generator doesn't have an API equivalent to `PROVIDE`,
but the existing `zephyr_linker_symbol()` function should do just fine.
It still lets us set `z_arm_platform_init = SystemInit` and thus keep
the reduced ROM space.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2024-06-14 19:16:37 +02:00
Nikodem Kastelik
37e511bcbf soc: nordic: add dmm component
DMM stands for Device Memory Management and its role is to streamline
the process of allocating DMA buffer in correct memory region
and managing the data cache.

Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
2024-06-13 12:02:33 -04:00
Rafał Kuźnia
6551492a3f soc: nordic: configure run once for nrf54h20
Erase and reset must run only once during flashing.
This prevents a situation, where the next flashed image erases the
previous one.

Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
2024-06-11 14:01:35 +01:00
Marcin Szymczyk
41071584a6 soc: nordic: vpr: remove Zifencei RISC-V extension
VPR does not implement Zifencei extension, remove it.

Signed-off-by: Marcin Szymczyk <marcin.szymczyk@nordicsemi.no>
2024-06-11 03:37:03 -07:00
Karsten Koenig
16e7e46478 soc: nordic: nrf54h: Retrigger TASK_FREQ_CHANGE
A single trigger of the TASK_FREQ_CHANGE task might not be enough, so
trigger twice to make sure the frequency gets updated.

Signed-off-by: Karsten Koenig <karsten.koenig@nordicsemi.no>
2024-06-06 15:21:51 -05:00
Grzegorz Swiderski
742c728c7e dts: nordic: Add RESETINFO
Add devicetree nodes for the Reset Information registers on nRF54H20,
along with a new binding.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2024-06-06 10:03:15 +02:00
Sebastian Bøe
e1347ded48 soc: nordic: nrf53: Remove broken PM_S2RAM support
Remove dead code that cannot be enabled.

Kconfig prevents us from enabling PM_S2RAM on 53 because it is not
supported any more.

But we still have some dead code left over in soc.c, so we delete this
code.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2024-06-06 10:02:58 +02:00
Yong Cong Sin
6a3cb93d88 arch: remove the use of z_arch_esf_t completely from internal
Created `GEN_OFFSET_STRUCT` & `GEN_NAMED_OFFSET_STRUCT` that
works for `struct`, and remove the use of `z_arch_esf_t`
completely.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-06-04 14:02:51 -05:00
Yong Cong Sin
3998e18ec4 arch: rename all esf struct to struct arch_esf
Rename every architecture's esf struct to `struct esf`.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-06-04 14:02:51 -05:00
Vinayak Kariappa Chettimada
fb774fef74 soc: nordic: Select new nrf54lx compatible kconfig option
Select the newly introduced nrf54lx compatible kconfig
option.

This is common both for real HW and for simulated HW,
allowing SW to behave appropriately for both.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-06-03 03:01:36 -07:00
Gerard Marull-Paretas
3731a137e7 soc: nordic: nrf54h: disable CAN120 MCAN cache
Configure CAN120 MCAN core registers as non-cachable to prevent D-Cache
from inhibiting volatile accesses to the CAN120 MCAN registers. Also
apply non-cachable attribute to the message ram region. Even though the
MCAN driver handles cache invalidation/flushing, MPU faults are still
triggered (to be investigated).

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-05-30 05:20:50 -07:00
Yong Cong Sin
bbe5e1e6eb build: namespace the generated headers with zephyr/
Namespaced the generated headers with `zephyr` to prevent
potential conflict with other headers.

Introduce a temporary Kconfig `LEGACY_GENERATED_INCLUDE_PATH`
that is enabled by default. This allows the developers to
continue the use of the old include paths for the time being
until it is deprecated and eventually removed. The Kconfig will
generate a build-time warning message, similar to the
`CONFIG_TIMER_RANDOM_GENERATOR`.

Updated the includes path of in-tree sources accordingly.

Most of the changes here are scripted, check the PR for more
info.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-28 22:03:55 +02:00
Piotr Kosycarz
146195a647 soc: nordic: configure run once for nrf54l15
Needed to support sysbuild (app + flpr) with --erase option.

Signed-off-by: Piotr Kosycarz <piotr.kosycarz@nordicsemi.no>
2024-05-23 11:51:31 -04:00
Rafał Kuźnia
9cba85bb8d soc: nrf54h: use word accesses to SPI_DW peripheral
The nRF54H20 EXMIF peripheral requires word accesses. Doing accesses of
byte or half-word sizes results in bus fault.

Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
2024-05-17 16:18:56 +01:00
Rafal Dyla
13aa26eac2 manifest: Adding nRF Services library
Adding nRF Services library to the hal-nordic repo

Signed-off-by: Rafal Dyla <rafal.dyla@nordicsemi.no>
2024-05-15 09:25:30 +01:00
Marcin Szymczyk
41b856f8dd soc: nordic: add vpr_launcher in sysbuild
`SB_CONFIG_VPR_LAUNCHER` can now be used in building a VPR target,
to enable automatic building of image that will launch the VPR.

Signed-off-by: Marcin Szymczyk <marcin.szymczyk@nordicsemi.no>
2024-05-14 13:24:45 +02:00
Grzegorz Swiderski
70edbd1cf5 soc: nordic: Add system for validating DT headers against MDK
Hardware-specific properties should stay in sync with the definitions
provided by MDK. Existing measures for this include:

  * The `validate_base_addresses.c` file included in every build;
  * The `nordic-nrf-ficr-nrf54h20.h` header generated from SVD.

If there's information that cannot be extracted from SVD, it may have to
be validated against C types. Add `validate_binding_headers.c` for this
purpose, which automagically includes all `dt-bindings` headers included
by DTS in a given build.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2024-05-13 10:36:37 +03:00
Tomasz Moń
3502b71386 soc: nordic: nrf54h20: Add default ARM MPU regions
Commit 149df6b61b ("soc: nordic: nrf54h20: Disable USBHS core cache")
inadvertedly removed default MPU regions defined in arm_mpu_regions.c.
Without the SRAM_0 region defined all builds with asserts enabled result
in failed assertion even before the kernel inits. The failed assertion
is the very last step of arch_kernel_init() when MPU areas are marked
for dynamic regions. Because the failure occurs so early, the device
appears completely dead.

Fix the issue by bringing the default regions to nrf54h20 custom
regions file.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2024-05-10 14:39:44 -05:00
Grzegorz Swiderski
f7d6880fce soc: nordic: Extend address validation for nRF54H20
Add `CHECK_DT_REG()` entries for a few additional peripheral types:
BELLBOARD, CCM, GRTC, HSFLL, UICR, and VPR.

For peripheral instances outside of the Global Domain, such as DPPIC020,
use domain-specific defines like NRF_RADIOCORE_DPPIC020 when validating.
These are always defined by the MDK, while NRF_DPPIC020 isn't guaranteed
to exist in those cases. Revise existing macro checks accordingly.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2024-05-09 12:41:17 -04:00
Grzegorz Swiderski
8212215779 soc: nordic: nrf54h20: Use KERNEL_INIT_PRIORITY_DEFAULT
Make the SoC initialization priority configurable.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2024-05-09 12:41:17 -04:00
Grzegorz Swiderski
8e63e0657b soc: nordic: nrf54h20: Make HSFLL trims optional
If no HSFLL needs trimming, then `trim_hsfll()` should be compiled out.
This makes it easier to reuse the rest of `soc.c` out of tree.

Furthermore, some HSFLL instances can be trimmed before booting Zephyr,
so the FICR client properties in the DT binding should not be required.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2024-05-09 12:41:17 -04:00
Sebastian Głąb
2f17c46fb1 drivers: wdt: nrf: Add WDT instances that exist in nrf54h20
Add WDT instances no. 010, 011, 131, 132.

Signed-off-by: Sebastian Głąb <sebastian.glab@nordicsemi.no>
2024-05-09 15:44:40 +02:00
Tomasz Moń
149df6b61b soc: nordic: nrf54h20: Disable USBHS core cache
Configure USBHS core registers as non-cachable to prevent D-Cache from
inhibiting volatile accesses to the USBHS core registers.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2024-05-07 13:50:58 +01:00
Rafał Kuźnia
fe98eb767c soc: nrf54h: Enable SPI DW HSSI register layout
The nRF54H20 implements a variant of the SPI DW peripheral that
has slightly different register layout. Enable it in the defconfig.

Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
2024-05-07 09:52:53 +01:00
Jamie McCrae
4b2d19f147 soc: nordic: Add run once and deferred reset configuration
Adds configuration that allows nRF53 and nRF91-based boards to be
flashed through west using sysbuild for multiple images with the
recover or erase options and prevent running those commands for
each image being flash, which would make the device unbootable.
Also defers reset whilst all images for the cores of these SoCs
are flashed.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-04-29 17:56:19 +01:00
Jamie McCrae
8b62a16b57 soc: nordic: Reformat soc.yml file
Reformats the soc.yml file to have uniform 2-space indentation

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-04-29 17:56:19 +01:00