Commit Graph

60921 Commits

Author SHA1 Message Date
Emil Gydesen 555c6ecc6c Bluetooth: L2CAP: Add `ing` to the bt_l2cap (dis)connect-ing state
Add `ing` to the `BT_L2CAP_CONNECT` and `BT_L2CAP_DISCONNECT`
states, so that the name better matches the actual state.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-02-28 10:53:08 +01:00
Daniel Leung dc22617478 linker: add a utility func to check if an addr is in RO section
This adds a utility function to check if an address is within
read only section. This is extracted from logging subsys so
use the new func in logging. The one is cbprintf_packaged is
also replaced.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-02-28 10:53:02 +01:00
Daniel Leung e54b4faabc logging: v2: force LOG2_ALWAYS_RUNTIME if XCC
XCC is based on GCC 4.2.0 which doesn't support auto type.
So force CONFIG_LOG2_ALWAYS_RUNTIME to be enabled if XCC is
being used.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-02-28 10:52:51 +01:00
Daniel Leung 4c3fa1b7fe logging: v2: workaround for old toolchains when !LOG
For GCC < 4.9.0 and Clang < 3.8.0, auto type is not supported.
But the previous behavior to depend on CONFIG_LOG2_ALWAYS_RUNTIME
to be enabled doesn't work because this kconfig is not available
when CONFIG_LOG is not enabled, as LOG_*() are still being
expanded when CONFIG_LOG=n, resulting in toolchain complaining
about unknown keyword. So when CONFIG_LOG=n and old toolchains,
force it to use runtime packaging to avoid the issue.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-02-28 10:52:51 +01:00
Daniel Leung fb92a654e3 toolchain: introduce macro TOOLCHAIN_HAS_C_AUTO_TYPE
This introduces the macro TOOLCHAIN_HAS_C_AUTO_TYPE to
indicate that the toolchain supports __auto_type. This is
supported since GCC 4.9.0 and Clang 3.8.0.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-02-28 10:52:51 +01:00
Daniel Leung 0726955978 toolchain: introduce macro TOOLCHAIN_HAS_C_GENERIC
This introduces the macro TOOLCHAIN_HAS_C_GENERIC to indicate
that the toolchain supports C Generic (i.e. _Generic keyword).
This is introduced in C11, and is also supported since GCC 4.9.0
and Clang 3.8.0.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-02-28 10:52:51 +01:00
Daniel Leung 6bb278a53c toolchain: introduce macro TOOLCHAIN_HAS_PRAGMA_DIAG
This introduces the macro TOOLCHAIN_HAS_PRAGMA_DIAG to indicate
that the toolchain supports #pragma diagnostics. This is
supported since GCC 4.6.0 and, AFAIK, all Clang.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-02-28 10:52:51 +01:00
Daniel Leung 8798fecd8e toolchain: introduce CLANG_VERSION macro
Adds a CLANG_VERSION macro to make it easier to write
preprocessor conditionals.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-02-28 10:52:51 +01:00
Daniel Leung 571a301174 toolchain: introduce GCC_VERSION macro
Adds a GCC_VERSION macro to make it easier to write
preprocessor conditionals.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-02-28 10:52:51 +01:00
Nicolas Pitre eee5b8e563 ring_buffer: make finish methods final
Make it possible to "finish" with fewer bytes than what was "claimed".

This was possible before on the get side, but the put side was
cummulative wrt finish. The revamp made it cummulative on both sides.
Turns out that existing users rely on the opposite behavior which is
more logical and useful. So make both sides that way.

Adjust documentation, test case and users accordingly.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2022-02-28 10:52:41 +01:00
Jordan Yates d9a74dda54 lora: sx126x: fix missing GPIO instantiation
Instantiate the values of `sx126x` GPIO's when they are present in
devicetree. This was missed in #42230.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2022-02-28 10:52:23 +01:00
Bartosz Bilas b5497d7d2f drivers: wifi: eswifi: fix spi bus initialization
spi_dt_spec structure initialization should not be done
in the runtime during spi bus initialization because it
caues kernel panic.

Fixes: https://github.com/zephyrproject-rtos/zephyr/issues/43046

Signed-off-by: Bartosz Bilas <bartosz.bilas@hotmail.com>
2022-02-28 10:52:17 +01:00
Gerard Marull-Paretas 2903680822 pm: constraint: drop __weak
No SoCs are re-implementing the constraints API. This _feature_ was
mostly put in place to cover TI platform needs, but it is no longer
needed. Refer to previous commit for more details.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-02-28 10:18:38 +01:00
Gerard Marull-Paretas bb40e38527 soc: arm: ti_simplelink: drop custom constraint implementation
The constraints API offered by TI HAL is meant to be used externally,
for example, when implementing a policy using their policy mechanism
(not used on Zephyr). The API is likely designed for systems where a
thin RTOS is used (e.g., FreeRTOS, TI-RTOS?), places where you basically
get a Kernel and a few services around, but not a system like Zephyr
where you also get, for example, a power management subsystem. This
means that it gets difficult for an RTOS like Zephyr to use such HAL
APIs while using its own constraints API. The first question is why we
allowed such kind of HAL code to be part of upstream Zephyr. It
certainly does useful things, but it is also uses a HAL infrastructure
which is hardly exportable to an RTOS like Zephyr. Part of the
Power_init() code, for example, should likely be in a clock controller
driver, where Zephyr APIs can be used.

The _solution_ that was done to workaround this case was allowing custom
full re-implementations of the constraints API. So we are basically
overwriting a functional API with custom HAL code because of poor HAL
designs. This is in general a bad design principle. If we allow this, we
can hardly offer any guarantees to the API users. For example, is
re-implemented as thread-safe? What is the API behavior then? ...
Platforms like TI that have incomplete support in Zephyr tend to leverage
to HAL code certain functions that should be proper Zephyr
drivers. Such platforms should not influence the design of APIs because
they lack solid foundations.

This patch removes the custom implementation since the HAL has been
patched so that it forwards PM state constraints to Zephyr.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-02-28 10:18:38 +01:00
Gerard Marull-Paretas 902ba8a967 manifest: update ti_hal
Update ti_hal to include PM constraint changes.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-02-28 10:18:38 +01:00
Anas Nashif 145bcd7ab9 tests: log_stack: define for riscv smp
Define stacks for riscv smp configurations.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-02-26 10:08:46 -05:00
Tom Burdick d5e6027131 dma/cavs_gpdma: Revert IRQ_CONNECT changes
It turns out XCC didn't like this change as it doesn't have a
__COUNTER__ builtin. Bummer.

This reverts commit e8389f2f53.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2022-02-25 22:20:31 -05:00
Michal Orzel 176240c3c2 xenvm: Add support for using GICv3
Currently xenvm board/soc is configured to use GICv2 and there
is no clean way(without modifying the source code) to alter this
configuration to use GICv3.

Due to the increasing number of users wishing to use GICv3, add
a new configuration called xenvm_gicv3 that enables GICv3.
Create a Kconfig file and add a config XENVM_USE_GIC_V3 that,
if set, will cause SOC_XENVM to select GICv3 instead of GICv2.

Update documentation accordingly.

Take the opportunity to remove the unnecessary config options
from the defconfig files.

Signed-off-by: Michal Orzel <michal.orzel@arm.com>
2022-02-25 22:19:37 -05:00
Ederson de Souza 6babbd32e1 boards/riscv: Add qemu_riscv32_smp and qemu_riscv64_smp
Based on qemu_riscv32 and qemu_riscv64, add minimal SMP support
using the "virt" machine.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2022-02-25 19:13:50 -05:00
Ederson de Souza ab17f69a72 tests/kernel/fpu_sharing: Run test with MP_NUM_CPUS=1
This test uses k_yield() to "sync" between threads, so it's implicitly
supposed to run on a single CPU. Make it explicit, to avoid issues on
platforms with more cores.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>

FIXKFLOATDISABLE
2022-02-25 19:13:50 -05:00
Ederson de Souza 2aab236c12 arch/riscv: Add IPI support
Use CLINT to send interrupts to another CPU. SMP support is kinda
incomplete without it.

This patch only enables it for riscv-privilege platforms - specifically,
"virt" one.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2022-02-25 19:13:50 -05:00
Ederson de Souza b0458201cc arch/riscv: Do not use irq_lock() on arch_irq_offload
With SMP, it's the wrong with to do, according to
3b145c0d4b.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2022-02-25 19:13:50 -05:00
Ederson de Souza d27cdd1a1e drivers/timer: Use correct timer for CPU in SMP Risc-V
With SMP, it shouldn't be assumed that there's only one CPU to set
timers.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2022-02-25 19:13:50 -05:00
Ederson de Souza d9ab35577b arch/riscv: Boot secondary CPUs for SMP support
Secondary CPUs are now initialised and made available to the system. If
the system has more CPUs than configured via CONFIG_MP_NUM_CPUS, those
are still left looping as before.

Some implementations of `soc_interrupt_init` also changed to use
`arch_irq_lock` instead of `irq_lock`.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2022-02-25 19:13:50 -05:00
Ederson de Souza be28de692c arch/riscv: Use arch_switch() for context swap
Enable `arch_switch()` as preparation for SMP support. This patch
doesn't try to keep support for old style context swap - only switch
based swap is supported, to keep things simple.

A fair amount of refactoring was done in this patch, specially regarding
the code that decides what to do about the ISR. In RISC-V, ECALL
instructions are used to signalize several events, such as user space
system calls, forced syscall, IRQ offload, return from syscall and
context switch. All those handled by the ISR - which also handles
interrupts. After refactor, this "dispatching" step is done at the
beginning of ISR (just after saving generic registers).

As with other platforms, the thread object itself is used as the thread
"switch handle" for the context swap.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2022-02-25 19:13:50 -05:00
Ederson de Souza 8686ab5472 arch/riscv: Get current CPU properly instead of assuming single CPU
isr.S code currently gets CPU information from global `_kernel` assuming
there's only one CPU. In order to prepare for upcoming SMP support,
change code to actually get current CPU information.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2022-02-25 19:13:50 -05:00
Ederson de Souza fdf7c96994 arch/riscv: Implement arch_curr_cpu()
Implement function that will be necessary for upcoming SMP support.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2022-02-25 19:13:50 -05:00
Kai Vehmanen 1bcf79f729 soc/intel_adsp: add intel_adsp_cavs25_tgph board
Add a new board to support Intel Tiger Lake H PCH variant of cAVS2.5.

Move common Kconfig options for cavs25 to soc level. No need to
replicate these for every board.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-02-25 14:28:45 -06:00
Kai Vehmanen 50ec4231d8 samples/subsys/audio/sof: fix rimage signing schema for cavs2.5
The correct signing schema for cAVS2.5 is "tgl".

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-02-25 14:28:45 -06:00
Rubin Gerritsen 52a240c583 Bluetooth: Host: Remove experimental tag from periodic adv and sync
We have done sufficient testing to claim that the host is no longer
experimental.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2022-02-25 21:59:49 +02:00
Mahesh Mahadevan 240f330ca9 boards: Update MXRT display settings
Add display properties for display RK043FN02H

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2022-02-25 13:35:58 -06:00
Mahesh Mahadevan 45cc1d6fc7 drivers: display: Update the MCUX ELCDIF driver
1. Rename device data to dev_data to fix variable
   name clash
2. Use Device Tree properties to setup the display
3. Delete unused Kconfigs

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2022-02-25 13:35:58 -06:00
Mahesh Mahadevan 9b7fbc624a dts: Update NXP LDCIF to add display properties
Add properties to specify panel properties

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2022-02-25 13:35:58 -06:00
Mahesh Mahadevan 3489a39631 dts: Rename NXP LCDIF dts node
Rename fsl,imx6sx-lcdif to nxp,imx-elcdif as it
used by imxrt and imx platforms.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2022-02-25 13:35:58 -06:00
Torsten Rasmussen 8b199b0fbb cmake: test CMake and issue error if using 3.22.1 / 3.22.2 from PyPI
Fixes: #43099

The CMake 3.22.1 / 3.22.2 PyPI version suffers a bug in the
`cmake_path(... PARENT_PATH)` implementation.

Therefore, when CMake version 3.22.1 / 3.22.2 is detected, test if the
CMake version is suffering from the bug, and in case the bug is present,
fail with an error regarding the issue.

The reason for failing, and not implementing work arounds is that Zephyr
already uses `cmake_path()` at two locations, and we cannot prevent
contributors from adding code which uses this function.

Secondly, Zephyr modules may also use `cmake_path()`, and thus be
affected by said bug.
It is impractical to implement work arounds at all possible locations
for something that is a CMake bug.

Therefore the safest solution is to test CMake itself, to check if the
version in use suffers said bug, and fail with a proper error message
if an affected CMake version is used.

See more here:
https://gitlab.kitware.com/cmake/cmake/-/issues/23187
https://github.com/scikit-build/cmake-python-distributions/issues/221

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-02-25 10:16:25 -08:00
Veijo Pesonen 2231287e27 net: lwm2m: Resource Instance level read access.
Makes possible to read a single resource instance at a time with
plaint text, JSON and TLV content formats.

Signed-off-by: Veijo Pesonen <veijo.pesonen@nordicsemi.no>
2022-02-25 10:12:23 -08:00
Ryan Erickson 34acbceef5 modem: hl7800: CTS to monitor sleep
Use CTS input to monitor HL7800 sleep state
when in SLEEP mode.
When CTS is high, shutdown the UART to
save power.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2022-02-25 10:10:22 -08:00
Szymon Janc 0b01cf14e1 tests/bluetooth/tester: Add support for rejecting connection parameters
This is required for GAP/CONN/CPUP/BV-05-C qualification test.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2022-02-25 10:09:09 -08:00
Szymon Janc 3cbec153b2 tests/bluetooth/tester: Add support for multiple GATT subscriptions
This is required by GATT/CL/GAI/BI-01-C qualification test.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2022-02-25 10:08:45 -08:00
Szymon Janc 382e53c255 tests/bluetooth/tester: Fix possible buffer overflow
Make sure we have enough space for notification data.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2022-02-25 10:08:45 -08:00
Fu Haolei 2d58806161 twister: for twister can run tests on ITE board.
Set board flasher, so twister can run tests on ITE(it8xxx2_evb) board.
Add supported drivers of it8xxx2_evb board, so twister could run these
driver tests without skipping.

Signed-off-by: Fu Haolei <haolei.fu@intel.com>
2022-02-25 10:07:19 -08:00
YanBiao Hao 57f5125a8a Bluetooth: mesh: load iv && neykey from app
User can load iv && netkey from app for
the first time to create network.

Signed-off-by: YanBiao Hao <haoyanbiao@xiaomi.com>
2022-02-25 10:06:32 -08:00
Mariusz Skamra 57ad6af3a0 tests: bsim: unicast_server_test: Fix codec specific capabilities
This fixes format of codec specific capabilities in PAC record.

Fixes: #43058
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-02-25 10:05:33 -08:00
Mariusz Skamra 8da5fefce2 samples: unicast_audio_server: Fix codec specific capabilities
This fixes format of codec specific capabilities in PAC record.

Fixes: #43058
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-02-25 10:05:33 -08:00
Herman Berget 47a7fb8d03 Bluetooth: Host: Add test for EATT connection with encryption
Check that the connection request is retried and succeeds when
CONFIG_BT_EATT_SEC_LEVEL=2.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2022-02-25 10:04:10 -08:00
Herman Berget 5b63ead63c BLuetooth: Host: Fix ecred connection retry on encryption change
The L2CAP channels were removed from the bt_conn channels list. They
were thus not found in the ecred connection response handler.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2022-02-25 10:04:10 -08:00
Mariusz Skamra 27d95a0201 Bluetooth: audio: Fix potential compilation warnings
This fixes potential compilation warning about implicit
conversion to unsigned char.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-02-25 10:01:56 -08:00
Ryan Erickson 48cca618fb modem: hl7800: fix +CFUN handler
Fix the +CFUN command handler to find
the end of the message properly.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2022-02-25 09:56:43 -08:00
Rubin Gerritsen 9a088f9778 Bluetooth: Host: Error if setting unsupported adv data for ext adv
We keep the behavior for legacy advertising data as the controller will
ignore such scenarios when using legacy advertising commands.

Extended non-scannable advertising sets don't support scan response
data. Extended scannable advertising sets don't support advertising
data.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2022-02-25 09:56:04 -08:00
Sam Hurst 0a9e8fb9ea pm: Remove extraneous "info" statement left over from PR #42041
Remove extraneous "info" statement left over in file stm32g0/power.c

Signed-off-by: Sam Hurst <sbh1187@gmail.com>
2022-02-25 11:23:02 -05:00