Commit graph

87723 commits

Author SHA1 Message Date
Hein Wessels f27e45473a drivers: adc: stm32: driver now agnostic of actual dma name
Previously the STM32 DMA driver was dependent on a very specific
name for the DMA in the DTS. This hidden requirement has caused
a bit of confusion. This commit changes the driver to instead
always use the first DMA listed in the ADC node's dma property.

Should fix: #65387

Signed-off-by: Hein Wessels <heinwessels93@gmail.com>
2023-11-23 10:00:50 +01:00
Hein Wessels 2750e1e3b5 drivers: dma: stm32: add utilities to access properties by idx
Some drivers like the ADC access the DMA through it's index
and not the DMA name. This commit add some better support
for such instances.

Signed-off-by: Hein Wessels <heinwessels93@gmail.com>
2023-11-23 10:00:50 +01:00
Siddharth Chandrasekaran 5b24a8ad72 mgmt/osdp: Fix off-by-one in buf len checks
Initially, the command/reply ID byte was not part of the data length
macros. But later, when it was changed to include it, the buffer length
checks was not adjusted. Due to this, we were not using the last byte in
the buffer. Fix this issue by correcting the condition.

Signed-off-by: Siddharth Chandrasekaran <sidcha.dev@gmail.com>
2023-11-23 09:59:52 +01:00
Siddharth Chandrasekaran 061a87aff8 mgmt/osdp: Replace __ASSERT() with an explicit if
Commit c7fec71193 ("mgmt/osdp: Add length checks for commands and
replies") attempted to remove code duplication by adding a macro to perform
a length check. At the time, a CI linter did not like macros with control
flow so the code was switched to a method which called __ASSERT() on this
condition.

The __ASSERT() macro is a nop if CONFIG_ASSERT=n (which is the default) and
causes the buffer access to be unguarded which may lead to OOB accesses.
This patch fixes the issue by reintroducing the if check.

Fixes: c7fec71193.
Signed-off-by: Siddharth Chandrasekaran <sidcha.dev@gmail.com>
2023-11-23 09:59:52 +01:00
Andrej Butok d2bd778bcc kconfig: mcuboot: Add MCUBOOT_IMGTOOL_OVERWRITE_ONLY option
Add MCUBOOT_IMGTOOL_OVERWRITE_ONLY Kconfig option which
passes the --overwrite-only option to imgtool to avoid
adding the swap status area size when calculating overflow.
It is used by non-swap update modes.

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2023-11-23 09:59:36 +01:00
Christopher Friedt 41b7c17ac4 tests: posix: pthread: check that pthread_atfork() exists
Add a simple existence check that pthread_atfork() has
some kind of implementation. The function is mandatory
by all conforming POSIX systems.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-11-23 00:59:32 -05:00
Christopher Friedt 1d501a76af doc: services: portability: posix: pthread_atfork() supported
Mark pthread_atfork() as supported in the documentation.

This option is a mandatory requirement (i.e. it must be present)
even when calling it produces undefined behaviour. That is the
case here, and documentation sbould be updated to reflect that.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-11-23 00:59:32 -05:00
Christopher Friedt a0c307c0a5 posix: pthread: implement pthread_atfork()
pthread_atfork() is required by the POSIX_THREADS_BASE
Option Group as detailed in Section E.1 of IEEE-1003.1-2017.

The POSIX_THREADS_BASE Option Group is required for PSE51,
PSE52, PSE53, and PSE54 conformance, and is otherwise
mandatory for any POSIX conforming system as per Section
A.2.1.3 of IEEE-1003-1.2017.

Since Zephyr does not yet support processes and (by extension)
fork(), this implementation includes a deviation and should be
categorized as producing undefined behaviour.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-11-23 00:59:32 -05:00
Christopher Friedt 3b45235887 doc: posix: structural reorganization of posix docs
Revise the structure of the POSIX API docs. This separates
related items out to dedicated pages. Further improvements
could yet be made - e.g. using the 'collapse' feature to
expand and collapse large sections of text or tables.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-11-22 22:47:26 -05:00
Fabio Baltieri 5efa5b2892 tests: drop input_ prefix from input tests
These are already in a "input" subdirectory, the prefix is redundant,
drop it.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-11-22 23:22:38 +00:00
Fabio Baltieri d9fd752392 sensor: mchp_tach_xec: drop PM_DEVICE guards
These are not needed and are now causing build errors since the
pm_device calls are always there and need the header to become a no-op.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-11-22 21:54:45 +00:00
Marek Matej d34f725df8 soc: xtensa: esp32s3: Update SOC variant list
Add missing combinations of the ESP32-S3 Wroom module.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2023-11-22 21:56:39 +01:00
Jamie McCrae 46889819e6 cmake: modules: dts: Fix board revision 0 overlay
Fixes an issue whereby a board revision is 0 and the overlay file
exists but would not be included

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-11-22 21:55:17 +01:00
Bartosz Bilas 43d5f39209 zbus: add MULTITHREADING dependency
Zbus uses mutexes internally that are available
only when MULTITHREADING is enabled so add
it to fix the following error:

/opt/zephyr-sdk-0.16.3/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/
12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/subsys/
zbus/libsubsys__zbus.a(zbus.c.obj): in function `k_mutex_init':
/builds/zephyr/mcuboot/zephyr/include/generated/syscalls/kernel.h:969:
undefined reference to `z_impl_k_mutex_init'

Signed-off-by: Bartosz Bilas <b.bilas@grinn-global.com>
2023-11-22 21:54:44 +01:00
Fabio Baltieri 939b90be4c drivers: drop few redundant guard around pm_policy_state_lock_*
The pm_policy_state_lock_put and pm_policy_state_lock_put functions
already become a no-op if CONFIG_PM is not enabled. Drop the guards
around it in few different drivers.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-11-22 18:34:36 +00:00
Jamie McCrae 2a6cec0687 west.yml: MCUboot synchronization from upstream
Update Zephyr fork of MCUboot to revision:
  47b34362552835621bc289d53d2127691088cb7c

Brings following Zephyr relevant fixes:
 - 47b34362 zephyr: kconfig: Prevent MBEDTLS selection when
   tinycrypt is used
 - cd82f8bf boot: zephyr: add support for lpcxpresso55s28

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-11-22 17:32:33 +01:00
Jamie McCrae 67696b7311 sysbuild: mcuboot: Disable signing key in no signing mode
Prevents allowing the user to enter a signing key when the signing
mode is set to hash check only without signatures

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-11-22 17:32:33 +01:00
Jamie McCrae bd6d43d4c8 sysbuild: bootloader: Fix setting application Kconfig in MCUboot
Fixes wrongly setting configuration to generate an unsigned image
in the MCUboot configuration when this does not apply to MCUboot

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-11-22 17:32:33 +01:00
Anisetti Avinash Krishna 6de5a1a5d5 tests: drivers: uart: uart_async_api: Enabled tests for rpl_s platform
Enabled tests for intel_rpl_s_crb platform.

Signed-off-by: Anisetti Avinash Krishna <anisetti.avinash.krishna@intel.com>
2023-11-22 17:31:08 +01:00
Anisetti Avinash Krishna 7b412be883 dts: x86: intel: raptor_lake: Added LPSS dma node for UART
Added LPSS dma node for UART Async API support

Signed-off-by: Anisetti Avinash Krishna <anisetti.avinash.krishna@intel.com>
2023-11-22 17:31:08 +01:00
Anisetti Avinash Krishna 05fd5b0426 boards: x86: intel_rpl: Added modifications for Asycn NS16550
Added modifications to support async apis for ns16550
on RPL-s using LPSS DMA.

Signed-off-by: Anisetti Avinash Krishna <anisetti.avinash.krishna@intel.com>
2023-11-22 17:31:08 +01:00
Anisetti Avinash Krishna f66930fd3e drivers: uart: uart_ns16550: Enable Async operations using DMA
Enabled Async API feature for ns16550 driver using DMA support.

Signed-off-by: Anisetti Avinash Krishna <anisetti.avinash.krishna@intel.com>
2023-11-22 17:31:08 +01:00
Huifeng Zhang 716de6fef2 MAINTAINERS: Add myself to ARM arch as collaborator
Adding myself as a collaborator on ARM arch so that I can help maintain
the aarch32 cortex-a/r codes.

Signed-off-by: Huifeng Zhang <Huifeng.Zhang@arm.com>
2023-11-22 14:58:12 +00:00
Ian Morris 18c4574786 drivers: clock_control: clock_control_ra.c: main oscillator select fix
Due to a typo it is not possible to select the main oscillator (MOSC) as a
clock source for an RA Microcontroller. This patch resolves the issue.

Signed-off-by: Ian Morris <ian.d.morris@outlook.com>
2023-11-22 14:57:23 +00:00
Rander Wang efc3208189 soc: intel_adsp: cavs: mask idc interrupt before halting cpu
Secondary dsp is idle and waiting for interrupt before it is totally
halted. The other active cores can trigger idc interrupt to this core,
this can wake it up and result to fw panic. Mask idc interrupt as timer
interrupt to prevent this case.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2023-11-22 14:57:07 +00:00
Peter van der Perk 5edb7cbe41 soc: arm: nxp_imx: rt11xx: add support for CONFIG_ETH_MCUX_RMII_EXT_CLK
ENET_REF_CLK as an input during rt11xx clock initialization.

Signed-off-by: Peter van der Perk <peter.vanderperk@nxp.com>
2023-11-22 14:56:38 +00:00
Najumon B.A c0d61d0bbd board: x86: remove parent init level dependency config
remove parent init level config from Intel Alder Lake platform

Signed-off-by: Najumon B.A <najumon.ba@intel.com>
2023-11-22 14:56:18 +00:00
Najumon B.A 608cc4d1f2 drivers: ns16550: remove parent init level dependency
remove parent init level dependency such as PRE_KERNEL or
POST_KERNEL. Uart driver init level change always to PRE_KERNEL

Signed-off-by: Najumon B.A <najumon.ba@intel.com>
2023-11-22 14:56:18 +00:00
Aleksander Wasaznik 589f3ad904 Bluetooth: testlib: Create testlib/conn.h
This header file declares the functions that rely on `bluetooth/conn.h`.

This collects `testlib/connect.h`, `conn_ref.h` and `conn_wait.h` into one.

Initial documentation for the functions in this file is also added.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2023-11-22 14:55:43 +00:00
Aleksander Wasaznik 4e976e0d58 sys: atomic: Fix includes, create atomic_types.h
This patch fixes the include of `atomic_builtin.h` and `atomic_arch.h`
so that they are IWYU. This mean they compile correctly independent of
other includes at the include-site. It was nessessary to move the
definition of the atomic types out of `atomic.h` to avoid unsatifiable
circular dependencies between `atomic.h` and `atomic_builtin.h`, as well
as definition conflicts between `atomic_arch.h` and `atomic_builtin.h`.
The definition of the type was to moved to a new file `atomic_types.h`.

The include in `atomic.h` has a IWYU pragma which will preserve
backwards compatibility with code expecting the types to be defined in
`atomic.h` if we start linting for IWYU.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2023-11-22 14:55:43 +00:00
Jerzy Kasenberg 46bbe052d3 drivers: regulator: add LDO/DCDC support for Smartbond.
This add regulator driver for Smartbond DA1469X SOC.
Driver can control VDD, V14, V18, V18P, V30 rails,
full voltage range supported by SOC is covered.
For VDD, V14, V18, V18P DCDC can be configured.

Special VDD_CLAMP (always on) and VDD_SLEPP are added
to allow configuration of VDD in sleep modes.

Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
2023-11-22 14:55:16 +00:00
Kamil Piszczek 1ab08634f2 settings: nvs: improve the name ID metadata handling on delete operation
Improved the updates to the name ID metadata (NVS_NAMECNT_ID) item
in the Settings NVS backend implementation. The improvements should
make the implementation more robust in handling edge cases such as:
power downs, resets or a case in which the storage partition is
full. In the last case, the NVS backend could return an ENOSPC error
in the context of the settings_delete API. This change also fixes
this issue.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2023-11-22 14:54:53 +00:00
Fabio Baltieri ea887af0aa input: gpio_kbd_matrix: drop redundant gpio_kbd_matrix_set_detect_mode
This is called already as soon as the polling thread starts, so the call
in the gpio init function is harmless but redundant, drop it.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-11-22 11:44:48 +00:00
Fabio Baltieri 6cd72493ff input: gpio_kbd_matrix: add direct access support
When the matrix is connected to consecutive pins on the same port, it's
possible to read the whole row or set the whole column in a single
operation. For the column, this is only possible if the matrix is
configured for driving unselected column, as there's no API to configure
multiple pins at the same time at the moment.

This is more efficient than checking the pins individually, and it's
particularly useful if the row or columns are driven from a GPIO port
expander.

Add some code to detect the condition and enable it automatically as
long as the hw configuration supports it.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-11-22 10:34:40 +00:00
Fabio Baltieri 8ec1b5487e input: gpio_kbd_matrix: add column drive mode
Add an option to drive inactive columns to inactive state rather than
high impedance. This is useful if the matrix has isolation diodes for
every key, as it allows the matrix to stabilize faster and the API for
changing the pin value is more efficient than the one to change the pin
configuration.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-11-22 10:34:40 +00:00
ingram weeks 45a5cedfd6 doc: Console.rst added to os_services docs
Barebones Console.rst added to os_services docs

Signed-off-by: ingram weeks <ingram.weeks@gmail.com>
2023-11-22 09:37:38 +00:00
ingram weeks 6718a21b56 doc: console_api group added to doxygen
console.h modified to include console api in doxygen

Signed-off-by: ingram weeks <ingram.weeks@gmail.com>
2023-11-22 09:37:38 +00:00
ingram weeks 3f1024b93f doc: README.rst added to subsys/console/echo sample
README added to the console echo sample

Signed-off-by: ingram weeks <ingram.weeks@gmail.com>
2023-11-22 09:37:38 +00:00
Dawid Niedzwiecki 3387c57a94 dts: stm32f4: set RTC as idle timer by default
Only RTC can be used as the idle timer for cortex-m systick. Set the
chosen node as RTC by default.

The idle timer will be enabled only if PM management is set.

Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
2023-11-22 09:28:53 +00:00
Dawid Niedzwiecki a877bb5001 timer: cortex_m_systick: add idle timer dependency
Allow enabling the Cortex-m idle timer only if power management is set.
It doesn't make sense to use an idle timer without PM.

It allows adding the idle timer chosen node to dts without enabling the
idle timer by default. Now, the PM config has to be set as well.

Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
2023-11-22 09:28:53 +00:00
Armando Visconti 69d4c13ab3 dt-bindings: sensor: fix typos in ST sensors comment
Fix dt-binding wrong filename in dts comment for ST sensors.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2023-11-22 09:54:50 +01:00
Andrei Emeltchenko 98f33a76d6 drivers: tsl2561: Fix type
Use int as correct type, fixes also warning comparing uint8_t < 0.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2023-11-22 09:54:39 +01:00
Jamie McCrae 90dfbf99d8 drivers: ieee802154: nrf5: Fix missed variable rename
Fixes and issue with a variable that has been renamed but whose
reference in the source file has not

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-11-22 09:54:23 +01:00
Seppo Takalo 31e9a56742 test: lwm2m: Test cancellation using observe parameter
Implement test cases:
LightweightM2M-1.1-int-303 - Cancel observations using Observe with
Cancel parameter

LightweightM2M-1.1-int-305 - Cancel Observation-Composite Operation

Modify existing Leshan API to passive_cancel().

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2023-11-22 09:54:13 +01:00
Seppo Takalo 2135e009e4 test: lwm2m: Implement Read-Composite Operation on root path
Test case:
LightweightM2M-1.1-int-235 - Read-Composite Operation on root path
is now working as Leshan added a support for reading the root path.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2023-11-22 09:54:13 +01:00
Seppo Takalo 92ceaab491 test: lwm2m: Implement write_attributes()
Implement write and remove attributes command for Leshan.
Remove all written attributes at the end of test, so it won't
affect the next test case.

Remove skip marks from testcase that is fixed on Leshan side.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2023-11-22 09:54:13 +01:00
Seppo Takalo eb127538b1 test: lwm2m: Mark some tests as slow
This allows quick filtering with
pytest_args: ['-k not slow']

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2023-11-22 09:54:13 +01:00
Alberto Escolar Piedras 6d762359a5 tests/subsys/storage/*: Switch to native_sim
Enable all these tests which run in native_posix in 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-22 09:54:03 +01:00
Alberto Escolar Piedras f59c9c0dde tests/subsys/input/*: Switch to native_sim
Switch from native_posix to native_sim as default test platform
And switch overlays to native_sim.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-22 09:54:03 +01:00
Alberto Escolar Piedras 13b7557fe1 tests/subsys/modem/*: Switch to native_sim
Enable all these tests which run in native_posix in native_sim
And add native_sim as default test platform

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-22 09:54:03 +01:00