Commit graph

41120 commits

Author SHA1 Message Date
Kumar Gala
0c7a5fdf1c drivers: usb: usb_dw: convert to DT_INST defines
Convert driver to use DT_INST_ defines.  The preferred defines for
drivers are DT_INST_.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-11 07:59:38 -06:00
Kumar Gala
f91b4dbe94 drivers: dma: dma_dw: convert to DT_INST defines
Convert driver to use DT_INST_ defines.  The preferred defines for
drivers are DT_INST_.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-11 07:59:38 -06:00
Kumar Gala
505591d52a drivers: ieee802154: mcr20a: convert to DT_INST defines
Convert driver to use DT_INST_ defines.  There was just one case for
CS_GPIOS that wasn't using DT_INST defines already.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-11 07:59:38 -06:00
Kumar Gala
667f96389b drivers: uart: esp32: convert to DT_INST defines
Convert driver to fully use DT_INST_ defines.  Currently IRQs are not
generated from DTS on esp32 so we create #defines for what they should
look like.  Convert the IRQ defines to match DT_INST style so if/when
we have that info in DTS it will look the same.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-11 07:59:38 -06:00
Kumar Gala
3e6614a330 drivers: uart: msp432p4xx: convert to DT_INST defines
Convert driver to fully use DT_INST_ defines.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-11 07:59:38 -06:00
Kumar Gala
afca340fc0 drivers: uart: native_posix: convert to DT_INST defines
Convert driver to fully use DT_INST_ defines.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-11 07:59:38 -06:00
Kumar Gala
1b0e654aec drivers: i2c: nios2: convert to DT_INST defines
Convert driver to use DT_INST_ defines.  The preferred defines for
drivers are DT_INST_.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-11 07:59:38 -06:00
Kumar Gala
e04a367408 drivers: mcux_rtc: convert to DT_INST defines
Convert driver to use DT_INST_ defines.  Replace dts_fixup.h use
for DT_RTC_0_NAME with DT_INST_0_NXP_KINETIS_RTC_LABEL to be
consistent.  Also, remove the aliases that had been used for this
driver in various nxp_k*.dtsi.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-11 07:59:38 -06:00
Kumar Gala
a49de1543b drivers: entropy: mcux_trng: convert to DT_INST defines
Convert driver to use DT_INST_ defines.  The preferred defines for
drivers are DT_INST_.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-11 07:59:38 -06:00
Kumar Gala
a9e68d61df drivers: clock_control: mcux_sim: convert to DT_INST defines
Convert driver to use DT_INST_ defines.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-11 07:59:38 -06:00
Kumar Gala
a32eed06f7 drivers: clock_control: mcux_pcc: convert to DT_INST defines
Convert driver to use DT_INST_ defines.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-11 07:59:38 -06:00
Kumar Gala
6ad07b6a2a drivers: clock_control: mcux_mcg: convert to DT_INST defines
Convert driver to use DT_INST_ defines.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-11 07:59:38 -06:00
Kumar Gala
ee53047aff drivers: clock_control: mcux_ccm: convert to DT_INST defines
Convert driver to use DT_INST_ defines.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-11 07:59:38 -06:00
Kumar Gala
41fcf784e9 drivers: mcux_gpt: convert to DT_INST defines
Convert driver to use DT_INST_ defines and remove Kconfig per instance
enablement in favor of DT_INST_ define existing.  Also, remove the
aliases that had been used for this driver in nxp_rt.dtsi.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-11 07:59:38 -06:00
Kumar Gala
c3f4c1d02b drivers: watchdog: wdt_mcux: convert to DT_INST defines
Convert driver to use DT_INST_ defines.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-11 07:59:38 -06:00
Kumar Gala
4a7c2921f8 drivers: modem: ublox-sara-r4: convert to DT_INST defines
Convert driver to use DT_INST_ defines.  The preferred defines for
drivers are DT_INST_.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-11 07:59:38 -06:00
Kumar Gala
46fe3046fe drivers: wifi: eswifi: Convert to use DT_INST defines
Use DT_INST define as this is the preferred set of defines to utilize
for drivers.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-11 07:59:38 -06:00
Ulf Magnusson
35166c45d9 dts: edtlib/gen_defines: Fix API design re. dtc flags
It's better to allow per-instance EDT configuration than to set a global
variable on the edtlib module. Enable/disable the warning for reg/unit
address mismatches via a flag to EDT.__init__(), instead of via a global
variable. That makes it consistent too.

Another option would be to pass the 'dtc' flags to EDT.__init__(), but
it makes the interface a bit ugly. Maybe if it needs to emulate lots of
other flags later.

Clarify that edtlib itself isn't meant to have any state in the comment
at the top of the module.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-03-11 07:59:38 -06:00
Andrei Emeltchenko
f57f7d162c console: xtensa_sim_console: Cleanup and use static keyword
Cleanup xtensa_sim_console and use static keyword.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2020-03-11 09:17:38 -04:00
Andrei Emeltchenko
caa95fc10d console: uart_console: Use static for static functions
Use static keyword for static functions.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2020-03-11 09:17:38 -04:00
Luiz Augusto von Dentz
2b466a54da tests: work_q: Add assert if k_delayed_work_submit fails in the handler
This makes the tests actually assert if k_delayed_work_submit fails to
resubmit to ensure that not only the work is executed but also no errors
are reported in such case.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2020-03-11 09:16:15 -04:00
Ruth Fuchss
828d707465 doc: keep IDs when redirecting URLs
When redirecting from old-topic.html#some-id to new-topic.html,
the ID is ignored.
Not sure if it is possible to keep the ID in the meta redirect,
but at least in the JavaScript version we should keep it and
redirect from old-topic.html#some-id to new-topic.html#some-id.

Signed-off-by: Ruth Fuchss <ruth.fuchss@nordicsemi.no>
2020-03-11 08:46:26 -04:00
Markus Becker
6a66ae53f2 usb: cdc_acm: set initialization level to POST_KERNEL
Set initialization level of CDC ACM class to POST_KERNEL.

The proposed OpenThread Network-Coprocessor uses ACM. OpenThread is
started at POST_KERNEL level by the 802.15.4 radio drivers.

Signed-off-by: Markus Becker <markus.becker@tridonic.com>
2020-03-11 11:09:21 +01:00
Alberto Escolar Piedras
c7e106aab3 nrf52_bsim: Remove no longer needed header stubs
These headers were here only because some drivers were
using them directly.
But they are not needed anymore, so remove them.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2020-03-11 10:32:49 +01:00
Miguel Azevedo
61d56b4c53 mgmt: Added Kconfig values and west.yml changes for mcumgr new version
The new version of mcumgr adds a few new Kconfig values, so
this commit adds them on Zephyr side.
This commit also updates west.yml so it points to the latest
changes on mcumgr's repo.

Signed-off-by: Miguel Azevedo <miguellazev@gmail.com>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-03-11 10:11:31 +01:00
Carlo Caione
b4335a04ac arm: aarch64: Reintroduce _ASM_FILE_PROLOGUE
This is currently missing from the AArch64 assembly files.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2020-03-11 09:34:24 +01:00
Ioannis Glaropoulos
1c56f87321 kernel: fatal: fix indentation in z_fatal_error
Fix indentation error in z_fatal_error().

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-03-11 10:26:36 +02:00
Ioannis Glaropoulos
f003c8b508 tests: arch: arm: interrupt: test the spurious ISR handler
We extend the interrupt test for ARM Cortex-M so that
it can test the behavior of the spurious ISR handler.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-03-11 10:26:36 +02:00
Ioannis Glaropoulos
9d184286d3 kernel: fatal: allow tests to continue upon spurious ISR trigger
We want to be regression-testing the spurious ISR functionality.
Therefore, in z_fatal_error() we need to allow a test to continue
if an error has occured due to a spurious IRQ being triggered.
Only in test mode, wee allow the function to return without an
error. In normal mode the current thread will be aborted.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-03-11 10:26:36 +02:00
Ioannis Glaropoulos
49fb5d0812 kernel: fatal: check for esf validity when inspecting nested IRQ
For architectures that support detection of nested interrupts,
we need to check the validity of the exception stack frame,
before we can supply it as a pointer to the function that
evaluates whether we are in a nested interrupt context. This
commits adds the required esf pointer checks in z_fatal_error().

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-03-11 10:26:36 +02:00
Ioannis Glaropoulos
0773fd5963 arch: arm: aarch32: fix z_irq_spurious() implementation
We align the implementation of z_irq_spurious() handler
with the other Zephyr ARCHEs, i.e. we will be calling
directly the ARM-specific fatal error function with
K_ERR_SPURIOUS_IRQ as the error type. This is already
the case for aarch64.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-03-11 10:26:36 +02:00
Ioannis Glaropoulos
a31795c440 arch: arm: aarch32: fix documentation in z_irq_spurious definition
Correct documentation note in z_irq_spurious() definition,
stressing that the function is installed in _sw_isr_table
entries at boot time (which may be or not be used for
dynamic interrupts).

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-03-11 10:26:36 +02:00
Peter Bigot
bd56c2ecf2 samples: drivers: spi_flash: use printf argument consistent with format
Coverity thinks this is a long because FLASH_TEST_REGION_OFFSET is a
signed value.  Zephyr doesn't use standard types so make it a u32_t.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-03-10 19:06:38 -04:00
Anas Nashif
ab6179c6fe sensor: shell: return -ENODEV on binding errors
If we can't bind to a device, return -ENODEV and do not continue.

Fixes #22429
Coverity-ID: 207989

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-03-10 19:05:03 -04:00
Peter Robinson
22b6a4ccff boards: arm: nrf52840_pca10059: Add pwmleds to DT
Add a pwm0 entry and PWM support for the RGB LED so that the
rgb_led and fade_led demos work on the nrf52840_pca10059.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
2020-03-10 22:28:39 +02:00
Andrew Boie
c4fbc08347 kernel: fixup thread monitor locking
The lock in kernel/thread.c was pulling double-duty, protecting
both the thread monitor linked list and also serializing access
to k_thread_suspend/resume functions.

The monitor list now has its own dedicated lock.

The object tracing test has been updated to use k_thread_foreach().

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-03-10 16:09:24 -04:00
Kumar Gala
18a30e9184 sensor: pms7003: Convert to DTS
Convert pms7003 sensor driver to utilize device tree.

DTS would look something like the following for the pms7003:

uart {
	pms7003: pms7003 {
		 status = "okay";
		 compatible = "plantower,pms7003";
		 label = "pms7003";
	};
};

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-10 14:15:22 -05:00
Kumar Gala
94322e503c sensor: ak8975: Convert to DTS
Convert ak8975 sensor driver to utilize device tree.

This also supports the ak8975 embedded in a invensense MPU9150.  In such
a case the device tree node should look something like, where the ak8975
is a child of the mpu9150.

        mpu9150@68 {
                compatible = "invensense,mpu9150";
                reg = <0x68>;
                label = "mpu9150";
                #address-cells = <1>;
                #size-cells = <0>;
                ak8975@c {
                        compatible = "asahi-kasei,ak8975";
                        reg = <0xc>;
                        label = "ak8975";
                };
        };

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-10 14:13:40 -05:00
Flavio Ceolin
8ae822c9fa kernel: random: ifdef z_early_boot_rand_get
This function had a to sys_rand_get() even without random source. As
Zephyr is built with linkage garbage collection and this function is
called only if either ENTROPY_HAS_DRIVER or TEST_RANDOM_GENERATOR is
enabled and these options automatically enable a random source.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2020-03-10 21:12:28 +02:00
Jan Van Winkel
e242f020f4 samples: display: doc: Corrected build commands
Corrected build command paths in the documentation of the display
driver sample

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2020-03-10 21:10:27 +02:00
Johan Hedberg
4bdb407d7d drivers: ieee802154_nrf5: Fix build failure
Fix build failure when CONFIG_NET_L2_OPENTHREAD is not enabled. The
failure looks as follows:

drivers/ieee802154/ieee802154_nrf5.c:187:12:
	warning: 'nrf5_energy_scan_start' defined but not used
	[-Wunused-function]
 static int nrf5_energy_scan_start(struct device *dev,
            ^~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2020-03-10 14:09:11 -05:00
Kumar Gala
5acb97ffa6 doc: releases: Release notes for v2.3 - initial (empty) draft
Getting things prepared for the Zephyr 2.3 release cycle

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-10 20:54:01 +02:00
Stephanos Ioannidis
7c5db4b755 arch: arm: cortex_r: Enable Thumb2 instruction set support
The ARMv7-R architecture supports both Thumb-2 (T32) and ARM (A32)
instruction sets.

This commit selects the `ISA_THUMB2` symbol to indicate that the
ARMv7-R architecture supports the Thumb-2 instruction set, which can
be enabled by selecting the `COMPILER_ISA_THUMB2` symbol.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-03-10 17:51:32 +01:00
Stephanos Ioannidis
0bd86f3604 arch: arm: aarch32: Allow selecting compiler instruction set
This commit introduces the `COMPILER_ISA_THUMB2` symbol to allow
choosing either the ARM or Thumb instruction set for C code
compilation.

In addition, this commit introduces the `ASSEMBLER_ISA_THUMB2` helper
symbol to specify the default target instruction set for the assembler.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-03-10 17:51:32 +01:00
Stephanos Ioannidis
e89881f532 cmake: compiler: arm: Whitespace-align flags
This commit whitespace-aligns the toolchain flags.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-03-10 17:51:32 +01:00
Josh Gao
b9d2028590 usb_dc_stm32: improve struct layout.
Put the one-byte sized fields next to each other to reduce padding.

Signed-off-by: Josh Gao <josh@jmgao.dev>
2020-03-10 18:32:47 +02:00
Josh Gao
c4a7d96c04 usb_dc_stm32: reuse PMA buffer when possible.
Previously, endpoint configuration would reserve memory in the packet
memory area which would never be reclaimed. After this patch, endpoints
will reuse previously allocated memory when possible. We still leak
memory when reconfiguration increases the max packet size for a given
endpoint number, but this fixes the common case.

Bug: https://github.com/zephyrproject-rtos/zephyr/issues/23178
Signed-off-by: Josh Gao <josh@jmgao.dev>
2020-03-10 18:32:47 +02:00
Daniel Bujak
92a31f1a40 drivers: sensor: Add support for free-fall triggering to sensor api
Add an entry in the sensor_trigger_type enum for triggering an
event on free-fall

Signed-off-by: Daniel Bujak <danb@swiftlabs.com>
2020-03-10 18:31:38 +02:00
Andrzej Głąbek
3e93f9f67d modules: hal: nordic: Fix translation of peripheral symbols
Update the hal_nordic module revision, to apply the following changes:

nrfx_config: Fix translation of symbols for _S or _NS only peripherals

For peripherals with only one type of access available (either secure
or non-secure), the common symbol translation scheme cannot be used
as it leads to mapping to non-existing symbols (e.g. NRF_FICR_NS).
Instead, use fixed translations for these symbols (e.g. NRF_FICR to
NRF_FICR_S, only for secure images).

nrfx_config: Add missing _S/_NS symbol translations for nRF5340/nRF9160

Add translations of names with _S and _NS suffixes for peripheral
access symbols that are available for a given chip but were not used
so far in any nrfx HAL or driver, to make the lists of translations
complete and consistent.

This commit corrects also the translation of NRF_I2S symbol for nRF5340
whose name for this SoC contains also the index 0 (so it needs to be
handled similarly like NRF_PDM0 is).

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2020-03-10 17:21:27 +01:00
Andrzej Głąbek
668d401293 modules: hal: nordic: Define NRFX_ASSERT as __ASSERT_NO_MSG
Update hal_nordic's revision, so that NRFX_ASSERT uses __ASSERT_NO_MSG
directly, not through the assert macro that comes from from libc,
as the definition of the latter might be different when some specific
libc version is used, and this could generate troubles.

Replace also uses of assert() with __ASSERT_NO_MSG() in nrfx driver
shims that use this macro without including the corresponding header
file (i.e. that implicitly rely on assert.h being included from
nrfx_glue.h, which is no longer the case).

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2020-03-10 17:21:27 +01:00