Commit graph

87316 commits

Author SHA1 Message Date
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
Nick Ward 0df794e316 drivers: gpio: shell: improve tab complete/suggestion support
This commit implements this enhancement:
https://github.com/zephyrproject-rtos/zephyr/issues/63018

The forms of the gpio commands are now:

        gpio conf device pin ol0
        gpio set device pin 1
        gpio get device pin
        gpio blink device pin

Device name and pin subcommands now are
suggested/completed when tab is used.

Pin names are suggested with numbers and line names if
available from the gpio controller’s Devicetree node.

GPIO pin command is now limited to pins that are not assigned
as reserved.

Signed-off-by: Nick Ward <nix.ward@gmail.com>
2023-11-17 12:41:14 +01:00
Nick Ward 7a83724e0f boards: nrf52840dk_nrf52840: add gpio reserved ranges and line names
Add gpio-reserved-ranges and gpio-line-names properties.

Signed-off-by: Nick Ward <nix.ward@gmail.com>
2023-11-17 12:41:14 +01:00
Jukka Rissanen 5209666539 net: mdns: Fix compile error when using clang
No issues with gcc but clang gives this error for
the *v4 variable few lines below.

.../lib/dns/mdns_responder.c:712:2: error: expected expression
        struct net_context *v4;

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-11-17 12:40:33 +01:00
Jukka Rissanen 9246d98a6a samples: net: mdns_responder: Add VLAN support
Add virtual LAN support to the sample so that it is easier to
test the multiple mDNS listener feature implemented in previous
commit.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-11-17 12:40:33 +01:00
Jukka Rissanen 5049a049db net: mdns: Create a listener to all available network interfaces
Instead of just listening first network interface in the system,
install a multicast listener to all available network interfaces.

Fixes #18748

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-11-17 12:40:33 +01:00
Jukka Rissanen dd2a222086 net: if: Add helper to calculate number of interfaces
Add a helper macro that can be used at runtime to return
the number of network interfaces in the system.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-11-17 12:40:33 +01:00
Jukka Rissanen 3f891ced3a net: conn: Check also network interface for duplicates
When verifying if there are duplicate connections, check
also network interface.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-11-17 12:40:33 +01:00
Jukka Rissanen 8157b48734 net: context: Add function to bound to a network interface
Helper function that marks the net_context to bound to a
network interface.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-11-17 12:40:33 +01:00
Jukka Rissanen 31ee2e678d net: context: Allow binding to different interfaces
Allow user to bind to different network interface. This is
useful if binding a multicast address to a certain network
interface.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-11-17 12:40:33 +01:00
Adam Wojasinski 599bcb1e5d drivers: watchdog: wdt_nrfx: Implement disable API
nRF5340 SoC has `TASK_STOP` this patch implements disabling
watchdog for that SoC and enables allowing WDT to STOP in WDT setup.

Signed-off-by: Adam Wojasinski <adam.wojasinski@nordicsemi.no>
2023-11-17 10:00:53 +01:00
Adam Wojasinski 968916572c drivers: watchdog: wdt_nrfx: Remove config field from config structure
The field config of `nrfx_wdt_config_t` type is redundant in device
config structure. Instead of that local variable is used in the setup
function.

Signed-off-by: Adam Wojasinski <adam.wojasinski@nordicsemi.no>
2023-11-17 10:00:53 +01:00
Anas Nashif f25e2201a4 tests: fix various test identifiers
Fix a few inconsistent test identifiers.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-11-17 09:27:40 +01:00
Fabio Baltieri 190f0dde26 doc: migration-guide: annotate various entry with the PR numbers
Add a PR number reference to various migration guide entries.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-11-17 09:27:26 +01:00
Filip Kokosinski 3b96c2421e MAINTAINERS: add the PLIC interrupt controller driver to the RISC-V area
This commit adds the RISC-V Platform-Level Interrupt Controller driver to
the RISC-V area of maintenance.

Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
2023-11-17 09:26:33 +01:00
Jonathan Rico dfd7624270 Revert "Bluetooth: att: use a dedicated metadata struct for RSP PDUs"
This reverts commit 14858d96d87d33ebb593d61380f4607e14107287.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2023-11-17 09:26:08 +01:00
Jonathan Rico bd9c35b496 Revert "Bluetooth: att: re-use REQ buf for RSP"
This reverts commit aa7954bd4725bbd46e974a03c0d0312b7e9a483f.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2023-11-17 09:26:08 +01:00
Jonathan Rico 530e845f92 Revert "Bluetooth: att: don't re-use the ATT buffer for confirmations"
This reverts commit 4cd0748a407b118145916393a954231ee11abb1e.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2023-11-17 09:26:08 +01:00
Guennadi Liakhovetski e0ea44cbfa llext: fix symbol address calculation for ET_DYN
Symbopl tables of ELF objects of type ET_REL contain offsets instead
of addresses as for ET_DYN.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-11-17 09:25:42 +01:00
Guennadi Liakhovetski 21cea07b8c llext: fix a confusion between section indices
A common pattern is used throughout llext.c:

ext->mem[ldr->sect_map[sym.st_shndx]]

where ldr->sect_map[sym.st_shndx] actually contains indices from
enum llext_section but ext->mem[] is indexed, using enum llext_mem
values. Fix this by changing ldr->sect_map[] to actually contain
enum llext_mem values.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-11-17 09:25:42 +01:00
Guennadi Liakhovetski eb3071ebe8 llext: check for an allocation failure
Add a missing allocation failure check in llext_export_symbols().

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-11-17 09:25:42 +01:00
Guennadi Liakhovetski fb92636056 llext: remove a symbol count copy
The symbol count in struct llext_loader is redundant, we already have
one in struct llext_symtable, accessible via struct llext. Remove the
redundant copy.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-11-17 09:25:42 +01:00
Guennadi Liakhovetski db43d35f61 llext: (cosmetic) remove an unused variable
op_code in llext_link() is unused, remove it.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-11-17 09:25:42 +01:00
Guennadi Liakhovetski 60aef84cad llext: (cosmetic) use a local variable
Simplify llext_copy_symbols() by using a local variable to store a
pointer.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-11-17 09:25:42 +01:00
Guennadi Liakhovetski fef999c06f llext: (cosmetic) remove "inline" in llext.c
Let the compiler decide which functions to inline.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-11-17 09:25:42 +01:00
Aleksander Wasaznik bf2f065876 Bluetooth: Host: Remove ifdef around sc_indicate
Instead, `sc_indicate` is defined as a no-op when if would previously
not be defined.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2023-11-17 09:25:34 +01:00
Fabio Baltieri 3452f9fa4e input: it8xxx2_kbd: drop unnecessary include
Drop the atomic.h included, this does not use any atomic anymore.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-11-17 08:25:27 +00:00
Fabio Baltieri 716281b5c9 input: kbd_matrix: move few assignment off the declaration area
Move a couple of automatic variable assignment off the declaration
block, leaves only structure aliases there, makes it a bit easier to
read.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-11-17 08:25:27 +00:00