Commit Graph

134 Commits

Author SHA1 Message Date
Alberto Escolar Piedras
7ddfc6af46 boards native_sim: Correct UART outdated comments
Both polling and interrupt based APIs are supported in the TTY driver.
And the console backend is enabled unless *any* UART driver is built.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-03-11 18:54:02 +01:00
Alberto Escolar Piedras
cb53e40ff9 drivers uart_native_posix: rename to native_pty and support N instances
Rename the driver from uart_native_posix to uart_native_pty.
Including renaming the DTS compatible, and kconfig options, deprecating
the old ones.

And refactor the driver, generalizing it, so we can have any number of
instances.
Note that, unfortunately generalizing to N instances cannot be done
without a degree of backwards compatibility breakage: This driver was
born with all its configuration and selection of the instances based on
kconfig.
When the driver was made to use DT, it was done in a way that required
both DT and kconfig needing to manually coherently enable the 2nd UART.
This has now been fixed, which it means only DT is used to decide how
many instances are avaliable, and UART_NATIVE_POSIX_PORT_1_ENABLE is
just ignored.

Including:
* Deprecate UART_NATIVE_WAIT_PTS_READY_ENABLE: the options is always on
  now as it has no practical drawbacks.
* Deprecate UART_NATIVE_POSIX_PORT_1_ENABLE: DTS intanciation defines it
  being available now.
* Rename a few functions and in general shorten pseudo-tty/pseudo-
  terminal to PTY instead of PTTY.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-03-11 18:54:02 +01:00
Alberto Escolar Piedras
ab7a6de5bb drivers/counter/counter_native_sim: Rename from counter_native_posix
Including renaming the DTS binding and kconfig options
deprecating the old one.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-03-10 06:52:37 +01:00
Alberto Escolar Piedras
7ffd698785 board native_sim: BT userchan now supports picolibc
Let's update the table

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-03-10 06:52:19 +01:00
Alberto Escolar Piedras
df5318479b docs boards native_sim: Improve FUSE FS access description
The FUSE driver allows accessing a possible filesystem, independently
of the underlaying device, so let's correct the description so we do
not mix "flash" with "filesystem".

Also, one does not need to create the 'flash' folder these days. The
FUSE library will if needed.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-03-08 15:26:29 +01:00
Alberto Escolar Piedras
65018e2803 docs boards native_sim: FUSE driver now supports all libCs
Now we can build the FUSE driver with any embedded libC,
so let's update the table.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-03-08 15:26:29 +01:00
Alberto Escolar Piedras
43b43f5408 boards/native_sim: Deprecate timer_model.h
Deprecate this header which provides API compatibility for the
native_posix timer HW model, with planned removal in v4.4.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-03-08 08:46:34 +01:00
Alberto Escolar Piedras
543f2da251 boards/native_sim: Deprecate native_posix_compat.h
Deprecate this header which provides API compatibility with
native_posix, with planned removal in v4.4.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-03-08 08:46:34 +01:00
Alberto Escolar Piedras
4338122248 drivers entropy: fake_entropy_native_posix rename to _native_sim
Rename the driver files, binding and kconfig options, while deprecating
the old binding and kconfig options.

Uses in tree are replaced.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-03-08 03:38:13 +01:00
Alberto Escolar Piedras
78f800642a drivers/ethernet/eth_native_posix: Rename to eth_native_tap
Rename this driver to eth_native_tap, including renaming all its
options.
The old options remain until v4.4, but as deprecated.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-03-07 20:10:38 +01:00
Alberto Escolar Piedras
bd42df2662 boards native_sim: deprecate NATIVE_POSIX_SLOWDOWN_TO_REAL_TIME
In favour of NATIVE_SIM_SLOWDOWN_TO_REAL_TIME.
To be removed by 4.4.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-03-07 20:10:23 +01:00
Alberto Escolar Piedras
b6625b1b28 boards native_sim: Update cmdline.h header comment
Correct the reference in the comment to native posix.
This header is here to stay providing the API for registering
arguments.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-03-07 19:16:14 +01:00
Alberto Escolar Piedras
0f33f0ab46 board native_posix: Remove
Remove native_posix as it has reached its end of life in 4.2,
after being deprecated since 4.0.

For more information check
https://github.com/zephyrproject-rtos/zephyr/issues/76895

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-03-07 19:16:14 +01:00
Alberto Escolar Piedras
2265a30deb doc board native_posix: Remove this board docs
native_posix is being removed as it has reached its end of life in 4.2,
after being deprecated since 4.0.

Let's remove this board docs.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-03-07 19:16:14 +01:00
Alberto Escolar Piedras
fe5753a393 docs: Remove references to native_posix pages
The native_posix pages are going to be removed from the tree, let's
remove references to them.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-03-07 19:16:14 +01:00
Alberto Escolar Piedras
6c38bc8ec4 boards native_posix: Remove twister support
native_posix is being removed as it has reached its end of life in 4.2,
after being deprecated since 4.0.

Remove the twister support for native_posix[//64] and therefore all
references to them from the testcases and samples yamls, so twister
does not error out.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-03-07 19:16:14 +01:00
Alberto Escolar Piedras
82941a6a6e boards/native/nrf_bsim: command line compat with native_sim/posix
Provide it from native_sim instead of native_posix as native_posix
is going to be removed.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-03-07 19:16:14 +01:00
Alberto Escolar Piedras
3883ef279e boards nrf54l15bsim: Remove out of date notes in doc
Remove two out of date/incorrect notes in the documentation for this
board:
For quite a while now, we have models of some parts of the CRACEN HW.
Since f4cdb0f07e we are using the CRACEN
RNG driver.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-03-03 03:21:03 +01:00
Alberto Escolar Piedras
e96b2a7c11 boards nrf54l15bsim: Remove uncessary defconfig
This board is using since f4cdb0f07e
the cracen RNG driver, so there is no need to set default options for
the native_posix entropy driver.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-03-03 03:21:03 +01:00
Alberto Escolar Piedras
ac2d1e66ba boards nrf54l15bsim: Do not delete grtc clock properties
Revert the change to this file done in
865b2456c0
In which these clock properties were added to the GRTC binding but
they were, at the same time, not added/removed for the simulated
target.
The author indicates this was done due to some test failing,
but at this point no test fails with these properties present also
in the simulated target, and there is no understanding of why they
would.
So let's avoid diverging the simulated target from the real
one.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-02-21 15:13:29 +00:00
Adam Kondraciuk
865b2456c0 dts: nordic: Add support for clock outputs
Add support for GRTC clock output pins.

Signed-off-by: Adam Kondraciuk <adam.kondraciuk@nordicsemi.no>
2025-02-18 18:37:35 +01:00
Piotr Krzyzanowski
ae80fb10d4 boards: nrf_bsim: disable insted of deletion spi node
Disable insted of deletion of spi00 node on 54l15bsim

Signed-off-by: Piotr Krzyzanowski <piotr.krzyzanowski@nordicsemi.no>
2025-02-17 14:03:27 +01:00
Alberto Escolar Piedras
5e7df92082 boards nrf54l15bsim: Do not work around peripheral clock issue
In 923d313a04 the clock frequency in DTS
for the UART00 was fixed, but not for the simulated target. This was
likely due to the HW models modeling it as 16MHz instead of 128MHz for
this particular one as it is in reality.

Now that the HW models have been fixed, let's let this clock be
configured like for real HW.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-02-14 13:36:55 +01:00
Rubin Gerritsen
0f3e6fd3d6 boards: nrf_bsim: Document how to use the console with bsim
This commit describes how to build and run applications using
the console. This documentation is added because it may
not be obvious how this is done. That is, sometimes a user
may believe that the terminal launching the application is the
the console which is not the case.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2025-02-07 10:25:20 +01:00
Rubin Gerritsen
77de5935f2 boards: nrf_bsim: Set chosen console dts entry
This makes the bsim boards more similar to their corresponding DKs.
This makes it simpler to run samples and application requiring
the use of a console.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2025-02-07 10:25:20 +01:00
Rubin Gerritsen
a2d1b28ba0 boards: nrf52_bsim: Remove disabling of LOG_BACKEND_UART
There seems like there is no good reason for having it disabled.
For bsim boards CONFIG_SERIAL is disabled by default, there will
anyways not be any logging on the UART.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2025-02-07 10:25:20 +01:00
Krzysztof Chruściński
f96064379b boards: native_sim: Detect attempt to configure not existing int
Similar to e770128c2. Prevent overrunning the irq vector table.
This is not happening today in tree, but coverity thinks it
does. Checking for it to prevent it is not a bad idea
anyhow, so let's do it.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-01-29 11:03:02 +01:00
Krzysztof Chruściński
cd23fdf63f boards: nrf*_bsim: Detect attempt to configure not existing int
Similar to 923d4fbad8. Prevent overrunning the irq vector table.
This is not happening today in tree, but coverity thinks it
does. Checking for it to prevent it is not a bad idea
anyhow, so let's do it.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-01-29 11:03:02 +01:00
Krzysztof Chruściński
e54a050785 boards native_posix: Detect attempt to configure not existing int
Similar to 66a4fe32ce. Prevent overrunning the irq vector table
in posix_irq_priority_set. This is not happening today in tree,
but coverity thinks it may. Checking for it to prevent it is not
a bad idea anyhow, so let's do it.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-01-29 11:03:02 +01:00
Alberto Escolar Piedras
a211999141 doc boards nrfbsim: Update list of supported HW
The models include enough of the CRACEN to run the same
nrfx drivers as in Zephyr. So let's add it to the list.

Also let's remove the RTC from the list as the hal does not
expose it anymore for this platform as the GRTC is to be used
instead.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-01-23 16:33:12 +01:00
Alberto Escolar Piedras
f4cdb0f07e boards nrf54l15bsim: Default to new cracen rng driver
Let's default to this new driver.
And therefore change the conditions in the BT controller kconfig
which were selecting the native_posix fake entropy driver

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-01-22 18:32:35 +01:00
Krzysztof Chruściński
32898cf38f boards: native: nrf_bsim: nrf54l15: Bring back clocks
Do not delete clocks for the bsim target. Clocks are referenced
by peripherals and it can be used to get frequency that clocks
the peripheral.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-01-17 09:07:58 +01:00
Nicolas Pitre
46aa6717ff Revert "arch: deprecate _current"
Mostly a revert of commit b1def7145f ("arch: deprecate `_current`").

This commit was part of PR #80716 whose initial purpose was about providing
an architecture specific optimization for _current. The actual deprecation
was sneaked in later on without proper discussion.

The Zephyr core always used _current before and that was fine. It is quite
prevalent as well and the alternative is proving rather verbose.
Furthermore, as a concept, the "current thread" is not something that is
necessarily architecture specific. Therefore the primary abstraction
should not carry the arch_ prefix.

Hence this revert.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2025-01-10 07:49:08 +01:00
Valerio Setti
bc3baf096a boards|soc: remove selection of ENTROPY_GENERATOR
Now that MbedTLS is capable of automatically enabling
CONFIG_ENTROPY_GENERATOR (when available), we can remove forced
enablements in boards|soc deconfig files.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-12-19 17:53:37 +01:00
Valerio Setti
c79991fd29 Revert "boards: remove ENTROPY_GENERATOR selection if BT"
This reverts commit 9789d4d5f8.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-12-12 00:15:39 +00:00
Valerio Setti
e05518146b boards: remove ENTROPY_GENERATOR selection if BT
ENTROPY_GENERATOR is now automatically enabled if the board
has "zephyr,entropy" chosen property set, so there is no need
to manually select it.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-12-10 08:05:33 +01:00
Johan Hedberg
8b02141ca7 Bluetooth: Controller: Replace BT_CTLR with HAS_BT_CTLR
Deprecate BT_CTLR, and add a new HAS_BT_CTLR as a virtual option which
specific users (like BT_LL_SW_SPLIT) select. This also means that we can
remove all places that were forcefully enabling the BT_CTLR option, and
instead we now depend on devicetree to get some local LL HCI driver
enabled which in turn also enables the HAS_BT_CTLR option.

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2024-12-03 10:16:44 +01:00
Krzysztof Chruściński
923d313a04 dts: common: nordic: nrf54l: Add hfpll clock source
Add 128 MHz clock source and use it for uart00. Baudrate setting
must be adjusted based on uart clock source so without this
change there is wrong baudrate on uart00.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-11-29 11:44:49 +01:00
Valerio Setti
72555fabb4 board: enable random/entropy generators if BT
BT uses PSA Crypto API to perform crypto operations and, on this
platform, these APIs are implemented through Mbed TLS. In order
to properly initialize this library, a random number generator
is required.

* If the platform supports an HW entropy generator (ex: native_sim,
  nrf), then ENTROPY_GENERATOR must be used;
* Otherwise (ex: qemu_cortex_m3) test random generator can be
  enabled.

Enabling the proper option at board Kconfig level allows for
a more compact code change instead of manually editing _all_
the samples/tests that required this fix.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-11-27 16:40:47 -05:00
Jordan Yates
b13985d806 boards: nrf_bsim: add default soc_secure_mem_read
Add the default implementation of `soc_secure_mem_read` from
`nordic/common/soc_secure.h`.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-11-25 14:41:43 +01:00
Wilfried Chauveau
85f36aae51 boards: twister: update boards' twister metadata files
Following the update of the schema, this updates all boards with the new
structure.

Signed-off-by: Wilfried Chauveau <wilfried.chauveau@arm.com>
2024-11-25 08:31:28 +01:00
Yong Cong Sin
b1def7145f arch: deprecate _current
`_current` is now functionally equals to `arch_curr_thread()`, remove
its usage in-tree and deprecate it instead of removing it outright,
as it has been with us since forever.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-11-23 20:12:24 -05:00
Alberto Escolar Piedras
890f13426e doc boards nrfbsim: Mention the UARTE as supported for nrf54l15
Include in the list of supported peripherals the UARTE for the
simulated nrf54l15

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-22 11:34:30 +01:00
Alberto Escolar Piedras
ca46c7c816 boards nrfbsim: Enable UART(E) peripherals for nrf54l15bsim
The HW models now support this peripheral for this target.
Let's enable it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-22 11:34:30 +01:00
Alberto Escolar Piedras
b77d896ff6 boards native_sim: Deprecate CONFIG_NATIVE_SIM_NATIVE_POSIX_COMPAT
This option existed only to make the transition from native_posix to
native_sim easier. As native_posix is going to be removed in v4.2
we deprecate this option now, so it will also be removed.

We also switch this option to default to false already now.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-19 20:04:55 -05:00
Alberto Escolar Piedras
7065b4628b doc boards nrfbsim: Mention the UARTE as supported for nrf5340
Include in the list of supported peripherals the UARTE for the
simulated nrf5340

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-16 14:05:52 -05:00
Alberto Escolar Piedras
a7abf80064 boards nrfbsim: Enable UART(E) peripherals for nrf5340bsim
The HW models now support this peripheral for these targets.
Let's enable them.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-16 14:05:52 -05:00
Alberto Escolar Piedras
3418305eb8 doc boards nrfbsim: Mention the GPIO & GPIOTE as supported
Include in the list of supported peripherals the GPIO
and GPIOT for both the nrf5340 and nrf54l15

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-16 14:05:52 -05:00
Alberto Escolar Piedras
d0746f1177 boards nrfbsim: Enable GPIO & GPIOTE peripherals for nrf5340bsim
The HW models now support these pheripherals, let's enable them

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-16 14:05:52 -05:00
Alberto Escolar Piedras
4b890bc7b5 boards nrfbsim: Enable GPIO & GPIOTE peripherals for nrf54l15bsim
The HW models now support these pheripherals, let's enable them

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-16 14:05:52 -05:00