Commit graph

87343 commits

Author SHA1 Message Date
Alberto Escolar Piedras eae99c1035 tests net/ptp/clock: Enable for native_sim
Enable these tests for native_sim and switch from
native_posix to native_sim as default test platform

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-20 09:21:13 +01:00
Alberto Escolar Piedras 18d27f0a29 tests ieee802154: Enable for native_sim
Enable these tests for native_sim and switch from
native_posix to native_sim as default test platform

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-20 09:21:13 +01:00
Alberto Escolar Piedras 6bba2d955b tests/net/traffic_class: Enable for native_sim
Enable these tests in native_sim
and switch from native_posix to native_sim as default
test platform

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-20 09:21:13 +01:00
Alberto Escolar Piedras ef346c2505 tests input/gpio_keys: Switch from native_posix to native_sim
Switch from native_posix to native_sim as default test platform

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-20 09:20:59 +01:00
Alberto Escolar Piedras e13acd2f29 tests fuel_gauge/sbs_gauge: Enable for native_sim
Enable for native_sim

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-20 09:20:59 +01:00
Alberto Escolar Piedras 3ff73f22a4 tests fuel_gauge/max17048: Switch from native_posix to native_sim
Switch from native_posix to native_sim as default test platform

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-20 09:20:59 +01:00
Alberto Escolar Piedras c6f5dbe8a7 tests fuel_gauge/bq27z746: Switch from native_posix to native_sim
Switch from native_posix to native_sim as default test platform

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-20 09:20:59 +01:00
Alberto Escolar Piedras 64cb9a4540 tests/drivers/regulator/api: Enable for native_sim
Enable for native_sim.
and switch from native_posix to native_sim as default
test platform

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-20 09:20:59 +01:00
Alberto Escolar Piedras be8f4e104b tests/drivers espi: Switch from native_posix to native_sim
Switch from native_posix to native_sim as default test platform

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-20 09:20:59 +01:00
Alberto Escolar Piedras 7d5772d2d6 tests/drivers/pinctrl/api: Enable for native_sim
Enable for native_sim.
and switch from native_posix to native_sim as default
test platform

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-20 09:20:59 +01:00
Alberto Escolar Piedras b85aef003c tests/drivers/build_all/sensor: Enable for native_sim
And switch from native_posix to native_sim as default
test platform

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-20 09:20:59 +01:00
Alberto Escolar Piedras 1846fa6f2c tests/drivers ina237: Switch from native_posix to native_sim
Switch from native_posix to native_sim as default test platform

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-20 09:20:59 +01:00
Alberto Escolar Piedras 5327ba38e5 tests/drivers ina230: Switch from native_posix to native_sim
Switch from native_posix to native_sim as default test platform

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-20 09:20:59 +01:00
Alberto Escolar Piedras 75006ad9af tests/drivers akm09918c: Switch from native_posix to native_sim
Switch from native_posix to native_sim as default test platform

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-20 09:20:59 +01:00
Alberto Escolar Piedras 5dbb71cc6f tests/drivers icm42688: Switch from native_posix to native_sim
Switch from native_posix to native_sim as default test platform

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-20 09:20:59 +01:00
Alberto Escolar Piedras 3175a81da5 tests/drivers adltc2990: Switch from native_posix to native_sim
Switch from native_posix to native_sim as default test platform

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-20 09:20:59 +01:00
Alberto Escolar Piedras 95bf611ac6 tests/drivers sbs_gauge: Switch from native_posix to native_sim
Switch from native_posix to native_sim as native test platform

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-20 09:20:59 +01:00
Benjamin Lindqvist 1d6d24b6ef net: lwm2m: don't load credentials on plaintext context
Since lwm2m_load_tls_credentials(ctx) will assume that the ctx has a
valid security object assigned to it, it should not be called at all
when ctx.use_dtls == false.

This solves a major bug where LwM2M comms are DTLS encrypted but FOTA is
allowed to be plain-text.

Signed-off-by: Benjamin Lindqvist <benjamin@eub.se>
2023-11-20 09:20:43 +01:00
Juha Heiskanen 07ae06f8fe mgmt: mcumgr: Doxygen tags update
Added a missing defgroup and ingroup for mcmumgr client
and smp client.

Signed-off-by: Juha Heiskanen <juha.heiskanen@nordicsemi.no>
2023-11-20 09:20:25 +01:00
Piotr Wojnarowski 6670dbe834 tests: drivers: intc_plic: Add tests for register index and offset
Add a test to verify that the regression from
ffb8f31bff is fixed.

Signed-off-by: Piotr Wojnarowski <pwojnarowski@antmicro.com>
2023-11-20 09:20:13 +01:00
Piotr Wojnarowski 3afe238926 drivers: intc: plic: Fix memory-mapped register offset calculation
Previously, the PLIC's registers were accessed through uint32_t *,
so all calculated offsets were effectively multiplied by
sizeof(uint32_t). Do the same manuallly now that we have
mem_addr_t/sys_read32.

Signed-off-by: Piotr Wojnarowski <pwojnarowski@antmicro.com>
2023-11-20 09:20:13 +01:00
Piotr Wojnarowski 3ef34ff6d1 drivers: intc: plic: Make function names and types consistent
`get_claim_complete_offset` and `get_threshold_priority_offset` actually
return addresses directly. Rename them to `_addr` for consistency within
the driver. Also change their return type to `mem_addr_t`.

Signed-off-by: Piotr Wojnarowski <pwojnarowski@antmicro.com>
2023-11-20 09:20:13 +01:00
Laurentiu Mihalcea 43a0839c6c drivers: dma: Add SOF host DMA driver
This commit introduces the SOF host DMA driver.
This driver is used by NXP platforms in the context of
SOF's host component to copy data from the host memory
to the firmware (local) memory. This is possible because
NXP platforms can access the host memory directly w/o
an actual DMA engine.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-11-20 09:19:53 +01:00
Natalia Pluta 8b2c5120aa drivers: sensor: qdec_nrfx: Add support for new QDEC instances
Introducing support for new QDEC instances in the driver.

Signed-off-by: Natalia Pluta <natalia.pluta@nordicsemi.no>
2023-11-20 09:19:45 +01:00
Natalia Pluta f5658254e8 modules: hal_nordic: Add QDEC Kconfig symbols and translation to nrfx
Add Kconfig symbols for QDEC instances (20, 21, 130, 131) and
translation symbols used in nrfx drivers.

Signed-off-by: Natalia Pluta <natalia.pluta@nordicsemi.no>
2023-11-20 09:19:45 +01:00
Natalia Pluta d7d11ef09f soc: arm: nordic_nrf: Add Kconfig symbols for QDEC instances
Add QDEC instances 20, 21, 130, 131

Signed-off-by: Natalia Pluta <natalia.pluta@nordicsemi.no>
2023-11-20 09:19:45 +01:00
Pieter De Gendt 0156593221 bindesc: Use zephyr_library_add_dependencies
Replace usage of add_dependencies(${ZEPHYR_CURRENT_LIBRARY} ...)

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2023-11-20 09:19:34 +01:00
Pieter De Gendt 8f8a77abc9 modules: hal_rpi_pico: Use zephyr_library_add_dependencies
Replace usage of add_dependencies(${ZEPHYR_CURRENT_LIBRARY} ...)

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2023-11-20 09:19:34 +01:00
Pieter De Gendt 58152eb938 cmake: modules: Add zephyr_library_add_dependencies extension
Add a CMake zephyr library extension for add_dependencies, similar
to the target_<func> functions.
This avoids using ${ZEPHYR_CURRENT_LIBRARY} directly.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2023-11-20 09:19:34 +01:00
Daniel Leung f52f76fd6b doc: kernel/mm: some doxygen works
() Some kernel memory management functions were previously
   not in any group. So put them under the kernel memory
   management group, and now they appear in API doc.
() Group things together when appropriate.
() Add doc if none exists before.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-11-20 09:19:14 +01:00
Daniel Leung f12d49d7ef kernel: mm: separate demand paging headers into its own file
This separates demand paging related headers into its own file
instead of being stuffed inside the main kernel memory
management header file.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-11-20 09:19:14 +01:00
Daniel Leung c972ef1a0f kernel: mm: move kernel mm functions under kernel includes
This moves the k_* memory management functions from sys/ into
kernel/ includes, as there are kernel public APIs. The z_*
functions are further separated into the kernel internal
header directory.

Also made a quick change to doxygen to group sys_mem_* into
the OS Memory Management group so they will appear in doc.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-11-20 09:19:14 +01:00
Flavia Caforio 524ed5dbc1 drivers: counter: nrf_timer: Add event clear to set_top_value
At present, if you want to set a periodic timer again with
set_top_value, the last triggered event is not cleared. This could
result in an old event being served at the next interrupt activation.

The solution proposed in this patch adds the nrf_timer_event_clear
function into set_top_value to prevent this from happening in the
above case.

Signed-off-by: Flavia Caforio <flavia.caforio@amarulasolutions.com>
2023-11-20 09:19:02 +01:00
Andriy Gelman 0d1fa268bb drivers: clock_control: Add PWM clock device
Adds a clock control device for a PWM node, allowing the PWM
to be controlled using the clock control API.

It is a similar idea to the device driver in linux:
linux/Documentation/devicetree/bindings/clock/pwm-clock.yaml

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2023-11-20 09:18:44 +01:00
Daniel Leung b485cd717b xtensa: remove unused z_mp_entry declaration
z_mp_entry has been removed from Xtensa architecture.
So there is no need for a function declaration. Remove it.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-11-17 18:23:06 -05:00
Nicolas Pitre 21d885535e MAINTAINERS: declare myself as a RISC-V collaborator
... given that 62.5% of the code in arch/riscv/core/* is mine.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2023-11-17 18:22:02 -05:00
Manuel Argüelles 92fb8b2238 arm: nxp_mpu: enable module's clock only when needed
NXP SYSMPU is used in other SoCs besides the Kinetis series. For
devices like S32K1xx, its bus interface clock lacks of clock gating
and it's driven by the system clock. Hence, only enable the module
clock for the Kinetis series.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-11-17 13:44:27 -06:00
Manuel Argüelles da3d9197a6 include: arm: nxp_mpu: remove redundant HAL include
The inclusion of `fsl_common.h` solely for defining `NXP_MPU_BASE`
is redundant, as this symbol is not used. Consequently, this
unnecessary inclusion leads to the pervasive inclusion of HAL
headers through kernel headers.
The needed HAL definitions are already included into the NXP MPU
driver implementation via the SoC header.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-11-17 13:42:48 -06:00
Jun Lin 317d070222 tests: timer_behavior: increase stdev tolerance for npcx timer
Change the stdev tolerance stdev from 10 to 33 when npcx timer is used.
This is because the clock source of npcx event timer, which is used to
generate the timeout interrupt, is running at 32.768 KHz.
(i.e. 1 count = ~30.5 us.) The conversion from the absolute system timer
to the event timer count might have -30.5 ~ 30.5 deviation.
The tolerance setting is under the assumption that test sampes are
evenly located at 1030.5 and 969.5 for the worst case.

Fixes #59594

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
2023-11-17 17:24:14 +00:00
Jun Lin 4cfd4b5379 driver: timer: npcx: fix announce/set timer timeout tick
The timer driver doesn't annouce/set the timeout at the tick boundary
but at the absolute next expiration time.
It will cause the accumatlation of the tick drift and cannot pass the
kernel/timer/timer_behavior test suite.
This commit fixes the tick drift problem by annouce the time at the tick
bouandry.

Fixes #59594

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
2023-11-17 17:24:14 +00:00
Ian Morris dfc747d53a samples: sensor: dht_polling: Add generic dht sample application
This simple application periodically prints the temperature and humidity
measured by one or more digital humidity/temperature sensors.

Signed-off-by: Ian Morris <ian.d.morris@outlook.com>
2023-11-17 10:33:02 -06:00
Ian Morris 4c92419546 drivers: sensor: hs300x: Add driver for Renesas HS300x sensors
Adds support for Renesas HS3001 and HS3003 temperature/humidity sensors
connected via an I2C bus.

Signed-off-by: Ian Morris <ian.d.morris@outlook.com>
2023-11-17 10:33:02 -06:00
Jamie McCrae ce3ba0dfd2 modules: openthread: platform: radio: Rename missed type
Fixes an issue whereby a rename of a variable type has been
forgotten in an instance, which now uses the correct type name

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-11-17 16:00:07 +01:00
Josuah Demangeon 2dce408bc3 drivers: serial: uart_liteuart: fix interrupt-driven mode
Interrupt-driven mode was not working, and disabled by default.
When it was forced on, the behavior was to only have a few bytes:
as many as min(CONFIG_SHELL_BACKEND_SERIAL_TX_RING_BUFFER_SIZE, 9).

After the hardware FIFO was filled by software and emptied by hardware,
no interrupt occured, and enqueuing more data did never happen.

By letting the events enabled for TX (only), then interrupts are still
generated after the first transfer, and the software can then add the
subsequent transfers until all data is print: the UART works.

It does not generate endless interrupts either, which was tested by
adding litex_write8('%', UART_RXTX_ADDR) in liteuart_uart_irq_handler()
to log all interrupts events, and when there is nothing to print, no
interrupt is fired.

It was tested with the Zephyr shell.

Fixes #63794

Signed-off-by: Josuah Demangeon <me@josuah.net>
2023-11-17 15:29:14 +01:00
Alberto Escolar Piedras bc08e801c6 native_sim build: Fix for APPLICATION_BINARY_DIR!=CMAKE_BINARY_DIR
In some cases, the APPLICATION_BINARY_DIR does not match
the CMAKE_BINARY_DIR, in those cases the native simulator
build would not find the zephyr elf file.
Fix it by using the correct variable.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-17 12:42:17 +01:00
Torsten Rasmussen 19d250e1dc sysbuild: create sysbuild_cache function
Create dedicated function, sysbuild_cache(), for handling sysbuild's
image specific cache file.

This provides a cleaner handling of said cache file, and provides a
mechanism for updating the cache file at later sysbuild CMake stages.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2023-11-17 12:41:55 +01:00
Nick Ward cd9f307e71 drivers: gpio: shell: add vendor specific flags argument
Allow the optional setting of vendor specific flags in the conf command.

Signed-off-by: Nick Ward <nix.ward@gmail.com>
2023-11-17 12:41:14 +01:00
Nick Ward 738a1517b1 drivers: gpio: shell: optimise blink command
Use gpio toggle api instead of manually toggling.
Remove redundant text.
Print error and break from blinking if it occurs.
Only print 'how to exit' text if first toggle is successful.

Saves roughly 40 bytes.

Signed-off-by: Nick Ward <nix.ward@gmail.com>
2023-11-17 12:41:14 +01:00
Nick Ward 45509fdc0e drivers: gpio: shell: make blink command optional
Adds CONFIG_GPIO_SHELL_BLINK_CMD symbol.
Saves around 300 bytes when command is disabled.

Signed-off-by: Nick Ward <nix.ward@gmail.com>
2023-11-17 12:41:14 +01:00
Nick Ward 695a0ac503 drivers: gpio: shell: add info command
Usage:
gpio info [device]

The new command prints gpio controller information
for a specific device if specified or if no device is specified
it prints out all controller information ordered by line name.

Also added Kconfig option so this command can be removed if
resources need to be conserved.

Signed-off-by: Nick Ward <nix.ward@gmail.com>
2023-11-17 12:41:14 +01:00