Commit graph

61383 commits

Author SHA1 Message Date
Erwan Gouriou
045c986314 drivers/bluetooth/hci: stm32wb: Implement close api
Add treatment for close api.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-03-10 13:28:41 -05:00
Erwan Gouriou
49b15c8306 drivers/bluetooth/hci: stm32wb: Move RX thread creation to open
In order to enable RX thread abortion on close, move creation
to from init to open.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-03-10 13:28:41 -05:00
Erwan Gouriou
a099c79234 subsys/bluetooth/host: hci_core: Add a bt_disable command
Add a bt_disable function. This will abort existing threads and
close the HCI transport.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-03-10 13:28:41 -05:00
Erwan Gouriou
b3c5a028f5 include/drivers/bluetooth: hci_driver: Add close function
Add a close api function to bt_hci_driver structure.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-03-10 13:28:41 -05:00
Francois Ramu
71f20d8b3e tests: drivers: pwm for stm32l073 and stm32f091 nucleo boards
The overlay are defined to run the tests/drivers pwm_api
on the nucleo_l073rz,nucleo_f091rc.
Note than pwm pb10 is for DTS definition purpose

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-03-10 13:25:54 -05:00
Francois Ramu
2620c53771 samples: pwm for stm32l073 and stm32f091 nucleo boards
The overlay are defined to run the samples application with PWM
feature on the nucleo_l073rz,nucleo_f091rc, nucleo_g474re

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-03-10 13:25:54 -05:00
Francois Ramu
08e3ce0ebc boards: arm: stm32l073, stm32f091 stm32g474 nucleo board has pwm feature
This adds the pwm feature to the nucleo_f091rc and nucleo_l073rz
and change the pin for nucleo_g474re from STMicroelectronics.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-03-10 13:25:54 -05:00
Jose Alberto Meza
ee1653985d drivers: espi: xec: mec172x: Handle eSPI peripheral channel error
Handle eSPI periperal channel error to avoid continous interrupt
beyond the bus error.

Whenever an eSPI access causes an internal bus error,
PC_BUS_ERROR bit is set, it remains set until cleared by written
with an 1.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2022-03-10 13:25:13 -05:00
Benedikt Schmidt
ccd7ae2445 net: if: add default selection of first up interface
Add the default selection of the first interface which is up.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2022-03-10 13:24:03 -05:00
Andries Kruithof
0927b89540 Bluetooth: tests: Fixup conf to make sure new LLCP is selected
Selecting the new LLCP is a 'choice' in Kconfig, so setting
CONFIG_BT_Ll_SW_LLCP_LEGACY to 'n' does not select the new LLCP
Instead CONFIG_BT_LL_SW_LLCP needs to be set explicitly to 'y'

Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
2022-03-10 13:17:50 -05:00
Herman Berget
3fb7f24f1d Bluetooth: Host: Add missing BT_ATT_OPs to att_op_get_type()
BT_ATT_OP_READ_MULT_VL_REQ, BT_ATT_OP_READ_MULT_VL_RSP, and
BT_ATT_OP_NOTIFY_MULT were missing.

Because of this, multiple variable length reads did not time out.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2022-03-10 13:16:56 -05:00
Aleksandr Khromykh
660fa1b5ce tests: Bluetooth: Mesh: add heartbeat publication to bsim test
Extend the existing bsim Heartbeat test
to check the publication callback functionality.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2022-03-10 13:16:40 -05:00
Aleksandr Khromykh
8c9e8da82f Bluetooth: Mesh: add heartbeat publication callback
Heartbeat publication sent callback can be used
as a watch mechanism to determine whether
the mesh stack is still capable of sending messages or not.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2022-03-10 13:16:40 -05:00
Chen Peng1
8c069c365d cmake: save eh_frame section in output with CONFIG_EXCEPTIONS.
.eh_frame section should not be removed directly in the
hex format and bin format output, it should be based on
whether we need exception handler feature.

Signed-off-by: Chen Peng1 <peng1.chen@intel.com>
2022-03-10 13:13:03 -05:00
Flavio Ceolin
ac079fcba6 kernel: init: Simplify early rand get
There is an API to get an specific number of random bytes. There is
no need to re-implement this logic here.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2022-03-10 12:45:58 -05:00
Kai Vehmanen
ec7451b485 soc/intel_adsp: add support for Intel Jasper Lake
Add a variant of Intel cAVS2.0 used in Jasper Lake based
products.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-03-10 09:26:41 -06:00
Damian Krolik
a505148d2f scripts: enforce module name uniqueness
Although CMake scripts already support duplicated module
names, if two modules with the same name provide different
Kconfig files, then both files will be loaded leading to
potential conflicts.

Modify zephyr_module.py to enforce that all modules are
uniquely named so that it is possbile to override some of
the built-in modules using ZEPHYR_EXTRA_MODULES variable.

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
2022-03-10 09:47:58 -05:00
Tomislav Milkovic
7f365f46b8 drivers: clock_control: clock_stm32_ll_h7: Fix PLL3 PQR output init
Due to typo in macro name, PLL3P, PLL3Q and PLL3R outputs
are never enabled

Signed-off-by: Tomislav Milkovic <tomislav.milkovic95@gmail.com>
2022-03-10 09:44:52 -05:00
Herman Berget
0e5d438ee2 Bluetooth: Host: Add test for issue #42306
Checks that only CONFIG_BT_EATT_MAX EATT bearers get connected.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2022-03-10 13:26:46 +01:00
Herman Berget
6a23439b20 Bluetooth: Host: Fix check for number of ATT bearers
Fixes #42306

Attach bt_att_chan objects to bt_att when creating them so that the
check in att_chan_new() works. Use the flag ATT_CONNECTED to signal that
a channel is connected instead of attaching it.

The flag ATT_DISCONNECTED was not set anywhere and is replaced by
ATT_CONNECTED.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2022-03-10 13:26:46 +01:00
Herman Berget
5afa815e88 Bluetooth: Host: Remove unused function att_chan_is_connected()
gcc does not warn on unused static inline functions.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2022-03-10 13:26:46 +01:00
Dominik Ermel
8db0e5a42e kernel: Reduce strncpy in z_impl_k_thread_name_set by null char
No point to copy terminating NULL character to just overwrite it in
next line.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-03-10 10:12:48 +01:00
Enjia Mai
2b1bccde07 tests: testsuite: add emulating send IPI in X2APIC mode
We emulate the interrupt by sending the IPI to core itself by
the local APIC for x86 platfrom.

But in X2APIC mode, this no longer works. So we emulate the
interrupt the by writing the IA32_X2APIC_SELF_IPI MSR to send
IPI to the core itself via LOAPIC also. According to SDM vol.3
chapter 10.12.11.

Fixes #42108

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-03-09 14:55:26 -05:00
Tom Burdick
ad2799ed15 drivers: dma: nios2: const device driver config
Moves the nios2 msgdma driver device config struct to the device data
struct for mutable data. The config struct is expected to be const.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2022-03-09 14:13:02 -05:00
Tom Burdick
82449f6749 drivers: i2c: nios2: const driver config
Moves the nios2 msgdma driver device config struct to the device data
struct for mutable data. The config struct is expected to be const.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2022-03-09 14:13:02 -05:00
Enjia Mai
8300ffd302 samples: fix the metairq_dispatch sample sporadically failed on ehl_crb
The metairq sample sometimes failed due to stuck because it has a
potential race when recording the latencies. The previous solution
checks whether the stats.mirq greater than MAX_EVENT. But stats.mirq
might also have a race here. So we change to check the msg sequence,
its correctness ensured by the kernel's message queue.

And also remove the spinlock in previous fix because tests only use
1 CPU, no need to add this. It also improves the fix for #40889,
to prevent test failed sporadically on acrn_ehl_crb and ehl_crb.

Fix #42874.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-03-09 14:09:12 -05:00
Joakim Andersson
84d15bbe90 doc: tfm: Improve documentation of non-secure firmware image
Explain when the TF-M nonsecure firmware image is used.
Use non-secure consistently instead of nonsecure or ns.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2022-03-09 14:03:52 -05:00
Joakim Andersson
3191191943 doc: tfm: Document size report commands for TF-M and BL2 images
Add documentation with example commands for getting the RAM and ROM
reports for the secure firmware image (TF-M) and mcuboot (BL2).

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2022-03-09 14:03:52 -05:00
Joakim Andersson
6a2e297231 doc: Fix whitespace alignment in example report
Fix whitespace alignment in example report.
This shows up unaligned in the published documentation.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2022-03-09 14:03:52 -05:00
Joakim Andersson
5ee41d8b4e scripts: size_report: Add support for TF-M and BL2 image size reports
Add support for TF-M and BL2 image size reports.
This adds the following targets when TF-M or BL2 is enabled:
tfm_rom_report, tfm_ram_report, tfm_footprint
bl2_rom_report, bl2_ram_report, bl2_footprint

Example:
west build -t tfm_rom_report

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2022-03-09 14:03:52 -05:00
Lingao Meng
5b50133467 Bluetooth: Host: Reconstruct stream interface
Add `remaining_size` in struct ad_stream.

By calculating the actual space required instead of
using the maximum space.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2022-03-09 13:59:47 -05:00
Lingao Meng
5f2170f184 Bluetooth: Host: Optimize hci buf alloc by calc actually require size
By calculating the actual space required instead of using
the maximum space, for `hci_set_adv_ext_complete`.

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

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2022-03-09 13:59:47 -05:00
Andy Ross
672d0962c0 tests/kernel/schedule_api: Add TIMESLICE_PER_THREAD case
Simple coverage exerciser for the per-thread timeslice feature.  Added
as a(nother) new variant of the schedule_api test.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2022-03-09 13:49:44 -05:00
Andy Ross
3e696896bf kernel: Add "per thread" timeslice mechanism
Zephyr's timeslice implementation has always been somewhat primitive.
You get a global timeslice that applies broadly to the whole bottom of
the priority space, with no ability (beyond that one priority
threshold) to tune it to work on certain threads, etc...

This adds an (optionally configurable) API that allows timeslicing to
be controlled on a per-thread basis: any thread at any priority can be
set to timeslice, for a configurable per-thread slice time, and at the
end of its slice a callback can be provided that can take action.
This allows the application to implement things like responsiveness
heuristics, "fair" scheduling algorithms, etc... without requiring
that facility in the core kernel.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2022-03-09 13:49:44 -05:00
Andy Ross
24d4becac2 include/atomics: doc: Clarify memory barrier behavior
Zephyr is migrating into hardware where memory ordering is starting to
matter.  The existing gcc-based defaults have always been specifying
__ATOMIC_SEQ_CST, which is safe and correct.  And all the
arch-specific assembly we have currently are either safe or for
platforms where barriers aren't needed.

Discussion in #42831 made the case that it would be nice if we were to
formally promise this, and require it from future implementations.  So
let's do that.

Fixes: #42831

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2022-03-09 13:46:06 -05:00
Henrik Brix Andersen
e9c9caa80d net: remove unmaintained 6LoCAN implementation
Remove the unmaintained, experimental 6LoCAN (IPv6 over CAN bus)
implementation.

Fixes: #42559

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-03-09 18:07:31 +01:00
Jeremy Wood
2331b76b9b drivers: lis2dh: power management
* Add support for power management.

Signed-off-by: Jeremy Wood <jeremy@bcdevices.com>
2022-03-09 10:19:22 -06:00
Peng Fan
30d2c17fb8 board: arm64: imx8mm_evk: add a dummy file
Because we currently use RAM_CONSOLE for now, and there is actually
no device in the build, so there is twister build failure,
add a dummy file to avoid build failure.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2022-03-09 09:56:12 -06:00
Peng Fan
8bfdb6ad5e CODEOWNERS: update CODEOWNERS for i.MX8MM
Update CODEOWNERS for i.MX8MM

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2022-03-09 09:56:12 -06:00
Peng Fan
020c163445 board: arm64: imx8mm_evk: add jailhouse hypervisor inmate support
This is to let zephyr run in an inmate cell on top of Jailhouse
hypervisor.

The step as below:
jailhouse enable imx8mm.cell
ailhouse cell create imx8mm-zephyr.cell
jailhouse cell load 1 zephyr.bin -a 0x93c00000
jailhouse cell start 1

Currently we have not use loader to kick zephyr, later we will
use jailhouse loader to kick zephyr.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2022-03-09 09:56:12 -06:00
Peng Fan
132f21e836 board: arm64: add i.MX8MM EVK A53 board support
Add i.MX8MM EVK A53 board support.
Zephyr is kicked from NS-EL1 U-Boot.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2022-03-09 09:56:12 -06:00
Peng Fan
aa255db1c2 dts: arm64: nxp: add i.MX8MM A53 device tree
Add i.MX8MM A53 device tree

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2022-03-09 09:56:12 -06:00
Peng Fan
84081ffddc soc: arm64: nxp_imx: Add i.MX8M Mini SoC A53 support
Add minimal SoC support for the NXP i.MX8M Mini series Cortex-A53 Core.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2022-03-09 09:56:12 -06:00
Henrik Brix Andersen
9fe466f4b0 drivers: can: rcar: add statistics support
Add CAN controller statistics support to the Renesas R-Car CAN driver.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-03-09 09:51:05 -06:00
Gerard Marull-Paretas
25f7176749 sys: util: improve docs for MIN/MAX/CLAMP
Improve the documentation for the MIN/MAX/CLAMP macros.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-09 10:47:32 -05:00
Navin Sankar Velliangiri
f1a0389f76 boards: arm: Add LPCXPRESSO55S06 board definition
Add board definition for the NXP lpcxpresso55s06 development
board.

Signed-off-by: Navin Sankar Velliangiri <navin@linumiz.com>
2022-03-09 09:46:17 -06:00
Navin Sankar Velliangiri
90a11851ec soc: arm: nxp: add LPC55S06 support
Add initial support for the NXP LPC55S06.

Signed-off-by: Navin Sankar Velliangiri <navin@linumiz.com>
2022-03-09 09:46:17 -06:00
Erik Brockhoff
691175f026 maintainers: adding erbr-ot to bluetooth/controller
Adding Erik Brockhoff <erbr@oticon.com> to maintainers list

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-03-09 08:56:35 -06:00
Ederson de Souza
08fc86bd84 MAINTAINERS: Add myself as RISC-V collaborator
Add myself as collaborator for RISC-V architecture.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2022-03-09 09:42:50 -05:00
Gerard Marull-Paretas
034b705745 drivers: counter: native_posix: use tabs in Kconfig
Kconfig used spaces instead of tabs, leading to compliance failures.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-09 15:35:54 +01:00