Commit graph

52111 commits

Author SHA1 Message Date
Guennadi Liakhovetski
e027a54440 cavs: remove unused and dangerous definitions
uncache_to_cache(), cache_to_uncache() and is_uncached() macros
are currently unused in Zephyr, besides the former two are
dangerous because they add and subtract an offset instead of
masking and unmasking a bit, which can lead to wrong addresses
if applied repeatedly. Remove these macros for now, we can
re-add them later if needed in their fixed versions.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-05-07 12:44:34 -04:00
Guennadi Liakhovetski
d7a3752915 work: remove a statement with no effect
work_timeout() is a function, a statement like "(void)work_timeout;"
has no effect.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-05-07 12:44:34 -04:00
Guennadi Liakhovetski
faecc4c235 ipm: cavs: (cosmetic) fix indentation
Add a missing TAB.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-05-07 12:44:34 -04:00
Guennadi Liakhovetski
b592dc571e xtensa: cavs: all cAVS versions have to select ARCH_HAS_COHERENCE
Currently only cAVS 1.5 Kconfig selects ARCH_HAS_COHERENCE,
which is wrong. cAVS 1.8, 2.0 and 2.5 have to select it too.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-05-07 12:44:34 -04:00
Andrzej Puzdrowski
41dd425196 manifest: update MCUboot
- bootutil_public: allow to confirm padded image without
  copy-done flag
- Configure mimxrt106x_evk boards

fixes #34683

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-05-07 11:10:01 -05:00
Erwan Gouriou
da6727572d samples/boards/stm32: blinky: Limit execution on stm32 lptim enabled
Restrict sample execution in CI to boards that have
"st,stm32-lptim" enabled so we're sure it is a STM32 target.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-05-07 10:40:18 -05:00
Rodrigo Brochado
037f994ed2 drivers: flash: Add workaround for anomaly 122 on nrf52840
The energy consumption on nrf52840 is unnecessarily high when
CONFIG_NORDIC_QSPI_NOR is used due to Anomaly 122. The nrf_qspi_nor
driver is unitialize after QSPI usage and initialize before using
it again.

Semaphore objects are used to allow multiple threads exclusive access
and efficient usage.

The main assumption made was that all QSPI API is stateless, in the
sense that it is not required to store any peripheral state before
uninit. Also, the QSPI driver was supposed to be synchronous, except
for the erase operation, in which the nrf signals its start, instead of
its end. While the flash is performing the erase, an uninit followed
by an init doesn't work. For that reason, polling is done before
every uninit.

Tests were made with a simple LittleFS application in a custom board
using flash MX25R3235F and another with the LittleFS flash sample
using nrf52840 DK that has a MX25R6435F. Current consumption dropped
from 630 uA to ~10uA in both cases.

Signed-off-by: Rodrigo Brochado <git.rodrigobrochado@gmail.com>
2021-05-07 10:26:21 -05:00
Xavier Chapron
e845878870 drivers: i2c_nrfx_twi: Add recover when I2C transfer timeout
Previously to this commit, nothing was done to restore the bus to an
healthy level.
However, I2C devices sometimes needs help to recover from an aborted
transaction.
Therefore, we now add a call to nrfx_{twi, twim}_bus_recover().

Signed-off-by: Xavier Chapron <xavier.chapron@stimio.fr>
2021-05-07 10:24:41 -05:00
Kumar Gala
34d6e488a6 boards: native_posix: Add i2c & spi to supporte features
We have I2C & SPI controllers on native posix, so list them as
supported features in the board YAML.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-05-07 10:02:01 -05:00
Jukka Rissanen
bcdc762609 net: Use k_fifo instead of k_work in RX and TX processing
The k_work handler cannot manipulate the used k_work. This means
that it is not easy to cleanup the net_pkt because it contains
k_work in it. Because of this, use k_fifo instead between
RX thread and network driver, and between application and TX
thread.

A echo-server/client run with IPv4 and UDP gave following
results:

Using k_work
------------
TX traffic class statistics:
TC  Priority	Sent pkts	bytes	time
[0] BK (1)	21922		5543071	103 us	[0->41->26->34=101 us]
[1] BE (0)	0		0	-
RX traffic class statistics:
TC  Priority	Recv pkts	bytes	time
[0] BK (0)	0		0	-
[1] BE (0)	21925		6039151	97 us	[0->21->16->37->20=94 us]

Using k_fifo
------------
TX traffic class statistics:
TC  Priority	Sent pkts	bytes	time
[0] BK (1)	15079		3811118	94 us	[0->36->23->32=91 us]
[1] BE (0)	0		0	-
RX traffic class statistics:
TC  Priority	Recv pkts	bytes	time
[0] BK (1)	0		0	-
[1] BE (0)	15073		4150947	79 us	[0->17->12->32->14=75 us]

So using k_fifo gives about 10% better performance with same workload.

Fixes #34690

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-05-07 09:46:44 -05:00
Jukka Rissanen
2697275d23 net: ppp: Convert to use k_fifo instead of k_work
Following commits will remove k_work from net_pkt, so convert
PPP L2 to use k_fifo when sending PPP data.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-05-07 09:46:44 -05:00
Jukka Rissanen
0808ead6ff net: 6locan: Convert to use k_fifo instead of k_work
Following commits will remove k_work from net_pkt, so convert
6locan L2 to use k_fifo between application and TX thread, and
driver and RX error handler.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-05-07 09:46:44 -05:00
Anas Nashif
5343aed002 tests: fix testcase.yaml files
Puts all filter in common section and fix filters. Platforms in
integration_platforms must also be allowed first, otherwise the tests
will never run.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-05-07 09:39:08 -05:00
Krzysztof Chruscinski
41c8823250 tests: lib: cbprintf_package: Enable CONFIG_CBPRINTF_LIBC_SUBSTS
Enable option to use snprintfcb in the test.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-05-07 09:39:08 -05:00
Krzysztof Chruscinski
0bc3bee738 tests: lib: cbprintf_package: Add CBPRINTF_MUST_RUNTIME_PACKAGE test
Extended test to cover CBPRINTF_MUST_RUNTIME_PACKAGE macro.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-05-07 09:39:08 -05:00
Krzysztof Chruscinski
604c9ac231 tests: lib: cbprintf_package: Minor cleanup
Adding static to local functions. Using void * for %p argument
which often triggered compilation warning.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-05-07 09:39:08 -05:00
Krzysztof Chruscinski
9280b90939 tests: logging: log_msg2: Fix test on qemu_cortex_a53
Test was failing because of uninitialized variable and wrong
pointer being used (pointer to char).

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-05-07 09:39:08 -05:00
Krzysztof Chruscinski
fbabe70063 lib: os: cbprintf: Fixes for c++ and coverity
Fixes for C++ includes:
- avoid calling static inline template function in static
assert on certain platforms which consider it non const expression
- Add 0 to variable before calling C++ argument storing function
to promote a variable.

Fix for coverity:
- avoid using sizeof(n + 0) by using local variable (gcc extension)

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-05-07 09:39:08 -05:00
Kumar Gala
56d44705a0 ci: double number of worker for the day
Increase the number of works to help PR throughput as we get
close to code freeze.  Will revert this back after code freeze.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-05-07 09:18:19 -05:00
Hake Huang
ff4eb86903 net/virtual: test case need have random generator driver
add below to fitler out correct platforms
filter: CONFIG_ENTROPY_HAS_DRIVER

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2021-05-07 08:53:10 -05:00
U Divya
04b885d4e3 drivers: gpio: Fixed pin number check condition
Fixed check condition for GPIO pin number.
This check is done
before reading or writing value for the pin.

Verified on ehl_crb.

Signed-off-by: U Divya <u.divya@intel.com>
2021-05-07 09:45:50 -04:00
U Divya
86fa606a0c drivers: gpio: Add GPIO driver for Intel Elkhart Lake
Added support for GPIO driver for Intel Elkhart Lake
board.
The GPIO driver will support pin value read/write operations,
pin direction and interrupt configuration. ACPI enumeration
support and support for different GPIO communities is also
present.

Verified on ehl_crb.

Signed-off-by: U Divya <u.divya@intel.com>
2021-05-07 09:45:50 -04:00
U Divya
f6436a14d8 drivers: gpio: Generic GPIO driver for Intel SoC
Modified GPIO driver for Intel APL SoC to have a
generic driver for all Intel SoC.

Signed-off-by: U Divya <u.divya@intel.com>
2021-05-07 09:45:50 -04:00
Peter Bigot
c42eb823ce doc: kernel: interrupts: correct description of irq lock behavior
Contrary to the documentation giving a semaphore while an IRQ lock is
held does not release the lock and give control to another thread.
The release-lock behavior is observed only if the lock-holding thread
sleeps.

However the opportunity to reschedule will have been lost so it may be
necessary to explicitly yield to allow the higher-priority thread to
be serviced.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-05-07 09:28:13 -04:00
Tomasz Michalec
d83647dea6 drivers: adc: add ADC emulator
ADC emulator is designed to be used in tests on native_posix board. It
supports 1-16 bit resolution range and all GAINs from enum adc_gain.
Reference voltages and number of emulated channels are set through dts.
Using special API from drivers/adc/adc_emul.h it is possible to set
constant voltage value returned by given ADC channel or set custom
function which allows to simulate complex output.
Also reference voltages can be changed in runtime using the API.

The CL also includes:
- Add adc definitions of ADC emulator in
  tests/drivers/adc/adc_api/src/test_adc.c for supporting test suites.
- Add test for ADC emulator API in tests/drivers/adc/adc_emul/

Signed-off-by: Tomasz Michalec <tm@semihalf.com>
2021-05-07 15:27:37 +02:00
Vinayak Kariappa Chettimada
32d9b68944 Bluetooth: controller: Implement LE Set Host Feature Command
Added implementation of HCI LE Set Host Feature command.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-05-07 15:25:18 +02:00
Vinayak Kariappa Chettimada
ed59ceba62 Bluetooth: controller: Replace use if LL_FEAT with ll_feat_get()
Replace the use of LL_FEAT define with ll_feat_get() so that
feature set value can be updated at runtime with host
feature bit values.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-05-07 15:25:18 +02:00
Hake Huang
c1080f3ceb adc: adc dma driver
add dma support to adc driver
add HW trigger dma support
using new dma api to request dma channel

tested on frdm_k82f and frdm_k64f

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2021-05-07 08:23:49 -05:00
Hake Huang
d7edd375bd adc: add sim opt for adc hw trigger
add sim opt setting for adc hw trigger

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2021-05-07 08:23:49 -05:00
Hake Huang
c1a17cfd89 test: add adc_dma test application
add adc_dma test application
enable periodic_trigger flag for adc edma

enable for frdm_k64f and frdm_k82f

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2021-05-07 08:23:49 -05:00
Hake Huang
77f27ac158 test: update adc_api case to support frdm_k82f
add frdm_k82f adc settings

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2021-05-07 08:23:49 -05:00
Hake Huang
d4c0c95a1c adc: add adc edma support in frdm_k82f
adc edma and pit support in frdm_k82f

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2021-05-07 08:23:49 -05:00
Hake Huang
0062372af1 adc: add soc config for adc
update k8x series to support edma and pit

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2021-05-07 08:23:49 -05:00
Hake Huang
b336579cbb dts: add edma related in dts bindings
add dts bingings for dma usage
add dts support for adc with edma and hwtrigger
add a periodic_trigger feature to dts

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2021-05-07 08:23:49 -05:00
Emil Gydesen
8192623263 Bluetooth: Audio: BSIM test suite for VCS
Adds a Babblesim test suite for the volume control service
and client, that exercises the entire API and most of the
VCS functionality.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-05-07 15:02:41 +02:00
Emil Gydesen
82a32f5ca5 Bluetooth: Audio: Volume Control Service and client
This commit implements the volume control service (VCS) and
client, The implementation supports and uses the
Audio Input Control Service (AICS) and
Volume Offset Control Service (VOCS) secondary services.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-05-07 15:02:41 +02:00
Vinayak Kariappa Chettimada
a9e900dbfd Bluetooth: controller: Fix scheduling stall in BT_CTLR_LOW_LAT feature
Fix radio event scheduling stall when using BT_CTLR_LOW_LAT
feature.

Performing a Connection Update Procedure on an ACL
connection while simultaneously having continuous scanning
causes the ACL connection to drop in nRF51 series which uses
BT_CTLR_LOW_LAT by default.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-05-07 15:02:13 +02:00
MORGER Patrick
0e1d16bf03 drivers: sensors: smart-battery with SBS 1.1 compliant fuel gauge
Implementation of a SBS 1.1 compliant fuel gauge driver

Signed-off-by: MORGER Patrick <patrick.morger@leica-geosystems.com>
2021-05-07 07:55:23 -05:00
Krzysztof Chruscinski
4a382ae2ce tests: kernel: threads: no-multithreading: Add more platforms
Add more platforms (including non-emulators) on which test runs.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-05-07 14:40:27 +02:00
Krzysztof Chruscinski
22ae43f0a6 tests: arch: arm: arm_no_multithreading: Add physical platforms
Add 2 nordic boards on which no multithreading test is
passing.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-05-07 14:40:27 +02:00
Ioannis Glaropoulos
afb73942c1 doc: release: add note for new TF-M boards in v.2.6.0
Add a release note entry for the new Zephyr boards
supported in TF-M in Zephyr v.2.6.0.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-05-07 13:33:43 +02:00
Ioannis Glaropoulos
cc9431c41c doc: release notes: add Zephyr v2.6.0 release notes for TF-M
Add release note entries for TF-M.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-05-07 13:33:43 +02:00
Watson Zeng
01815af28e board: qemu_arc: skip trigger_fault_divide_zero test case
qemu arc has limited support for DIV/REM, no DIVZERO exception
throw, so we need to skip trigger_fault_divide_zero test case.

Signed-off-by: Watson Zeng <zhiwei@synopsys.com>
2021-05-07 13:15:13 +02:00
Watson Zeng
b2aab9f0e8 board: qemu_arc: disable test: tests/kernel/mem_protect/mem_protect
This test fails on qemu_arc_{em|hs} consistently,
due to bug in quem_arc, details:
https://github.com/foss-for-synopsys-dwc-arc-processors/qemu/issues/14.
To get clean results we need to disable this test until the
bug is fixed and fix gets propagated to new Zephyr-SDK.

Signed-off-by: Watson Zeng <zhiwei@synopsys.com>
2021-05-07 13:15:13 +02:00
Watson Zeng
e0af111d33 board: qemu_arc: fix cpu frequency to 10Mhz
we have set SYS_CLOCK_HW_CYCLES_PER_SEC to 10000000,
so we need to set cpu.freq_hz=10000000 too.

Signed-off-by: Watson Zeng <zhiwei@synopsys.com>
2021-05-07 13:15:13 +02:00
Watson Zeng
6a7982ff10 arc: qemu: enable MPU
Enable MPU for arc qemu.

Signed-off-by: Watson Zeng <zhiwei@synopsys.com>
2021-05-07 13:15:13 +02:00
Johann Fischer
85a9e04aa2 doc: release-notes-2.6: add note about USB HID class API change
Add release note about USB HID class API change.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-05-07 13:14:47 +02:00
Johann Fischer
8999c30cee usb: hid: remove get_protocol/set_protocol from USB HID class API
The USB HID class API offers the possibility to register callbacks
for Get/SetIdle, Get/SetProtocol to the application.
Rules for these callbacks are neither obvious nor documented.

This patch remove this possibility to register Get/SetProtocol
and Get/SetIdle callbacks for the following reasons:

The possibility to call unknown application code while processing
control requests should be avoided or reduced to a minimum.

The Get/SetProtocol callbacks are redundant and do not provide any
additional value since the way to inform the application
about the change of the protocol exists via the callback
hid_protocol_cb_t protocol_change.

The core provides implementation to handle Get/SetIdle requests and
on idle reports. If this is not suitable in any way then the application
should implement everything itself.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-05-07 13:14:47 +02:00
Asger Munk Nielsen
29006bd6fb Bluetooth: Controller: ISO adaptation layer
Improves error handling and makes ISO adaptation layer
independent of CIS.

Signed-off-by: Asger Munk Nielsen <asmk@oticon.com>
2021-05-07 13:14:31 +02:00
Dong Wang
7989302e6a interrupt_controller: ioapic: support more device power states
do nothing when enter or resume from DEVICE_PM_LOW_POWER_STATE

Signed-off-by: Dong Wang <dong.d.wang@intel.com>
2021-05-07 13:11:14 +02:00