Commit graph

3986 commits

Author SHA1 Message Date
Michael Hope e678dbb20f drivers: add ch32v00x pinctrl support 2024-05-17 19:39:24 +02:00
Michael Hope dce32fb11e dts: add the ch32v003 DTSI and bindings 2024-05-17 19:36:40 +02:00
Johann Fischer b0d7d70834 usb: device_next: add initial BOS support
Use the same scheme as for string descriptors. Descriptors can be added
or removed using the existend interface.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-05-17 16:25:02 +01:00
Johann Fischer 29003ff264 usb: bos: cleanup Binary Device Object Store header
We could reuse the BOS header, but there are parts that are only needed
in the legacy device support or used internally and the tests. Move this
parts to the appropriate places.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-05-17 16:25:02 +01:00
Johann Fischer 4f17bc6051 usb: device_next: store bDescriptorType and bLength in descriptor node
It simplifies the macros to create the string descriptors. We also no
longer need placeholders for the SerialNumber descriptor when it is
generated from hwid. In the future, we can store other descriptor types
in the same list.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-05-17 16:25:02 +01:00
Johann Fischer 48ca72326b usb: device_next: move string descriptor data to a separate structure
Move and rework string descriptor data to a separate structure so we can
share memory with another type. Also add description to the
USBD_DESC_STRING_DEFINE macro.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-05-17 16:25:02 +01:00
Johann Fischer f110766072 usb: device_next: add few more string descriptor helpers
Add function to get string descriptor index and function
to remove linked descriptor from a device. This abstracts
it a bit so that the user does not need to know how it is
handled internally.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-05-17 16:25:02 +01:00
Krzysztof Chruściński 24082d582f arch: arm: cortex_m: pm_s2ram: Add option for custom marking
s2ram procedure used RAM magic word for marking suspend-to-RAM. This
method may not work in some cases, e.g. when global reset does not
reset RAM content. In that case resuming from s2ram is detected when
global reset occurred.

RAM magic word method is the default but with
CONFIG_PM_S2RAM_CUSTOM_MARKING a custom implementation can be provided.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-05-17 14:33:47 +02:00
Emil Gydesen c547079cc2 Bluetooth: Audio: Upgrade from experimental to unstable
This commit upgrades the LE audio API and implementation
from experimental to unstable.

LE Audio have existing for quite a few years in Zephyr
and is not going anywhere, but at the same time it still
has significant effort remaining before it can be
considered stable.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-05-17 14:33:39 +02:00
Pete Skeggs f04f8b2422 net: lib: coap_client: Improve cancel function
Improve coap_client_cancel_requests(). Ensure it can be
called from a callback. Report error to waiting callbacks.
Clear active flag.

This is useful when the network becomes unavailable
or prior to disconnecting in order to save power.

Signed-off-by: Pete Skeggs <peter.skeggs@nordicsemi.no>
2024-05-17 10:34:12 +02:00
Tom Burdick b249535093 sensors: Add channel specifier
Use a structured channel specifier rather than a single enum when
specifying channels to read in the new read/decoder API.

Replaces usages of a seperate channel and channel_index parameter
where previously used with a struct sensor_chan_spec.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2024-05-17 09:30:18 +02:00
Flavio Ceolin 8cd1ab8896 drivers: pcie: Remove deprecated pcie_bdf_lookup
pcie_bdf_lookup() was deprecated before 3.3 release. Time to remove
it.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-05-17 09:30:04 +02:00
Flavio Ceolin f4aefc281b drivers: pcie: Remove deprecated pcie_probe
pcie_probe() was deprecated before 3.3 release. Time to remove it.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-05-17 09:30:04 +02:00
Abderrahmane Jarmouni 32c04c6b25 include: dt-bindings: gpio: fix flag value
'1u' causes devicetree parsing error.

Signed-off-by: Abderrahmane Jarmouni <abderrahmane.jarmouni-ext@st.com>
2024-05-17 09:29:53 +02:00
Ryan McClelland 9640905a71 drivers: i3c: add ccc getcaps helper
This adds the defines for getcaps format 1 and format 2.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-05-16 16:23:31 +02:00
Ryan McClelland da094d4d3c drivers: i3c: fix ccc getmxds macros
GETMXDS macros had typos in them. This fixes them.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-05-16 16:23:31 +02:00
Mateusz Michalek 5919163b48 include: storage: flash_map: _NODE macros
adds size, offset and divice access macros that are
operating with nodes as an argumet.

Signed-off-by: Mateusz Michalek <mateusz.michalek@nordicsemi.no>
2024-05-16 16:21:34 +02:00
Jérémy LOCHE - MAKEEN Energy 8ef8e8b497 arch: arm: rom_start relocation configuration
In order to support Linux rproc loading, some SOCs require
the boot-vector and irq-vectors to be placed into a defined
memory area for the mcu to boot.

This is necessary for NXP's IMX SOCs for instance but
can be leveraged by other SOCs that have multiple
zephyr,flash choices.

Signed-off-by: Jérémy LOCHE - MAKEEN Energy <jlh@makeenenergy.com>
2024-05-16 15:52:20 +02:00
Chris Friedt ed501d788b kernel: structs: define priq bitmap size via bits per long
Since a long is 64-bits on 64-bit architectures, and 32-bits
on 32-bit architectures, we can simplify the definition of
PRIQ_BITMAP_SIZE by defining it in terms of BITS_PER_LONG.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-05-16 13:51:23 +02:00
Henrik Brix Andersen 0f7cd6128e drivers: can: set default initial bitrates via Kconfig
Set the default initial bitrates globally via Kconfig. The initial bitrates
can still be overridden using the "bus-speed" and "bus-speed-data"
devicetree properties.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-05-16 09:23:59 +02:00
Daniel DeGrasse 82ce2b412d sd: sdmmc: rework frequency and timing selection logic
SDMMC framework frequency and timing selection logic has several
longstanding issues, including:
- requiring that SD hosts support the maximum frequency possible for a
  given UHS mode in order to apply that timing
- selecting SDHC_TIMING_SDR25 for high speed mode, when SDHC_TIMING_HS
  would be correct

Rework the frequency and timing selection logic within the SD framework
to resolve these issues.

Fixes #52589
Fixes #67943

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-05-16 09:21:03 +02:00
Daniel DeGrasse 87030f4cbf sd: sdmmc: add DEFAULT and HIGH_SPEED bus speeds
Add DEFAULT and HIGH_SPEED bus speeds to SD spec definition, for non UHS
cards.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-05-16 09:21:03 +02:00
Daniel DeGrasse 06f3574685 include: zephyr: sd: sd_spec: add UNSUPPORTED frequency for HS mode
Add UNSUPPORTED frequency macro for HS mode frequencies, used when a
card does not support any high speed mode frequencies

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-05-16 09:21:03 +02:00
Daniel DeGrasse 771451f616 include: zephyr: sd: sd_spec: use frequency macros
Use frequency macros to define SD frequencies, this should increase
readability of the file and reduce errors.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-05-16 09:21:03 +02:00
Lyle Zhu 615fe2466b Bluetooth: RFCOMM: Kconfig: Add configure BT_RFCOMM_DLC_STACK_SIZE
The default stack size of RFCOMM DLC is 256.
The default value is sufficient for basic operation.

If more stack space is used (such as call function printk)
in context of callback disconnected of RFCOMM DLC, the
default stack size is not sufficient.

Add a configuration BT_RFCOMM_DLC_STACK_SIZE to configure
the RFCOMM DLC stack size.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2024-05-16 09:15:49 +02:00
Lyle Zhu 514c78546c include: Bluetooth: Add BT COD macros to hci_types.h
Add macros to get Major Service Classes, Major Device
Class and Minor Device Class.

Define Major Device Class code.
Define Minor Device Class field for Computer Major
Class.
Define Minor Device Class field for Phone Major Class.
Define Minor Device Class field for Audio/Video Major
Class.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2024-05-16 09:15:49 +02:00
Lyle Zhu 84144c6833 Bluetooth: HFP_AG: Initialize HFP AG
Implement basic functions for HFP AG.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2024-05-16 09:15:49 +02:00
Johann Fischer c3ec41bdf8 usb: device_next: remove unused API function
Remove unused and not required usbd_ep_ctrl_buf_alloc().

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-05-15 17:29:24 +01:00
Johann Fischer 4c360f38d1 usb: device_next: add controller can detect VBUS state change capability
There are controllers with capability to detect VBUS state change. This
can be used in a generic application to explicitly handle the VBUS
detected event after usbd_init() and for example allow the PMIC to
detect to what type of port device controller is connected.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-05-15 17:29:24 +01:00
Johann Fischer 693191467d usb: device_next: add USB device context to message delivery callback
Add USB device context argument to message delivery callback.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-05-15 17:29:24 +01:00
Fin Maaß c5fc2e743c kernel: docs: correct sys_heap_aligned_realloc
correct doc of sys_heap_aligned_realloc().

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-05-15 15:00:12 +02:00
Seppo Takalo 01b57b4999 net: lwm2m: Add offset to post-write callback
When Block-Wise transfer restarts, the post-write callback should
receive some indication that the block is actually a beginning of new,
instead of part of previous transfer.

Fixes #71351

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-05-15 14:58:15 +02:00
Emil Gydesen a6a14360a9 Bluetooth: BAP: Remove err from recv_state_removed callback
The callback is only ever called when we received a
notification from the BASS server that the receive state is
removed, which cannot contain an error code.
Thus it does not make sense for the callback to have an
error code.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-05-15 14:57:20 +02:00
Francois Ramu e255444179 dts: bindings: introduce a new compatible for stm32 xSPI flash controller
The new bindings for the stm32 xspi is for new stm32 devices with
XSPI peripherals like the stm32h5 serie. This is close to the octo-spi.
Adapt the flash controller constants to the XSPI model especially.
This is done through a new xspi.h definition file.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-05-15 10:56:04 +02:00
Jukka Rissanen 6d129b2a2d net: http_server: Add support for specifying Content-Type
Allow user to specify the Content-Type header field for the
HTTP response.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-05-14 20:22:58 -04:00
Johann Fischer c0e8f0d96b usb: device_next: add initial HID device support
Add initial HID device support. Unlike the existing HID implementation,
the new implementation uses a devicetree to instantiate a HID device.
To the user, the HID device appears as a normal Zephyr RTOS device.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-05-14 18:24:45 -04:00
Johann Fischer a2c9c65bfa include: usb_hid: remove conditional definition from struct hid_ops
For upcoming HID support in the new device stack and to provide API
backward compatibility, there must be no conditional definitions in the
header.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-05-14 18:24:45 -04:00
Declan Snyder c767ed6e27 dts: bindings: adc: Add NXP GAU ADC binding
Add binding for NXP GAU ADC

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-05-14 18:23:22 -04:00
Johan Hedberg 484fe3f06c Bluetooth: Remove bt_read_static_addr() "hack"
This function was used to shortcut HCI for combined host + controller
builds. It doesn't provide much value and adds complexity to the HCI
driver interface, so just remove it. This means vendor-specific HCI
commands is now the only way for the host to access the same
information.

Signed-off-by: Johan Hedberg <johan.hedberg@gmail.com>
2024-05-14 18:21:11 -04:00
Jukka Rissanen e71569fc00 net: http: Make sure not use undefined Kconfig symbols
If CONFIG_HTTP_SERVER is not enabled, then we must not use
Kconfig symbols that are only available when HTTP server is
enabled.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-05-14 15:51:20 +02:00
Jamie McCrae 7a4f4711af drivers: led_strip: Make update channels function optional
Makes the update channels function optional, this is only
implemented in one driver so can be safely omitted from most
drivers

Signed-off-by: Jamie McCrae <spam@helper3000.net>
2024-05-14 09:33:58 +02:00
Jamie McCrae 50b7d61c91 drivers: led_strip: Check length before updating LED strip
Checks that the supplied length is valid for the given driver
before passing it to the update function

Signed-off-by: Jamie McCrae <spam@helper3000.net>
2024-05-14 09:33:58 +02:00
Jamie McCrae 245163cb87 drivers: led_strip: Update format
Updates the include file to fix some formatting issues

Signed-off-by: Jamie McCrae <spam@helper3000.net>
2024-05-14 09:33:58 +02:00
Jamie McCrae 4bea96b68b drivers: led_strip: Add length function
Adds a length function which returns the length of the LED strip

Signed-off-by: Jamie McCrae <spam@helper3000.net>
2024-05-14 09:33:58 +02:00
Jordan Yates 98deebd29b kernel: add k_uptime_seconds
Add a helper function for retrieving the system uptime in seconds
without having to do a second division.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-05-14 09:32:01 +02:00
Jordan Yates aee130f8d7 sys: time_units: add seconds conversions
Add conversions between the existing time units and seconds.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-05-14 09:32:01 +02:00
Jordan Yates c354f7b00b sys: time_units: move warning to doxygen command
Move the warning about code being autogenerated into the doxygen comment
instead of being added as a separate comment that then appears in the
`@return` text.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-05-14 09:32:01 +02:00
Jukka Rissanen 70ab0e65a5 net: websocket: Add a way to unregister a websocket connection
Doing a normal close for a websocket does not close the underlying
real socket. If we do not have fd for the real socket, then it is
not possible to fully close a websocket connection. As we are allocating
a websocket using websocket_register() in HTTP server use case,
create a websocket_unregister() that will close both the real
socket and the websocket socket.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-05-14 09:31:37 +02:00
Corey Wharton bf114c6b1a logging: add API to trigger immediate processing of logs
There are use cases where it's beneficial to trigger the log
thread to process log messages as soon as able instead of waiting
for the processing timer or threshold triggers. An example would be
to flush the log buffer before entering the idle thread after
forcing a system power state.

Signed-off-by: Corey Wharton <xodus7@cwharton.com>
2024-05-13 16:06:11 -04:00
Nicolas Pitre 57305971d1 kernel: mmu: abstract access to page frame flags and address
Introduce z_page_frame_set() and z_page_frame_clear() to manipulate
flags. Obtain the virtual address using the existing
z_page_frame_to_virt(). This will make changes to the page frame
structure easier.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2024-05-13 16:04:40 -04:00