Commit graph

15409 commits

Author SHA1 Message Date
Mark Wang
21ae5576a7 usb: udc: fix noncache usb transfer buffer
CONFIG_UDC_BUF_FORCE_NOCACHE depend on NOCACHE_MEMORY && DCACHE in Kconfig,
so it can only be true when the platform supports cache.
The controller driver can imply the value of CONFIG_UDC_BUF_FORCE_NOCACHE,
like UDC_NXP_EHCI. If CONFIG_UDC_BUF_FORCE_NOCACHE is true, then all the
usb transfer buffer should be in noncache section.

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
2025-01-21 19:27:18 +01:00
Cong Nguyen Huu
e31d3645b4 drivers: memc_nxp_s32_qspi: add support for s32ze
Add support QSPI secure flash protection (SFP)

Signed-off-by: Cong Nguyen Huu <cong.nguyenhuu@nxp.com>
2025-01-21 19:26:45 +01:00
Emil Gydesen
e4c5bb99b0 Bluetooth: GATT: Change get_handle function of find_by_uuid
bt_gatt_find_by_uuid used bt_gatt_attr_value_handle but that
function only works to get the value handle of a characteristic
declaration, i.e. if the UUID is not BT_UUID_GATT_CHRC then it
would always return handle = 0. This meant that
bt_gatt_find_by_uuid would always use handle = 0 as the starting
handle for non-BT_UUID_GATT_CHRC attributes, instead of the handle
of the provided attr.

This was not an issue for any UUIDs that may only exist once on a
GATT server, which is most UUIDs, but for UUIDs like the
BT_UUID_TBS_* UUIDs that may be multiple instances of, it would
always return the first attribute rather than the one starting
from the provided start attr.

This commit also ensures that we do not overflow the `end_handle`
when adding 2 uint16_t values.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-01-21 11:11:09 +01:00
Florian Weber
432c0cdc35 drivers: sensor: mlx90394: added driver
Added driver for Melexis MLX90394 magnetometer.

Signed-off-by: Florian Weber <Florian.Weber@live.de>
2025-01-21 09:12:41 +01:00
Guillaume Ranquet
e297293a54 drivers: mfd: add MAX22017 DAC/GPIO MFD
The MAX22017 DAC provides two 16 Channel Analog outputs and 6 GPIOs.

Signed-off-by: Guillaume Ranquet <granquet@baylibre.com>
2025-01-21 07:07:33 +01:00
Aksel Skauge Mellbye
2d3539b19a soc: silabs: Add support for xG29 device family
Add EFR32MG29 and EFR32BG29 device families.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2025-01-20 16:34:50 +01:00
Maochen Wang
f36e2e0664 lib: net_buf: support counting max used buf
Support counting the max used net_buf when CONFIG_NET_BUF_POOL_USAGE
is defined.

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
2025-01-20 11:16:18 +01:00
Ryan Erickson
adffb84329 modem: hl7800: improve AT command API
Update AT command API to return a response.
Add param to set the timeout when waiting for a response.
If the user does not desire a response, the response buffer can
be NULL.

Signed-off-by: Ryan Erickson <ryan.erickson@ezurio.com>
2025-01-20 11:15:57 +01:00
Ryan Erickson
5d27c9b298 modem: hl7800: Add new state event
The new state event allows a user to know the overall state of the
HL7800 driver.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2025-01-20 11:15:57 +01:00
Ryan Erickson
de83072776 modem: hl7800: reset API should be async
All other APIs that need to reset the modem do so in an async way.
Make the rest API async as well.
This fixes issues where modem events related to the reset
were not generated properly.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2025-01-20 11:15:57 +01:00
Jukka Rissanen
e658bc1b2b net: Extend the protocol handling in Ethernet
Allow user to specify protocol extensions when receiving data
from Ethernet network. This means that user can register L3
protocol handler using NET_L3_REGISTER() with the desired
protocol type. Ethernet code will then call the handler if
such a protocol type packet is received. This is currently
only implemented for Ethernet. The original IPv4 and IPv6
handling is left intact even if they can be considered to
be L3 layer protocol. This could be changed in the future
if needed so that IPv4 and IPv6 handling could be made
pluggable protocols.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-01-20 09:21:32 +01:00
Michal Piekos
d318726209 drivers: sensor: vl53l0x: Add private channels
Added private channels for metadata associated with
distance measurement according to datasheet and API manual.

Signed-off-by: Michal Piekos <michal.piekos@wp.pl>
2025-01-17 23:07:54 +01:00
Måns Ansgariusson
3de3402e48 smp_shell: Add missing include for k_fifo
The smp_shell module uses k_fifo, but does not include the kernel header
file that defines it. This commit adds the missing include.

Signed-off-by: Måns Ansgariusson <Mansgariusson@gmail.com>
2025-01-17 19:43:44 +01:00
Måns Ansgariusson
efcc734b79 tracing: k_pipe: Add tracing support for reworked k_pipe API
Add tracing support for the reworked k_pipe API.

Signed-off-by: Måns Ansgariusson <Mansgariusson@gmail.com>
2025-01-17 19:43:44 +01:00
Måns Ansgariusson
84584c579e kernel: k_pipe: Add object_core support for the k_pipe rework
This patch adds object_core support for the k_pipe api rework.

Signed-off-by: Måns Ansgariusson <Mansgariusson@gmail.com>
2025-01-17 19:43:44 +01:00
Måns Ansgariusson
a9ab8cb779 feat: enable polling support for k_pipe interface
This commit adds polling support to the newly rewritten k_pipe interface.
Changes include:

* Removed ifdef CONFIG_POLL from kernel/poll.c to let both implementations
  coexist.
* Added the needed datastructures to the new k_pipe struct.
* k_pipe_write(..) now notifies the poll subsystem that data is available.

Signed-off-by: Måns Ansgariusson <Mansgariusson@gmail.com>
2025-01-17 19:43:44 +01:00
Måns Ansgariusson
c8a2a080ac kernel: Rewrite k_pipe_* API
The `k_pipe_*` API has been reworked to provide a more consistent and
intuitive interface. The new API aims to provide a simple to use byte
stream interface that is more in line with the POSIX pipe API.
The previous API has been deprecated and will be removed in a future
release.

Signed-off-by: Måns Ansgariusson <Mansgariusson@gmail.com>
2025-01-17 19:43:44 +01:00
Joakim Andersson
6a3f885408 sys: byteorder: Add endian-specific buffer convert and copy functions
Add endian specific buffer convert and copy functions.
This is helpful when you want to convert arbitrary data lengths
but only swapping byte order when needed.

Signed-off-by: Joakim Andersson <joerchan@gmail.com>
2025-01-17 13:56:33 +01:00
Lyle Zhu
40993fe507 Bluetooth: RFCOMM: Add a argument server to bt_rfcomm_server.accept
In current implementation, the `accept` cannot be identified if the
same one `accept` callback is passed by the upper layer.

Similar with `accept` of `bt_l2cap_server.accept`, add a parameter
`server` to the `bt_rfcomm_server.accept` callback.

Add a argument `server` to function bt_hfp_hf_accept() to avoid
building issue for HFP_HF.

Add a argument `server` to function rfcomm_accept() to avoid building
issue for shell/rfcomm.c.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-01-17 13:54:13 +01:00
Lyle Zhu
87b2a3006c Bluetooth: rfcomm: Support dynamic channel allocation
In the function `bt_rfcomm_server_register()`, the channel cannot be
dynamic allocated. And only pre-set channel is supported.

Improve the function `bt_rfcomm_server_register()` to support the
dynamic channel allocation if the passed channel is zero.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-01-17 13:54:00 +01:00
Lyle Zhu
c4090998d3 Bluetooth: RFCOMM: Move BT_RFCOMM_BUF_SIZE to rfcomm.h
The buffer `BT_RFCOMM_BUF_SIZE` is used to define the TX buffer size of
TX pool.

In current implementation, the TX buffer size of RFCOMM cannot be
calculated due to the macro `BT_RFCOMM_BUF_SIZE` is defined in internal
header file `rfcomm_internal.h`.

Move the macro `BT_RFCOMM_BUF_SIZE` form internal header file
`rfcomm_internal.h` to interface `rfcomm.h`.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-01-17 10:41:49 +01:00
Lars Knudsen
bc4a2f37f3 Bluetooth: BAP: Remove ISO limitation on BASE parsing
BASE is now parsed on-the-fly on sink sync, removing
unnecessary restriction in intermediate parsed storage
and without requiring an excessive amount of memory.

Signed-off-by: Lars Knudsen <LAKD@demant.com>
2025-01-17 09:08:16 +01:00
Fin Maaß
beffba6d87 dfu: flash_img: add flash_img_get_upload_slot()
add flash_img_get_upload_slot() to get current
upload slot.
when CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD
is enabled, it is not based on the DT.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-01-17 09:07:45 +01:00
Sebastian Huber
cd0a20d1a9 logging: Fix set but not used warning
Fix this warning:

zephyr/logging/log_core.h:356:21: \
warning: variable 'mode' set but not used [-Wunused-but-set-variable]
  356 |                 int mode; \
      |                     ^~~~

Use the same approach as in Z_LOG2().

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2025-01-17 06:43:18 +01:00
Qiang Zhang
436f3dc65e clock: driver/clock_control: Add sai clock support for syscon.
Add sai clock support for syscon.

Signed-off-by: Qiang Zhang <qiang.zhang_6@nxp.com>
2025-01-17 02:13:01 +01:00
Piotr Radecki
e2ddac3715 net: lib: http: Added Content-Range to http client.
Content-Range functionality added in recent commits has been propagated
to http_client module. If "Content-Range" string is detected on header
field, Content-Range are returned via http_response structure.

Signed-off-by: Piotr Radecki <piotr.radecki@jrdltd.co.uk>
2025-01-16 22:55:51 +01:00
Piotr Radecki
d572ebb62b net: lib: http: Added Content-Range header parsing.
Content-Range hasn't been supported in zephyr. This change adds
Content-Range header parsing to http_parser module. Range start,
range end, and total size are supported. All units are currently
interpreted as bytes.
This is much needed change, because many applications responsible
for http data download are based on Content-Range approach.

Signed-off-by: Piotr Radecki <piotr.radecki@jrdltd.co.uk>
2025-01-16 22:55:51 +01:00
Parthiban Veerasooran
7cfa5bf6cf drivers: mdio: lan865x: add mdio driver support
Implement lan865x mdio driver to provide interface between lan865x MAC
driver and internal PHY driver phy_microchip_t1s.c. This driver is needed
to support the driver architecture followed.

Signed-off-by: Parthiban Veerasooran <parthiban.veerasooran@microchip.com>
2025-01-16 22:45:03 +01:00
Parthiban Veerasooran
2b8880cc38 drivers: ethernet: phy: Add OPEN Alliance TC14 PLCA generic lib support
10BASE-T1S PHYs can operate in either CSMA/CD or PLCA mode. PLCA mode
needs some set of parameters like node id, node count, max burst count,
burst timer and TO (Transmit Oppertunity) timer to be configured. OPEN
Alliance TC14 specification defined a set of PLCA registers to configure
PLCA mode. The below APIs are implemented for PLCA mode.

genphy_set_plca_cfg() - to configure PLCA settings.
genphy_get_plca_cfg() - to get the configured PLCA settings.
genphy_get_plca_sts() - to get the PLCA status like active or inactive.

These APIs are implemented as generic library so that all 10BASE-T1S
PHYs can use these APIs to configure/access PLCA settings to avoid
duplication of code.

Signed-off-by: Parthiban Veerasooran <parthiban.veerasooran@microchip.com>
2025-01-16 22:45:03 +01:00
Parthiban Veerasooran
53d5b1efef drivers: ethernet: phy: Implement clause 45 register read/write APIs
Some devices like Microchip's LAN8650/1 has direct clause 45 register
access where clause 22 indirect access is not needed to read/write
clause 45 registers. PHY drivers can implement read_c45/write_c45
functions using mdio_read_c45/mdio_write_c45 if direct access is
supported OR mdio_read/mdio_write indirect approach to access clause 45
registers indirectly.

Signed-off-by: Parthiban Veerasooran <parthiban.veerasooran@microchip.com>
2025-01-16 22:45:03 +01:00
Parthiban Veerasooran
8eaf558a59 include: net: phy: fix style issue using clang-format
Fix the style formatting of phy.h using clang-format utility.

Signed-off-by: Parthiban Veerasooran <parthiban.veerasooran@microchip.com>
2025-01-16 22:45:03 +01:00
Jilay Pandya
5c0b85d00f drivers: sensor: adltc2990 expose functions to public api
This commit replaces a hack where is_busy status of adltc2990 was
checked by fetching SENSOR_CHAN_ALL with a dedicated function
expose adltc2990_trigger_measurement function to public api

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2025-01-16 22:36:30 +01:00
Joel Holdsworth
fafef7b83e arch: Fixed typo in header gates
Many of the exception.h files from various arch directories have a typo in
the header gate e.g. ZEPHYR_INCLUDE_ARCH_MIPS_EXPCEPTION_H_ .

This patch corrects the issue by substituting EXPCEPTION for EXCEPTION.

Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
2025-01-16 14:47:27 +01:00
Jianxiong Gu
6f0d72118a usbc: Update tcpc_sop_prime_enable() description
Clearly mention that this function enables both SOP' and SOP'' messages.

Signed-off-by: Jianxiong Gu <jianxiong.gu@outlook.com>
2025-01-15 19:03:27 +01:00
Jianxiong Gu
90530cba96 usbc: add generic TCPCI related functions
Add generic functions that will be common to all TCPCI compliant drivers.

Signed-off-by: Jianxiong Gu <jianxiong.gu@outlook.com>
2025-01-15 19:03:27 +01:00
Mark Chen
f4da9b9705 drivers: sensor: Add sensor clock API support
This commit introduces a new Sensor Clock API, enabling the retrieval
of cycle counts and conversion to nanoseconds based on the system or
external clock. The API includes:

- `sensor_clock_get_cycles()` to get the current cycle count from the
  sensor clock.
- `sensor_clock_cycles_to_ns()` to convert cycles to nanoseconds using
  the clock's frequency.

The implementation supports both system clocks and external clocks
defined in the device tree, making the sensor clock integration more
flexible for various sensor use cases.

Signed-off-by: Mark Chen <mark.chen@cienet.com>
2025-01-15 19:03:13 +01:00
Yangbo Lu
7c57fec0d0 drivers: firmware: scmi: add power domain protocol
Added helpers for ARM SCMI power dmomain protocol.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2025-01-15 19:03:00 +01:00
Yangbo Lu
db703919ba drivers: firmware: scmi: add more APIs of clock management protocol
Added more APIs for ARM SCMI clock management protocol.
- scmi_clock_rate_set
- scmi_clock_parent_get
- scmi_clock_parent_set

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2025-01-15 19:03:00 +01:00
Fabian Blatz
705365c747 drivers: stepper: Change stepper velocity to step interval
Change the stepper API to instead of changing the stepper speed based on
the velocity in microsteps per second to use the delay in usec between
successive steps. Also remove the velocity from the `stepper_run` function
as typical API usage is enable -> set step interval -> run.

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
2025-01-15 15:06:37 +01:00
Pieter De Gendt
6e1bedd370 include: net: ethernet: sort ptype definitions
Keep the ptype definitions sorted by name.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-01-15 15:06:25 +01:00
Alberto Escolar Piedras
d72d1aaeae net: if: Fix net_if_list iteration issue with llvm & ASAN
The address sanitizer in llvm adds padding (redzones) after data.
But for those structures we are re-grouping using the linker script
and for which we iterate over we cannot have that extra padding.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-01-15 15:05:48 +01:00
Tom Burdick
5de7e415a0 logging: Add a log flush operation
Ensure all pending log messages are processed by the log processing
thread when log_flush is called, blocking the caller until done.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2025-01-15 09:33:28 +01:00
Tom Burdick
4148512567 mctp: Add mctp subsystem with uart binding
libmctp provides interfaces for wiring up a MCTP bus it calls bus
bindings. The bindings provided in libmctp however are not directly
useful to Zephyr without some work. Provide an initial uart binding that
directly uses Zephyr's async uart interface.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2025-01-14 22:55:41 +01:00
Henrik Brix Andersen
c46247b550 dts: arm: atmel: samx7x: move SAM E70/V71 DMA header to dt-bindings
Move the Atmel SAM E70/V71 DMA PERIDs header file to
include/zephyr/dt-bindings/dma and unify it for use with the entire product
family (SAM E70/S70/V70/V71).

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2025-01-14 22:54:33 +01:00
Gerson Fernando Budke
ac579a8f89 drivers: sensors: Add SENSOR_CHAN_FREQUENCY channel
Add new SENSOR_CHAN_FREQUENCY constant to allow implement sensors that
output frequency values in Hertz.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2025-01-14 17:58:41 +01:00
Lucien Zhao
47cc069cb9 drivers: clock_control: update mcux_lpc_syscon_clock.c drivers
add more flexcomm instances clock support to adapt
rt700 instances number

add xspi clock support

Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
2025-01-14 17:56:53 +01:00
Tomasz Moń
c705551a8c usb: device_next: hid: Pass request buffer in input report done
Pass the report buffer originally provided in hid_device_submit_report()
as a parameter to input_report_done() callback. Example use case is to
enable HID report multi buffering which is easiest achieved by
allocating report buffer before submitting it and then releasing the
buffer after it has been sent.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2025-01-14 10:56:06 +01:00
Grzegorz Swiderski
a62d9d820e devicetree: Fix DT_HAS_COMPAT_ON_BUS_STATUS_OKAY documentation
The doxygen comment was malformed.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2025-01-14 00:01:53 +01:00
Chris Friedt
d33b5c907f posix: features: correction on posix2 feature test macros
The _POSIX2_VERSION feature test macro should be either -1 or
left undefined on systems that do not have a POSIX-conformant
shell or utilities. Otherwise, it should be defined to the
value _POSIX_VERSION.

Since Zephyr has neither a conformant shell nor utilities, leave
_POSIX2_VERSION undefined.

Similarly, the _POSIX2_C_DEV macro should be either -1 or left
undefined if the implementation does not support the c99, lex,
and yacc shell utilities. Otherwise it should be defined to the
value _POSIX_VERSION.

Although _POSIX2_C_BIND appears to be related to the _POSIX2
family of feature test macros, all it conveys is that the
implementation supports POSIX C Language bindings, which is
always the case if the implementation uses the C programming
language, even if the implementation does not support a
conformant shell and utilities. _POSIX2_C_BIND should be
defined to the same value as _POSIX_VERSION.

Define _POSIX2_C_BIND as _POSIX_VERSION since Zephyr's
implementation of the POSIX API supports C language bindings.

The information above comes from the "unistd.h" page in the
spec and also through word search of the term "C-Language
Development Utilities".

https://pubs.opengroup.org/onlinepubs/9699919799/index.html

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-01-13 20:24:05 +01:00
Florian Weber
b4667e0445 drivers: rtio: bugfix
fixes the following:
- If a read SQE generates a CQE with an error before a buffer
has been allocated,
the flags of the sqe are not correctly translated into cqe flags.
- rtio_cqe_get_mempool_buffer(...) sets the *buff
to a non-zero value, even if no buffer is assigned

Signed-off-by: Florian Weber <Florian.Weber@live.de>
2025-01-13 10:08:45 +01:00