Commit graph

56512 commits

Author SHA1 Message Date
Lingao Meng 3f68692069 Bluetooth: Mesh: Reflact disconnect logic to separate roles
remove section ordering to use code more readable.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-09-28 19:57:15 -04:00
Lingao Meng 22b234cf03 Bluetooth: Mesh: Move bt_mesh_proxy_role to proxy_msg.c
Mesh bt_mesh_proxy_role structure to proxy_msg.c

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-09-28 19:57:15 -04:00
Lingao Meng bc1d6580dc Bluetooth: Mesh: Move proxy complete message to seperate role
Move proxy complete message to seperate role.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-09-28 19:57:15 -04:00
Lingao Meng d831d8a7d3 Bluetooth: Mesh: Move command buffer to proxy_msg.c
Move command buffer alloc to proxy_msg.c.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-09-28 19:57:15 -04:00
Lingao Meng a88aac2a7f Bluetooth: Mesh: Remove unnecessary prov buf get function
Remove `bt_mesh_pb_gatt_get_buf`.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-09-28 19:57:15 -04:00
Lingao Meng c057a69a2c Bluetooth: Mesh: Rename bt_mesh_pb_gatt<*> function
Rename bt_mesh_pb_gatt_<*> function, and split from proxy.h

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-09-28 19:57:15 -04:00
Lingao Meng b2889903a3 Bluetooth: Mesh: Split gatt services to pb-gatt and proxy
Split gatt services to pb-gatt-srv and proxy-srv.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-09-28 19:57:15 -04:00
Lingao Meng 412e7da951 Bluetooth: Mesh: Delete bt_mesh_proxy_prov_disable parameter.
we will no longer need the additional `disconnect` parameter,
such as we only process gatt database from disconnect handler.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-09-28 19:57:15 -04:00
Francois Ramu 99c4d362d3 boards: arm: stm32f303 disco DTS supports uart4
This adds the uart4 device to the stm32f3_disco board
based on the stm32f303 device from STMicroelectronics

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-09-28 19:56:52 -04:00
Emil Lindqvist f7dad07bb0 kconfig: add names to some choices
In order to be able to make a "choice" from any other
Kconfig.defconfig (-ish) file, the choice needs to be named.
This commit names a few choices.

Signed-off-by: Emil Lindqvist <emil@lindq.gr>
2021-09-28 19:56:32 -04:00
Aleksandr Khromykh 68d8a263b6 test: Bluetooth: Mesh: add provisioning with OOB auth tests
BubbleSim tests that check provisioning with all possible (from spec)
OOB authentications

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2021-09-28 19:54:00 -04:00
Aleksandr Khromykh 6f2516d9a7 Bluetooth: Mesh: Refactoring provisioning to make all OOB auth working
The current implementation has hidden dependencies that break
OOB authentication if provisioner does not have the configured
input or output fields used for device capabilities.
It didn't allow to pass several OOB authentication cases.
After refactoring provisioner behavior is independent to
provisionee settings.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2021-09-28 19:54:00 -04:00
Aleksandr Khromykh 009ecdfda0 test: Bluetooth: Mesh: clean up warnings in Mesh scanner test
Clean up warnings in the BubbleSim Mesh scanner test.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2021-09-28 19:54:00 -04:00
Ruibin Chang d16ae76d30 ITE drivers/kscan: add keyboard scan driver for it8xxx2_evb
Add keyboard scan driver for board it8xxx2_evb.

Signed-off-by: Ruibin Chang <ruibin.chang@ite.com.tw>
2021-09-28 19:53:15 -04:00
Ramiro Merello 28da82c0e1 json: Changes enum name of square brackets from list to array
Marked JSON_TOK_LIST_ as deprecated in favor of JSON_TOK_ARRAY_

Signed-off-by: Ramiro Merello <rmerello@itba.edu.ar>
2021-09-28 19:52:10 -04:00
Deimantas Aukštkalnis 17238ab26b dts: added stm32f103Xd.dts file
This commit adds stm32f103xd series dts file that was missing.

Also, changed stm32f103xe.dts for highlighting the differences between
f103xd and f103xe series.

Signed-off-by: Deimantas Aukštkalnis <deimantas.aukstkalnis@teltonika.lt>
2021-09-28 19:51:53 -04:00
Dennis Ruffer fe1b167760 gpio: shell: Change shell *shell to shell *sh
To fix MISRA Rule 5.7 violation

Signed-off-by: Dennis Ruffer <daruffer@gmail.com>
2021-09-28 19:51:33 -04:00
Dennis Ruffer 95bab86051 gpio: shell: Use macro SHELL_CMD_ARG to check parameters count
The args_number and args_no structures could be removed
But other parameter checks we still preserved.

Signed-off-by: Dennis Ruffer <daruffer@gmail.com>
2021-09-28 19:51:33 -04:00
Dennis Ruffer 9b3dfe7443 gpio: shell: Replace gpio listen with blink
This is a frequently used command during hardware bringup
The listen command was not actually implemented
Also uncrustified and check_compliance.py

Signed-off-by: Dennis Ruffer <daruffer@gmail.com>
2021-09-28 19:51:33 -04:00
Neil Armstrong 481b5a2424 tests: arm64: add GICv3 ITS test suite
Add a simple ITS driver test allocating 8192 LPIs over 256 DeviceIDS
and 32 EventIDs per DeviceID to exercise the ITS for the MSI/MSI-X
usecase.

The test is set as `build_only: true` and whitelisted to the
fvp_base_revc_2xaemv8a board until the shipped Zephyr QEMU
has the ITS support.
Since `fvp_base_revc_2xaemv8a` needs FIP & BL1 files, test is marked
as `skip: true`.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2021-09-28 19:45:29 -04:00
Neil Armstrong 0619e96e87 boards: fvp_base_revc_2xaemv8a: reserve HEAP for GICv3 ITS tables
The ITS needs a number of table, so HEAP must be reserved for runtime
allocation (1MiB is a round and convenient value):
- Redistributor:
* 64K table for all redistributors
* 64k for each redistributors
- ITS:
* 4K collection table aligned on 4K
* 4K x 128 device table aligned on 4K

This makes 11x64K to permit all allocations to success.

Note, will need 64K HEAP_MEM per CPUs added.

This doesn't necessarily include the Interrupt Translation Table,
which are 256bytes aligned tables, for reference a 32 ITEs table
needs 256bytes.
With 14x64K HEAP, up to 116 ITT tables of 32 ITEs can be allocated.

A specific HEAP_MEM_POOL_SIZE as been added to arm64_gicv3_its test
for the fvp_base_revc_2xaemv8a board to satisfy all memory allocation
constraints for 256 ITT tables with 32 ITEs allocations.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2021-09-28 19:45:29 -04:00
Neil Armstrong f5ac88f166 soc: fvp_aemv8a: enable 16384 IRQs to permit using up to 8192 LPIs
When using ITS, the LPI range starts at 8192 and by default support
8192 LPIs.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2021-09-28 19:45:29 -04:00
Neil Armstrong 2385d91c56 board: fvp_base_revc_2xaemv8a: add ITS node
Add the FVP machine ITS node.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2021-09-28 19:45:29 -04:00
Neil Armstrong c523014983 board: fvp_base_revc_2xaemv8a: set 16bits for ITS DeviceID
By default fvp_base_revc_2xaemv8a used 17bits per DeviceID, limit it to
16bits for the PCIe MSI/MSI-C use-case and save some memory.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2021-09-28 19:45:29 -04:00
Neil Armstrong a737999b5b interrupt_controller: gicv3: add Interrupt Translation Service support
This implements support for the optional Interrupt Translation Service
(ITS) module of the GICv3 Interrupt Controller.

The current implementation is designed for MSI/MSI-X interrupt delivery
in mind.
The gicv3 driver calls each ITS INVALL command when LPI interrupts are
enabled/disabled.
A simple atomic integer is used to allocate unique LPI INTIDs to ITS
users.
CPUs numbers are directly mapped as ICIDs into the Collections Table.

As a limitation it doesn't support indirect Device table to simplify
implementation but may use a large amount of memory.

INV, DISCARD, MOVI and MOVALL commands are not implemented.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2021-09-28 19:45:29 -04:00
Neil Armstrong e819bd8f34 interrupt_controller: gicv3: add support for LPIs
The LPI (Locality-specific Peripheral Interrupts) are edge-triggered
message-based interrupts that can use an Interrupt Translation
Service (ITS) to route an interrupt to a specific Redistributor and
connected PE.

This implement the necessary LPI support when an ITS is enabled.

The LPI states are stored in memory-backed tables.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2021-09-28 19:45:29 -04:00
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