Commit Graph

83490 Commits

Author SHA1 Message Date
Grzegorz Swiderski c323cc6fb1 sysbuild: Support relative ordering of images
Fixes #53650

The existing solution for image ordering involves the `IMAGES` variable,
which sysbuild originally provided to let users manually add a new image
in a desired order. This isn't very flexible for the following reasons:

* The order in which `IMAGES` is updated across multiple modules and
  `sysbuild.cmake` files is not well defined.
* Having a single variable means that the same order is used for both
  configuration and flashing. Usually, there is no reason for the
  flashing order to be the same as the configuration order.

Introduce the `sysbuild_add_dependencies()` function for more fine-tuned
ordering of images. It makes one image depend on other images in either
configuration or flashing order. Its usage is similar to the standard
CMake function `add_dependencies()`, but with an extra parameter to
distinguish between two types of dependencies:

 sysbuild_add_dependencies(CONFIGURE my_sample sample_a sample_b)
 sysbuild_add_dependencies(FLASH     my_sample sample_c sample_d)

CONFIGURE dependencies determine the order in which sysbuild configures
(runs CMake for) the individual images. This is useful if there is some
information from one application's build which needs to be available to
another application.

FLASH dependencies control the sequence of images used by `west flash`.
This could be used if a specific flashing order is required by an SoC,
a runner, or something else. Note that these dependencies are not valid
for images specified as `BUILD_ONLY`.

The internal `sysbuild_images_order()` function is responsible for
assembling two sorted lists of images based on the added dependencies,
with the help of `topological_sort()`.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2023-09-05 15:27:04 +02:00
Grzegorz Swiderski 6c2ad89e4c cmake: extensions: Add zephyr_topological_sort()
This function performs topological sorting of CMake targets. Its initial
use case in Zephyr will be for implementing sysbuild image dependencies,
i.e., specifying an image order for CMake configuration and flashing.

Sourced from a comment on PR #57884 (anchor: #discussion_r1206807021)

Authored-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2023-09-05 15:27:04 +02:00
Gerard Marull-Paretas 35479cccac soc: arm: atmel_sam0: common: bossa: add missing init.h
Because modules uses SYS_INIT, from init.h.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2023-09-05 12:19:04 +02:00
Gerard Marull-Paretas 95cac89b4e ipc: rpmsg_service: s/device.h/init.h
Because module uses init.h APIs (SYS_INIT), not device.h.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2023-09-05 12:01:01 +02:00
Gerard Marull-Paretas b7ff64d91c tests: drivers: build_all: adc: add support for native_posix_64
To catch any potential issues when building for 64-bit platforms.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2023-09-05 11:57:44 +02:00
Gerard Marull-Paretas 26ba7b03b4 tests: drivers: build_all: optimize built drivers
All generic drivers, ie, emulators/SPI/I2C based devices, were defined
in app.overlay, meaning the overlay is picked by all builds. However,
what was defined in app.overlay was only used by the native_posix build.
This will save some CI time, as generic drivers were being built more
than strictly necessary.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2023-09-05 11:57:44 +02:00
Bindu S 8350fc2c63 tests: drivers: spi: spi_loopback: Added intel_adl_crb overlay
Added overlay and conf to enable SPI tests on intel_adl_crb board.

Signed-off-by: Bindu S <bindu.s@intel.com>
2023-09-05 11:41:46 +02:00
Bindu S cb6aef4329 dts: x86: intel: alder_lake: Added SPI instances
Added SPI instances supported on Alderlake platform

Signed-off-by: Bindu S <bindu.s@intel.com>
2023-09-05 11:41:46 +02:00
Jordan Yates 72c94d982c bluetooth: hci: spi: warn about l2cap MTU values
`CONFIG_BT_L2CAP_TX_MTU` drives the maximum supported MTU on a Bluetooth
connection, but the SPI backend also imposes its own hidden limits.

Display a warning if a value is chosen that can result in failures to
send. This is done here instead of as a range on `BT_L2CAP_TX_MTU` as
ranges on that symbol are already defined in terms of software features,
which would conflict with this check.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-09-05 11:41:33 +02:00
Lukasz Mrugala 8977567a2d scripts: tests: twister: Testsuite test expansion
This should increase the coverage of the testsuite.py module
up to 100%.
Some tests have been commented out, as the code tested there is
incorrect. Thus the real increase is 99%.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2023-09-05 11:41:08 +02:00
Laczen JMS c64e806b63 flash: correct missing erase handler
flash_handlers was missing the required z_vrfy_flash_erase function

Signed-off-by: Laczen JMS <laczenjms@gmail.com>
2023-09-05 11:40:43 +02:00
Fabio Baltieri b873f19bc8 shields: rk055hdmipi4m: fix touch controller label
This got renamed in 42c6f3311b, use the new label in the board overlay.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-09-05 11:30:41 +02:00
Mariusz Skamra 9a9855f711 tests: Bluetooth: audio: Unit test bt_audio_codec_cfg_get_* helpers
This adds unit tests for bt_audio_codec_cfg_get_* functio helpers.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-09-05 10:06:09 +02:00
Mariusz Skamra dd3cffcd20 Bluetooth: audio: Fix bt_audio_codec_cfg_get_chan_allocation_val return
This fixes bt_audio_codec_cfg_get_chan_allocation_val return value that
shall be 0 in case of success.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-09-05 10:06:09 +02:00
Mariusz Skamra c585bf5b44 Bluetooth: audio: Fix BT_AUDIO_CODEC_CFG_LC3_DATA sampling frequency
The sampling frequency in codec configuration is 1 byte value.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-09-05 10:06:09 +02:00
Mariusz Skamra 856b8cb5e9 Bluetooth: audio: Fix pointer value assignment
This fixes data pointer that was never set because wrong pointer
assignment.
It's regression introduced in:
b4af917ad0

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-09-05 10:06:09 +02:00
Fabian Blatz 594e919b25 tests: misc: check_init_priorities: update output
Update the expected output of the init priority checking.

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
2023-09-05 10:05:50 +02:00
Fabian Blatz ccdb667068 boards: Remove touch input kscan nodes
Change boards and shields and remove kscan nodes in favor of the
"zephyr,lvgl-pointer-input" compatible.

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
2023-09-05 10:05:50 +02:00
Fabian Blatz 10ca5216bb samples: subsys: display: lvgl: Remove lvgl-pointer-input in overlays
After adding the lvgl pointer device into the board dts the custom overlays
are not needed anymore.

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
2023-09-05 10:05:50 +02:00
Fabian Blatz 42c6f3311b boards: stop using kscan for LVGL touch input
Change boards and shields which enable the LV_Z_POINTER_KSCAN symbol to use
the new "zephyr,lvgl-pointer-input" compatible instead.

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
2023-09-05 10:05:50 +02:00
Chien Hung Lin cad51f874c driver: wifi: eswifi: Fix spi buffer length
The eswifi spi driver sets up spi buffer length as number of frames,
but the length shall be number of bytes. Because eswifi use 16 bit as
frame size, so this turns out reading and writing half of data and
fails to sending any at command request and getting any responds from
eswifi module.

Fix it by setting up length as number of bytes.

Fixes #62056

Signed-off-by: Chien Hung Lin <chienhung.lin.tw@gmail.com>
2023-09-05 10:05:37 +02:00
Marcus Folkesson 46cdec8dc6 oards/arm/efr32xg24_dk2601b: add support for sensors attached to I2C
Zephyr already have support for a couple of sensors on the board:
- Silicon Labs Si7210 hall effect sensor
- Silicon Labs Si7021 relative humidity & temperature sensor
- Vishay VEML6035 ambient light sensor

Add support for those in device tree.

Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
2023-09-05 10:05:19 +02:00
Marcus Folkesson 73dbd3c1fa boards/arm/efr32xg24_dk2601b/doc: list sensors on board
The efr32xg24_dk2601b has several sensors on board attached to buses.

Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
2023-09-05 10:05:19 +02:00
Vinayak Kariappa Chettimada f6bf73de83 Bluetooth: Controller: Use NRF_CCM HEADERMASK for ISO PDU encryption
Use NRF_CCM HEADERMASK register to use correct Additional
Authentication Data (AAD) from ISO PDU header.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-09-05 10:04:57 +02:00
Vinayak Kariappa Chettimada 9ede8cd87e dts: nRF: Add missing headermask binding for NRF_CCM
Add missing headermask binding for NRF_CCM peripheral and
define HAS_HW_NRF_CCM_HEADERMASK Kconfig.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-09-05 10:04:57 +02:00
Fabio Baltieri 1ddabfa8d8 dai: intel: dmic: fix shadow variable
Fix a shadow variable build error:

dmic_nhlt.c: In function 'dai_dmic_write_coeff':
dmic_nhlt.c:57:78: error: declaration of 'base' shadows a global
declaration [-Werror=shadow]

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-09-04 19:35:56 -04:00
Kai Vehmanen 5ba4288fea CODEOWNERS/MAINTAINERS: change drivers/dai ownership
I'll take over the drivers/dai and drivers/dai/intel from Jaska
Uimonen.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-09-04 21:31:46 +02:00
Adrian Warecki b26921d776 dai: intel: dmic: New functions for writing fir coefficients
Created set of new functions for configure fir coefficients with support
for packed format. This allowed to make the dai_dmic_set_config_nhlt
function simpler.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2023-09-04 15:30:00 -04:00
Adrian Warecki cba9ec10c3 dai: intel: tgl: dmic: Refactor of dai_nhlt_dmic_dai_params_get function
Added reading of a necessary register values in
dai_nhlt_dmic_dai_params_get function to simplify its parameter list. The
code that calculates dai_params has been moved to it to simplify the
dai_dmic_set_config_nhlt function.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2023-09-04 15:30:00 -04:00
Adrian Warecki c28e8ba9ba dai: intel: dmic: Add pdm_base and pdm_idx variables in blob parser
More verbose variable pdm_idx was used instead of n. The series of
references to the array of pdm base addresses has been replaced with
a pdm_base variable.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2023-09-04 15:30:00 -04:00
Adrian Warecki 2452aaad50 dai: intel: dmic: Separate fir configuration code into function
All fir filters have an identical set of registers so their definitions
were combined to simplify the code. From the dai_dmic_set_config_nhlt
function, a duplicate piece of code responsible for configuring fir was
separated into a new function.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2023-09-04 15:30:00 -04:00
Adrian Warecki f74fd8edaf dai: intel: ace: dmic: Add dai_dmic_start_fifo_packers function
Created dai_dmic_start_fifo_packers function corresponding to an already
existing dai_dmic_stop_fifo_packers.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2023-09-04 15:30:00 -04:00
Adrian Warecki 76d03e798f dai: intel: ace: dmic: Using the WAIT_FOR macro in waiting functions
The while loop in the code fragments waiting for a bit to be cleared has
been replaced with the WAIT_FOR macro call. Added a warning in the case of
timeout.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2023-09-04 15:30:00 -04:00
Adrian Warecki 3fbaed4de9 dai: intel: ace: dmic: Refactor of dai_nhlt_dmic_dai_params_get function
Added reading of a necessary register values in
dai_nhlt_dmic_dai_params_get function to simplify its parameter list. The
code that calculates dai_params has been moved to it to simplify the
dai_dmic_set_config_nhlt function.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2023-09-04 15:30:00 -04:00
Adrian Warecki d7672af838 dai: intel: dmic: Combine PDM registers definitions
All PDM controllers have the same set of registers. Their definitions have
been merged to simplify the code.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2023-09-04 15:30:00 -04:00
Adrian Warecki 8ea53d49b6 dai: intel: dmic: nhlt: Move debug print code to a separate functions
Moved code fragments responsible for logging and verification of the
configuration register values from the dai_dmic_set_config_nhlt function to
a separate functions. Behavior of the code verifying the correctness of
register values has been changed so that it only displays warnings.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2023-09-04 15:30:00 -04:00
Adrian Warecki 81944c5c62 dai: intel: dmic: Move definitions of nhlt structures to a new file
Definitions of a configuration blob structures were separated from the main
drivers header file and moved to a dedicated file to improve code
readability. Removed unnecessary nhlt_pdm_fir_coeffs structure.
The nhlt_pdm_ctrl_cfg structure was extended with nhlt_pdm_ctrl_fir_cfg
and fir coefficients.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2023-09-04 15:30:00 -04:00
Keith Packard 844c78cf3a tests/kernel: Also run tests using minimallibc
With picolibc being the default C library, we need to explicitly include
testing against the minimal C library for kernel components.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-09-04 15:29:13 -04:00
Keith Packard f0daf904bb libc: Default to picolibc where supported
This switches the default C library to picolibc for all targets which
support it.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-09-04 15:29:13 -04:00
Martin Jäger 1ab434edda tests: canbus: isotp: implementation: enable for native_posix
The ISO-TP tests were disabled for native_posix in the past because of
timing issues.

The implementation test is working well with native_posix now and
should also be run in CI.

Signed-off-by: Martin Jäger <martin@libre.solar>
2023-09-04 19:19:44 +02:00
Alberto Escolar Piedras 393db164e1 ci: bsim: Improve path triggers for bsim tests
Let's also run the BabbleSim tests when either
the native simulator or the the include headers
are changed.
The include path was forgotten when creating the filter.
The nrf52_bsim was changed to use the native simulator
in 3a4bebacb1

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-09-04 13:00:52 -04:00
Kamil Piszczek 2f90ef488a bluetooth: tests: add bsim test for identity address update
Added a BabbleSim test to check the update of the destination address
of all active connections during the identity resolution operation.
All connection objects associated with the same private peer address
should convert it to the identity address.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2023-09-04 18:41:48 +02:00
Kamil Piszczek 42c904526b bluetooth: host: convert conn address on identity resolution
Fix an issue in the CCC configuration when the Peripheral device
maintains two or more distinct connections on different identities
with the same peer. The issue occurs when the local device performs
the pairing and the bonding procedure on a connection associated
with one of the Bluetooth identities. During the identity resolution,
the peer address field in the CCC descriptor is converted from the
RPA-type address to the Identity Address. However, the destination
address on the remaining connection objects associated with other
Bluetooth identities is not converted. Due to this, their CCC
configuration is reset and GATT indications and notification fail
to be sent even if the Central device subscribed to them.

Added necessary code to iterate over all connection objects during
the identity resolution phase and aligned their destination address
from the RPA-type to the Identity Address.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2023-09-04 18:41:48 +02:00
Vinayak Kariappa Chettimada 0c5b07838f tests: bsim: Bluetooth: Add verification of Broadcast ISO recv data
Add test implementation to verify correct broadcast ISO
receive data.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-09-04 18:22:41 +02:00
Vinayak Kariappa Chettimada 96c12650e8 Bluetooth: Controller: Fix timestamp to use CIS reference anchor point
Fix timestamp calculation to use CIS reference anchor point
instead of incorrectly used CIG reference anchor point.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-09-04 18:22:24 +02:00
Damian Krolik 49fb5f0a1a nvs: replace CRC with better hash function for lookup cache
NVS lookup cache currently uses CRC8/16 as a hash function
to determine the cache position, which is not ideal choice.
For example, when NVS lookup cache size is 512 and 256
subsequent NVS IDs are written (that is, 0, 1.., 255), this
results in 128 cache collisions.

It is better to use a dedicated integer hash function. This
PR uses one of the 16-bit integer hash functions discovered
with https://github.com/skeeto/hash-prospector project. The
hash function was additionally tested in the context of NVS
lookup cache using simple NVS ID allocation patterns as well
as using real device NVS dump.

Also, add a test case to verify that the hash function is
not extremely bad.

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
2023-09-04 18:21:20 +02:00
Fabio Baltieri 5f0efb94fa modem: modem_chat,modem_cmux: fix mismatched CONTAINER_OF
Add a missing k_work_delayable_from_work to go from k_work to
k_work_delayable.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-09-04 16:54:56 +02:00
Alberto Escolar Piedras 0c55710040 nrf52_bsim: Update HW models to latest and align with them
* In Zephyr: The HW models now include N interrupt controllers
The interrupt handling code needs to target one controller
specifically.

* Update the HW models module to
  57b61a9a2da75c860f15ca79522b24d57992df2c

  Including the following:
  * 57b61a9 INT CNTRL: Generalize to N controllers
  * 1ea8194 nrf_bsim_redef.h: Add first definitions for nrf5340
  * 5f81ee9 irq_ctrl: Lower a bit HW event priority
  * 0986acc RNG: Add nrf53 variant in model
  * 09345da RNG: Generate level interrupts instead of pulse ones
  * f9b7c7a DPPI: Add first version
  * 62dabd3 HW models: Initial peripheral adaptation for multi-int_cntr
  * f54b59d HW models: Adding initial nrf5340 structure
  * fb1edd9 HW models: Use HW types definitions only where neded
  * 2744f4c Add basic support for variants
  * a5f79cd nrf_bsim_redef.h: Remove unnecessary redefinitions
  * 2c781dd HW_models: Improve includes
  * bdb0a08 minor: Remove non-ASCII characters from source
  * b5e95bd RADIO: Corrected note about MAXLEN and CRCINC behaviour

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-09-04 13:18:01 +02:00
Alberto Escolar Piedras 3973475719 nrf52_bsim: Set CPU we are targetting
Let's be explicity about which CPU we are targetting.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-09-04 13:18:01 +02:00
Alberto Escolar Piedras d9c76e6fe1 native SOC: Add option to select CPU we target
Add a new kconfig option to select which embedded
CPU we are targetting.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-09-04 13:18:01 +02:00