Commit graph

15409 commits

Author SHA1 Message Date
Rubin Gerritsen
4e30803e15 Bluetooth: Host: Define bt_gatt_err_to_str()
The function reuses the ATT implementation.
To make the function simpler to use, the function handles both positive
and negative values.

Unfortunately the APIs do not document if the API returns an
errno val or a GATT return value.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2024-06-20 15:34:39 +02:00
Rubin Gerritsen
94d712e5cf Bluetooth: Host: Define bt_att_err_to_str()
This can be useful if application developers
want to print them in the applications.

Later we can also use them in
the host to improve debuggability.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2024-06-20 15:34:39 +02:00
Maochen Wang
001ac3976a modules: hostap: fix hostap compile error and support enterprise
Fix compile error when enable enterprise security mode.

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
2024-06-20 12:47:18 +02:00
Maochen Wang
762169034b net: wifi: split wifi interface into STA and uAP
Split wifi interface into station mode and soft-AP mode, as there may be
station and soft-AP two interfaces that work concurrently.

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
2024-06-20 12:47:18 +02:00
Jerzy Kasenberg
207195dfe8 drivers: clock_control: smartbond: Add USB clock
Smartbodn does not have dedicated USB clock.
For USB to work PLL needs to be turned on.
To allow for flexible configuration artificial USB clock
is added that can be operated via clock_control subsystem.
This new clock turns on PLL when USB subsystem is enabled.
PLL can also be request in DT if application requires
more speed.

PLL can be automatically turned off when USB enters suspend
state and application did not requested it.

Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
2024-06-19 13:44:32 -04:00
Alberto Escolar Piedras
77acec32f7 native/posix arch: Reorder sections to avoid a RWE segment
GNU ld since 2.39, produces more security related warnings.
Due to the way we ordered sections the linker may end up with
a segment in the elf which contains both executable code
and read and write data.
This results in this new versions of the linker warning us.

So, in the linker script,
let's move the executable native_sim_if section from
being placed with the other native port related segments
after .data to being placed after .text instead.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-06-19 13:23:58 -04:00
Nikolay Agishev
a2dd517d7f ARCMWDT: Fix macroses for section definition
With adding support for ARC-V architecture some additional
changes in section definitions are required.

This PR fixes https://github.com/zephyrproject-rtos/zephyr/issues/74421

Signed-off-by: Nikolay Agishev <agishev@synopsys.com>
2024-06-19 13:23:13 -04:00
Dominik Ermel
97a97c744a drivers/flash: Fix typos and incorrect description
Fixing typos.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-06-19 09:34:19 +02:00
Johann Fischer
afa6411139 doc: usb: include group usbd_msg_api
Include group usbd_msg_api to reference its members.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-06-18 19:56:54 -04:00
Tomasz Moń
e653816665 doc: usb: include new MSC device API
Add doxygen group with MSC device API and document macro to create
mapping between disk access and MSC LUN.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-06-18 19:56:54 -04:00
Yong Cong Sin
15dc87d172 tracing: trace sys_init calls
Created tracing APIs to trace the enter and (exit + result) of
SYS_INIT and DEVICE_DT_DEFINE (and friends).

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-06-18 14:39:05 -04:00
Bjarki Arge Andreasen
1fc26b8974 drivers: rtc: api: Add helper for determining calibration
Add helper function which calculates the required calibration to
1 Hertz from the actual frequency of an RTC. This helper is both
functional and adds to the documentation of the RTC calibration
API.

The rtc.h header now includes zephyr/kernel.h instead of
zephyr/types.h as __ASSERT_NO_MSG is now referenced in the header.

The commit additionally extends the rtc_api_helpers test suite
with a test to validate the conversion function itself.

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-06-18 14:35:55 -04:00
Yong Cong Sin
19e4cb8f89 libc: cleanup deprecated heap-related Kconfigs
The following heap-related Kconfigs shared by the picolibc &
minimal libc have been deprecated for more than 2 releases,
remove them and update the Kconfigs accordingly:

- `CONFIG_MINIMAL_LIBC_MALLOC_ARENA_SIZE`
- `CONFIG_MINIMAL_LIBC_REALLOCARRAY`

Cleanup the handling to support the deprecated malloc arena
size configuration values.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-06-18 14:33:58 -04:00
Yong Cong Sin
d7f41e938d lib: hash: update the include headers
Include "stdio.h" as `malloc()` is used in the header.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-06-18 14:33:58 -04:00
Yong Cong Sin
94e12d595e net: lwm2m: remove deprecated functions & definition
These functions have been deprecated for more than 2 releases,
remove them:

- lwm2m_engine_update_observer_min_period
- lwm2m_engine_update_observer_max_period
- lwm2m_engine_create_obj_inst
- lwm2m_engine_delete_obj_inst
- lwm2m_engine_set_opaque
- lwm2m_engine_set_string
- lwm2m_engine_set_u8
- lwm2m_engine_set_u16
- lwm2m_engine_set_u32
- lwm2m_engine_set_u64
- lwm2m_engine_set_s8
- lwm2m_engine_set_s16
- lwm2m_engine_set_s32
- lwm2m_engine_set_s64
- lwm2m_engine_set_bool
- lwm2m_engine_set_float
- lwm2m_engine_set_objlnk
- lwm2m_engine_set_time
- lwm2m_engine_get_opaque
- lwm2m_engine_get_string
- lwm2m_engine_get_u8
- lwm2m_engine_get_u16
- lwm2m_engine_get_u32
- lwm2m_engine_get_u64
- lwm2m_engine_get_s8
- lwm2m_engine_get_s16
- lwm2m_engine_get_s32
- lwm2m_engine_get_s64
- lwm2m_engine_get_bool
- lwm2m_engine_get_float
- lwm2m_engine_get_objlnk
- lwm2m_engine_get_time
- lwm2m_engine_register_read_callback
- lwm2m_engine_register_pre_write_callback
- lwm2m_engine_register_validate_callback
- lwm2m_engine_register_post_write_callback
- lwm2m_engine_register_exec_callback
- lwm2m_engine_register_create_callback
- lwm2m_engine_register_delete_callback
- lwm2m_engine_set_res_buf
- lwm2m_engine_set_res_data
- lwm2m_engine_set_res_data_len
- lwm2m_engine_get_res_buf
- lwm2m_engine_get_res_data
- lwm2m_engine_create_res_inst
- lwm2m_engine_delete_res_inst
- lwm2m_engine_path_is_observed
- lwm2m_engine_send
- lwm2m_send
- lwm2m_engine_enable_cache

And additionally, the following definition:
- LWM2M_RD_CLIENT_EVENT_REG_UPDATE_FAILURE

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-06-18 14:32:56 -04:00
Yong Cong Sin
a3fada484a include: net: openthread: remove deprecated function
`openthread_set_state_changed_cb()` has been deprecated for
more than 2 releases, remove it.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-06-18 14:32:56 -04:00
Yong Cong Sin
cccb6b20c0 include: json: remove deprecated tokens
These token enums been deprecated for more than 2 releases,
remove them:

- JSON_TOK_LIST_START
- JSON_TOK_LIST_END

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-06-18 14:32:56 -04:00
Yong Cong Sin
18a6b07aa5 include: bluetooth: remove bt_le_whitelist_add()
`bt_le_whitelist_add()` has been deprecated for more
than 2 releases, remove it.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-06-18 14:32:56 -04:00
Rodrigo Peixoto
3b10caf96e zbus: channel msg subscriber pool isolation
Currently, zbus uses a single global `net_buf`pool to publish messages to
msg_subscribers. It would be good to have a way to separate the pools for
channels related to critical parts of the systems to avoid publication
failure on these particular channels. These channels will not use the
global pool. They can set an isolated pool by calling the
`zbus_chan_set_msg_sub_pool.`

Signed-off-by: Rodrigo Peixoto <rodrigopex@gmail.com>
2024-06-17 21:20:05 -04:00
Marco Widmer
e83f88b9a4 logging: use runtime message creation when logging is disabled
If compiler optimizations are disabled, some compilers (especially
arm_cortex_m) are using unrealistic amounts of stack for dead code.
Currently, if CONFIG_LOG=y and CONFIG_NO_OPTIMIZATIONS=y,
CONFIG_LOG_ALWAYS_RUNTIME is enabled to reduce the stack used by the
logging code.
However, if CONFIG_LOG=n, CONFIG_LOG_ALWAYS_RUNTIME is not available
which causes the compiler to allocate lots of stack space for the (dead)
logging code.
This patch forces runtime message creation when CONFIG_LOG=n. Since all
logging code is dead code when logging is disabled, the behavior should
be unchanged.

Signed-off-by: Marco Widmer <marco.widmer@bytesatwork.ch>
2024-06-17 15:30:02 +02:00
Christoph Schnetzler
239c20d2c7 logging: use #ifdef instead of #if
use #ifdef to avoid to use undefined macros in #if expressions

Signed-off-by: Christoph Schnetzler <christoph.schnetzler@husqvarnagroup.com>
2024-06-17 15:29:39 +02:00
Christoph Schnetzler
3c9e05959b logging: cmsis: prevent wundef warnings
If -Werror is used compilation fails due to wundef warning.

Signed-off-by: Christoph Schnetzler <christoph.schnetzler@husqvarnagroup.com>
2024-06-17 15:29:39 +02:00
Eric Holmberg
563ef0d28f net: tracing: fix sys_track_socket_init() declaration
Function declaration does not match definition causing a compilation error
when CONFIG_TRACING_OBJECT_TRACKING is enabled.

Signed-off-by: Eric Holmberg <eric.holmberg@northriversystems.co.nz>
2024-06-17 15:29:22 +02:00
Swift Tian
f5554ca762 emul: mspi: Add the mspi controller emulator
Add bus emulator support for MSPI and the MSPI controller emulator.
The mspi_emul.c not only serves as an emulator but also provides an
example implementation of the MSPI API. It does not actually do anything
other than validating parameters and forwarding transceive request back
to the device driver emulators.

Signed-off-by: Swift Tian <swift.tian@ambiq.com>
2024-06-14 21:07:00 -04:00
Swift Tian
8dd5b1e6b8 dts: mspi: Add MSPI bindings
Add the generic controller and device bindings for MSPI.

Signed-off-by: Swift Tian <swift.tian@ambiq.com>
2024-06-14 21:07:00 -04:00
Swift Tian
8a2bf58826 drivers: mspi: Add the new MSPI API
The MSPI(multi-bit SPI) is provided as a generic API to accommodate
advanced SPI peripherals and devices that typically require command,
address and data phases, and multiple signal lines during these phases.
While the API supports advanced features such as XIP eXecute In Place
and scrambling, it is also compatible with generic SPI.

Signed-off-by: Swift Tian <swift.tian@ambiq.com>
2024-06-14 21:07:00 -04:00
Flavio Ceolin
82f111a3b3 toolchain: llvm: Fix missing symbols
__INT16_C, __UINT16_C, __INT8_C and __UINT8_C are not defined in
zephyr_stdint.h and have to be defined in llvm.h when
CONFIG_MINIMAL_LIBC is enabled.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-06-14 19:10:08 -04:00
Flavio Ceolin
c0aba216af toolchain: llvm: Fix possible undefined macro
When CONFIG_MINIMAL_LIBC is enabled, __INTMAX_C and __UINTMAX_C
depend on int_c. Move the build guard to ensure that it is defined
when CONFIG_MINIMAL_LIBC is enabled.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-06-14 19:10:08 -04:00
Nikolay Agishev
efedf1cff3 ARCMWDT: Add compiler support for nSIM RMX platform
Add MetaWare compiller support for nSIM RMX platform

Signed-off-by: Nikolay Agishev <agishev@synopsys.com>
2024-06-14 19:01:06 -04:00
Nicolas Pitre
6a3aa3b04e demand_paging: add frame tracking functions to eviction algorithms
Let eviction algorithms be notified when a given page frame:

- should be considered as possible candidate

- should no longer be considered as candidate

- has just been marked as "accessed"

The NRU algorithm is unchanged so it implements those as empty stubs.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2024-06-14 18:58:02 -04:00
Raffael Rostagno
6096a10b9a drivers: clock_control: Refactor for ESP32C6
Added support for C6 to allow CPU clock config

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2024-06-14 18:51:46 -04:00
Raffael Rostagno
d59168eecb drivers: ledc: Clock source update to support ESP32C6
Clock source SCLK added for C6 on LEDC

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2024-06-14 18:51:46 -04:00
Raffael Rostagno
7500f4e620 drivers: spi: Add suport to ESP32C6
Added GP-SPI2 (general purpose SPI2) support for ESP32C6

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2024-06-14 18:51:46 -04:00
Lucas Tamborrino
32f73ef5d8 dt-bindings: add esp32c6 signals
Add clock, interrupt controller and pinctrl related macros
for esp32c6

Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
2024-06-14 18:51:46 -04:00
frei tycho
d5ff0cc820 include: sys: added missing parenthesis
- added missing parenthesis around macro argument expansion

Signed-off-by: frei tycho <tfrei@baumer.com>
2024-06-14 18:50:33 -04:00
Hess Nathan
15ddfa8b80 coding guidelines: comply with MISRA C:2012 Rule 11.2
avoid convert pointers to incomplete type using the pointer to first item

Signed-off-by: Hess Nathan <nhess@baumer.com>
2024-06-14 17:12:12 -04:00
Babak Arisian
7b9a0e7e95 Bluetooth: Audio: add add_by_broadcast_name for the assistant shell
Add add_by_broadcast_name command that scan for broadcast sources
has BT_DATA_BROADCAST_NAME that matches with whatever name is given
to the shell command.

Fixes #70836

Signed-off-by: Babak Arisian <bbaa@demant.com>
2024-06-14 17:11:04 -04:00
Eric Ackermann
4f72df466c net: Support partial checksum offloading
The Xilinx AXI Ethernet subsystem is capable of RX/Tx checksum
offloading. While it supports computing IP and UDP/TCP checksums, it
does not support computing ICMP checksums and only computes IP checksums
for ICMP messages. Thus, this patch adds an additional configuration for
ethernet drivers that indicates for which protocols checksum offloading
is (to be) supported. This flag is then considered by the IP subsystem
in determining when flags need to be computed in software.

Signed-off-by: Eric Ackermann <eric.ackermann@cispa.de>
2024-06-14 17:10:43 -04:00
Damian Nikodem
a2386efbce drivers: ssp: update SSP driver to support Intel ACE30 PTL
This commit refactors the SSP driver to support the Intel ACE30 PTL
platform. The changes include:
- Adding new structures ssp_rx_dir and ssp_tx_dir to hold the TDM
slot configuration for RX and TX directions
- Adjusting the dai_ssp_set_config_blob functions to work with
the new TDM slot configuration.

Signed-off-by: Damian Nikodem <damian.nikodem@intel.com>
2024-06-14 20:33:18 +02:00
Chris Friedt
2d4346ba53 posix: implement mprotect()
Provide a stub for mprotect() to satisfy the requirement for the
base definitions / system interfaces and subsequently PSE51,
PSE52, PSE52, etc.

Currently, Zephyr's virtual memory-management API does not seem
to support modifying memory protection bits after pages have
already been mapped.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-14 14:01:05 -04:00
Chris Friedt
64f336c251 posix: tie page size to mmu page size
Make POSIX_PAGE_SIZE_BITS not user-configurable and tie it to
CONFIG_MMU_PAGE_SIZE if there is an MMU. Otherwise, simply
default it to something small.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-14 14:01:05 -04:00
Chris Friedt
5346306261 posix: add support for shared memory objects
Implement shm_open() and shm_unlink() to complete support for
the _POSIX_SHARED_MEMORY_OBJECTS Option.

Since mmap() support is not yet implemented in Zephyr, I/O is
limited to read(), write(), ftruncate(), lseek(), close(), for now.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-14 14:01:05 -04:00
Chris Friedt
58c1c48df0 fdtable: per-fd offset support, add read/write_offs() methods
File offset actually varies on a per-file-descriptor basis,
and not with the resource that is abstracted behind the file
descriptor.

This is consistent with both the POSIX model and also the
ISO C/C++ model, so Zephyr should follow suit.

This is very work-around-y, but it's necessary to ensure
that shared memory objects, block devices, files and
directories all behave consistently.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-14 14:01:05 -04:00
Chris Friedt
2710903014 os: fdtable: add mode field for fd_entry
Add a mode field for struct fd_entry, as well as a new
initializer, z_finalize_typed_fd().

The constants ZVFS_MODE_* may be used to differentiate
between fifo, character device, message queues, directories,
semaphores, block devices, shared memory objects, regular files,
symbolic links, and sockets.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-14 14:01:05 -04:00
Chris Friedt
5e99e13b4c posix: add support for mlockall() and munlockall()
Add support for mlockall() and munlockall(). These two functions
comprise the _POSIX_MEMLOCK Option which is required by PSE51,
PSE52, PSE53, and PSE54.

Zephyr's on-demand paging API does not yet support pinning and
unpinning *all* virtual memory regions, so these functions are
expected to fail, setting errno to ENOSYS. Any other usage is
currently categorized as undefined behaviour.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-14 14:01:05 -04:00
Chris Friedt
d949c9c8b8 posix: add support for mlock() and munlock()
Add support for mlock() and munlock(). These two functions
comprise the _POSIX_MEMLOCK_RANGE Option which is
required by PSE51, PSE52, PSE53, and PSE54.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-14 14:01:05 -04:00
Chris Friedt
73394a8390 posix: add implementation of mmap(), msync(), and munmap()
Add stubs for mmap(), msync(), and munmap() as required by the
_POSIX_MAPPED_FILES Option and POSIX_MAPPED_FILES and
Option Group of IEEE 1003.1-2017.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-14 14:01:05 -04:00
Chris Friedt
50fc010f0f posix + fdtable: move zvfs_ftruncate() to fdtable.c
Move the zvfs_ftruncate() call from fs.c to fdtable.c, as file
types other than regular files can also be truncated.

Instead of hard-wiring zvfs_ftruncate() to fs_truncate(),
add a new ZVFS_IOCTL_TRUNCATE so that the operation can be
handled with other ioctl() operations.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-14 14:01:05 -04:00
Chris Friedt
1f9ca63b93 posix: fs: implement fstat() via zvfs_fstat()
Route the fstat() call (part of POSIX_FILE_SYSTEM) to
zvfs_fstat() so that other types of file descriptors can also
supply file status information.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-14 14:01:05 -04:00
Chris Friedt
1a95246f61 posix: features: correct typo _POSIX_XOPEN_STREAMS
An invalid feature test macro was found in in sysconf.h .

It should be corrected from _POSIX_XOPEN_STREAMS to
_XOPEN_STREAMS.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-14 14:01:05 -04:00