Commit Graph

64096 Commits

Author SHA1 Message Date
Emil Gydesen 6b41e9991d Bluetooth: Audio: Rename enum bt_audio_pac_type
The enum bt_audio_pac_type does not fully
represent the what the value is used for.

The typical use of it is not for just published
audio capabilities (PAC), but rather describes the
type, or direction, of audio endpoints.

For the unicast client, the type/direction is
relative to the unicast server.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-05-10 18:56:00 +02:00
Emil Gydesen 306d766329 Bluetooth: Audio: Unicast client remove id from ep_init
The unicast_client_ep_init took a ID value that was
always 0. Moved the initialization to the value to
the function, instead of an argument. The value
is only used for the unicast server, so it can
probably be removed from the endpoint
struct for unicast clients only. To be optimized later.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-05-10 18:56:00 +02:00
Emil Gydesen 7d134e4e1d Bluetooth: Audio: Remove unused endpoint types
The endpoint.type field was unused as it was
always LOCAL for the unicast server and always
REMOTE for the unicast client, and the few places
where we actually checked it, we already had a
check for acl->role which gave the same value.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-05-10 18:56:00 +02:00
Morten Priess ffc07e0293 tests: bluetooth: Added VS RX data path to ISO test
Verifies ISOAL functionality for VS RX data path by implementing weak
function ll_data_path_sink_create, and implementing sink callbacks.

Test verifies construction of sink and checks that SDUs are emitted in
VS sink implementation.

Test relies on the Nordic synchronous receiver implementation, and is
compiled under CONFIG_BT_CTLR_ISO_VENDOR_DATA_PATH, which is enabled in
the project file.

Signed-off-by: Morten Priess <mtpr@oticon.com>
2022-05-10 18:55:35 +02:00
Morten Priess e74804c125 Bluetooth: controller: Removed compiler warnings in ull_iso.c
Conditionally declared auto-variables to avoid 'unused' warnings in BSIM
ISO test compilation.

Signed-off-by: Morten Priess <mtpr@oticon.com>
2022-05-10 18:55:35 +02:00
Erwan Gouriou b52021189b tests/drivers/clock_control: stm32: Migrate includes to <zephyr/...>
Follow up of what was done in main branch during this development.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-05-10 18:42:30 +02:00
Erwan Gouriou d9b9e12cd3 dts/bindings/clocks: stm32: 'clock-names' optional for source clock setting
Since implementation of clock source selection in consumer device drivers
could be achieved without usage of a clock-names property and no
example of usage is provided up to now, remove this property from existing
examples.
Additionally, make it clear in stm32 clock control binding that it is
driver's responsibility to correctly access clock source information
and use it as required.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-05-10 18:42:30 +02:00
Erwan Gouriou ac61ea9e44 tests/drivers/clock_control: stm32: Add stm32_common_devices tests
Add a test section to enable device clock source selection testing.
Test targets I2C1 device which supports clock source selection
on all SOCs using this driver except L1
Initial test done on wb target.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-05-10 18:42:30 +02:00
Erwan Gouriou 17ace929f9 tests/drivers/clock_control: stm32_common: Move to stm32_common_core
Move stm32_common tests to stm32_common_core before adding new folder
for device source selection tests.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-05-10 18:42:30 +02:00
Erwan Gouriou 09217865ce drivers/clock_control: stm32_common: Implement clock source selection
Similarly to what was done on U5 and H7 clock_control drivers, enable
device clock source selection.
This is done by:
-providing implementation for clock_control_configure().
-updating clock_control_get_rate() to support various possible clock
sources (SYSCLK, PLLCLK, LSE, LSI, HSI, HSE).
-providing enable_clock() to verify requested clock source exists and
is enabled.
-adding LSI and LSE device tree based initialization to
set_up_fixed_clock_sources().

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-05-10 18:42:30 +02:00
Erwan Gouriou c2ee8209ab drivers/clock_control: stm32_common: Remove unused definitions
STM32WL_DUAL_CORE and RCC_CALC_MSI_RUN_FREQ are not used anymore.
Clean up those definitions

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-05-10 18:42:30 +02:00
Erwan Gouriou 988fe8d5a2 include/dt-bindings/clock: stm32: Add clock sources bindings
Add clock sources bindings on F0/F3/G0/G4/L0/L1/L4/WB/WL series.
Due to inconsistencies, some common bindings are now split:
F1 -> F0/F1/F3
L4 -> L4/G4/WB
Update .dtsi files when required

In a first step, allowed sources are limited to already supported
clocks: LSI/LSE/HSI/HSE/MSI/PCLK/PLLCLK/SYSCLK
Support for other clocks such as HSI48, SAIXCLK, ... is left for a
next step.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-05-10 18:42:30 +02:00
Erwan Gouriou e579027d20 include/dt-bindings/clock: stm32: Factorize Clock source binding accessors
Rename and factorize clock source bindings accessors by moving them
in common header file stm32_clock_control and remove them from
include/dt-bindings/clock/stm32XY_clock.h files

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-05-10 18:42:30 +02:00
Erwan Gouriou bc2a0b65a6 tests/drivers/clock_control: stm32u5: Fix pll_msis_80 test config
PLL input should be between 4 and 16MHz, so when MSI is set to 4MHz
fix PLLM can't be higher than 1.
Fix PLL1-NQR in consequence.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-05-10 18:42:30 +02:00
Erwan Gouriou 424f937c2b drivers/clock_control: stm32u5: Add support for optional clocks config
This change updates stm32u5 driver to support configuration of
optional clocks on peripherals.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-05-10 18:42:30 +02:00
Erwan Gouriou c9f5113d80 include/dt-bindings/clock: Add stm32u5 clock bindings
This new binding allows to work on providing stm32u5 specific
alternate and complementary device clocks.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-05-10 18:42:30 +02:00
Erwan Gouriou b821599abc tests/drivers/clock_control: stm32u5: Add a _devices test
Add a stm32u5_devices test which aims at testing devices
clock control configuration on stm32u5 targets

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-05-10 18:42:30 +02:00
Erwan Gouriou c0238a7af3 tests/drivers/clock_control: stm32h7_device: Add test for CKPER source
Add 2 scenarios to test CKPER used as a clock source.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-05-10 18:42:30 +02:00
Erwan Gouriou b22dd170e6 drivers/clock_control: stm32h7: Add support for CKPER clock mux
Add support for CKPER clock mux.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-05-10 18:42:30 +02:00
Erwan Gouriou ceb6ecc740 dts/arm/st: stm32h7: Add perck clock-mux node
Add perck clock-mux node as disabled by default and
the include bindings helping to select it.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-05-10 18:42:30 +02:00
Erwan Gouriou d71b89b398 drivers: clock_control: Add STM32 clock multiplexer driver
Add a clock multiplexer driver.
Its only function is to select a clock input.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-05-10 18:42:30 +02:00
Erwan Gouriou e79fea3b78 dts/bindings/clocks: Add stm32 clock mux binding
Add STM32 clock mux binding.
Only property of a node using such compatible is to
select a clock input.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-05-10 18:42:30 +02:00
Erwan Gouriou 0b65c1c619 drivers/spi: stm32: Use alt clock freq if available
Add support for an alternate clock. If available,
alternate clock is enabled and used to get the
device clock rate.

Fixes #41650

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-05-10 18:42:30 +02:00
Erwan Gouriou 3f503e87cc boards: nucleo_h723zg: Enable SPI
Enable SPI on nucleo_h723zg board

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-05-10 18:42:30 +02:00
Erwan Gouriou f61c4ae838 tests/drivers/clock_control: stm32h7_device: Use STM32_DT_CLOCKS_FOO
Make use of STM32_DT_CLOCKS_ macros to have the test work conditionally
based on alt clock presence.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-05-10 18:42:30 +02:00
Erwan Gouriou 07b095556e include/drivers/clock_control: stm32: Add _DT_CLOCK helpers
Add a DT based macros to be used by stm32 device drivers to
populate pclken[] arrays at build time.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-05-10 18:42:30 +02:00
Erwan Gouriou 833eda84d3 drivers/clock_control: stm32h7: Add support for alt clocks
Add support for alternate clocks configuration.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-05-10 18:42:30 +02:00
Erwan Gouriou 78f40773b8 tests/drivers/clock_control: stm32h7: Add test for devices clock cfg
Add 2 clocks tests around device clock configuration on stm32h7.
For now, 'spi1_pllq_2_d1ppre_4' test variant is failed, which
illustrates issue reported in #41650.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-05-10 18:42:30 +02:00
Erwan Gouriou cf5436ce13 include/drivers: clock_control.h: Add configure() to api
Add configure() function to clock_control API.
This function allows caller to configure a given clock.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-05-10 18:42:30 +02:00
Michal Sieron eff89c6b24 drivers: timer: litex_timer: Fix sys_clock_cycle_get functions
e8e88dea incorrectly changed registers
used in `sys_clock_cycle_get(32|64)` functions.

This commit fixes that.

Signed-off-by: Michal Sieron <msieron@internships.antmicro.com>
2022-05-10 18:41:20 +02:00
Andrzej Głąbek e7b389ddf5 dts: nordic: Add missing qdec0 node labels
This is a follow-up to commit 586e26e8fc.

Add missing `qdec0` node labels in definitions of SoCs that have only
one QDEC instance so that the `HAS_HW_NRF_QDEC0` option is properly set
for them. Use the same pattern as in the WDT case and keep the existing
`qdec` labels for backward compatibility.
Also update validation of base addresses so that both QDEC0/QDEC and
QDEC1 are checked.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2022-05-10 18:41:14 +02:00
Herman Berget 874ef53b17 Bluetooth: Host: Assert that all channels in request have the same PSM
The PSM of the first channel in the connection request is used, but the
PSM value is used for all of them on the receiving side.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2022-05-10 18:40:36 +02:00
Herman Berget 1069d5fe56 Bluetooth: Host: Fix L2CAP collision mitigation
There were some errors in the detection of ECRED connection collisions,
so the retry was triggered incorrectly.

The number of channels requested in the retry was wrong in some cases,
using the number of channels from the received request instead of the
sent request.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2022-05-10 18:40:36 +02:00
Bernardo Perez Priego 2fc78a9b39 drivers: adc: Add threshold_reg_offset to NPCX adc config structure
ADC threshold control register offset is provided by devicetree, this
change will add this property into `adc_npcx_config` structure and
update macro to access register accordingly. Driver behavior is not
meant to be impacted.

Signed-off-by: Bernardo Perez Priego <bernardo.perez.priego@intel.com>
2022-05-10 18:40:24 +02:00
Bernardo Perez Priego aa875b3766 drivers: adc: Add threshold_count to NPCX adc config structure
Number of supported ADC thresholds is provided by devicetree, this
change will add this property into `adc_npcx_config` structure and
replace macro usage. Driver behavior is not meant to be impacted.

Signed-off-by: Bernardo Perez Priego <bernardo.perez.priego@intel.com>
2022-05-10 18:40:24 +02:00
Lucas Dietrich 616efeb2f2 tests: workq: Add a regression test for issue #45267
When an object availability event triggers a k_work_poll
item, the object lock should not be held anymore
during the execution of the work callback.

Signed-off-by: Lucas Dietrich <ld.adecy@gmail.com>
2022-05-10 18:39:51 +02:00
Lucas Dietrich 9a848b3ad4 kernel: workq: Add internal function z_work_submit_to_queue()
This adds the internal function z_work_submit_to_queue(), which
submits the work item to the queue but doesn't force the thread to yield,
compared to the public function k_work_submit_to_queue().

When called from poll.c in the context of k_work_poll events, it ensures
that the thread does not yield in the context of the spinlock of object
that became available.

Fixes #45267

Signed-off-by: Lucas Dietrich <ld.adecy@gmail.com>
2022-05-10 18:39:51 +02:00
Jordan Yates d778d5c711 arch: aarch32: improve very early debugging
Debugger plugins use the `z_sys_post_kernel` variable to detect whether
the kernel is currently running, and hence whether any threads exist. As
this is just a standard variable however, after a reset the initial
value of this variable is whatever it was before reset (true) until the
bss section is zeroed halfway through `z_arm_prep_c`. Debuggers are
therefore unable to differentiate between a normally running application
and the very first stages of the boot process.

Clearing this variable as the first action upon reset allows debuggers
to display the correct thread state after the first 3 instructions have
run.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2022-05-10 18:36:51 +02:00
Piotr Dymacz 9ed3373c32 boards: cc1352r*/cc26x2r1*: enable MPU and hw stack protection
This enables 'ARM_MPU' and 'HW_STACK_PROTECTION' for the following Texas
Instruments LaunchPad development boards:

- CC1352R1 LaunchXL
- CC1352R SensorTag
- CC26x2R1 LaunchXL

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2022-05-10 18:33:50 +02:00
Piotr Dymacz 15b22e066f soc: arm: cc13x2_cc26x2: Kconfig: select CPU_HAS_ARM_MPU
This adds missing 'CPU_HAS_ARM_MPU' for Texas Instruments SimpleLink
CC13x2 and CC26x2 SoC series.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2022-05-10 18:33:50 +02:00
Matt Campbell 2d937f0683 lib: os: mpsc_pbuf: null check notify_drop callback
Allow the user of a mpsc_pbuf to not use the notify_drop callback by
setting it to NULL.

signed-off-by: Matt Campbell <matt@silvertree.io>
2022-05-10 18:32:26 +02:00
Derek Snell 8b3e0e6622 boards: lpcxpresso55s69: fix JLink device name
Incorrect device name for JLink runner causing wrong device selected,
causing issues flashing the device when flash size is large.

Signed-off-by: Derek Snell <derek.snell@nxp.com>
2022-05-10 11:05:29 -05:00
Flavio Ceolin 99be4358af soc: nxmp: rt10xx: Fix pm callbacks
The pm hooks for this target were not updated to follow the current API.
These weak functions will never be called for the pm subsystem.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2022-05-10 09:44:17 -05:00
Volodymyr Bondarchuk bba3bd01c9 boards: thingy53_nrf5340: Remove CS configuration in board.c
CSs now are configured properly according to DTS description during SPI
driver initialization. Earlier, additional configuration was required
due to a problem, fixed in f7466d2.

Signed-off-by: Volodymyr Bondarchuk <volodymyr.bondarchuk@nordicsemi.no>
2022-05-10 09:39:15 -05:00
TLIG Dhaou 4de1d01956 boards: stm32: use size helpers to describe size of storage partition
The goal of this commit is to update existing STM32 boards descriptions
to use these size "DT_SIZE" macros to enhance readability. To realize this
i used a python script, which will detect the STM32 Boards
/zephyr/board/arm, and then will update in the dts files the partition
description using "DT_SIZE_K" and "DT_SIZE_M" macros.
Check manually and modify in .overlay files in samples and tests.

Signed-off-by: TLIG Dhaou <dhaou.tlig-ext@st.com>
2022-05-10 09:22:43 -05:00
Jordan Yates 523cd60a77 tests: build_all: modem: test esp-at
Add build tests for the `espressif,esp-at` driver, together with both
the interrupt and async variants of modem_ifact_uart.

Only build the async API variant for emulated platforms, as many
platforms do not build cleanly when `UART_ASYNC_API` is enabled without
custom setup of DMA nodes.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2022-05-10 10:44:04 +02:00
Jordan Yates e66864e088 tests: build_all: modem: remove custom serial
Remove a custom Kconfig symbol that was used to indicate serial
interrupt support, as the test serial driver now selects the appropriate
symbols.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2022-05-10 10:44:04 +02:00
Jordan Yates 95d8deb572 modem: modem_iface_uart_async: added
Adds a communications backend based on the asynchronous UART API,
instead of the interrupt-driven UART API. The primary advantage of this
backend is an improved robustness to dropping bytes under high interrupt
or critical section loads.

Under all loads system efficiency is improved by:
 * Reducing the time spent writing out individual bytes.
 * Reducing the number of UART interrupts fired.
 * Waking up the RX thread much less often.

When utilising this backend over `nordic,nrf-uarte` on a nRF52840, the
baudrate of an esp-at modem could be pushed to at least 921600 without
dropping bytes, compared to a maximum of 230400 with the interrupt API.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2022-05-10 10:44:04 +02:00
Jordan Yates 5228de3af5 modem: choice symbol for UART backend
Add a choice symbol that is used to select which UART backend to use.
This allows backends that don't use the interrupt API to be implemented.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2022-05-10 10:44:04 +02:00
Jordan Yates a6081eeedf wifi: esp_at: fix pointer logging
Use the proper `%p` printf specifier when printing memory addresses,
instead of casting to an integer, which may not be the same size as a
pointer.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2022-05-10 10:44:04 +02:00