Commit Graph

84334 Commits

Author SHA1 Message Date
Daniel Baluta b4998c357e mm_drv: tlb: Fix compile time warning
This fixes the following compile time warning;

drivers/mm/mm_drv_intel_adsp_mtl_tlb.c: In function 'sys_mm_drv_mm_init':
include/zephyr/sys/__assert.h:44:52: error: format '%p' expects argument
of type 'void *', but argument 2 has type
'long unsigned int' [-Werror=format=]
__ASSERT_PRINT("\t" fmt "\n", ##__VA_ARGS__)

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2023-09-22 09:24:02 +02:00
Pavel Vasilyev ac050455c5 Bluetooth: Mesh: Fix printing device UUID
IS_ENABLED was incorrectly used here.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-09-22 09:23:44 +02:00
Manuel Argüelles 45c8cb2343 counter: nxp_pit: use clock control to obtain module's clock rate
Use standard clock control API to retrieve the PIT clock rate instead of
using the HAL.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-09-22 09:23:30 +02:00
Manuel Argüelles ddaacd9ee8 counter: nxp_pit: allow to specify max load value
The PIT maximum load value may not be always 32-bit. Allow the SoC to
define this value from devicetree.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-09-22 09:23:30 +02:00
Manuel Argüelles f8e16ae81a counter: nxp_pit: support flexible number of interrupts
Depending on the SoC design, the PIT channel interrupts can be
individual or OR'ed together to a single interrupt line.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-09-22 09:23:30 +02:00
Manuel Argüelles d590fb2f78 counter: nxp_pit: support only top callback
This periodic timer (PIT) has a single load value register for each
channel, which is currently used for both alarm and top callback APIs.
If using both APIs together (which is a valid use-case) it will write
to the same register causing unexpected behavior of the timer.

The nature of the PIT is to trigger an event (like interrupts) at a
certain rate, and not to produce single-shot events. Hence keep only top
callback functionality.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-09-22 09:23:30 +02:00
Manuel Argüelles e22f634f33 counter: nxp_pit: support multiple instances
Add support for multiple device instances.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-09-22 09:23:30 +02:00
Tomasz Bursztyka ba02d85c74 doc/nvme: NVMe mandates dword-aligned buffer addresses
In Zephyr, this is let to the disk access API user. There is nothing the
driver can do about it.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2023-09-22 09:23:18 +02:00
Tomasz Bursztyka 95b8493857 drivers/nvme: Return an error in case of non dword-aligned data buffer
This is a specific case for NVMe where given data buffer pointers must
be dword (4 bytes) aligned.

There is no virtual memory management between the user thread and NVMe
driver (which one could detect such wrong alignement on physical memory
and thus reallocate the memory properly, so it would be fully
transparent for the user thread), thus the need to push that check to
the user.

This has been going under the radar so far as Qemu does not seem to
follow NVMe specifications where PRP1 (in DPTR) must always be
dword-aligned. It really does not follow the rule: specifications
details that if bits 1:0 of PRP1 are set, the controller may generate
an error or treat the address as if these bits were unset. Seems like
a bug in Qemu, I did not check the code there however.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2023-09-22 09:23:18 +02:00
Tomasz Bursztyka 2caced752a drivers/nvme: Rewrite how data pointer is filled
Former way was difficult to read, so let's have a better way which
easily follows the specifications.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2023-09-22 09:23:18 +02:00
Tomasz Bursztyka f21760252a drivers/nvme: Make sure PRP2 value is encoded in little endian.
To avoid issue in address translation when CPU is running in big endian.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2023-09-22 09:23:18 +02:00
Tomasz Bursztyka 0b45688335 drivers/nvme: Rely on CONFIG_MMU_PAGE_SIZE for PRP
Getting rid of 4Kib page size hardcoded value on PRP handling.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2023-09-22 09:23:18 +02:00
Tomasz Bursztyka eeea64a19c drivers/nvme: Add debug information in case of request error
This will provide a detailed error status report.

As for most of the original code of the driver, this is a backport of
the work done by Jim Harris in FreeBSD.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2023-09-22 09:23:18 +02:00
Mulin Chao 68dd26574c boards: arm: npcx: add support for npcx4m8f_evb
Add support for npcx4m8f_evb board that is a development platform to
evaluate the Nuvoton NPCX4 embedded controller.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2023-09-22 09:23:06 +02:00
Fabio Baltieri 794893315a intc: loapic: convert DEVICE_DEFINE to DEVICE_DT_INST_DEFINE
Convert DEVICE_DEFINE to DEVICE_DT_INST_DEFINE, this allows the build
system to track the device dependencies and ensure that the interrupt
controller is initialized before other devices using it.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-09-22 09:22:55 +02:00
Fabio Baltieri ceb02b3f31 intc: intc_nxp_pint: convert SYS_INIT to DEVICE_DT_INST_DEFINE
Convert SYS_INIT to DEVICE_DT_INST_DEFINE, this allows the build system
to track the device dependencies and ensure that the interrupt
controller is initialized before other devices using it.

Adjust some DT_INST macro as well while at it.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-09-22 09:22:55 +02:00
Fabio Baltieri e9a67aabf7 intc: swerv_pic: convert SYS_INIT to DEVICE_DT_INST_DEFINE
Convert SYS_INIT to DEVICE_DT_INST_DEFINE, this allows the build system
to track the device dependencies and ensure that the interrupt
controller is initialized before other devices using it.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-09-22 09:22:55 +02:00
Fabio Baltieri aea618ebc0 intc: nuclei_eclic: convert SYS_INIT to DEVICE_DT_INST_DEFINE
Convert SYS_INIT to DEVICE_DT_INST_DEFINE, this allows the build system
to track the device dependencies and ensure that the interrupt
controller is initialized before other devices using it.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-09-22 09:22:55 +02:00
Fabio Baltieri a7e0cb0c80 intc: vexriscv_litex: convert SYS_INIT to DEVICE_DT_INST_DEFINE
Convert SYS_INIT to DEVICE_DT_INST_DEFINE, this allows the build system
to track the device dependencies and ensure that the interrupt
controller is initialized before other devices using it.

Fix an incorrectly declared compatible and adjust some DT macros as
well.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-09-22 09:22:55 +02:00
Fabio Baltieri 6fbe62bdb5 intc: arcv2: convert SYS_INIT to DEVICE_DT_INST_DEFINE
Convert SYS_INIT to DEVICE_DT_INST_DEFINE, this allows the build system
to track the device dependencies and ensure that the interrupt
controller is initialized before other devices using it.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-09-22 09:22:55 +02:00
Fabio Baltieri 17ae9a7680 intc: gic: convert SYS_INIT to DEVICE_DT_INST_DEFINE
Convert SYS_INIT to DEVICE_DT_INST_DEFINE, this allows the build system
to track the device dependencies and ensure that the interrupt
controller is initialized before other devices using it.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-09-22 09:22:55 +02:00
Fabio Baltieri 1539ca906e intc: irqmp: convert SYS_INIT to DEVICE_DT_INST_DEFINE
Convert SYS_INIT to DEVICE_DT_INST_DEFINE, this allows the build system
to track the device dependencies and ensure that the interrupt
controller is initialized before other devices using it.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-09-22 09:22:55 +02:00
Fabio Baltieri 843f66f52d intc: plic: convert SYS_INIT to DEVICE_DT_INST_DEFINE
Convert SYS_INIT to DEVICE_DT_INST_DEFINE, this allows the build system
to track the device dependencies and ensure that the interrupt
controller is initialized before other devices using it.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-09-22 09:22:55 +02:00
Emil Gydesen 2147eefa15 Bluetooth: PACS: Remove CONFIG_BT_PACS_{SNK,SRC}_CONTEXT
The Kconfig option was never used by the stack and should
thus be removed.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-09-22 09:21:53 +02:00
Benjamin Cabé f6a4217a88 doc: driver: samples: Update driver samples to use new Sphinx extension
Migrated existing driver samples to use the new code-sample directive
and role.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-09-22 09:21:43 +02:00
Benjamin Cabé 336941a1e5 samples: drivers: cleanup led_xec README
The README file for led_xec sample had several formatting issues
causing it to render very poorly.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-09-22 09:21:43 +02:00
Guillaume Gautier 01f080ebe0 doc: releases: update migration guide
Update migration guide

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2023-09-22 09:21:34 +02:00
Guillaume Gautier fa1f33316d dts: arm: st: remove sensor channels from stm32 adc nodes
Remove temp-, vref- and vbat-channel from STM32 ADC nodes as it is not
used in the driver anymore.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2023-09-22 09:21:34 +02:00
Guillaume Gautier a1adc17b31 drivers: adc: stm32: move internal path setting to sensor drivers
On some STM32 families (such as F4), temperature and Vbat sensor share the
same ADC channel, which can lead to conflict when reading them, and wrong
measurement can follow.

To alleviate this problem, this commit moves the setting of the common
path internal channel to the sensor drivers themselves instead of doing
it in the ADC driver.

The teardown is still done in the ADC driver, systematically, instead of
channel by channel (which has the same result).

By moving this logic in the sensor drivers, the properties temp-channel,
vbat-channel and vref-channel becomes useless and are thus removed.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2023-09-22 09:21:34 +02:00
Saw Xu 8951bab7e7 samples: subsys: usb: audio: Add volume control case
Add sample code for getting volume to headset sample and
headphone_microphone sample

Signed-off-by: Saw Xu <Saw1993@126.com>
2023-09-21 15:04:14 +02:00
Saw Xu 459f8e3251 usb: device: audio: Support volume control
Makes USB device audio class support volume control feature.

Signed-off-by: Saw Xu <Saw1993@126.com>
2023-09-21 15:04:14 +02:00
Saw Xu 16487c7047 dts: bindings: usb_audio: Add volume properties
Add volume feature specific fields. So remove this outdated description.

Signed-off-by: Saw Xu <Saw1993@126.com>
2023-09-21 15:04:14 +02:00
Erwan Gouriou 235319cfaa samples: boards: stm32: power_mgmt: Disable exclusive device PM
Disable exclusive PM run time handling as PM_DEVICE_RUNTIME is not
supported in all drivers.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2023-09-21 15:04:05 +02:00
Gerard Marull-Paretas 3ff5222a6f tests: kernel: device: drop APPLICATION level
Level is about to be removed, so stop testing it.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2023-09-21 15:02:45 +02:00
Gerard Marull-Paretas beec8b05a8 device: only allow PRE_KERNEL_1/2 and POST_KERNEL levels
Because devices share the same underlying infrastructure with SYS_INIT,
the same levels have always been available. However, not all of them are
needed, and some are not even usable. For example, `EARLY` can't be used
because when initialized `z_device_state_init` has not been called yet.
`SMP` has never been used by device drivers, and it is now in question,
likely to be moved to SMP specific hooks. Finally, `APPLICATION` does
not make much sense in the context of Kernel devices. Note that of the 3
levels just mentioned, only one was actively tested (`APPLICATION`) by
Kernel tests, meaning others were likely never considered in the context
of devices.

This patch leaves `PRE_KERNEL_1`, `PRE_KERNEL_2` and `POST_KERNEL`
available to devices. Others have been deprecated, and will generate a
compiler warning if used.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2023-09-21 15:02:45 +02:00
Piotr Dymacz 634416bc49 drivers: hwinfo: add driver for TI SimpleLink CC13xx/CC26xx series
Introduce hwinfo driver for Texas Instruments SimpleLink CC13xx/CC26xx
SOC series, with support for retrieving device's ID and cause of reset.

By default, the pre-programmed, 8-bytes length IEEE MAC address is used
for device's ID, with option ('HWINFO_CC13XX_CC26XX_USE_BLE_MAC') for
use 6-bytes length BLE MAC instead. By default, read-only values stored
in FCFG (Factory Configuration) are used but additional Kconfig option
('HWINFO_CC13XX_CC26XX_ALWAYS_USE_FACTORY_DEFAULT') is also provided,
which allows to use values from writable CCFG (Customer Configuration)
area. In all cases, device ID value is provided in big-endian which
matches what TI's UniFlash tool returns.

For reset cause, 'SysCtrlResetSourceGet()' function from TI's driver
library is used and its value is mapped to Zephyr's implementation.
Importantly, only root cause of reset is available on CC13xx/CC26xx
platform as described in MCU Technical Reference Manual ('RESET_SRC'
field in 'RESETCTL' register):

  "Shows the root cause of the last system reset. More than the
   reported reset source can have been active during the last
   system reset but only the root cause is reported."

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2023-09-21 08:07:35 -04:00
Anas Nashif 42d8f7ff17 samples: pm: fix init priority after init level change
Moving from APPLICATION level to POST_KERNEL and keeping both parent and
child on the same level is causing problems, so fix this by putting them
on different priorities in POST_KERNEL.

Also, this sample runs fine in qemu, so make it the integration
platform.

Fixes #62772

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-09-21 13:59:46 +02:00
Manuel Argüelles af7d972f4c can: nxp_s32_canxl: use clock control APIs
Use clock control API to retrieve the module's frequency and
update the boards using it to provide the source clocks.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-09-21 13:37:19 +02:00
Henrik Brix Andersen 89935550ce dts: bindings: can: deprecate advanced CAN timing properties
Deprecate the advanced CAN timing devicetree properties in favor of setting
advanced timing parameters from application code.

The advanced timing properties are giving in number of time quanta (Tq) and
requires reverse-calculation to find a suitable CAN clock divider. The
resulting bitrate error is compared against a threshold in the driver
initialization code, but the application is not able to retrieve it.

Forcing applications to use the CAN timing APIs directly instead makes it
up to the application to determine if the bitrate error is acceptable or
not.

The deprecated properties are:
- prop-seg
- phase-seg1
- phase-seg2
- prop-seg-data
- phase-seg1-data
- phase-seg2-data

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2023-09-21 13:37:08 +02:00
Grant Ramsay 663826a9f9 drivers: can: mcan: Add CAN statistics
Add CAN stats for MCAN drivers.

Update MCAN drivers to use CAN_DEVICE_DT_INST_DEFINE
which initialises and registers CAN stats if enabled.

Signed-off-by: Grant Ramsay <gramsay@enphaseenergy.com>
2023-09-21 13:36:52 +02:00
Marcin Gasiorek 4ebf6e5fac tests: net: Add missing tests to net_pkt_clone
Add tests for flag cloning and couple extra.

Signed-off-by: Marcin Gasiorek <marcin.gasiorek@nordicsemi.no>
2023-09-21 13:36:20 +02:00
Marcin Gasiorek 0564345715 net: Follow coding style when converting int to bool
Added double exclamation mark where missing in order to keep
code in one convention.

Signed-off-by: Marcin Gasiorek <marcin.gasiorek@nordicsemi.no>
2023-09-21 13:36:20 +02:00
Marcin Gasiorek c668fbc4d2 net: ip: Add cloning of missing attributes
A few attributes isn't cloned togerder with pkt.
This commit add missing part.
Additionally, because the `eof` flag in net_pkt structure is
avilable unconditionally hence `#if defined(CONFIG_NET_SOCKETS)`
guard has been removed form setter and getter functions for
this flag.

Signed-off-by: Marcin Gasiorek <marcin.gasiorek@nordicsemi.no>
2023-09-21 13:36:20 +02:00
Marcin Gasiorek a3cde71fbb net: Remove '#ifdef CONFIG_NET_ROUTE' around forwarding getter and setter.
Because `forwarding` flag is available unconditionally the compilation
guard has no make sense. Additionally this flag and related getter and
setter can be used for e.g. IPv4 packets forwarding in future, which
would be impossible looking at `NET_ROUTE` dependencies.

Signed-off-by: Marcin Gasiorek <marcin.gasiorek@nordicsemi.no>
2023-09-21 13:36:20 +02:00
Marcin Gasiorek 6a536f9f8c net: Deprecated and unused flags cleanup.
In net_pkt structure couple of flags are no longer used.
Flag pkt_queued can be removed permanently togeter with setter
and getter functions.
Second flag sent_or_eof has been renamed because it is still
used partially only for indicating EOF. Additionally unused setter
and getter for 'sent_' part of this flag are removed.

Signed-off-by: Marcin Gasiorek <marcin.gasiorek@nordicsemi.no>
2023-09-21 13:36:20 +02:00
Ryan McClelland 646ef0b3b1 drivers: misc: ethos_u: rename init.c to ethos_u.c
A file just named `init.c` is not that descriptive inside of a project
that has a lot of files of already. Rename to `ethos_u.c`.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2023-09-21 13:36:12 +02:00
Ryan McClelland f4993df937 drivers: misc: ethos_u: fix irq connect
The Ethos-U driver was using IRQ_DIRECT_CONNECT. This is not what the
driver needs as this will not detect a context switch when coming out
of the isr, and this is needed as the isr will release a semaphore.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2023-09-21 13:36:12 +02:00
Vinayak Kariappa Chettimada 3fba1a18e7 Bluetooth: Controller: Use max time when scheduling Broadcast ISO
Use maximum event time length when scheduling Broadcast ISO
events.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-09-21 12:49:48 +02:00
Vinayak Kariappa Chettimada 0f2980db15 Bluetooth: Controller: Maximize BIG event length and preempt PTO & CTRL
Maximize BIG event length to extend upto ISO interval, and
allow PTO and Control subevents to be pre-emptible.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-09-21 12:49:48 +02:00
Vinayak Kariappa Chettimada 87138e7ee3 Bluetooth: Controller: Calculate Broadcast ISO event overheads
Calculate Broadcast ISO event overheads due to extended and
periodic advertising events.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-09-21 12:49:48 +02:00