Commit graph

15409 commits

Author SHA1 Message Date
Flavio Ceolin
4f29930e4c pm: Fix cpus active count
Only set a cpu as active (on pm subsystem) when the cpu is effectively
initialized. We cannot assume on pm subsystem that all cpus were
initialized since when the option CONFIG_SMP_BOOT_DELAY is used cpus are
initialized on demand by the application.

Note that once cpus are properly initialized the subystem is able to track
their status.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-06-01 10:05:31 +02:00
Wojciech Slenska
ccfbac8b07 rtio: Fix cpp compatibility
Fixed comparison between signed(int64_t) and unsigned(uint64_t) variables.

Signed-off-by: Wojciech Slenska <wsl@trackunit.com>
2023-05-31 12:40:59 -07:00
Gerard Marull-Paretas
fd21601930 drivers: ivshmem: adjust brief/group title
Use `Inter-VM Shared Memory` so that `ivshmem` abbreviation is clear.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-05-31 14:39:29 -04:00
Gerard Marull-Paretas
6d6e079b32 drivers: virtualization: add to io_interfaces group
Device driver APIs belong to io_interfaces group.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-05-31 14:39:29 -04:00
Gerard Marull-Paretas
75dd00a732 bluetooth: mesh: fix top-level Doxygen groups
Doxygen groups in large_comp_data_cli/srv, rpr_cli/srv, opp_agg_cli/srv
belong to the bt_mesh group, otherwise they show up as top level
modules.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-05-31 14:39:29 -04:00
Gerard Marull-Paretas
9979fd6721 drivers: display: move display_interface to io_interfaces
All device driver APIs belong to the io_interfaces group.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-05-31 14:39:29 -04:00
Gerard Marull-Paretas
248137169a doc: doxygen: add some subsystems to os_services group
Add the following root Doxygen modules under the umbrella of "OS
Services" Doxygen group:

- Cache
- File system
- IPC
- RTIO
- CRC
- Iterable sections
- ZBus
- Task watchdog
- Shell
- Semihosting
- Logging
- System init

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-05-31 14:39:29 -04:00
Gerard Marull-Paretas
a98d673230 doc: doxygen: s/subsys/os_services
Rename the subsystems group from `subsys` to `os_services`, aligning
with what we have on the Sphinx side.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-05-31 14:39:29 -04:00
Morten Priess
3fd1fbeff8 Bluetooth: controller: Validate parameters for CIG configuration
Parameter checking updates for passing HCI/CIS/BI* EBQ tests.

Signed-off-by: Morten Priess <mtpr@oticon.com>
2023-05-30 08:59:16 -04:00
Siyuan Cheng
4babd545cc drivers: pinctrl: add pinctrl driver for ARC emsdp
Add Synopsys ARC EMSDP board Pin controller for its Pmod
and Arduino shield interface.

Signed-off-by: Siyuan Cheng <siyuanc@synopsys.com>
2023-05-29 09:21:07 -04:00
Flavio Ceolin
c22c4fd49f linker: Fix __stackmem section with CONFIG_KERNEL_COHERENCE
When building whith CONFIG_KERNEL_COHERENCE enabled,
__stackmem was not being put in the user_stack section making
impossible to gen_kobject script find user capable stacks.

It is responsability of the platform to put user_stacks
section in the appropriated region.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-05-27 06:33:17 -04:00
Benedikt Schmidt
bb679532f4 dts: bindings: adc: Add configurable current source pin for ADCs
Add a property to the ADC channels which allows the configuration
of the current source pin.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2023-05-27 05:33:52 -04:00
Emilio Benavente
86d63c5cff dts: arm: nxp: lpc55S6X: Added trig bindings for DMA
Added Input/Output trigger mux address's as properties
that can be passed into the DMA driver. This is intended
to send INPUTMUX signals into the DMA.

Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
2023-05-26 17:22:43 -05:00
Jamie McCrae
bdf2e56ce1 drivers: Add auxdisplay (text) interface
Adds the base driver include file and base auxiliary display
dts file.

Signed-off-by: Jamie McCrae <spam@helper3000.net>
2023-05-26 23:05:58 +02:00
Chad Karaginides
9ab7354a46 arch: arm64: SCR_EL3 EEL2 Enablement
For secure EL2 to be entered the EEL2 bit in SCR_EL3 must be set.  This
should only be set if Zephyr has not been configured for NS mode only,
if the device is currently in secure EL3, and if secure EL2 is supported
via the SEL2 bit in AA64PFRO_EL1.  Added logic to enable EEL2 if all
conditions are met.

Signed-off-by: Chad Karaginides <quic_chadk@quicinc.com>
2023-05-26 13:51:50 -04:00
Dawid Niedzwiecki
66d8e27c34 mgmt: ec_host_cmd: add a function to send response
A function to send Host Command response is needed for commands that
that sends IN_PROGRESS status or doesn't return e.g. perform reboot.

Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
2023-05-26 13:51:30 -04:00
Hou Zhiqiang
41520e8b5b kernel: mmu: add direct-map support in z_phys_map()
Many RTOS applications assume the virtual and physical address
is 1:1 mapping, so add the 1:1 mapping support in z_phys_map()
to easy adapt these applications.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
2023-05-26 13:50:35 -04:00
Yuval Peress
ca5bf10143 sensor_shell: Update to new sensor_read API
Update the sensor shell logic to use the new sensor_read() APIs and
make triggers an option of the sensor_shell sample (this avoids the
trigger stealing the interrupt status from one-shot reads).

Signed-off-by: Yuval Peress <peress@google.com>
2023-05-26 11:04:54 -05:00
Yuval Peress
ed380de152 sensors: Add new async one-shot reading API
Add a new async API based on the RTIO subsystem. This new API allows:
1. Users to create sampling configs (telling the sensor which channels
   they want to sample together).
2. Sample data in an asynchronous manner which provides greater control
   over the data processing priority.
3. Fully backwards compatible API with no driver changes needed for
   functionality (they are needed to improve performance).
4. Helper functions for processing loop.

Signed-off-by: Yuval Peress <peress@google.com>
2023-05-26 11:04:54 -05:00
Anisetti Avinash Krishna
5925a4670b drivers: dma: dma_intel_lpss: Added intel LPSS DMA interface
Added intel LPSS DMA interface using dw common to support
usage of internal DMA in LPSS UART, SPI and I2C for
transfer and receive operations.

Signed-off-by: Anisetti Avinash Krishna <anisetti.avinash.krishna@intel.com>
2023-05-26 10:06:00 -04:00
Georgij Cernysiov
943bc1cebc drivers: mdio: add adin2111
Adds MDIO driver. Works via exposed
ADIN2111 functions.

It is possible to access Clause 45 and 22 registers.

Due to MDIO API limitation Clause 45 access
is done using driver specific MDIO functions.

Provides API and functions for PHY driver.

Signed-off-by: Georgij Cernysiov <geo.cgv@gmail.com>
2023-05-26 09:50:09 -04:00
Georgij Cernysiov
9a15d72b32 drivers: ethernet: add adin2111
Adds initial ADIN2111 2-Port 10BASE-T1L (SPE)
switch support. Works over SPI.

The driver creates 2 interfaces, 1 per port (PHY).
Configures multicast and broadcast filters.
The same unicast is applied to both ports.

Supports:
  - Link state detection
  - CRC enable/disable
  - Ports config set
  - Ports ETH stats

Provides functions for MDIO driver.

Signed-off-by: Georgij Cernysiov <geo.cgv@gmail.com>
2023-05-26 09:50:09 -04:00
TOKITA Hiroshi
59a6092849 fb: cfb: Add cfb_draw_rect() API
Add cfb_draw_rect() API for rendering rectangle.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
2023-05-26 09:48:56 -04:00
TOKITA Hiroshi
ea42b0dc9d fb: cfb: Add cfb_draw_line() API
Add cfb_draw_line() API for rendering line.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
2023-05-26 09:48:56 -04:00
TOKITA Hiroshi
9def1258a0 fb: cfb: Add cfb_draw_point() API
Add cfb_draw_point() API for rendering dot.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
2023-05-26 09:48:56 -04:00
Johann Fischer
32668dc7fd usb: device_next: allow string descriptor index to be updated
Support for multiple instances of a class implementation,
and the ability to register an instance to a configuration
at runtime, requires a mechanism to add a string descriptor
and update its index based on the total number of descriptors.

We also need to handle some special string descriptors like
Product or Serial Number provided by the application.
Marked as such by using specific macros, these descriptors
can be sorted out by the stack and the device descriptor
indexes are updated automatically.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2023-05-26 09:48:19 -04:00
Johann Fischer
8a8e9e1dfe usb: device_next: implement usbd_class_shutdown()
Implement marked as TODO usbd_class_shutdown().

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2023-05-26 09:48:19 -04:00
Johann Fischer
9a4ed741d6 usb: device_next: use specific macros for string descriptors
Add and use specific macros for manufacturer, product, and
serial number string descriptors.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2023-05-26 09:48:19 -04:00
Johann Fischer
7e2d359e8f usb: device_next: use dlist instead of slist for descriptors list
While this does not provide much of an advantage yet,
it will allow us to add descriptors and assign an index
more easily in the next commit.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2023-05-26 09:48:19 -04:00
Johann Fischer
c34ad3114c usb: device_next: allow reuse of string descriptor nodes
If we try to reuse a string descriptor node, the content will
be corrupted because the device stack assumes it is still ASCII7
encoded. Add a flag to indicate that a descriptor node contains
UTF16LE encoded content.

And while we are at it, add a flag to indicate that the SN string
should not be obtained from the hwinfo API.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2023-05-26 09:48:19 -04:00
Jarno Lämsä
05e0b31fa8 net: lib: coap: Add an asynchronous coap client
The coap client takes requests and provides responses
asynchronously to callback given in a request.
Currently supports only 1 request at a time.

Signed-off-by: Jarno Lämsä <jarno.lamsa@nordicsemi.no>
2023-05-26 09:44:50 -04:00
Fredrik Danebjer
7457bcf0a2 Bluetooth: Audio: Make HAS optional notify characteristics optional
Added Kconfig options to make HAS characteristics that has notify as
optional property selectable and thus optional. These settings are
global, meaning that a chosen notify property will be used for all
registered has instances.

Signed-off-by: Fredrik Danebjer <frdn@demant.com>
2023-05-26 09:09:06 -04:00
Pavel Vasilyev
5720ba51db Bluetooth: Mesh: Disable models initialization macros for C++
These macros use Compound Literal C99 feature which is not supported by
C++.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-05-26 09:07:22 -04:00
Alberto Escolar Piedras
0ae060d174 drivers: Console: Move all posix arch boards to same driver
All posix arch boards are required to provide the same
tracing/print API.
So, instead of having a different driver for native_posix and the
bsim boards, let's have a common one which uses this API.
This in turn results in the printk strings being printed in
the same underlaying backend as before with individual drivers.

A part from this, the native_posix console driver was a full
backend for the now long gone Zephyr console shell
(named legacy_shell from 527256501f
until it was retired in fd0b7f7767).
The whole input handling in this driver was dead code
(since 140a8d0c8a)

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-05-26 12:57:41 +02:00
BJ Chen
215f180296 ITE: drivers/usb/device: Add USB Device Controller Support
Add USB Device Driver (usb_dc) of ITE IT82xx2

TEST=west build -p always -b it82xx2_evb
1. zephyr/sample/subsys/usb/hid
2. zephyr/sample/subsys/usb/hid-mouse

Signed-off-by: BJ Chen <bj.chen@ite.com.tw>
2023-05-26 12:40:18 +02:00
Jamie McCrae
7e23e73bc1 mgmt: mcumgr: transport: udp: Rework transport
This reworks the UDP transport to resolve some issues with object
interactions and streamlines the code.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-05-26 10:22:42 +02:00
Jamie McCrae
0cce365c4f mgmt: mcumgr: fs_mgmt: Add other access hooks and minor fixes
Adds callback checks to other fs_mgmt group file access functions
which allows for file access control, and moves where the callback
is triggered for uploads and downloads to prevent getting the
callback multiple times for the same file. The callback struct has
been modified so applications using the previous signature will
need to be updated.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-05-26 10:20:39 +02:00
Vincent Genevès
86f54b79b7 include: drivers: stm32 clock control: set HSIDIV for STM32C0
Configure HSIDIV to 1 so the HSI clock of 48MHz can be achieved.

Signed-off-by: Vincent Genevès <vincent@geneves.fr>
2023-05-25 16:31:40 -04:00
Daniel Leung
c369c88ce9 kernel: extract common code in K_{,KERNEL_}THREAD_DEFINE
K_THREAD_DEFINE and K_KERNEL_THREAD_DEFINE have common code
so extract the common code and put them into another macro
Z_THREAD_COMMON_DEFINE().

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-05-25 16:30:26 -04:00
Jose Alberto Meza
6281ec414d kernel: add macro to define threads to run in kernel mode only
This addition allows to define threads without a privileged stack,
and are to run in kernel mode only.

When CONFIG_USER_SPACE is enabled, a thread ends up allocating
space for both its own thread stack and a privileged stack.
When a thread runs in kernel mode only, this extra space for
the privileged stack is not needed.

The macro K_THREAD_DEFINE(), by default, defines a thread with
privileged stack. A new macro K_KERNEL_THREAD_DEFINE() is added
so that a kernel mode only thread can be defined without
the privileged stack.

DL: Edited commit message, clarification in function comment and
    alignment.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-05-25 16:30:26 -04:00
Daniel Leung
1645537cc1 kernel: remove outdated comment in K_THREAD_DEFINE()
The internal comment in K_THREAD_DEFINE() on alignment needed
for x86 is outdated. The alignment is taken care of by
the iterable sections in linker scripts. So remove.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-05-25 16:30:26 -04:00
Aaron Massey
6b4920ba9d fuel_gauge: Convert property #defines to enum
Fuel gauge properties used #defines to support Cpp custom downstream
properties. However, discussion in
https://github.com/zephyrproject-rtos/zephyr/pull/56666#discussion_r1189580654
showed that we could still use enums for this use-case if we typedefed a
uint as a fuel gauge property type. Since enums are more maintainable and
easier to extend, we should move from defines to enums.

Change fuel gauge properties from defines to an extendable enum.

Signed-off-by: Aaron Massey <aaronmassey@google.com>
2023-05-25 16:30:08 -04:00
Gerard Marull-Paretas
9a145e52a0 pm: policy: add support for events
Events in the power-management policy context are defined as any source
that will wake up the system at a known time in the future. By
registering such event, the policy manager will be able to decide wether
certain power states are worth entering or not.

Events will bypass the ticks argument received by the policy manager if
they occur earlier.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-05-25 16:29:40 -04:00
Gerard Marull-Paretas
c8cd40f5ae pm: policy: clarify latency units and clarify private members
Latency is always specified in microseconds, so apend `us` to the
relevant variables. Also, make it clear that latency request structures
are private (they are just exposed publicly to allow static allocation).

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-05-25 16:29:40 -04:00
Fabio Baltieri
3431c1b59d drivers: sensors: add a sensor driver for TCS3400
Add a sensor driver for the TCS3400 color light-to-digital converter.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-05-25 13:30:45 +00:00
Gerard Marull-Paretas
87bfe597d9 logging: fix multidomain helpers Doxygen
I realized today that we had a "." and "IDs of message." top level
Doxygen sections. It looks like the multidomain helpers module was
merged without a proper Doxygen structure. This patch adds the helpers to
a subgroup within `log_backend` and uses `@name` to group definitions.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-05-25 04:48:13 -04:00
Nikolay Agishev
78be96b152 ARC: MPU: Add MPUv8 fixes
Add mpuv8-related fixes that setup alignment and region overlapping

Signed-off-by: Nikolay Agishev <agishev@synopsys.com>
2023-05-25 08:27:34 +00:00
Emil Gydesen
e0b84798c9 BluetootH: Audio: Split CAP broadcast start API
Split the CAP initiator broadcast start API into a create
and a start. This will allow users to create the broadcast source
without starting it immediately, making it possible to get the
BASE etc. without an active advertising set.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-05-25 08:26:33 +00:00
Jaxson Han
894f1b1fd7 drivers: gic: Add irq pending check and clear function
Implement irq pending check and clear function for both gic and gicv3.

Signed-off-by: Jaxson Han <jaxson.han@arm.com>
2023-05-25 08:25:11 +00:00
Nicolas Pitre
e2d0d1a801 kernel: allow for arch specific processing within busy loops
Give architectures that need it the ability to perform special checks
while e.g. waiting for a spinlock to become available.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2023-05-25 08:25:11 +00:00