Commit graph

56486 commits

Author SHA1 Message Date
Jaxson Han
d282d86d7e arm64: Create common mmu and mpu interfaces
Include the new introduced include/arch/arm64/mm.h instead of the
arm_mmu.h or arm_mpu.h.

Unify function names z_arm64_thread_pt_init/z_arm64_swap_ptables with
z_arm64_thread_mem_domains_init/z_arm64_swap_mem_domains for mmu and
mpu, because:
1. mmu and mpu have almost the same logic.
2. mpu doesn't have ptables.
3. using the function names help reducing "#if define" macros.

Similarly, change z_arm64_ptable_ipi to z_arm64_domain_sync_ipi

And fix a log bug in arm_mmu.c.

Signed-off-by: Jaxson Han <jaxson.han@arm.com>
2021-09-28 20:06:06 -04:00
Jaxson Han
9c1115c655 include: arm64: Refine the K_MEM_PARTITION_ defs
The defination of K_MEM_PARTITION_* marcos denpens on wheather it is
mmu or mpu, so I move those definations for mmu into arm_mmu.h and
create mpu relevant ones in arm_mpu.h

Signed-off-by: Jaxson Han <jaxson.han@arm.com>
2021-09-28 20:06:06 -04:00
Jaxson Han
0f60930540 include arm64: Add mm.h to unify mmu and mpu
The arm_mmu.h and arm_mpu.h have some common logic. To reduce some
redundency and the ugly 'if defined' marcos, I add a new header
include/arch/arm64/mm.h to include arm_mmu.h or arm_mpu.h depending on
CONFIG_ARM_MMU or CONFIG_ARM_MPU. Thus, in the future, the common code
of mmu and mpu should be in include/arch/arm64/mm.h.

Signed-off-by: Jaxson Han <jaxson.han@arm.com>
2021-09-28 20:06:06 -04:00
Jaxson Han
34d6c7caa7 arm64: cortex_r: Move mpu code to a better place
This patch mainly moves mpu related code from
arch/arm64/core/cortex_r/mpu/ to arch/arm64/core/cortex_r/ and moves
the mpu header files from include/arch/arm64/cortex_r/mpu/ to
include/arch/arm64/cortex_r/

Signed-off-by: Jaxson Han <jaxson.han@arm.com>
2021-09-28 20:06:06 -04:00
Jaxson Han
a11721115e test: subsys: cpp: Fix stack overflow on Armv8R-64
After doing some tests on Armv8R aarch64 board, the used stack memory
exceeds the stack size for about 64 bytes. Extending ZTEST_STACKSIZE
to 5120 can fix it.

Signed-off-by: Jaxson Han <jaxson.han@arm.com>
2021-09-28 20:06:06 -04:00
Markus Fuchs
643242423b doc: release: Add note about multicast monitor's new IPv4 support
Add release note about multicast group join/leave monitor API change.

Signed-off-by: Markus Fuchs <markus.fuchs@ch.sauter-bc.com>
2021-09-28 20:04:49 -04:00
Markus Fuchs
fb082a6923 net: dns: Make mdns and llmnr responders join their multicast groups
As with IPv6, the mdns and llmnr responders should join their multicast
groups for IPv4 instead of just adding the multicast address to the
interface.

Signed-off-by: Markus Fuchs <markus.fuchs@ch.sauter-bc.com>
2021-09-28 20:04:49 -04:00
Markus Fuchs
a283cb3311 drivers: Update drivers to use new multicast monitor API
Update drivers regarding latest multicast group join/leave monitor
changes which now supports both IPv6 and IPv4 multicast addresses.

Signed-off-by: Markus Fuchs <markus.fuchs@ch.sauter-bc.com>
2021-09-28 20:04:49 -04:00
Markus Fuchs
7926657b27 net: if: Add IPv4 support to multicast monitor
Make multicast group join/leave monitor support both IPv6 and IPv4
addresses.

Fixes #26585

Signed-off-by: Markus Fuchs <markus.fuchs@ch.sauter-bc.com>
2021-09-28 20:04:49 -04:00
Emil Gydesen
49b36f4e79 Bluetooth: iso: Handle broadcast iso data path failure
Handle the case that setting up the iso data path for a
broadcast (sink or source) bis fails.

As part of this fix, implement the lookup_big_by_handle
function.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-09-28 20:03:39 -04:00
Marc Herbert
3e0bc8c231 samples/audio/sof: remove zephyr_interface_library_named(sof_lib)
As this makes no difference, it's misleading so let's remove it to stop
being misled. I don't know why initial commit efa794dbc5 added it but
the build directory is strictly identical with or without this line.

The SOF code is included in the build thanks to CONFIG_SOF in prj.conf,
not this.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-09-28 20:03:15 -04:00
Xabier Marquiegui
b2b4bb0005 doc: mention mimxrt1020_evk and mimxrt1024_evk qspi flash
Both boards have qspi flash driver support

Signed-off-by: Xabier Marquiegui <xmarquiegui@ainguraiiot.com>
2021-09-28 20:02:21 -04:00
Xabier Marquiegui
251e730e21 boards: arm: Add mcuboot flash partitions to mimxrt1020_evk
Adds flash partitions and chosen nodes to the mimxrt1020_evk device tree
to support mcuboot on the internal QSPI flash.

Also enables FlexSPI flash driver XIP mode support on this board to
support mcuboot.

Signed-off-by: Xabier Marquiegui <xmarquiegui@ainguraiiot.com>
2021-09-28 20:02:21 -04:00
Jakub Rzeszutko
3ebe9c9ea1 shell: log backend minor improvements
Replace direct setting of the internal shell flag with a
dedicated function for this.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2021-09-28 20:02:01 -04:00
Jakub Rzeszutko
2b5723d455 shell: add init backend configuration
Each backend can configure separately features like colors on/off, VT100
handling and so on. This can be very handy for planned MQTT backend.
Shell will not send VT100 commands when VT100 is not enabled globally or
for particular backend.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2021-09-28 20:02:01 -04:00
Jakub Rzeszutko
0a50ebed01 shell: rework vt100 commands storage
VT100 commands are now stored as strings rather than character arrays.
This change will make it easier to create a unified macro for sending
all VT100 commands.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2021-09-28 20:02:01 -04:00
Alex Sergeev
851cccb67e drivers: ethernet: mcux: generalize gPTP code to support PTP L2
Update eth_mcux.c to use CONFIG_NET_L2_PTP instead of CONFIG_NET_GPTP.

Signed-off-by: Alex Sergeev <asergeev@carbonrobotics.com>
2021-09-28 20:01:16 -04:00
Alex Sergeev
e7778b8584 net: ptp: extract PTP interfaces outside gPTP subsys under NET_L2_PTP
As per #38352, we would like to start building out PTP (IEEE 1588)
support for superset of gPTP functionality in Zephyr. This is the first
step to abstract away some key interfaces from NET_GPTP umbrella to
NET_L2_PTP.

Signed-off-by: Alex Sergeev <asergeev@carbonrobotics.com>
2021-09-28 20:01:16 -04:00
Gerard Marull-Paretas
1face7731a tests: devicetree: devices: add test for DEVICE_DT_GET_OR_NULL
Add a unit test to verify the correct behavior of the
DEVICE_DT_GET_OR_NULL macro.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-09-28 20:00:00 -04:00
Gerard Marull-Paretas
222a21dd72 drivers: pinmux: stm32: use DEVICE_DT_GET_OR_NULL
Use existing Devicetree macro to obtain optional references to GPIO
ports.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-09-28 20:00:00 -04:00
Gerard Marull-Paretas
4df1d15618 device: add DEVICE_DT_GET_OR_NULL utility macro
Add a new utility macro to obtain an optional reference to a device. If
the provided node_id is not enabled, the macro falls back to NULL.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-09-28 20:00:00 -04:00
Lingao Meng
5ddbdcedd0 Bluetooth: Mesh: Move proxy message size to kconfig
Add `BT_MESH_PROXY_MSG_LEN` to config proxy message length

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-09-28 19:57:15 -04:00
Lingao Meng
4fcf549607 Bluetooth: Mesh: Use common buf size for all conn
Use common buffer size for all bluetooth mesh connection.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-09-28 19:57:15 -04:00
Lingao Meng
355b18c43e Bluetooth: Mesh: Add seperate config for pb-gatt dev name
Add seperate config to control whether device name include in
pb-gatt advertising scan response data.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-09-28 19:57:15 -04:00
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