Commit graph

96703 commits

Author SHA1 Message Date
Yong Cong Sin
9d9576b442 subsys/debug: relocate gdbstub stuff into its folder
Move the gdbstub files into the gdbstub folder, and relocated
its Kconfig as well.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-06-04 22:36:51 -04:00
Flavio Ceolin
0b3d7eb3e7 doc: vulnerabilities: Info about CVE-2024-3332
Add an entry for CVE-2024-3332.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-06-04 22:36:09 -04:00
Flavio Ceolin
ee92645e9c doc: relnotes/3.7: Add info about CVE-2024-3332
Information about CVE-2024-3332 in release notes.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-06-04 22:36:09 -04:00
Peter Mitsis
48285cb6b8 tests: Add IPI_OPTIMIZE tests
Adds several tests to verify that IPIs can be appropriately
targeted to specific CPUs.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2024-06-04 22:35:54 -04:00
Peter Mitsis
1753a0dabe manifest: optional: Update revision for arch_sched_ipi()
Updates the sof revision. This is needed for it to pick up a
change to the arch_sched_ipi() which has been renamed to
arch_sched_broadcast_ipi().

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2024-06-04 22:35:54 -04:00
Peter Mitsis
0bcdae2c62 kernel: Add CONFIG_ARCH_HAS_DIRECTED_IPIS
Platforms that support IPIs allow them to be broadcast via the
new arch_sched_broadcast_ipi() routine (replacing arch_sched_ipi()).
Those that also allow IPIs to be directed to specific CPUs may
use arch_sched_directed_ipi() to do so.

As the kernel has the capability to track which CPUs may need an IPI
(see CONFIG_IPI_OPTIMIZE), this commit updates the signalling of
tracked IPIs to use the directed version if supported; otherwise
they continue to use the broadcast version.

Platforms that allow directed IPIs may see a significant reduction
in the number of IPI related ISRs when CONFIG_IPI_OPTIMIZE is
enabled and the number of CPUs increases.  These platforms can be
identified by the Kconfig option CONFIG_ARCH_HAS_DIRECTED_IPIS.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2024-06-04 22:35:54 -04:00
Peter Mitsis
d8a4c8a90c kernel: Add CONFIG_IPI_OPTIMIZE
The CONFIG_IPI_OPTIMIZE configuration option allows for the flagging
and subsequent signaling of IPIs to be optimized.

It does this by making each bit in the kernel's pending_ipi field
a flag that indicates whether the corresponding CPU might need an IPI
to trigger the scheduling of a new thread on that CPU.

When a new thread is made ready, we compare that thread against each
of the threads currently executing on the other CPUs. If there is a
chance that that thread should preempt the thread on the other CPU
then we flag that an IPI is needed for that CPU. That is, a clear bit
indicates that the CPU absolutely will not need to reschedule, while a
set bit indicates that the target CPU must make that determination for
itself.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2024-06-04 22:35:54 -04:00
Peter Mitsis
9ff5221d23 kernel: Update IPI usage in k_thread_priority_set()
1. The flagging of IPIs is moved out of k_thread_priority_set() into
z_thread_prio_set(). This allows for an IPI to be done for a thread
that had its priority bumped due to the handling of priority
inheritance from a mutex.

2. k_thread_priority_set()'s check for sched_locked only applies to
non-SMP builds that are using the old arch_swap() framework to switch
between threads.

Incidentally, nearly all calls to flag_ipi() are now performed with
sched_spinlock being locked. The only exception is in slice_timeout().

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2024-06-04 22:35:54 -04:00
Henrik Brix Andersen
afb2791ccf tests: drivers: can: host: allow specifying context along with fixture
Allow specifying the python-can configuration context to use along with the
"can" fixture. This opens up for specifying board-specific contexts in the
twister hardware map file.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-06-04 21:27:35 -05:00
Henrik Brix Andersen
3eb3c33096 scripts: twister: allow fixtures to contain extra configuration
Allow twister fixtures to contain extra information, which can be used for
test suite configuration. The extra information can be appended to existing
fixtures separated by a colon (i.e. <fixture>:<configuration>).

This is especially useful for the pytest harness, where a fixture of a
given type may need to refer to an instance of a particular piece of host
hardware needed by the pytest suite (e.g. a network interface, a UART, or a
CAN interface connected to the device under test).

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-06-04 21:27:35 -05:00
Henrik Brix Andersen
a7d55cfa13 twister: harness: pytest: list available fixtures in device config
Pass the list of supported twister fixtures for a given platform to pytest
via DeviceConfig. This allows for the pytest suites to use knowledge of the
fixtures for test suite configuration.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-06-04 21:27:35 -05:00
Chekhov Ma
07f132b1b5 boards: imx93_evk: enable flexcan driver
Add pinctrl for flexcan2
Add EXP_SEL gpio hog for board mux selection during boot.
Add TJA1057 CAN PHY driver.
Update supported features in board document

Signed-off-by: Chekhov Ma <chekhov.ma@nxp.com>
2024-06-04 19:14:16 -04:00
Chekhov Ma
69360d2f38 soc: imx93: enable flexcan driver
- Add flexcan dts node and pinctrl.

Signed-off-by: Chekhov Ma <chekhov.ma@nxp.com>
2024-06-04 19:14:16 -04:00
Flavio Ceolin
4ffefed23a tests: power_mgmt: Test system-managed disabled per state
Check that a power state that has system-managed device power
management disabled does not trigger device power management
when the system sleeps.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-06-04 19:13:53 -04:00
Flavio Ceolin
2dfacadd04 tests: pm: Replace depracated build option
Replace the usage of CONFIG_PM_DEVICE_RUNTIME_EXCLUSIVE with
CONFIG_PM_DEVICE_SYSTEM_MANAGED.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-06-04 19:13:53 -04:00
Flavio Ceolin
1359eb9308 tests: power_mgmt: Add test for PM_DEVICE_SYSTEM_MANAGED
Add a new test that disables PM_DEVICE_SYSTEM_MANAGED, since this
option is enabled by default.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-06-04 19:13:53 -04:00
Flavio Ceolin
dcf22a66de doc: pm: Update system device pm
Add new information about new property to
enable/disable device power management per
power state.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-06-04 19:13:53 -04:00
Flavio Ceolin
7dcec56601 tests: device_wakeup_api: Use DTS overlay for power state
Define the power state needed in the test in DT.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-06-04 19:13:53 -04:00
Flavio Ceolin
45e9c2eed3 tests: power_mgmt: Use DTS overlay for power state
Define the power state needed in the test in DT.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-06-04 19:13:53 -04:00
Flavio Ceolin
1c2e988021 pm: device: De-couple device pm from system pm
PM_DEVICE is not attached to system managed device power management.
It is a very common use case targets with device runtime power
management that don't want system device power management enabled.

We introduce a new symbol (PM_DEVICE_SYSTEM_MANAGED) to explicit
control whether or not system device power management should be
globally enabled.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-06-04 19:13:53 -04:00
Flavio Ceolin
c65be0cfb9 pm: Exclude device pm path when it is not needed
Remove device pm path when there is no is no power state in DT with
device pm enabled. This basically does the same thing that was done
by PM_DEVICE_RUNTIME_EXCLUSIVE.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-06-04 19:13:53 -04:00
Flavio Ceolin
2f99ff51cc pm: Disable device pm per power state
Make it possible to disble device power management individually per
power state.  This allows targets tuning which states should
(and which should not) trigger device power management.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-06-04 19:13:53 -04:00
Flavio Ceolin
94af630b22 pm: Deprecate PM_DEVICE_RUNTIME_EXCLUSIVE
That is option has shown confusing on it is attempt to prevent
system pm doing device power management. Lets address this
problem properly.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-06-04 19:13:53 -04:00
Flavio Ceolin
1a6bdb2e3e doc: crypto: Add PSA Crypto documentation
Add PSA Crypto in the cryptographic services
section.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-06-04 19:13:36 -04:00
Flavio Ceolin
c1bcf3c72f doc: crypto: Remove TinyCrypt from documentation
TinyCrypt is being removed from Zephyr in favor of PSA Crypto.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-06-04 19:13:36 -04:00
Flavio Ceolin
9751f78ce5 doc: security-overview: Update cryptographic information
Zephyr's transition to PSA Crypto API and demoting TinyCrypt.
Lets not promote TinyCrypt in the overview.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-06-04 19:13:36 -04:00
Sven Depoorter
cabeaf1436 drivers: display: ili9xxx: add justification for default rotation
To align with udpated ssd16xx bindings.

Signed-off-by: Sven Depoorter <svndepoorter@gmail.com>
2024-06-04 19:13:18 -04:00
Sven Depoorter
dda604c96f drivers: display: ssd16xx: performance improvement
The driver writes the scan entry mode to the display controller on each
set_window call. Multiple calls to set_window can be needed to update
a single frame buffer in the controller.

There's a performance improvement by only setting the scan mode when
the orientation is changed (set_orientation, see previous commit)
and when the profile has changed.
For the latter the scan_mode is lost on the controller
due to a software reset.

Signed-off-by: Sven Depoorter <svndepoorter@gmail.com>
2024-06-04 19:13:18 -04:00
Sven Depoorter
e01f422b02 drivers: display: ssd16xx: implement display_set_orientation API
I chose this approach instead of software rotation because I need it for
an ultra low power project.
Rotation in steps of 0, 90, 180, 270 degrees is done by changing
the data entry modes.
This commit removes the orientation-flipped property as it is redundant.

I made the assumption that the current driver implementation is right
about controller X/Y versus display width/height. The display controller X
parameter matches with the display height (dts) and display controller Y
parameter matches with the display width (dts). It looks like display
manufacturers choose to have it like this because a wider screen probably
makes more sense.

Tested on the reel_board with a 250x122 display (ssd1673 controller)
and a custom PCB with a 200x200 display (ssd1681 controller).
Also tested all orientations with various width/height dts overrides.

Signed-off-by: Sven Depoorter <svndepoorter@gmail.com>
2024-06-04 19:13:18 -04:00
Yassine El Aissaoui
cb85932488 boards: rd_rw612_bga: Update board documentation
Add information about BLE.

Signed-off-by: Yassine El Aissaoui <yassine.elaissaoui@nxp.com>
2024-06-04 19:12:45 -04:00
Yassine El Aissaoui
ffa3f168ec samples: tests: Create dedicated test section for rd_rw612_bga
Monolithic build is enabled by default and it
requires the presence of the binary blobs.
CI will fail since it doesn't fetch them
to the environment. To avoid this
monolithic for BT app is disabled.

Signed-off-by: Yassine El Aissaoui <yassine.elaissaoui@nxp.com>
2024-06-04 19:12:45 -04:00
Axel Le Bourhis
bb6669418a boards: rd_rw612_bga: flash size with monolithic feature
When building with monolithic feature enabled, the firmwares binaries
will be linked during the build with the application. This means we can
remove the application size limit due to the firmware storage in flash
not useful anymore.

Signed-off-by: Axel Le Bourhis <axel.lebourhis@nxp.com>
Signed-off-by: Yassine El Aissaoui <yassine.elaissaoui@nxp.com>
2024-06-04 19:12:45 -04:00
Axel Le Bourhis
ca53f5ee8e soc: rw6xx: Enable NXP_BLE_MONOLITHIC
Enable monolithic build for all BLE apps.

Signed-off-by: Axel Le Bourhis <axel.lebourhis@nxp.com>
Signed-off-by: Yassine El Aissaoui <yassine.elaissaoui@nxp.com>
2024-06-04 19:12:45 -04:00
Axel Le Bourhis
8f5892a830 mcux: add Kconfig to configure NXP BLE monolithic feature
The monolithic feature allows to link the binary blobs with
the application during the build.

Signed-off-by: Axel Le Bourhis <axel.lebourhis@nxp.com>
Signed-off-by: Yassine El Aissaoui <yassine.elaissaoui@nxp.com>
2024-06-04 19:12:45 -04:00
Tahsin Mutlugun
859c733b01 tests: drivers: gpio: Enable gpio driver tests for MAX32680EVKIT
Enable GPIO driver tests for MAX32680EVKIT.

Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
2024-06-04 19:12:21 -04:00
Sadik Ozer
191b9ca096 boards: Add MAX32680EVKit board
Added MAX32680EVKit board
For more information about this board please check
https://www.analog.com/

Co-authored-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
Signed-off-by: Sadik Ozer <sadik.ozer@analog.com>
2024-06-04 19:12:21 -04:00
Sadik Ozer
6a8674ce12 soc: Add the MAX32680 SoC
Add MAX32680 Kconfig and dts files

Co-authored-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
Signed-off-by: Sadik Ozer <sadik.ozer@analog.com>
2024-06-04 19:12:21 -04:00
Peter Mitsis
46e3cfa665 doc: kernel: Fix pipes configuration option link
Updates the pipes documentation to generate a link to CONFIG_PIPES
Kconfig option description instead of merely listing the name of
this option.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2024-06-04 19:10:56 -04:00
Peter Mitsis
ed7a5f31c2 kernel: Update CONFIG_PIPES Kconfig description
Updates the CONFIG_PIPES Kconfig description to add a note that
enabling it will cause a slight increase to the thread structure.
This mirrors a similar comment in CONFIG_EVENTS.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2024-06-04 19:10:56 -04:00
Dominik Ermel
c9a21363a1 fs: Improved CONFIG_FILE_SYSTEM_MAX_FILE_NAME processing
The processing of CONFIG_FILE_SYSTEM_MAX_FILE_NAME override for
MAX_FILE_NAME has been improved to limit possibility to set it to
value that is not allowed by any of the in-tree subsystems, when
such subsystem is enabled.
When no in-tree subsystem is allowed the value is still not limited.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-06-04 19:10:39 -04:00
Dominik Ermel
02dfda818d fs: Fix MAX_FILE_NAME setting for LittleFS
Fix MAX_FILE_NAME for LittleFS, which was set to 255, while currently
allowed is 255.

Fixes #72394

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-06-04 19:10:39 -04:00
Yassine El Aissaoui
5c308e0344 bluetooth: hci_nxp: move vendor specific setup to its dedicated place
Some vendor specific setup was done inside
the open() HCI function, those should be
inside setup() function instead.

Signed-off-by: Yassine El Aissaoui <yassine.elaissaoui@nxp.com>
2024-06-04 19:10:22 -04:00
Andrej Butok
26d56eb0a5 boards: nxp: frdm_k22f: fix the flash size value
- The MK22FN512VLH12 chip, installed on frdm_k22f,
  has 512 KB of Program Flash and 128KB SRAM
  according to the K22P121M120SF7RM.pdf manual (page 55).
- Fix the flash size to 512KB (was 1MB).
- Add nxp_k22fn512.dtsi with correct flash size value.

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2024-06-04 19:09:36 -04:00
Dominik Ermel
459517badc drivers/flash/spi_nor: Fix DPD exit
Incorrectly placed preprocessor conditions caused exit_dpd
when there has been no instance of a device with
dpd_wakeup_sequence parameter.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Signed-off-by: Jan Tore Guggedal <jantore.guggedal@nordicsemi.no>
2024-06-04 16:28:59 -05:00
Flavio Ceolin
f74a84b251 xtensa: mmu: MMU re-initialization API
With power managment is enabled, depending on the SoC power state
used when idle, the MMU may lose context and may need to be re-initialized.
When re-initializing the MMU, we must not re-create the page table
because it may overwrite changes done during the execution, but we still
need to set the asid and page table for the current context.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-06-04 16:27:55 -05:00
Chris Friedt
fe1e7f8d37 doc: release: posix: deprecate non-normative POSIX Kconfig
Add release notes for the deprecation of a number of POSIX
Kconfig options. These have been deprecated so that we can
use more normative Kconfig variable identifiers, based on
the Options and Option Groups of IEEE 1003.1-2017.

To simplify migration, use

python $ZEPHYR_BASE/scripts/utils/migrate_posix_kconfigs.py \
    -r root_path

Additionally, document the removal of PTHREAD_BARRIER_DEFINE(),
EFD_IN_USE, EFD_FLAGS_SET, which were previously deprecated
>= 2 release cycles before.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-04 16:27:12 -05:00
Chris Friedt
0fa97326c7 posix: create kconfig options for pse51, pse52, pse53
Create Kconfig "shortcuts" for PSE51, PSE52, and PSE53.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-04 16:27:12 -05:00
Chris Friedt
487a8756c3 posix: eventfd: fix dependency cycle between net and posix
Until recently, the posix api was purely a consumer of the
network subsystem. However, a dependency cycle was added as
a stop-gap solution for challenges with the native platform.

Specifically,

1. eventfd symbols conflict with those of the host
2. eventfd was excluded from native libc builds via cmake

If any part of the posix were then to select the network
subsystem (which is a legitimate use case, given that networking
is a part of the posix api), we would get a build error due to
the Kconfig dependency cycle.

As usual, with dependency cycles, the cycle can be broken
via a third, mutual dependency.

What is the third mutual dependency? Naturally, it is ZVFS
which was planned some time ago. ZVFS will be where we
collect file-descriptor and FILE-pointer APIs so that we can
ensure consistency for Zephyr users.

This change deprecates EVENTFD_MAX in favour of
ZVFS_EVENTFD_MAX.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-04 16:27:12 -05:00
Chris Friedt
b3e36ad6e8 posix: eventfd: remove deprecated eventfd macros
Remove the EFD_IN_USE and EFD_FLAGS_SET macros as they were not
part of the public API.

Rename the internal versions, accordingly.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-04 16:27:12 -05:00
Chris Friedt
b003636b2b doc: posix: misc cleanup and add links to system interfaces
memlock, memlock range, shared memory objects, and synchronized
io were missing links.

Also, vdisable is '\0' (not 0).

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-04 16:27:12 -05:00