Commit graph

56486 commits

Author SHA1 Message Date
Neil Armstrong
340a8697d2 interrupt_controller: Add GICv3 ITS API
Add driver API for the Interrupt Translation Service GICv3 module.

The Interrupt Translation Service (ITS) translates an input EventID
from a device, identified by its DeviceID, and determines the
corresponding INTID for this input and target Redistributor + target
PE for that INTID to be delivered as LPI interrupt.

The API permits :
- allocating a new unique LPI interrupt number
- initializing support for a new DeviceID and the required EventIDs
- mapping a DeviceID + EventID to a LPI interrupt number
- triggering an LPI with a DeviceID + EventID

This API will be used by the PCIe MSI/MSI-X logic in another patchset.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2021-09-28 19:45:29 -04:00
Neil Armstrong
ca849af5ea dts: add GIC v3 ITS bindings
Add DT bindings for the optional Interrupt Translation Service module
of the ARM GICv3 Interrupt Controller.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2021-09-28 19:45:29 -04:00
Neil Armstrong
d55991b98e arm64: isr_wrapper: ignore Special INTIDs between 1020..1023
Referring the Arm Generic Interrupt Controller Architecture
Specification GIC architecture version 3 and version 4 document
(see 2.2.1 Special INTIDs paragraph), these INTIDs are reserved
for special purposes and should be ignored for now.

For the ITS implementation, the INTID 1023 must be ignored since this
special INTID will trigger after an LPI acknowledge, thus triggering
the spurious interrupt handler.

The GICv3 Linux implementation ignores these INTIDs the same way.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2021-09-28 19:45:29 -04:00
Neil Armstrong
078113982f arm64: isr_wrapper: fixup out of bounds for large number of irqs
In case we enable a large number of IRQs, like when enabling LPIs using
interrupts > 8192, we hit an assembler error where the immediate value
is too large.

Copy the IRQ number into x1 to permit using a large IRQ number.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2021-09-28 19:45:29 -04:00
Jonathan Hahn
a133bf8821 samples: sensors: add sample for i3g4250d gyro
Adds a sample for the ST I3G4250D gyroscope.

Signed-off-by: Jonathan Hahn <Jonathan.Hahn@t-online.de>
2021-09-28 19:44:26 -04:00
Jonathan Hahn
f9e2969d87 tests: drivers: sensors: add i3g4250d to build_all
Adds i3g4250d gyro to build_all spi tests.

Signed-off-by: Jonathan Hahn <Jonathan.Hahn@t-online.de>
2021-09-28 19:44:26 -04:00
Jonathan Hahn
db2094eaae boards: arm: add i3g4250d gyro to stm32f3_disco_E
The gyro i3g4250d is added to the device tree of stm32f3_disco rev. E
and a yaml file for this revision to use in twister is added.

Signed-off-by: Jonathan Hahn <Jonathan.Hahn@t-online.de>
2021-09-28 19:44:26 -04:00
Jonathan Hahn
c9f87969c2 drivers: sensor: add I3G4250D Gyro driver
Implements a shim layer driver using st hal for
I3G4250D gyro, mounted for example on stm32f3_disco_E.
No support for triggers included yet.

Signed-off-by: Jonathan Hahn <Jonathan.Hahn@t-online.de>
2021-09-28 19:44:26 -04:00
Carlo Caione
d5556cafed arm_arch_timer: Fix ticks count on !CONFIG_TICKLESS_KERNEL
When SMP is enabled all the cores are announcing a tick and this is
causing too many ticks to be announced. Announce the tick even if this
is zero.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-09-28 19:40:01 -04:00
Torsten Rasmussen
af87599e11 scripts: twister: print message from CMake verify toolchain on failures
Fixes: #38924

When the `verify-toolchain.cmake` script fails, then twister will print
a standard message to the user regardless of the reason.
> E: Variable ZEPHYR_TOOLCHAIN_VARIANT is not defined

The `verify-toolchain.cmake` already prints detailed information
regarding the cause of the failure, so twister should just pass that
message as-is.

For example, the message that is provided by verify-toolchain.cmake
when Zephyr SDK 0.13.0 is installed but 0.13.1 is required looks like:
> CMake Error at cmake/verify-toolchain.cmake:75 (find_package):
>  Could not find a configuration file for package "Zephyr-sdk" that is
>  compatible with requested version "0.13.1".
>
>  The following configuration files were considered but not accepted:
>
> /opt/zephyr-sdk-0.13.0/cmake/Zephyr-sdkConfig.cmake, version: 0.13.0

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-09-28 14:10:37 -04:00
Carlo Caione
8f53f319cd reserved-memory: Fix layering violation
Move memory.h out of the way in a more "private" space
(include/linker/devicetree_reserved.h) to prevent polluting the
devicetree space.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-09-28 14:01:36 -04:00
Sven Åkersten
ffaff520ee include: usb: fix hid feature item typo
Fix typo setting HID feature item to output item.

Signed-off-by: Sven Åkersten <sven.akersten@gmail.com>
2021-09-28 19:22:06 +02:00
Vinayak Kariappa Chettimada
1ea0fabe72 Bluetooth: Controller: Fix BT_CTLR_FAST_ENC Kconfig help text
Fix BT_CTLR_FAST_ENC Kconfig help text to reflect the
current Encryption Setup Procedure behavior.

With the split architecture, Encryption Setup Procedure
will take 4 connection events when BT_CTLR_FAST_ENC is
enabled, in comparison to 3 connection events in the
legacy Controller architecture. This is due to split
architecture processes control procedures in the lower
priority Upper Linker Layer execution context.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-09-28 15:39:55 +02:00
Torsten Rasmussen
34e346de14 Revert "drivers: pinmux: build as static library"
This reverts commit 43309296b8.

Fixes: #38403

The referred commit introduced `zephyr_library()` for pinmux drivers but
also resulting in #38403 because several boards has `CONFIG_PINMUX=y`
without selecting any pinmux drivers from `drivers/pinmux` thus
generating the following warning:
> No SOURCES given to Zephyr library: drivers__pinmux
>
> Excluding target from build.

This commit reverts the changes so that this warning disappears.
This results in pinmux drivers from `drivers/pinmux` to be located in
libzephyr.a which is messy, but has been so for a long time, even before
Zephyr 1.14 LTS.

The future pinctrl API will be designed in such a way that this problem
will not occur. Thus the old behavior is acceptable until the transition
to pinctrl API has completed.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-09-28 14:33:16 +02:00
Erwan Gouriou
921a3d8543 tests/drivers: gpio_basic_api: Upudate nucleo_f103rb configuration
For some reason, provided pin configuration for nucleo_f103rb
is not able to detect gpio callback issues.
Move to other pin combination which detect pin callback issues.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-09-28 06:19:08 -04:00
Erwan Gouriou
5c23fa9f9d drivers/gpio: stm32f1: AFIO init should happen before GPIO inits
GPIO initialization was moved to PRE_KERNEL_1 with commit
590162a5cc06c72b70dee93f410b878bc0935f1f.
This had the consequence of having AFIO init done after GPIO init
as a consequence, this sequence ends up with AFIO clock disabled,
and hence negative impact on AFIO expected services.

Additionally, to save some flash, compile out afio init when not
required.

Fixes #38870

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-09-28 06:19:08 -04:00
Enjia Mai
db895f3241 docs: acrn: update the documentation of setting the ACRN hypervisor
Add some descriptions of hybrid scenario of ACRN hypervisor, and
completed the configurations that we are using to build ACRN. This
configuration change for ACRN hypervisor is necessary when our Zephyr
application is using over than one CPU for it.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2021-09-28 06:17:54 -04:00
Krzysztof Chruscinski
ba60c94b48 lib: os: mpsc_pbuf: Add const qualifier to API calls
Add const qualifier where it was missing. Updating
relevant code.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-09-28 06:15:39 -04:00
Ramiro Merello
f05b175656 subsys/fs/nvs: nvs_write return missing documentation
- Documentation of the 0 return value for ns_write function
- Ajusted lines length limit from 80 to 100
- Fixed extra and missing parameters for nvs_fs
- Misc spelling/grammar changes

Signed-off-by: Ramiro Merello <rmerello@itba.edu.ar>
2021-09-28 06:15:20 -04:00
Torsten Rasmussen
72a8520a57 drivers: console: remove unused CONSOLE selection
Fixes: #38403

Removing unneeded `CONFIG_CONSOLES=y` occurrences where no console
driver is selected.

Such selection results in an empty drivers__console zephyr library,
which again results in the following warning message.

> No SOURCES given to Zephyr library: drivers__console
>
> Excluding target from build.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-09-28 12:13:23 +02:00
Torsten Rasmussen
d800b4a4d7 drivers: gpio: remove unused GPIO selection
Fixes: #38403

Removing unneeded `imply GPIO` and `CONFIG_GPIO=y` occurrences where no
files are added to the gpio zephyr library.

Also removed `CONFIG_GPIO=y` occurences where this is handled by
defconfigs for the soc or board.

Selection of GPIO without selecting any drivers results in the warning:

> No SOURCES given to Zephyr library: drivers__gpio
>
> Excluding target from build.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-09-28 12:13:23 +02:00
Torsten Rasmussen
e8eb8a8c2c drivers: ethernet: remove dedicated drivers__ethernet__native_posix lib
Fixes: #38403

The two eth_native_posix.c and eth_native_posix_adapt.c are now added
to the common drivers__ethernet Zephyr library.

Instead of creating a dedicated library for just two files those files
are now added to the common ethernet library, see also #8826.
Instead, the dedicated compile definitions required for those files are
specified using COMPILE_DEFINITIONS on the source files.

This also avoids the following warning as the ethernet library is no
longer empty.

> No SOURCES given to Zephyr library: drivers__ethernet
>
> Excluding target from build.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-09-28 12:13:23 +02:00
Torsten Rasmussen
9b43e7a23d modules: hal_nxp: removing always empty zephyr_library
No sources were ever added to the `zephyr_library()` defined in
modules/hal_nxp/usb/CMakeLists.txt, thus removing this lib to avoid
the warning:

> No SOURCES given to Zephyr library: modules__hal_nxp__usb
>
> Excluding target from build.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-09-28 12:13:23 +02:00
Torsten Rasmussen
8e64038559 drivers: net: adding NET_DRIVERS menuconfig
Fixes: #38403

Adding NET_DRIVERS menuconfig so that network drivers are grouped
together in its own menu entry under drivers, similar to most other
drivers.

This further has the advantages that `CONFIG_NET_DRIVERS` can be used
for testing to determine if network drivers has been selected.

This changed revealed a dependency loop where both `select` (for SLIP)
and `depends` (for PPP) which both depends on NET_DRIVERS` where in use
in the dependency tree for Qemu networking, especially NET_SLIP_TAP.

This is handled by defaulting `NET_DRIVERS` to `y` when building for a
Qemu target.
`SLIP` had a dependency to `!QEMU_TARGET || NET_QEMU_SLIP`. This is
changed so that SLIP prompt depends on `!QEMU_TARGET` which provides
full user control in hardware but makes the symbol promptless on Qemu
targets.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-09-28 12:13:23 +02:00
Torsten Rasmussen
6ebe0b8425 drivers: create BT_DRIVERS Kconfig entry
Fixes: #38403

Changing Bluetooth drivers from being a menu into a menuconfig.
This aligns the Bluetooth driver configuration with other driver
configurations as well as provides a setting which identifies if
Bluetooth drivers has been enable.

This further helps to avoid empty Zephyr libraries for bluetooth
samples.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-09-28 12:13:23 +02:00
Francois Ramu
acad37196d drivers: adc: stm32 adc disable causing endless loop
Setting Oversampling also applies on stm32L5 but disabling
the ADC will cause endless loop except for the stm32L0 serie.
Errata applies only on stm32G0 soc series when
writing ADC_CFGR1 register.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-09-28 06:12:47 -04:00
Pavel Vasilyev
e40998a4e4 Bluetooth: Mesh: Return ETIMEDOUT if k_sem_take call times out
EAGAIN is used in some other places in the code, e.g. if node is not
provisioned when a model tries to send a message. This change helps to
differentiated if the acknowledged message timed out from other failers.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2021-09-28 11:49:27 +02:00
Guillaume Lager
a55a5b744d logging: rtt: Add overwrite mode
In this mode the oldest data is overwritten
when the buffer is full

Closes #36282

Signed-off-by: Guillaume Lager <g.lager@innoseis.com>
2021-09-28 11:45:02 +02:00
Agata Ponitka
bd8b9ee830 Bluetooth: Tester: Add the OOB Authentication method
Adding support for automatic testing OOB Authentication method.

Signed-off-by: Agata Ponitka <agata.ponitka@codecoup.pl>
2021-09-28 11:44:33 +02:00
Steven Lemaire
cc5f769436 drivers: serial: gecko: add hw flow control support for EFR32 Series 2
Add hardware flow control support for the EFR32MG21 and other modules
using GPIO_USART_ROUTEEN_RTSPEN (and GPIO_USART_ROUTEEN_CTSEN) instead
of the Kconfig SOC_GECKO_HAS_INDIVIDUAL_PIN_LOCATION.

The driver already contained the section settings the RTS and CTS pins
for modules using the GPIO_USART_ROUTEEN_(RTS|CTS)PEN define, but it was
not compiling because of an #ifdef checking only for
CONFIG_SOC_GECKO_HAS_INDIVIDUAL_PIN_LOCATION and not both.

Signed-off-by: Steven Lemaire <steven.lemaire@zii.aero>
2021-09-28 11:39:02 +02:00
Vinayak Kariappa Chettimada
f07763640e Bluetooth: Controller: Fix multiple peripheral connection deadlock
Fix deadlock in multiple peripheral connection in a device
due to redundant double reservation of node rx buffer during
crossover scenario in Data Length Update procedure.

Data Length Update resize state was reset back to response
wait state when peripheral received an acknowledgment to
local initiated Data Length Request PDU after having already
transitioned to resize state.

Implementation is designed to transition to resize state
under both Data Length Response reception and crossover
scenario of Data Length Request reception when procedure is
local initiated.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-09-28 11:38:16 +02:00
Nicolas Pitre
fd3dd0c2d6 net_buf_slist_{put|get}: make SMP safe
Replace irq_lock() with a spin lock, and rework the `get` version
to be entirely SMP safe.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2021-09-28 11:37:56 +02:00
Nicolas Pitre
8cd7f1c98a net_buf_alloc_len: make SMP safe
Replace irq_lock() with a spin lock.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2021-09-28 11:37:50 +02:00
Dino Li
29d039335f cleanup: soc: it8xxx2: remove unnecessary code
Code removed:
- IT8XXX2 doesn't support soc level software interrupt hence remove
  them.
- To use common macro to access csr (control status register).
- To remove CONFIG_RISCV_HAS_PLIC related code. IT8XXX2 uses its own
  interrupt controller code.
- To remove ite_write and ite_read. We don't use them anymore.

Code changed:
- Return true from arch_irq_is_enabled() when external interrupt-enable
  bit, and SOC's IER are both true.

Signed-off-by: Dino Li <Dino.Li@ite.com.tw>
2021-09-28 11:36:23 +02:00
Andrzej Głąbek
bcf20455ee soc: nrf53: Add missing HAS_HW_NRF_* entries
A few HAS_HW_NRF_* Kconfig options for peripherals available in nRF5340
are not selected. Fix it.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2021-09-28 11:30:09 +02:00
Joakim Andersson
284238339b Bluetooth: host: compile out check for multiple identities
Add check that can be removed by the compiler since the rest is only
needed when multiple identities have been enabled.

Fixes: #38134

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-09-27 22:27:18 -04:00
Emil Gydesen
623aaa136b Bluetooth: ISO: Remove bt_conn_unref for ISO deferred work
Removed the bt_conn_unref from the deferred_work function.
For ISO, the conn unref for the peripheral will happen in
the bt_iso_disconnected function. For the central, the
unref shall only happen when the CIG is terminated.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-09-27 22:24:23 -04:00
Glauber Maroto Ferreira
b7c987fe0e west: update hal revision
to latest version that supports clock_control
driver for esp32s2 SoC.

Signed-off-by: Glauber Maroto Ferreira <glauber.ferreira@espressif.com>
2021-09-27 22:02:08 -04:00
Glauber Maroto Ferreira
feb340d990 esp32: drivers: clock_control: add ownership
into CODEOWNERS file.

Signed-off-by: Glauber Maroto Ferreira <glauber.ferreira@espressif.com>
2021-09-27 22:02:08 -04:00
Glauber Maroto Ferreira
e605efc698 esp32s2: drivers: clock_control: add support
add clock control driver support for esp32s2 SoC.

Signed-off-by: Glauber Maroto Ferreira <glauber.ferreira@espressif.com>
2021-09-27 22:02:08 -04:00
Glauber Maroto Ferreira
1fb4eea95c esp32: dt: update peripheral enabling references
to allow peripheral clock gating.

Signed-off-by: Glauber Maroto Ferreira <glauber.ferreira@espressif.com>
2021-09-27 22:02:08 -04:00
Glauber Maroto Ferreira
d15d3de5fc esp32: drivers: clock_control: code refactoring
code refactoring.

Signed-off-by: Glauber Maroto Ferreira <glauber.ferreira@espressif.com>
2021-09-27 22:02:08 -04:00
Fabio Baltieri
89df245b0d samples: modbus: update/fix samples.yaml configs
Update the sample.yaml files for the modbus samples:
- depends_on entries should just be space separated, drop the comma
- add the platform referenced in the documentation to platform_allow
- replace the deprecated dt_compat_enabled_with_alias with
  dt_enabled_alias_with_parent_compat

Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
2021-09-27 21:54:56 -04:00
Fabio Baltieri
64a2d97c03 samples: modbus: rtu_server: drop unused variable
This has been unreferenced since:

4ff616b647 modbus: rework interface configuration

This generates a compiler warning, but it went unnoticed because the
sample test is configured incorrectly and not running.

Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
2021-09-27 21:54:56 -04:00
Fabio Baltieri
46ef9be075 samples: canopennode: fix the sample path
The sample code got moved in 613f1cde4a, update the old path to the
current one.

Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
2021-09-27 21:54:56 -04:00
Iuliana Prodan
3ec07c5f47 west: sign: add support for NXP i.MX8QXP board
Add support for signing i.MX8QXP SOF with Zephyr images with rimage.

i.MX8QXP and i.MX8QM have the same board-level definitions,
so we use the generic imx8.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2021-09-27 21:52:31 -04:00
Iuliana Prodan
0b23984920 samples/subsys/audio/sof: add configuration for i.MX8QXP board
Add support for i.MX8X, which represents i.MX8QXP board.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2021-09-27 21:52:31 -04:00
Iuliana Prodan
50124ad8cd boards: xtensa: adsp: add support for imx8x board
Add support for i.MX8QXP board by defining defconfig,
board configuration and device tree.
This is very similar with i.MX8QM board and uses the
same SoC and dts/xtensa/nxp/nxp_imx8.dtsi.

From Audio DSP point of view, i.MX8QXP has a
1 Xtensa HiFi4 core, with 64 KB TCM,
448 KB OCRAM, 8MB SDRAM and 1 ESAI, 1 SAI as
audio interfaces.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2021-09-27 21:52:31 -04:00
Carlo Caione
a7b119f710 MAINTAINERS: Add IPC maintainers
This is an area that is quickly growing and changing. Better having
someone taking a look at the incoming patches.

Set myself and Arnaud as maintainers.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-09-27 21:47:33 -04:00
Henrik Brix Andersen
9aa4a70e5c twister: ignore ROM region overflows
Add ROM region to list of regions to optionally ignore overflows on.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2021-09-27 17:53:09 -04:00