Commit graph

15409 commits

Author SHA1 Message Date
Dominik Ermel
4521c8ec2b storage/flash_map: Retire macros deprecated in release 3.2
The commit removes macros:
 - FLASH_AREA_LABEL_EXISTS()
 - FLASH_AREA_LABEL_STR()
 - FLASH_AREA_ID()
 - FLASH_AREA_OFFSET()
 - FLASH_AREA_SIZE()

That have been marked deprecated in release 3.2, by commit:
 54db76b4cd storage/flash_map: Deprecate FLASH_AREA_ macros

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-01-31 09:08:12 -06:00
Armando Visconti
4828340b92 drivers/sensor: add support to LIS2DE12 accelerometer
The LIS2DE12 is an ultra-low-power high- performance three-axis
linear accelerometer belonging to the “femto” family with digital
I2C/SPI serial interface standard output.

This driver is based on stmemsc HAL i/f v2.3

https://www.st.com/en/datasheet/lis2de12.pdf

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2024-01-31 15:39:45 +01:00
Najumon B.A
6e7f50d7aa docs: rename intel,pcie compatible id to pcie-controller
rename intel,pcie compatible id referance to pcie-controller in
header file comments and rst files

Signed-off-by: Najumon B.A <najumon.ba@intel.com>
2024-01-31 15:03:06 +01:00
Najumon B.A
2f3fb49d76 lib: acpi: add device resource enum support
add device resource enumaration support such as irq and mmio.

Signed-off-by: Najumon B.A <najumon.ba@intel.com>
2024-01-31 15:03:06 +01:00
Najumon B.A
dd9e0df06b arch: x86: add interface for encode irq flags
add interface for encode irq flags from acpica to arch specfic.
Currently enabled only for x86 archiecture.

Signed-off-by: Najumon B.A <najumon.ba@intel.com>
2024-01-31 15:03:06 +01:00
Najumon B.A
b5a9e8b031 arch: x86: add a sperate timer interface for acpica lib
add a separate timer interface for acpica lib instead of using
system timer which might use driver interface such as HPET and this
might cause init priority issue if a driver which need to init
before system timer driver instantiate.

Signed-off-by: Najumon B.A <najumon.ba@intel.com>
2024-01-31 15:03:06 +01:00
Gaetan Perrot
8a6c745e9f posix: sched: Implement set APIs for scheduling parameters
Implement `sched_setparam()` and `sched_setscheduler()` POSIX APIs
as a part of PSE53 `_POSIX_PRIORITY_SCHEDULING` option group.
Both functions are actually placeholders and just return `ENOSYS`
since Zephyr does not yet support processes or process scheduling.

signed-off-by: Gaetan Perrot <gaetanperrotpro@gmail.com>
2024-01-31 11:16:26 +01:00
Jonathan Rico
b3e67cf2a6 Bluetooth: L2CAP: document error values of bt_l2cap_chan_send()
They're still subject to change.
At least now the users have some idea of what's happening.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-01-31 09:06:08 +01:00
Abhinav Srivastava
52485876f0 posix: Add tests for stropts
Add tests, Fix config issues, Re-add Timer

Signed-off-by: Abhinav Srivastava <atg271@gmail.com>
2024-01-31 09:05:50 +01:00
Abhinav Srivastava
88568a3283 posix: add headers for stropts
Minimal header for stropts

Signed-off-by: Abhinav Srivastava <atg271@gmail.com>
2024-01-31 09:05:50 +01:00
Jordan Yates
9ff1fcf7e7 net: conn_mgr: generic wifi_mgmt connectivity backend
As connectivity backends need to be bound in the same file that the
`net_if` is created in, define a common backend type for WiFi modems.
All WiFi modems should be controllable through the `wifi_mgmt` API, so
there should be no need for dedicated context.

When enabled, the particular implementation to be used is chosen through
`CONNECTIVITY_WIFI_MGMT_IMPL`. For now, the only choice is an
application defined backend.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2024-01-30 18:51:46 -05:00
Magdalena Pastula
b605c4219b drivers: timer: add GRTC driver
Add Nordic driver for GRTC.

Signed-off-by: Magdalena Pastula <magdalena.pastula@nordicsemi.no>
2024-01-30 21:00:44 +00:00
Ian Morris
b1a15718aa dts-bindings: pinctrl: renesas_ra: enabled config of i/o ports 4-7
The RA_PINCFG macro is used to generate a value that can be written
directly to the pin function select register. In addition to the pin
function this value also contains port and pin number information,
located in bit fields that are unused by the register. The bit field
used to store the port information consists of 3-bits. However, a typo in
the mask definition limited the field to two bits meaning only ports 0-3
could be configured. This patch resolves the issue, allowing ports 0-7 to
be configured. If the port is greater than 7 another field (port4) is used
to store an additional bit (allowing an additional 8 ports to be
supported). However, use of this field has not yet been implemented.

Signed-off-by: Ian Morris <ian.d.morris@outlook.com>
2024-01-30 15:38:51 -05:00
Jordan Yates
374d354d16 sensing: sensing_sensor: fix doxygen warnings
Add missing parameter information in `SENSING_SENSORS_DT_DEFINE` and
`SENSING_SENSORS_DT_INST_DEFINE`.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2024-01-30 18:42:30 +01:00
Jamie McCrae
b26a4bf31c mgmt: mcumgr: grp: img_mgmt: Add optional max image size reduction
Adds an optional feature that can be used to reduce the maximum
allowed image upload file size whereby an image could be uploaded
that would be too large to swap even if it could fit the partition

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-01-30 18:01:24 +01:00
Adam Wojasinski
31af5f8fe1 tests: posix: Add test case for sysconf()
Adds test cases for sysconf() basic implementation.
Test case does not cover scenario where invalid value is passed
to the name argument of the function.

Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
2024-01-30 18:01:18 +01:00
Adam Wojasinski
6f5626d1cf posix: Add basic sysconf() function implementation
The patch introduces basic implementation of sysconf() function.
It's based on macro - that means that every function call is resolved
at compile time - and is not fully complient with POSIX standard
(the errno value is not handled and passing invalid name argument
results in compilation error). Treat this commit as a starting point
for proper sysconf() implementation. The one introduced in the patch
could stay as a defult implementation.

sysconf() documentation:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/sysconf.html
https://man7.org/linux/man-pages/man3/sysconf.3.html

Fixes #56670

Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
2024-01-30 18:01:18 +01:00
Evgeniy Paltsev
d2b5ac20d1 ARC: ARCv3: enable shared cache if available
In case of ARCv3 we have shared cache disabled after
reset (in ARCv2 it was enabled by default). Let's
enable it at early boot phase (if it's available in HW).

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
2024-01-30 12:36:24 +01:00
Evgeniy Paltsev
4d86be26c7 ARC: ARCv3: enable HW prefetch on boot
ARCv3 processors have HW prefetch feature which is disabled
after reset. Let's enable it.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
2024-01-30 12:36:24 +01:00
Oleksii Moisieiev
8bb40bbb8e arm: aarch32: cortex_a_r: Add MMU_ALIGN define to Linker script
cortex_a_r lacks of MMU_ALIGN definition. This define is added to the
target linker script when CONFIG_NOCACHE_MEMORY is enabled which
adds .nocache section where this define is used.

Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com>
2024-01-30 10:09:00 +00:00
Jordan Yates
1e1d2725a7 net: dns: option to disable auto context init
Adds an option to disable the automatic initialization of the default
dns_context. This lets applications use the default context, while also
managing the `init` and `close` functions.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2024-01-29 20:20:19 -06:00
Jordan Yates
e5f4fa0f4a net: dns: function to default initialize context
Adds a function that can be used to initialize a dns context to the
default Kconfig values.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2024-01-29 20:20:19 -06:00
Trond Einar Snekvik
aae51921df sys: util: Accept empty FOR_EACH
The ## part of ##__VA_ARGS__ in the Z_FOR_EACH_ENGINE macro technically
breaks the invocation of empty FOR_EACH sequences, as the empty
__VA_ARGS__ gets squashed with in the invocation of Z_FOR_LOOP_1() in
Z_FOR_LOOP_2(), which makes the macro only pass 4 arguments to
Z_FOR_LOOP_1.

This breaks IntelliSense in Microsoft's C/C++ extension for VS Code,
which is strict about the amount of arguments you can pass to a variadic
macro.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2024-01-29 11:32:54 +01:00
Ryan McClelland
97efd21ce9 tests: drivers: regulator: add api test for active discharge
Add tests for active discharge apis not being implemented.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-01-29 09:43:39 +01:00
Ryan McClelland
5a125a619c regulator: add active-discharge api
Add an active discharge api for regulators. This uses the already
existing but previously unused regulator-active-discharge
property.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-01-29 09:43:39 +01:00
Henrik Brix Andersen
5e9da13200 drivers: can: propagate CAN controller operation mode to CAN transceiver
Propagate the current CAN controller operation mode to the CAN transceiver
when enabling it.

Some more advanced CAN transceivers, especially those supporting Partial
Networking (CAN PN), require knowledge of the intended CAN operation mode
(e.g. normal mode vs. listen-only mode).

This commit simply prepares the CAN transceiver API for supporting such CAN
transceivers, although no in-tree drivers require this information yet.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-01-26 15:55:18 +00:00
Jukka Rissanen
e352a6e8e9 wifi: Have a separate wifi_drv_ops in wifi_mgmt_offload struct
There is no need to hide the wpa_supplicant interface
struct so add it directly to net_wifi_mgmt_offload struct.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-01-26 15:52:54 +00:00
Sandip Dalvi
4c7eb600c6 net: wifi: add wifi driver version API
Add command to query to WiFi driver/firmware revision. The API is expected
to return the firmware revision and driver version as a string, and can be
used by the user to determine what revision of the WiFi driver is in use.

Signed-off-by: Sandip Dalvi <sandip.dalvi@nxp.com>
2024-01-26 14:29:39 +01:00
Henrik Brix Andersen
583d44d7d5 drivers: can: add can_get_transceiver() system call
Add system call can_get_transceiver() for getting the CAN transceiver
associated with a CAN controller.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-01-26 14:27:57 +01:00
Henrik Brix Andersen
69d072ad2f drivers: can: add can_get_mode() system call
Add system call can_get_mode() for getting the current operation mode of a
CAN controller.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-01-26 14:27:57 +01:00
Jan Bylicki
3ef7f2a511 boards: arm: mercury_xu: Add remaining UART pin definitions
Add remaining UART0 pin definitions and migrate UART1 to utilize the
pinmux api

Signed-off-by: Jan Bylicki <jbylicki@antmicro.com>
2024-01-26 12:47:11 +01:00
Jan Bylicki
6400e3f437 drivers: pinctrl: Add ZynqMP / Mercury XU pinctrl support
Add a pinctrl driver for the ZynqMP SoC and the
Mercury XU board powered by it.

Signed-off-by: Jan Bylicki <jbylicki@antmicro.com>
2024-01-26 12:47:11 +01:00
Maciej Baczmanski
0f1747e4e7 net: openthread: upmerge to 7761b81
additionaly, implement `otPlatRadioResetCsl` functionality

Signed-off-by: Maciej Baczmanski <maciej.baczmanski@nordicsemi.no>
2024-01-26 10:48:02 +01:00
Declan Snyder
9ca7e4e487 drivers: mdio: Include errno in header
MDIO driver header (mdio.h)is using errno values without including
errno header, this causes build errors depending on the order of inclusion
of this mdio header in other files, fix by including the errno header
in this mdio.h file.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-01-26 09:44:11 +01:00
Kai Vehmanen
19a33c7884 init: adjust the SYS_INIT dev field init to play nice with older compilers
Fix a build error with certain older Cadence XCC toolchains. These
are used e.g. for Intel Tiger Lake products for the audio DSP (thhe oldest
platform supported in Zephyr upstream for the audio DSP).

To keep all compilers happy, use C89 style initializers.

Error:
lib/os/p4wq.c:216: error: unknown field ‘dev’ specified in initializer
lib/os/p4wq.c:216: warning: missing braces around initializer
lib/os/p4wq.c:216: warning: (near initialization for
  ‘__init_static_init.<anonymous>’)

Compiler version XCC RG-2017.8-linux (xt-xcc version 12.0.8)

Fixes: 2438dbb613 ("init: add missing initialization of dev pointer
in SYS_INIT macro")
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-01-26 09:44:04 +01:00
Emil Gydesen
2b0e39dfa5 Bluetooth: Audio: Add bt_audio_codec unset functions
Add functions to unset, or remove, specific codec
LTV structure from codec_cfgs or codec_caps.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-01-26 09:43:30 +01:00
Adam Wojasinski
c1643f9701 posix: Add implementation of mq_notify() function
The function was the last missing piece of the `_POSIX_MESSAGE_PASSING`
option group. Due to lack of signal subsystem in the Zephyr RTOS
the `sigev_notify` member of the `sigevent` structure that describes
the notification cannot be set to `SIGEV_SIGNAL` - this notification
type is not implemented, the function will return -1 and set `errno`
to `ENOSYS`.

`mq_notify` documentation:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/mq_notify.html

Fixes #66958

Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
2024-01-25 19:47:37 +01:00
Chaitanya Tata
de667a7fae wifi: ap: Add support to disconnect a STA
In AP mode, this can be used to disconnect a connected station.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-01-25 11:50:59 -05:00
Øyvind Rønningstad
527af809f8 mgmt: Adapt to API changes in zcbor 0.8.0
zcbor_new_state and zcbor_tstr_put_term

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2024-01-25 15:09:16 +00:00
Nicolas Pitre
7c21df641d multi_heap: keep number of heaps as an unsigned value
Although very unlikely for this value to ever be negative in practice,
this would make Coverity happy.

Fixes #67969

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2024-01-25 11:36:23 +00:00
Bjarki Arge Andreasen
d801e697dd modem: chat: Implement TRANSMIT_IDLE event
Refactors modem chat module to use TRANSMIT_IDLE event instead
of polling when transmitting, cleaning up the transmit handler
by combining duplicate code and using an internal state instead
of multiple iterators to track send state.

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-01-25 11:22:42 +01:00
Bjarki Arge Andreasen
27b0d4e3fe modem: chat: remove receive and transmit timeouts
Remove receive and transmit timeouts which are no
longer useful as the RECEIVE_READY and
TRANSMIT_IDLE events will be used to efficiently
manage timeouts between transmit/receive calls.

Then update the the in-tree drivers using the
modem_chat module to omit the process timeout
parameter.

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-01-25 11:22:42 +01:00
Mykola Kvach
09fbd4c2cd drivers: pinctrl: renesas: add definitions of missed IPSR macros
Add missed definitions of IP[0-3]SR[67] macros.

Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
2024-01-25 08:54:52 +01:00
Mykola Kvach
caf9a53330 drivers: pinctrl: renesas: fix ipsr generation for S4
Avoid unexpected memory access in cases where the IPSR has an odd
register index. In the scenario where an odd register index is present
in IPSR, the LSB of the register index is utilized as MSB of the bank
number. Observe how we pack reg/bank:
    'IPSR(((reg) << 4U) | (bank), shift, func)' (macro IPnSR)
and how it is read from the device tree source:
    '(RCAR_IPSR(node_id) >> 10U) & 0x1FU' (macro RCAR_PIN_FUNC).

 Finally, this bank is used to obtain the required IPSR offset:
    'PFC_RCAR_IPSR + rcar_func->bank * sizeof(uint32_t)'
in the 'pfc_rcar_set_ipsr' function. For example, if we have the 1 as
a reg index and the 3-rd bank, the resulting offset would be 19,
which is beyond the IPSR range.

Align the IPSR comment with the definition of the 'rcar_pin_func'
structure.

Note: we can omit the usage of the register index entirely since this
information is obtained from the pin number inside the
'pfc_rcar_get_reg_index' function.

Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
2024-01-25 08:54:52 +01:00
Greter Raffael
33ffe001f8 linker: Generate snippets files for dtcm and itcm
This allows to link code and data blocks, e.g. the vector table, into
tightly coupled memory using `zephyr_linker_sources`.

Signed-off-by: Greter Raffael <rgreter@baumer.com>
2024-01-24 22:10:11 -06:00
Yong Cong Sin
acfb87dca3 devicetree: reuse DT_CAT* instead of pasting manually
Reuse `DT_CAT*` macros to paste these things together instead
of pasting manually.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-01-24 19:56:42 -05:00
Yong Cong Sin
f64af1aecb devicetree: use DT_CAT* wherever possible
Use `DT_CAT*` macros to paste simple things together instead
of `UTIL_CAT` wherever possible. This should reduce the amount
of error messages from the compiler when something goes wrong.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-01-24 19:56:42 -05:00
Talha Can Havadar
4ce0555d90 drivers: bmp581: Add BMP581 driver
This commit adds source and header files required for bmp581 I2C driver.
I have used bmp581_user.h to add more usage related definitions
but bmp581.h to add hardware related definitions.

Signed-off-by: Talha Can Havadar <havadartalha@gmail.com>
Signed-off-by: Gerhard Jörges <joerges@metratec.com>
2024-01-24 09:32:34 -05:00
Gerhard Jörges
e832a87e1c include: usb: include usb_ch9.h
In usb_hid.h `struct usb_setup_packet` is used. This is defined in
usb_ch9.h but not included in usb_hid.h which leads to build errors when
you include the usb header files in the wrong order. This commit fixes
this behaviour.

Signed-off-by: Gerhard Jörges <joerges@metratec.com>
2024-01-24 13:38:12 +01:00
Fabio Baltieri
297faf71d0 input: add two input to hid code translation functions
Add a pair of functions to translate from input events to hid codes,
mapping most of the current hid codes defined in zephyr/usb/class/hid.h.
Use a sparse table for the mapping, which takes advantage of the fact
that code 0 is reserved. Inspired by the linux equivalent hid to input
map:

https://elixir.bootlin.com/linux/latest/source/drivers/hid/hid-input.c#L27

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-01-24 10:44:40 +01:00