Commit graph

66726 commits

Author SHA1 Message Date
Carlo Caione 87692cd809 riscv: Reduce callee saved registers for RV32E
This was lost when working on 673f41e708.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-07-11 16:11:13 +02:00
Carlo Caione 2f5fef960e sample: s2ram: Introduce S2RAM sample
Introduce a template / sample for S2RAM running on rf5340dk.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-07-11 15:26:26 +02:00
Carlo Caione 0ed637a7b6 arch: cortex-m: Enable support for S2RAM
Enable S2RAM for Cortex-M hooking up the provided API functions.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-07-11 15:26:26 +02:00
Carlo Caione 1e74f1bff5 arch: Introduce S2RAM interface
Add a new API used by arch to implement suspend-to-RAM (S2RAM).

The API is composed by a single function to save the CPU context on
suspend.

A CPU context is the arch-specific set of registers that must be
preserved on power-off (in retained RAM) to be able to resume the
execution from the point it was suspended without going through the
whole kernel startup stage.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-07-11 15:26:26 +02:00
Carlo Caione 83939c1bb5 dts: nrf5340: Add label for cpu0
Add a node label for cpu0 so that we can extend that using overlays.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-07-11 15:26:26 +02:00
Kumar Gala 97281913f5 modem: hl7800: Cleanup gpio assert/deassert
Use logical values of 0/1 for gpio_pin_set_dt and handle any
inversions as GPIO flags that might be required at a board level.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-11 07:46:22 -05:00
Kumar Gala 6100eadd4b modem: hl7800: Update driver to use gpio_dt_spec
Simplify the implementation by using gpio_dt_spec.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-11 07:46:22 -05:00
Kumar Gala de49b0a926 boards: arm: pinnacle_100_dvk: Add GPIO flags for hl7800 to dts
Update devicetree to have GPIO flags set for various pins on the
hl7800 modem.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-11 07:46:22 -05:00
Jonathan Rico 1f226e0c4b samples: boards: fix bbc_microbit pong build
The GATT caching feature isn't needed, and was making the memory
consumption blow up because of the recent addition of `long_wq` for
deferred work.

Fixes #47428 .

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2022-07-11 14:38:10 +02:00
Carlo Caione 541024eb43 riscv: litex-vexriscv: Add missing header
soc.h is using sys_read* functions. Add the proper header for that.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-07-11 14:31:39 +02:00
Carlo Caione 5d104f20ab riscv: Introduce API for CLIC and PLIC
Introduce a new interface for CLIC and PLIC to be used by the drivers.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-07-11 14:31:39 +02:00
Carlo Caione 364ad6dc64 riscv: Move IRQ code to a standalone header
arch.h is getting crowded. Move the IRQ code in a proper header file.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-07-11 14:31:39 +02:00
Carlo Caione 56466a14e1 riscv: Decouple CLIC and PLIC
Try to decouple CLIC and PLIC as much as possible.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-07-11 14:31:39 +02:00
Carlo Caione 31c5dc2230 Kconfig: Introduce RISCV_HAS_CLIC
Introduce a new RISCV_HAS_CLIC symbol for platforms using CLIC,
reorganize the Kconfigs and make the Nuclei ECLIC depending on the new
symbol.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-07-11 14:31:39 +02:00
Vinayak Kariappa Chettimada b397a950c5 Bluetooth: Controller: Fix missing reset of coded PHY scanning
When switching from Extended Scanning by Extended
Advertising HCI commands back to Legacy Scanning after a
HCI reset it is required that the coded PHY scanning
context is reset.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-07-11 14:15:13 +02:00
Pieter De Gendt f73ff469da manifest: nanopb: upmerge to version 0.4.6
The upstream version 0.4.6 was tagged. Upmerge the zephyr branch.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2022-07-11 14:15:06 +02:00
Pieter De Gendt 657a67d090 scripts/requirements: Replace protobuf with grpcio-tools
The nanopb module generates source files from .proto files,
however the latest protobuf v4.21.0 python package breaks
compatibility.
Using grpcio-tools instead fixes this.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2022-07-11 14:15:06 +02:00
Vinayak Kariappa Chettimada 265731b971 Bluetooth: Controller: Fix Extended Scan Address Resolution
Fix Extended Scanning Address Resolution that incorrectly
checked for Bit Count Comparison which is not to be checked
when explicit resolution is performed in the Rx ISR.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-07-11 13:53:19 +02:00
Vinayak Kariappa Chettimada 918585263e Bluetooth: Controller: Use maximum Adv PDU size time reservation
Use the maximum advertising PDU size time reservation
consider the Advertising Data could be updated from zero to
maximum support size. If maximum time reservation is
disabled then time reservation corresponding to the
Advertising Data present at the time of the start/enable
of Advertising is used.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-07-11 13:34:29 +02:00
Vinayak Kariappa Chettimada fab4511164 Bluetooth: Controller: Fix overlapping advertising events
When multiple advertising sets are support then use advanced
scheduling implementation to place multiple auxiliary PDUs
and periodic advertising PDUs in a non-overlapping schedule.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-07-11 13:34:29 +02:00
Aurelien Jarno 2ea4516a4a drivers/flash: stm32g0: Prepare for unaligned accesses in flash writes
When using the settings subsystem, the data argument argument passed to
flash_stm32_write_range() might not be 8-bytes aligned, causing an
unaligned memory access fault.

Fix that the same way as it was done for the STM32L4 in commit
652efa530f.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2022-07-11 13:28:45 +02:00
Guo Lixin dada9ea54b tests: kernel: gen_isr_table: move to new ztest API
Move tests/kernel/gen_isr_table/ to use new ztest API.

Signed-off-by: Guo Lixin <lixinx.guo@intel.com>
2022-07-11 13:23:27 +02:00
Gerard Marull-Paretas 2533b13cd2 drivers: gpio: nrfx: add custom drive flags
Now that we have 8 bits reserved for vendor specific GPIO flags,
introduce a new set of flags for nRF platforms to configure pins drive
mode. These new flags are equivalent to the previous existing ones, but
use a naming scheme the fits better with vendor hardware capabilities.

The table below shows the equivalence between old and new flag

| Old flags                 | New flags             |
|---------------------------|-----------------------|
| `NRF_GPIO_DS_DFLT_LOW`    | `NRF_GPIO_DRIVE_S0`   |
| `NRF_GPIO_DS_DFLT_HIGH`   | `NRF_GPIO_DRIVE_S1`   |
| `NRF_GPIO_DS_ALT_LOW`     | `NRF_GPIO_DRIVE_H0`   |
| `NRF_GPIO_DS_ALT_HIGH`    | `NRF_GPIO_DRIVE_H1`   |
| `NRF_GPIO_DS_DFLT`        | `NRF_GPIO_DRIVE_S0S1` |
| `NRF_GPIO_DS_ALT`         | `NRF_GPIO_DRIVE_H0H1` |
| `NRF_GPIO_DS_DFLT_LOW \|` | `NRF_GPIO_DRIVE_S0H1` |
| `NRF_GPIO_DS_ALT_HIGH`    |                       |
| `NRF_GPIO_DS_ALT_LOW \|`  | `NRF_GPIO_DRIVE_H0S1` |
| `NRF_GPIO_DS_DFLT_HIGH`   |                       |

Documentation has been written to explain in more detail the meaning of
the flags and how they can be used.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-07-11 13:22:24 +02:00
Gerard Marull-Paretas e29055a225 drivers: gpio: nrfx: remove custom DS flags
The naming of the custom DS flags is not clear for nRF platforms. This
patch removes all the NRF_GPIO_DS* flags. New flags will be
re-introduced in a follow-up commit.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-07-11 13:22:24 +02:00
Anas Nashif bfb65b054c cmake: binutils: find binutils nm for host compiler
We need this to generate symbols from final binary.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-11 11:56:39 +02:00
Anas Nashif 32c22cc63a ztest: generate symbols for tests
This will help with parsing testcases in test binaries.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-11 11:56:39 +02:00
Anas Nashif 47a673f2f4 build: generate symbols file
Optional way for generating symbols file using binutils. This file will
be generated on demand for tests which will then be parsed by twister to
create an accurate test plan from the listed testcase/suites.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-11 11:56:39 +02:00
Jordan Yates 8a2eed6cbd pm: device_runtime: use atomic_test_bit
Use `atomic_test_bit` when checking pm flags instead of manually using
bitwise operations.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2022-07-11 11:33:26 +02:00
Jordan Yates ab0bf48660 pm: device: store power state in all scenarios
Update the internal power state tracking for `PM_DEVICE_ACTION_TURN_ON`
and `PM_DEVICE_ACTION_TURN_OFF` even when the transition function fails.
Just because the driver couldn't perform some action does not mean the
device is still powered/unpowered.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2022-07-11 11:33:26 +02:00
Jordan Yates caca393aad pm: device: more complete state checking
Add state checking to every transition to ensure that the device is in
the state we think it is before running the action.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2022-07-11 11:33:26 +02:00
Torsten Rasmussen f08af4ce68 west: zcmake.py: support UNINITIALIZED type if CMakeCache.txt file
A variable set by the user with `-DVAR=<val>` will be given the type
UNINITIALIZED.

This results in the variable not being read into the cmake_cache.

Support reading of CMake cache variables of type UNINITIALIZED.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-07-11 11:33:15 +02:00
Kiril Petrov a4557a46b8 net: lwm2m: Pass client_ctx to observe callback
In case LWM2M cient wants to change attrs of observed obj,
it needs pointer to client_ctx.

For example:
On observer add, wants to change pmin for some obj path to 1s:

static void observe_cb(enum lwm2m_observe_event event,
		struct lwm2m_obj_path *path, void *user_data)
{
	struct lwm2m_ctx *ctx = (struct lwm2m_ctx *) user_data;

	switch (event) {
	case LWM2M_OBSERVE_EVENT_OBSERVER_ADDED:
		lwm2m_engine_update_observer_min_period(ctx, "3347", 1);
	...
}

Signed-off-by: Kiril Petrov <retfie@gmail.com>
2022-07-11 09:32:18 +00:00
Vinayak Kariappa Chettimada e027f0671a Bluetooth: Controller: Fix missing recv fifo reset
Fix missing recv fifo reset on HCI reset. This fix handles a
scenario where in Rx Prio thread has enqueued a node rx, Tx
thread handles HCI Reset Command, and Rx thread wakes up
from call to k_fifo_get to handle invalid node rx. The
changes here ensure Rx thread does not get any invalid node
rx post HCI Reset Command handled in Tx thread.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-07-11 11:28:07 +02:00
Kamil Piszczek 1eb9d36d46 bluetooth: add api for changing rpa timeout in runtime
Added a new Bluetooth API and Kconfig option for overriding the RPA
timeout in runtime.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2022-07-11 09:27:07 +00:00
Kamil Piszczek 8bdf363c0c bluetooth: adv: add rpa timeout callback to extended advertising api
Added a new callback to the Bluetooth Extended Advertising callback
structure. It notifies the application that the RPA validity of the
advertising set has timed out. The user can use this callback to
synchronize the advertising payload update with the RPA rotation.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2022-07-11 09:27:07 +00:00
Kamil Piszczek 4e924b6b1f bluetooth: id: sync advertising set start after rpa rotation
Synced the start of the advertising sets after each RPA rotation
in the Bluetooth identity module.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2022-07-11 09:27:07 +00:00
Alexandre Bourdiol 2d3c2efebd tests: arch: arm: arm-irq-vector-table: define _vector_end
Following implementation of commit 219d5b5,
and to complement commit 8c4f98d
it is also necessary define _vector_end in
test specific arm-irq-vector-table.ld

Fixes #47273

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2022-07-11 09:23:05 +00:00
Manuel Arguelles f2ae4b67b2 tests: samples: bump timeout for FVP BaseR board
Timeout must be increased for fvp_baser_aemv8r_aarch32 board. Enabling
MPU on this board makes simulation slower.

Signed-off-by: Manuel Arguelles <manuel.arguelles@nxp.com>
2022-07-11 11:17:02 +02:00
Manuel Arguelles be8c7e5a32 tests: error_hook: skip div-by-zero on FVP BaseR
Division-by-zero does not generate an exception on ARM FVP BaseR.

Signed-off-by: Manuel Arguelles <manuel.arguelles@nxp.com>
2022-07-11 11:17:02 +02:00
Manuel Arguelles 354254ff2b arch: arm: aarch32: mpu: fix is in region check
Buffer size must be decreased by one when non-zero to calculate the
right end address, and this must be checked for overflows.

Variables for region limit renamed for clarity since they may be
understood as the raw register values.

Signed-off-by: Manuel Arguelles <manuel.arguelles@nxp.com>
2022-07-11 11:17:02 +02:00
Julien Massot 189caf368e boards: arm: fvp_baser_aemv8r_aarch32: enable ARM_MPU
Now that we have support for ARMv8-R MPU and static
mpu regions define at SoC level we can enable the ARM MPU.

Signed-off-by: Julien Massot <julien.massot@iot.bzh>
Signed-off-by: Manuel Arguelles <manuel.arguelles@nxp.com>
2022-07-11 11:17:02 +02:00
Julien Massot 08f5fb5cdb soc: arm: fvp_aemv8r_aarch32: define static mpu regions
Add static MPU regions for this SoC.
These regions will be initialized as static region during system boot.

Signed-off-by: Julien Massot <julien.massot@iot.bzh>
Signed-off-by: Manuel Arguelles <manuel.arguelles@nxp.com>
2022-07-11 11:17:02 +02:00
Julien Massot ddcc5fb28d arch: arm: aarch32: add ARMv8-R MPU support
ARMv8-R aarch32 processor has support for
ARM PMSAv8-32. To add support for ARMv8-R we reuse the
ARMv8-M effort and change access to the different registers
such as rbar, rlar, mair, prselr.

Signed-off-by: Julien Massot <julien.massot@iot.bzh>
Signed-off-by: Manuel Arguelles <manuel.arguelles@nxp.com>
2022-07-11 11:17:02 +02:00
Daniel Leung ff54de3e16 tests: logging/log_api: add bits to test backend events
This adds a few bits to the log_api tests to test backend
event notifications.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-07-11 11:09:31 +02:00
Daniel Leung d0d6e1181c logging: backend: notify when process thread finishes one cycle
This adds the bits to allow the process thread to notify
backends when it has finished processing pending log messages.

This allows, for example, flash-based backends to group writing
log messages to storage to limit wear, since log_output_flush()
is called per message. Also the backend does not have to resort
to using timer to periodically flush its buffer to storage,
avoiding waking up the device when there are no messages.
Another use of this is for backends requiring DMA transfers.
Grouping all pending log messages into one DMA transfer is
sometimes preferrable.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-07-11 11:09:31 +02:00
Daniel Leung 31c13c892c logging: backend: add event notification support
This adds an API for backends to support event notification.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-07-11 11:09:31 +02:00
Xiao Song eda0bef213 tests: net: hostname: move to new ztest API
Move tests/net/hostname/ to use new ztest API.

Signed-off-by: Xiao Song <songx.xiao@intel.com>
2022-07-11 11:06:42 +02:00
Andrzej Głąbek 89421bf758 boards: thingy53_nrf5340: Reference usbd node from the common dts file
The thingy53_nrf5340 board definition based on the nrf5340dk_nrf5340
and thus added separate references to the usbd node for the secure and
non-secure targets, what unnecessary complicates things. This commit
replaces the references with one done from the common cpuapp dts file.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2022-07-11 11:03:56 +02:00
Andrzej Głąbek 915419ca2b boards: nrf5340dk_nrf5340: Clean up common cpuapp dts node definitions
In commit 619a498845, the initialization
of the spi2 node has been moved from the nrf5340_cpuapp_common.dts file
to separate dts files for secure/non-secure targets. That was done
to make the node unavailable in the nRF5340 PDK, that was also using
the common file, because it was non-functional on that board.
For the same reason, the initialization of the usbd node could not
be done in the common file and instead it had to be added separately
for the secure and non-secure targets.
Now that the nRF5340 PDK is no longer supported, there is no point in
keeping such complication. The usbd node initialization is moved to the
common file but the spi2 node initialization is removed and instead the
spi4 node is enabled, as it is labeled as arduino_spi and is assigned
with the same pins.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2022-07-11 11:03:56 +02:00
Simen S. Røstad 92eb309918 net: lib: lwm2m: Give Kconfig choices symbol names
Give Kconfig choices symbols names so that they can be redefined in
applications that wants to alter the choice's default value without
setting it in the project configuration.

Signed-off-by: Simen S. Røstad <simen.rostad@nordicsemi.no>
2022-07-11 11:03:41 +02:00