Commit graph

41120 commits

Author SHA1 Message Date
Flavio Ceolin
3bdf426707 testsuite: Ifdef an include
shell.h must be included only if CONFIG_SHELL is
defined, otherwise this will pull unused code.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2020-01-29 16:59:10 -05:00
Flavio Ceolin
fdae5305f4 tests: logging: Add missing header
This test was not include log header that is being used.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2020-01-29 16:59:10 -05:00
Anas Nashif
7605ac2c4c kernel: thread: fix string for _THREAD_PRESTART
_THREAD_PRESTART means the thread was not started yet and is being
setup, for example this is the case when starting a thread with a
timeout. We do not have a 'restart' thread state.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-01-29 13:17:19 -08:00
Erwan Gouriou
dbd054fbd3 drivers/flash: stm32: Fix faulty register access
Merge of conflicting PRs lead to compilation issue.
Fix this.

Fixes #22297

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-01-29 15:14:22 -06:00
Henrik Brix Andersen
be3cb485eb soc: arm: nxp: kinetis: disable watchdog init if bootloader is enabled
Disable the early watchdog initialization for the NXP Kinetis series
if the application is to be chain-loaded by mcuboot.

The early watchdog initialization must only take place once and needs
to happen within a SoC specific number of CPU clock cycles after
reset.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-01-29 15:12:24 -06:00
Henrik Brix Andersen
282d85c3f4 soc: arm: nxp: kinetis: unify CONFIG_WDOG_INIT Kconfig option
Move CONFIG_WDOG_INIT for the NXP Kinetis series to the top-level
Kinetis Kconfig file and enable it where needed.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-01-29 15:12:24 -06:00
Henrik Brix Andersen
9523f792da soc: nxp: kinetis: kw4xz: move watchdog init to z_arm_watchdog_init
Move the NXP Kinetis KW4xZ watchdog initialization code to
z_arm_watchdog_init() and make it optional based on CONFIG_WDOG_INIT.

This brings the KW4xZ in line with the other NXP Kinetis series SoC
implementations.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-01-29 15:12:24 -06:00
Henrik Brix Andersen
f9f7379549 soc: nxp: kinetis: kl2x: move watchdog init to z_arm_watchdog_init
Move the NXP Kinetis KL2x watchdog initialization code to
z_arm_watchdog_init() and make it optional based on
CONFIG_WDOG_INIT.

This brings the KL2x in line with the other NXP Kinetis series SoC
implementations.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-01-29 15:12:24 -06:00
Mieszko Mierunski
971c27af0d drivers: sam: UART async API change timeout to signed value.
Change timeout to signed value.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2020-01-29 19:37:31 +01:00
Mieszko Mierunski
3fff2e7291 tests: uart: Add forever timeout test for UART Async API.
Check for proper driver behaviour if timeout for uart_rx_enable or
uart_tx is set to K_FOREVER.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2020-01-29 19:37:31 +01:00
Mieszko Mierunski
20444869e3 drivers: nrf: Fix forever timeout handling in UART async API.
Current implementation directly passes timeout value to workqueue/timer
which results in assertion or instant timeout in case when K_FOREVER is
passed. This fix ensures that no timer or workqueue is called with
K_FOREVER.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2020-01-29 19:37:31 +01:00
Mieszko Mierunski
dc3c906d12 drivers: uart: Switch timeout values to s32_t in UART async API
Use signed values for timeout in UART asynchronous API, to be consistent
with timeout type in timer and workqueue values.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2020-01-29 19:37:31 +01:00
Kumar Gala
6317c82f06 toolchain: Have Kconfig NEWLIB_LIBC_NANO depend on toolchain support
Introduce HAS_NEWLIB_LIBC_NANO Kconfig option that the toolchain
specific Kconfig (gnuarmemb & zephyr 0.11) can select to convey that the
feature is supported.

This removes the need to if protect the NEWLIB_LIBC_NANO Kconfig with:

    if "$(ZEPHYR_TOOLCHAIN_VARIANT)" = "gnuarmemb"

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-01-29 12:22:31 -06:00
Kumar Gala
2630fbaa75 cmake: Introduce optional Kconfig for toolchains
Allow a given toolchain to specify Kconfig options that might be
relevant to a feature available in that toolchain.

For example, the ARM embedded GNU toolchain supports two variants of
newlib and you select the smaller one via a spec file.  We can use a
Kconfig option like HAS_NEWLIB_LIBC_NANO to convey that this feature is
supported by that toolchain.

We look for the toolchain Kconfig in ${TOOLCHAIN_KCONFIG_DIR}/Kconfig,
and default TOOLCHAIN_KCONFIG_DIR to:

${TOOLCHAIN_ROOT}/cmake/toolchain/${ZEPHYR_TOOLCHAIN_VARIANT})

toolchain specific cmake files can override the default if needed.

Additionally tweaked the zephyr/generic.cmake to use
${CMAKE_CURRENT_LIST_DIR} to reduce some duplication.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-01-29 12:22:31 -06:00
Krzysztof Chruscinski
dcdc61cfdb drivers: serial: nrf_uarte: Allow TX only instance
Extended nrf_uarte driver to support TX only UARTE instances.
When RX pin is not provided then RX is not started at all. This
allows to achieve low power with logging/console enabled.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-01-29 12:03:05 -06:00
Sebastian Bøe
fdac7b3319 cmake: Add target for generating header files
Before C sources can be compiled any generated header that they
include must be generated. Currently, the target 'offsets_h' happens
to depend directly or indirectly on all generated headers.

This means that to compile safely, one can simply depend on
'offsets_h'. But this is coincidental and might not be true in the
future.

To be able to safely depend on a target that represents all generated
headers being ready we introduce the target
'zephyr_generated_headers'.

Any third-party build scripts can now safely depend on
'zephyr_generated_headers' and be protected from any internal changes
to the build system, like the removal of offsets_h.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2020-01-29 11:44:57 -06:00
Krzysztof Chruscinski
e0dcf56567 logging: Fix forcing printk processing with RTT
Printk should be processed by the logger if RTT logger backend is
used and RTT console. It is not necessary if console has different
transport.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-01-29 09:24:10 -08:00
Kwon Tae-young
353fc8aac7 boards: nucleo_l152re: Enable IWDG
Enable the independent watchdog on the nucleo_l152re

Signed-off-by: Kwon Tae-young <tykwon@m2i.co.kr>
2020-01-29 11:20:57 -06:00
Kwon Tae-young
271bd8bcea soc: stm32l1: Add support for STM32 IWDG
The driver for STM32's independent watchdog already exists and is
compatible with the stm32l1 SoC. Enable the independent watchdog
for the stm32l1 series for use with this driver.

Signed-off-by: Kwon Tae-young <tykwon@m2i.co.kr>
2020-01-29 11:20:57 -06:00
Johan Hedberg
637582dfae Bluetooth: Mesh: Fix provisioning buffer initialization
When PB-GATT support has been enabled the provisioning code "borrows"
the buffer from the proxy code. However, the way that initialization
was happening the proxy buffers were initialized only after
provisioning initialization, resulting in a corrupted buffer with
buf->data pointing to NULL. Reorder the initialization calls so that
proxy is done first and provisioning only after it.

Fixes #22207

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2020-01-29 18:59:40 +02:00
Ulf Magnusson
88db84b89b dts: edtlib: Turn Node.instance_no into EDT.compat2enabled
Add an EDT.compat2enabled attribute that maps compatibles to enabled
devicetree nodes that implement them. For example,
EDT.compat2enabled["foo"] is a list of all enabled nodes with "foo" in
the 'compatible' property.

The old Node.instance_no functionality can be implemented in terms of
EDT.compat2enabled, so remove Node.instance_no. EDT.compat2enabled is
more flexible and easier to understand.

Simplify main() in gen_defines.py by using EDT.compat2enabled to
generate the DT_COMPAT_<compatible> existence macros. The behavior is
slightly different now, as DT_COMPAT_<compatible> is generated for
enabled nodes that don't have a binding as well, but that might be an
improvement overall. It probably doesn't hurt at least.

EDT.compat2enabled simplifies the implementation of the new
$(dt_compat_get_str) preprocessor function in
https://github.com/zephyrproject-rtos/zephyr/pull/21560. That was the
original motivation.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-29 09:46:38 -06:00
Ulf Magnusson
1b394ad153 soc: ti_simplelink: kconfig: Refactor CCFG flash block handling
Instead of having TI_CCFG_PRESENT as a symbol that's only defined in
soc/arm/ti_simplelink/cc13x2_cc26x2/Kconfig.defconfig.series and y when
SOC_SERIES_CC13X2_CC26X2 is enabled, turn it into a helper symbol that's
selected by SOC_SERIES_CC13X2_CC26X2.

This avoids having a symbol that's only defined in a Kconfig.defconfig
file, which is confusing. It also makes things a bit more generic, in
case other boards with CCFGs are added.

Also rename it to HAS_TI_CCFG to be consistent with other helper
symbols, and add a help text.

Flagged by scripts/kconfig/lint.py.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-29 09:41:46 -06:00
Krzysztof Chruscinski
510102dd71 soc: arm: nordic_nrf: nrf52: Add workaround for anomaly 132
Added delay before starting low frequency clock for the first time to
ensure that anomaly conditions are not met. Delay is configurable and
might be disabled.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-01-29 15:38:55 +01:00
Vinayak Kariappa Chettimada
0ee81aab9a Bluetooth: controller: Clean up nrf cmake include
Clean up the nRF cmake include file to remove redundant
check for BT_LLL_VENDOR_NORDIC inside the file.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-01-29 15:27:24 +01:00
Peter A. Bigot
046bae60b6 samples: drivers: spi_flash: switch nrf52840_pca10056 to Nordic QSPI
Adjust the configuration file, disable the SPI
driver and enable the QSPI driver and flash node.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Signed-off-by: Kamil Lazowski <Kamil.Lazowski@nordicsemi.no>
2020-01-29 15:15:49 +01:00
Kamil Lazowski
5b4f4253c1 drivers: flash: add Nordic JEDEC QSPI NOR flash driver
Most JEDEC NOR flash devices uses not only typical SPI mode
(MISO,MOSI,SCK and CS), but also QSPI mode (IO0,IO1,IO2,IO3,SCK and CS).
QSPI mode uses more data lines and as a result provide higher
throughput. If this were not enough, Nordic chips provide
hardware acceleration for read/write/erase functions, what
gives significant performance boost.
It does a lot of things "behind the scene", i.e when user has written
some data to the flash and would like to read them back, it has to wait
until the flash is ready by reading WIP bit in Status Register.
This driver does it automatically.

Signed-off-by: Kamil Lazowski <Kamil.Lazowski@nordicsemi.no>
2020-01-29 15:15:49 +01:00
Peter Bigot
240a57a6f2 samples: littlefs: correct to use SPI NOR flash memory on nrf52840_pca10056
A configuration file attempted to select the external flash memory for
this platform, but there was no overlay that redefined the storage
partition to be on that device rather than the SOC flash.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-29 15:15:49 +01:00
Andrzej Głąbek
01648cc099 Revert "soc: nrf5340: Fix busy waiting on nRF5340 application core"
This reverts commit 49bd19f3f2,
as the patch it contains is no longer needed after nrfx is updated
to version 2.1.0.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2020-01-29 15:00:45 +01:00
Andrzej Głąbek
7899b1f5b6 modules: hal_nordic: Update nrfx to version 2.1.0
Update the hal_nordic module revision, to switch to nrfx 2.1.0.

Because the list of peripherals for nRF5340 has changed as follows:
- SPIM2 has been renamed to SPIM4
- SPIM2-3, SPIS2-3, TWIM2-3, TWIS2-3, and UARTE2-3 have been added
a couple of related corrections needed to be applied in dts and Kconfig
files, plus the spi_nrfx_spim driver has been extended with the support
for SPIM4.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2020-01-29 15:00:45 +01:00
Andrzej Puzdrowski
d852159c27 doc/release: nrf flash driver change record
Added record for describing change of write-block-size
to 32-bits introduced by #19720.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-01-29 14:43:05 +01:00
Peter A. Bigot
1964bf08bb lib: os: onoff: add API for on-off service request and release management
There are various situations where it's necessary to support turning
devices on or off at runtime, includin power rails, clocks, other
peripherals, and binary device power management.  The complexity of
properly managing multiple consumers of a device in a multithreaded
system suggests that a shared implementation is desirable.  This
commit provides an API that supports managing on-off resources.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-01-29 14:08:46 +01:00
Alexander Wachter
cd2ff16a50 net: icmpv6: fix add own IP addr to nbr cache
This commit fixes a problem where our own IP address
is added to the cache instead of the senders.
This bug was due to a swap of the address in the original packet.
The swapping of the address is now removed.

Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
2020-01-29 11:39:50 +02:00
Henrik Brix Andersen
cb9614fca0 boards: arm: efm32wg_stk3800: add jlink flash runner support
Add support for flashing via the Segger J-Link OB.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-01-29 10:11:02 +01:00
Henrik Brix Andersen
58ce46ef62 boards: stm32f3_disco: enable canbus
Enable CAN1 canbus controller in the ST STM32F3 Disco development
board.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-01-29 09:47:27 +01:00
Henrik Brix Andersen
0b15a836a5 drivers: pinmux: stm32f3: add CAN_1 pins
Add pinmux definitions for CAN_1 RX/TX pins on PD0/PD1.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-01-29 09:47:27 +01:00
Henrik Brix Andersen
5a82424767 dts: arm: stm32f3: add can controller
Add the CAN controller device tree node for CAN_1 of the STM32F3 SoC
series.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-01-29 09:47:27 +01:00
Gerson Fernando Budke
268f65d221 drivers: ieee802154: rf2xx: Add missing handle_ack call
The rf2xx driver is doing automatic retransmissions in hardware based
on whether ACKs are received or not. Currently the driver is not
invoking ieee802154_radio_handle_ack() as other drivers are doing and
required by OpenThread since 4fe1da9. This add rf2xx_handle_ack method
to ensures required ACK processing when driver performs TX.

Fixes: #21763

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-01-29 09:01:53 +02:00
Krzysztof Chruscinski
7e7a4426d8 tests: drivers: counter: counter_basic_api: Fix teardown function
Teardown may fail due to not supported setting of top_value.
Modified to accept not supported case.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-01-28 18:20:15 -05:00
Tomasz Bursztyka
0ec6f4e257 CODEOWNERS: Adding owner on DW DMA driver
Just to make CI happy.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-01-28 18:18:18 -05:00
Tomasz Bursztyka
fb76ddfda3 soc/xtensa: Removing useless USB definitions for Intel s1000
These information are now provided through DTS.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-01-28 18:18:18 -05:00
Tomasz Bursztyka
b8e14b5b9d drivers/usb: Switching to DTS based configuration for DW driver
And applying the changes to intel_s1000_crb board as well.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-01-28 18:18:18 -05:00
Tomasz Bursztyka
1925b501a8 soc/xtensa: Configuring the DW USB DT aliases in Intel s1000
These aliases will be used by the DW driver.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-01-28 18:18:18 -05:00
Tomasz Bursztyka
1d679156f8 dts/xtensa: Adding USB node to Intel s1000
The SoS provides one instance of the DW controller.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-01-28 18:18:18 -05:00
Tomasz Bursztyka
c7cf2bc5f0 dts/bindings: Adding DesignWare USB node description
Corresponding driver will be configured via DTS.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-01-28 18:18:18 -05:00
Tomasz Bursztyka
2161c91f0b drivers/usb: Fixing style issues in DW driver
Lots of style mess in this driver:
- 80 chars limit not followed
- variable allocation and if condition on it should be coalesced
- etc...

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-01-28 18:18:18 -05:00
Tomasz Bursztyka
c82e629fd3 soc/xtensa: Removing useless DMA definitions for intel s1000
These information are now provided through DTS.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-01-28 18:18:18 -05:00
Tomasz Bursztyka
8d10e66371 drivers/interrupt-controller: Make irqs DT configured in DW
DesignWare driver can manage different amount of irqs so let's make it
configurable via DTS.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-01-28 18:18:18 -05:00
Tomasz Bursztyka
251141567f drivers/interrupt_controller: No need for runtime base address in DW
Base address does not change at runtime, thus storing it directly into
device's config.

Also keeping it consistent in naming: s/port/dev

And no need to store irq_num as it is unused.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-01-28 18:18:18 -05:00
Tomasz Bursztyka
4b94668f5b drivers/interrupt_controller: Normalize DT aliases consitently for DW
DT_<domain>_DW_<num>_<option> as for SPI, GPIO, DMA etc...

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-01-28 18:18:18 -05:00
Tomasz Bursztyka
82ecefc11c drivers/gpio: Fix indentation in DW driver
Commit ID c490219d1e introduced wrong indentation there.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-01-28 18:18:18 -05:00