Commit graph

54743 commits

Author SHA1 Message Date
Mulin Chao 47954a8955 MAINTAINERS: rename 'Nuvoton platform' to 'Nuvoton_NPCX Platform'.
This CL renames 'Nuvoton Platform' as 'Nuvoton_NPCX Platform' and
modifies the relevant files used by this platform. It also changes
status from 'orphaned' to 'maintained' since we do maintain npcx drivers
continuously.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2021-08-07 20:37:24 -04:00
Dino Li 91ba039381 riscv: linker: add support for FLASH_LOAD_OFFSET
This allows board to re-configure ROM_BASE address while building
firmware image.

For example, a board need to build two firmware images. And the images
are put into one flash and required to work independent:

config FLASH_LOAD_OFFSET
    default 0 if FIRST_IMAGE
    default 0x80000 if SECOND_IMAGE

Signed-off-by: Dino Li <Dino.Li@ite.com.tw>
2021-08-07 20:37:01 -04:00
Evgeniy Paltsev 7ca190c20f ARC: 64BIT: Kconfig increase stacks sizes for 64bit platforms
Increase default stacks sizes for 64bit platforms where it is
required.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
2021-08-07 20:36:23 -04:00
Evgeniy Paltsev 37a14c7e39 ARC: add nsim_hs6x_smp board with 2 cores ARCv3 HS6x
Add nsim_hs6x_smp simulation board (nSIM based) with
2 cores ARCv3 HS6x CPU.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
2021-08-07 20:36:23 -04:00
Evgeniy Paltsev 42da43bd72 ARC: reuse ARConnect header for ARCv3
ARCv3 has ARConnect implementation similar to ARCv2, so
use existing ARConnect header for ARCv3 as well.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
2021-08-07 20:36:23 -04:00
Evgeniy Paltsev 5ed232b62c ARC: ARCv3 64: adopt ARC SMP code for ARCv3 64 bit
Rewrite ARC SMP code with ASM-compat macros so it can be
used for ARCv3 64 bit.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
2021-08-07 20:36:23 -04:00
Yuval Peress 268f9bf163 nuvoton: battery-backed ram
Add bindings and entry for the battery-backed ram in the nuvoton
npcx. This commit is an upstream port of
https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/zephyr/dts/bindings/cros_bbram/nuvoton,npcx-cros-bbram.yaml;l=1;drc=e9af813c36b7b411bf2a01cbc1b09d5fdec49b8a

Along with a bit of cleaning up and an emulator.

Signed-off-by: Yuval Peress <peress@chromium.org>
2021-08-07 20:32:33 -04:00
Przemyslaw Bida 678a170925 net: openthread: Add capability to disable properly CSL.
This commit adds capability to disable CSL sampling by setting
CSL period to 0.

Signed-off-by: Przemyslaw Bida <przemyslaw.bida@nordicsemi.no>
2021-08-07 20:27:25 -04:00
Fabio Baltieri ef93bbad57 linker: add an initialized DATA_SECTIONS linker location option
Current location options for linker source files includes init and
noinit ram data, but only a noinit ram section. This makes it impossible
for application code to define an initialized RAM output section,
such as with the Z_ITERABLE_SECTION_RAM() helpers.

Adding a DATA_SECTIONS linker source option for this use case.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2021-08-07 20:26:41 -04:00
Scott Worley 114b84a58b Microchip: XEC GPIO driver interrupt enable fix part 2
Fixes issue 34879
This PR updates previous PR's 37138 and 37139.
Refer to issue 34879 for information from MCHP HW
designers. A delay after enabling interrupts is a
more appropriate work-around than depending upon
behavior of ARM DMB instruction.

Signed-off-by: Scott Worley <scott.worley@microchip.com>
2021-08-07 20:24:37 -04:00
Martí Bolívar d1eee6a966 linker: rename DT_REGION_FROM_NODE_STATUS_OKAY
The main motivation is to avoid polluting the all-caps "DT_"
namespace, which within zephyr belongs to devicetree.h.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-07 20:24:13 -04:00
Ramesh Babu B d40d963bef net: fix for assert on enabling socket CAN
Socket CAN does not require interface link address to be
assigned, check is not applicable for socket CAN
interfaces. As this address is NULL for socket CAN interface
it results in assertion.

Signed-off-by: Ramesh Babu B <ramesh.babu.b@intel.com>
2021-08-07 20:10:48 -04:00
Gerard Marull-Paretas 8b0d3450a0 pm: device: use z_device_get_all_static
Use the internal function z_device_get_all_static helper function
instead of using __device_start and __device_end directly. Some other
minor adjustments have been done (e.g. reduce *dev scope to the for
loop). An issue on the range of the for loop in _pm_devices has also
been fixed.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-08-07 19:59:48 -04:00
Gerard Marull-Paretas 7e7b222d84 pm: device: simplify suspend checks
The shared _pm_devices function used should_suspend check function to
see if a device had to be suspended or not. Some of the logic inside
that function was redundant since the pm_device_state_set function
already performs similar checks, e.g. if the device is already at the
given state or the state transition is not supported it will return
error codes appropriately.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-08-07 19:59:48 -04:00
Gerard Marull-Paretas f93778f2d2 pm: device: do not allow suspending a turned off device
A device that is turned off should not be suspended. A device that has
been turned off can only be resumed. This action is currently forbidden
by the "should_suspend" function in the device PM code.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-08-07 19:59:48 -04:00
Felipe Neves 4a0b5ce277 soc: riscv: esp32c3: fix ble controller init
By appending the right link layer controller configurarion

Signed-off-by: Felipe Neves <felipe.neves@espressif.com>
2021-08-07 19:59:27 -04:00
Felipe Neves 2a5c37829d soc: riscv: esp32c3: make use of atomic in C
esp32c3 SoC is an rv32imc, so it does not support the atomic builtin.

Since it relies in atomic instructions.

Signed-off-by: Felipe Neves <felipe.neves@espressif.com>
2021-08-07 19:59:27 -04:00
Felipe Neves 2474c9b3f3 soc: riscv: esp32c3: added initial support for ble
subsystem by linking esp32 vhci adapter to the
espressif ble controller adapter

Signed-off-by: Felipe Neves <felipe.neves@espressif.com>
2021-08-07 19:59:27 -04:00
Gerson Fernando Budke 7163473d66 boards: atmel soc: Remove non-minimal peripherals from defconfig
Some boards, e.g. atsamd20_xpro, enable non-minimal peripherals by
default like SPI.  This goes against board porting guidelines, as it
enables a peripheral that is not necessarily used by all samples,
as discussed at #30694.  This removes SPI as a default peripheral
for all sam/sam0 boards.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2021-08-06 21:21:52 -04:00
David Leach 569a1a0a5d soc: arm: nxp_imx: rt: Configure settings for TRNG IP
RT platforms that support TRNG IP (rt10xx and rt6xx) need to set
RNG and CSRNG to Xoroshiro and CTR_DRBG respectively instead of
using TRNG as random source.

Fixes: #37307

Signed-off-by: David Leach <david.leach@nxp.com>
2021-08-06 20:29:59 -04:00
Enjia Mai ee327803e3 tests: common: skip arch_nop testing on some physical x86 board
Using the NOP instructions to do timing control on some physical board
such as ehl_crb, up_squared and intel adsp board, that doesn't work.
It seems like it can only be used for instruction alignment purposes.
We skip this test on this board because it's not meaningful.

Fixes #35971

Signed-off-by: Enjia Mai <enjiax.mai@intel.com>
2021-08-06 20:20:32 -04:00
Emil Lindqvist dab4616e45 net: socket: fix regression causing corrupted poll timeout
k_timeout_t was converted to ticks using a nonsense function
causing poll timeout corruption for offloaded sockets; this
commit uses ticks directly from the struct instead.

Fixes #37472

Signed-off-by: Emil Lindqvist <emil@lindq.gr>
2021-08-06 19:20:48 -04:00
Emil Lindqvist f9023d2c41 net: sockets: dtls: reset mbedtls session on timed out handshake
According to MbedTLS API documentation, its session must be
reset if mbedtls_ssl_handshake returns timeout error. This
commit resets the session for said return value, and that
allows us to call send() multiple times even if handshake
times out for previous calls.

Fixes #35711

Signed-off-by: Emil Lindqvist <emil@lindq.gr>
2021-08-06 19:19:26 -04:00
Andrzej Głąbek bff5d03581 boards: nrf: Enable pull-ups on UART pins in Nordic DKs
This is a follow-up to commit 3656ba5ae9.

Enable pull-up resistors on UART pins RXD and CTS in Nordic DK boards
where it is possible that these pins are not connected to anything on
the board and could generate problems if left floating (on some DKs
also the Interface MCU can be disconnected with the switch "nRF only",
hence pull-ups enabled also on uart0 for them).
Those pull-ups can still be disabled (by deleting the added properties)
if necessary to use a given board in some specific hardware setup.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2021-08-06 19:17:26 -04:00
Andrzej Głąbek 3842babc79 drivers: serial: nrf: Make pull-ups on UART pins configurable
This is a follow-up to commit 3656ba5ae9.

Do not enforce pull-up resistors to be enabled on RXD and CTS pins
in nRF UART drivers, as in certain hardware designs this may be
undesirable or may even make certain hardware not working.
Instead, provide devicetree properties that allow enabling of those
resistors when it is actually needed.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2021-08-06 19:17:26 -04:00
Martí Bolívar fd73eb8b60 doc: dts: macros.bnf: add docs for new for-each macros
Document the new DT_FOREACH_OKAY_INST_<compat> and
DT_FOREACH_OKAY_INST_VARGS_<compat> macros that are generated by
gen_defines.py and explain how they are used in devicetree.h.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-06 12:24:57 -05:00
Martí Bolívar 9bd8534040 doc: dts: macros.bnf: fix a comment
This is referring to the wrong macro.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-06 12:24:57 -05:00
Martí Bolívar 56da140791 devicetree: add new for-each macros
Add two new for-each macros:

- DT_FOREACH_STATUS_OKAY(compat, fn)
- DT_FOREACH_STATUS_OKAY_VARGS(compat, fn, ...)

These can be used to expand "fn" once for every status "okay" node in
the devicetree which has a given compatible. The intended use case is
to allow doing something in C once for each node of a compatible,
but outside of a device driver.

E.g. an application might want to collect an array of structures for a
compatible, where each structure is initialized from a node.

In such cases we don't want people to be forced into using
DT_DRV_COMPAT and instance numbers, because that's in general a hint
that you're doing something driver-like.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-06 12:24:57 -05:00
Martí Bolívar e7d42ff879 dts: gen_defines: emit more for-each helpers
Add some helper macros that work similarly to the
'DT_FOREACH_OKAY_INST_<compat>(fn)' macros, except they give 'fn'
node identifiers in their expansion instead of instance numbers.

This makes it possible to add for-each APIs to devicetree.h that work
on an arbitrary compatible, not just DT_DRV_COMPAT.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-06 12:24:57 -05:00
Martí Bolívar 1c4aa60229 tests: devicetree: refactor some for-each tests
Split the generic tests for DT_INST_FOREACH_STATUS_OKAY() out of the
function which tests it as applied to device instantiation.

This is just moving code around as prep work for expanding on the set
of macros which are in for-each-node style.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-06 12:24:57 -05:00
Evgeniy Paltsev 1ffd1ea8fd test: lib/cbprintf_fp: fix test filtering
The commit
6fe9e408ab (tests/cbprintf_fp: Filter on CONSOLE_HAS_DRIVER)
added filtering on Kconfig symbol incorrectly - it checked
CONSOLE_HAS_DRIVER instead CONFIG_CONSOLE_HAS_DRIVER so
this test was filtered out (and therefore skipped) on all
platforms.

Fix that.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
2021-08-06 08:00:54 -05:00
Jamie McCrae 46d6b8f528 boards: arm: pinnacle_100_dvk: Update clock error
The 32KHz crystal used is a tuning fork crystal which can have a larger
clock drift over temperature than an AT cut crystal, therefore the LFXO
clock source error rate needs updating to account for this possible
drift over temperature.

Signed-off-by: Jamie McCrae <jamie.mccrae@lairdconnect.com>
2021-08-06 07:57:28 -05:00
Jamie McCrae e09b700df0 boards: arm: bt6x0: Update clock error
The 32KHz crystal used is a tuning fork crystal which can have a larger
clock drift over temperature than an AT cut crystal, therefore the LFXO
clock source error rate needs updating to account for this possible
drift over temperature.

Signed-off-by: Jamie McCrae <jamie.mccrae@lairdconnect.com>
2021-08-06 07:57:28 -05:00
Jamie McCrae adedf635a0 boards: arm: bt510: Update clock error
The 32KHz crystal used is a tuning fork crystal which can have a larger
clock drift over temperature than an AT cut crystal, therefore the LFXO
clock source error rate needs updating to account for this possible
drift over temperature.

Signed-off-by: Jamie McCrae <jamie.mccrae@lairdconnect.com>
2021-08-06 07:57:28 -05:00
Jamie McCrae 6922ff6ae5 boards: arm: bl654_sensor_board: Update clock error
The 32KHz crystal used is a tuning fork crystal which can have a larger
clock drift over temperature than an AT cut crystal, therefore the LFXO
clock source error rate needs updating to account for this possible
drift over temperature.

Signed-off-by: Jamie McCrae <jamie.mccrae@lairdconnect.com>
2021-08-06 07:57:28 -05:00
Jamie McCrae 89ec5d30ca boards: arm: bl5340_dvk: Update clock error
The 32KHz crystal used is a tuning fork crystal which can have a larger
clock drift over temperature than an AT cut crystal, therefore the LFXO
clock source error rate needs updating to account for this possible
drift over temperature.

Signed-off-by: Jamie McCrae <jamie.mccrae@lairdconnect.com>
2021-08-06 07:57:28 -05:00
Emil Gydesen 57fc354f6c Bluetooth: ISO: Fix iso channels not disconnecting properly
We had added a break in a switch statement that stopped
ISO channels from setting the BT_CONN_CLEANUP flag
which in turn stopped them from disconnecting (in the
eyes of the upper layers) properly.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-08-05 15:08:06 -04:00
Emil Gydesen b1f4764f4f Bluetooth: ISO: Add clearer error message on iso accept failure
Instead of just writing "err" we make it clear that it is
the ISO server that failed to accept.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-08-05 15:08:06 -04:00
Emil Gydesen 7f3a085a7a Bluetooth: shell: ISO change to use shell_print instead of printk
shell_print is preffered for the shell as printk may appear
in a different terminal.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-08-05 15:08:06 -04:00
Lingao Meng ce40fa434f tester: bluetooth: gatt: fix null pointer case CASE failed
GATT/SR/GAD/BV-03-C will read attr value, but we parse NULL
from `attr->read` which point to `attr_read` function.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-08-05 17:34:57 +02:00
Jan Pohanka 1df0569001 drivers: ethernet: eth_stm32_hal.c: add wait time for buffer allocation
Driver's RX thread can wait some time before a free buffer is available.
When resources are limited we can easily run out of them.

Fixes #36891.

Signed-off-by: Jan Pohanka <xhpohanka@gmail.com>
2021-08-05 11:32:42 -04:00
Krzysztof Chruscinski f923779e4d tests: drivers: counter: Extend basic api test with ZLI support
Modified test to handle case when counter handlers are called in
ZLI interrupt context where kernel primitives cannot be used. In
that case volatile counters are used to track number of handlers
calls.

Added configuration for nrf52840dk board where zli feature is enabled
for all counters.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-08-05 16:17:23 +02:00
Krzysztof Chruscinski 0419ff72aa drivers: counter: nrfx_timer: Add option to use ZLI interrupt
Extended driver configuration in device tree to enable ZLI interrupt.
When zli is set in the device tree then event handlers for alarm and
top is called in ZLI interrupt context. It means that kernel primitives
cannot be used there.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-08-05 16:17:23 +02:00
Krzysztof Chruscinski 53333d58bf drivers: counter: nrfx_rtc: Add option to use ZLI interrupt
Extended driver configuration in device tree to enable ZLI interrupt.
When zli is set in the device tree then event handlers for alarm and
top is called in ZLI interrupt context. It means that kernel primitives
cannot be used there.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-08-05 16:17:23 +02:00
Martí Bolívar 0dbe619f74 net/socket_select.h: add missing include
Macros such as __syscall must be defined before use.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-05 16:14:36 +02:00
Lukasz Maciejonczyk 53531a7682 openthread: implement missing time service functionality
Add missing otPlatTimeGet implementation which is needed for proper
calculation the time offset in host-RCP communication.

Signed-off-by: Lukasz Maciejonczyk <lukasz.maciejonczyk@nordicsemi.no>
2021-08-05 16:14:24 +02:00
Martí Bolívar 6fe3c30af7 scripts: check_compliance: fix filter_py edge case
The filter_py() function is handed a bunch of file names and is
expected to give back just the python files.

Its input is the output from a 'git diff' command which normally when
used in the vanilla zephyr repository just prints regular files.

In situations where we're checking compliance on a repository with
submodules, however, filter_py() can be given directories in the
'fnames' list from the git output.

In the interests of being defensive and sharing infrastructure, just
handle this case in filter_py().

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-05 16:14:12 +02:00
Jordan Yates 3e6598e7d9 gpio: fixup doxygen on _dt functions
Fixup the doxygen comments for return values on `_dt` functions.
@retval should only be used when specifying actual return values,
@return is more general and can refer to other functions.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-08-05 16:13:54 +02:00
Johann Fischer 5a35745b44 usb: fix SetInterface handling for interfaces without any endpoints
With the last changes in USB device stack it was unfortunately
not considered that an interface can have no endpoints.
This caused the USB DFU class to stop working in DFU mode.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-05 16:13:10 +02:00
Yuriy Vynnychek 84db9cd36a drivers: pwm: introduce new Telink B91 PWM driver
PWM driver basic support for Telink B91 SoC.

Signed-off-by: Yuriy Vynnychek <yura.vynnychek@telink-semi.com>
2021-08-05 16:11:41 +02:00