Commit graph

41120 commits

Author SHA1 Message Date
Kumar Gala
81ac58697e drivers: gpio: cc32xx: Convert to new DT_INST macros
Convert older DT_INST_ macro use the new include/devicetree.h
DT_INST macro APIs.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-27 15:18:00 -05:00
Kumar Gala
4192254ef2 dts: nios2: Add interrupt controller support in dts
Added properties to support the core interrupt controller on the NIOS2
cpu cores and enable that support for the NS16550 UART.

We rename some compatibles so that the cpu core compatibles is unique.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-27 15:16:53 -05:00
Kumar Gala
92d927691c boards: posix: nrf52_bsim: Add a device tree
Remove DT_ defines in board_soc.h now that we have a device tree.  We
remove all devices from the device tree that aren't known to be part
of the NRF52 BSIM simulation.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-27 15:15:02 -05:00
Kumar Gala
1bf839809c cmake: Get unit tests passing CI again
The following commit:

commit 407b49b35c (refs/bisect/bad)
Author: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Date:   Wed Feb 12 15:00:46 2020 +0100

    cmake: use find_package to locate Zephyr

breaks as we don't find the ZephyrUnittest package.  For now revert to
the old means until a proper fix can be made.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-27 14:16:37 -05:00
Stephanos Ioannidis
e57da829d7 tests: kernel: interrupt: Do not test interrupt nesting on RISC-V
This commit disables the nested interrupt test for the RISC-V platform,
as interrupt nesting is not supported on the current RISV-C
architecture port.

Furthermore, the current `trigger_irq` implementation for RISC-V is
mostly incorrect and cannot be used, so there is no point in leaving
that in the codebase (see #23593).

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-03-27 13:24:35 -04:00
Stephanos Ioannidis
84921c53b1 tests: kernel: interrupt: Rework nested interrupt test
The current nested interrupt test implementation is both buggy and
fundamentally flawed because it does not trigger a higher priority
interrupt from a lower priority interrupt context and relies on the
system timer interrupt, which is not fully governed by the test;
moreover, the current implementation does not properly validate the
test results and can report success if no interrupt is triggered and
serviced at all.

This commit reworks this test to have the following well-defined
and logical procedure:

1. [thread] Trigger IRQ 0 (lower priority)
2. [isr0] Set ISR 0 result token and trigger IRQ 1 (higher priority)
3. [isr1] Set ISR 1 result token and return
4. [isr0] Validate ISR 1 result token and return
5. [thread] Validate ISR 0 result token

The reworked test scenario ensures that the interrupt nesting works
properly and any abnormal conditions are detected (e.g. interrupts not
triggering at all, or ISR 1 not being nested under ISR 0).

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-03-27 13:24:35 -04:00
Stephanos Ioannidis
66a53dd5cd tests: kernel: interrupt: Reorganise tests
This commit re-organises the kernel interrupt tests for consistency.

In addition, it removes any references to the `irq_offload` feature,
which is no longer used by this test.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-03-27 13:24:35 -04:00
Kumar Gala
9f6d9573fd drivers: ipm: fix build issue from DT macro conversion
Since idc_read/idc_write are used outside of the driver we can't use the
DT_INST_... form (that utilize DT_DRV_COMPAT) of the macro's in
ipm_cavs_idc_priv.h.  Use DT_INST(0, intel_cavs_idc) explicitly in the
header to fix the build issue.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-27 11:41:16 -05:00
Peter Bigot
090088d015 samples: boards: nrf: battery: Convert to new DT macros
Reference properties through the path to vbatt.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-03-27 11:41:04 -05:00
Henrik Brix Andersen
639ae0bcd7 soc: arm: nxp: ke1xf: add NXP Kinetis LPTMR
Indicate that the NXP Kinetis KE1xF SoC contains a Low Power Timer
(LPTMR) and default to enabling the corresponding driver if
CONFIG_COUNTER is enabled.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-03-27 11:17:58 -05:00
Henrik Brix Andersen
5a5f6bfd5c dts: arm: nxp: ke1xf: add LPTMR
Add NXP Kinetis Low Power Timer (LPTMR) node to the KE1xF SoC device
tree.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-03-27 11:17:58 -05:00
Henrik Brix Andersen
85c996b016 drivers: counter: add NXP Kinetis LPTMR driver
Add counter driver for the NXP Kinetis Low Power Timer (LPTMR). The
driver can be configured either as 16 bit counter or 16 bit pulse
counter.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-03-27 11:17:58 -05:00
Henrik Brix Andersen
4dd1151b48 modules: mcux: add support for NXP Kinetis LPTMR
Add support for indicating that a SoC contains the NXP Kinetis Low
Power Timer (LPTMR) module.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-03-27 11:17:58 -05:00
Henrik Brix Andersen
120ef76a6a dts: bindings: add binding for NXP Kinetis LPTMR
Add device tree binding for the NXP Kinetis Low Power Timer (LPTMR)
module. This module can either act as a 16 bit counter or a 16 bit
pulse counter.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-03-27 11:17:58 -05:00
Kumar Gala
7fafce6eac drivers: video: mt9m114: Convert to new DT_INST macros
Convert older DT_INST_ macro use the new include/devicetree.h
DT_INST macro APIs.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-27 11:06:06 -05:00
Kumar Gala
7264946c4a drivers: wifi: eswifi: Convert to new DT_INST macros
Convert older DT_INST_ macro use the new include/devicetree.h
DT_INST macro APIs.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-27 11:05:19 -05:00
Kumar Gala
3300751082 soc: atmel_sam0: Convert to new DT_INST macros
Convert older DT_INST_ macro use the new include/devicetree.h
DT_INST macro APIs.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-27 11:02:57 -05:00
Kumar Gala
28870e7a32 drivers: atmel sam0: Convert atmel sam0 drivers to new DT_INST macros
Convert older DT_INST_ macro use in atmel sam0 drivers to the new
include/devicetree.h DT_INST macro APIs.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-27 11:02:57 -05:00
Torsten Rasmussen
db0b4e15e9 doc: Update documentation to describe use of find_package(Zephyr)
This commit changes the current boilerplate include description and
instead describes the use of find_package(Zephyr)

It also add a section covering additional possibilities when using
find_package(Zephyr).

- Search order
- Zephyr repository application description
- Zephyr workspace application description
- Zephyr freestanding application description
- Environment ZEPHYR_BASE setting
- Multiple Zephyr and preference setting

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-03-27 16:23:46 +01:00
Torsten Rasmussen
e819fa46cd scripts: west-commands: Updates needed when removing ZEPHYR_BASE env
This commit includes the following fixes in order to remove environment
setting of ZEPHYR_BASE is west extension commands.

- Build command
  west build --pristine will now use the ZEPHYR_BASE variable found
  in CMakeCache.txt in the build folder.

  This ensures that the pristine command is executed from the same
  Zephyr that was used for compilation.

- Board command
  The west boards command no longer sets Zephyr base before invoking
  cmake -P cmake/boards.cmake

  Instead boards.cmake uses find_package(Zephyr) to ensure consistent
  behavior with Zephyr samples, so that the detection of Zephyr base is
  uniform across CMake commands.

  It also changes BOARD_ROOT_SPACE_SEPARATED to BOARD_ROOT in order to
  be consistent with existing user documentation.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-03-27 16:23:46 +01:00
Torsten Rasmussen
8e929fd20c cmake: find_package to honor list of zephyr installations to prefer
This commit introduces ZEPHYR_PREFER which is a list that user can
specify when compiling an application.

This allows a user who has multiple Zephyr installations in the same
work-tree to provide a list of which Zephyr to prefer.

This is an extension to CMake VERSION field, as a user who is working
with multiple Zephyr installations could face a situation where multiple
Zephyr's is having same version, as example 2.2.99, in which case CMake
version is not sufficient.

Example, workspace looking as:
/projects/workspace/zephyr
/projects/workspace/zephyr-alternate
/projects/workspace/zephyr-wip
/projects/workspace/my_app

To prefer zephyr-alternate, then zephyr-wip the my_app/CMakeLists.txt
should look as:
set(ZEPHYR_PREFER "zephyr-alternate" "zephyr-wip")
find_package(Zephyr)

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-03-27 16:23:46 +01:00
Torsten Rasmussen
e85cfe4554 cmake: West extension command for Zephyr config package registration
This command make it possible to use west for first time registration
of a Zephyr config package in CMake.

To register Zephyr as a CMake config package, invoke:
west zephyr-export

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-03-27 16:23:46 +01:00
Torsten Rasmussen
39cd4c8f52 cmake: propagating zephyr base to west
West utilizes Zephyr base when invoked out-of-tree in order to determine
west topdir.

This commit ensures that zephyr base when invoking west from CMake is
set to current zephyr base.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-03-27 16:23:46 +01:00
Torsten Rasmussen
d7862cf776 cmake: using ${ZEPHYR_BASE} instead of $ENV{ZEPHYR_BASE}
With the introduction of ZephyrConfig.cmake all parts of CMake code
should rely on the CMake ZEPHYR_BASE variable instead of the environment
setting.

This ensures that after the first CMake invocation, then all subsequent
invocation in same build folder will use same zephyr base.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-03-27 16:23:46 +01:00
Torsten Rasmussen
ad1fecc950 cmake: ninja usage build target
Fixed usage build target.

Previously, `ninja usage` would print:
Build flags:

  ninja VERBOSE=1 [targets] verbose build

This is clearly wrong, as VERBOSE=1 is for make targets.

To support both ninja based builds and make based build systems, the
CMAKE_MAKE_PROGRAM is now exported from the calling CMake / build
instance, and the verbose flag is set depending on whether ninja or
make is used as build program.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-03-27 16:23:46 +01:00
Torsten Rasmussen
21080447a8 board: updating test cases for intel s1000 crb board
Changing ZEPHYR_BASE throughout Zephyr tests and samples revealed that
intel s1000 crb cache test case could not be run on CI.

This has now been fixed by moving the tests file located in
tests/board/intel_s1000_crb folder into tests/board/intel_s1000_crb/main
instead so there is now main and cache folders with test projects.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-03-27 16:23:46 +01:00
Torsten Rasmussen
407b49b35c cmake: use find_package to locate Zephyr
Using find_package to locate Zephyr.

Old behavior was to use $ENV{ZEPHYR_BASE} for inclusion of boiler plate
code.

Whenever an automatic run of CMake happend by the build system / IDE
then it was required that ZEPHYR_BASE was defined.
Using ZEPHYR_BASE only to locate the Zephyr package allows CMake to
cache the base variable and thus allowing subsequent invocation even
if ZEPHYR_BASE is not set in the environment.

It also removes the risk of strange build results if a user switchs
between different Zephyr based project folders and forgetting to reset
ZEPHYR_BASE before running ninja / make.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-03-27 16:23:46 +01:00
Torsten Rasmussen
8829e8237a cmake: ZephyrUnittestConfig.cmake added
Adding ZephyrUnittestConfig.cmake and ZephyrUnittestConfigVersion.cmake
to allow unittest projects to use find_package to locate ZephyrUnittest.

This means that it will be possible to allow users to run CMake without
the need to source zephyr-env.sh or run zephyr-env.cmd.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-03-27 16:23:46 +01:00
Torsten Rasmussen
caf596ef1b cmake: Zephyr package now sets ZEPHYR_BASE as cmake cached variable
This commit introduces ZEPHYR_BASE as a cached variable, ensures that
once ZEPHYR_BASE has been set in a project, it is sticky.
Using cached variable also allows users to reconfigure ZEPHYR_BASE if
they so wish.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-03-27 16:23:46 +01:00
Torsten Rasmussen
555eb9b5dc cmake: detection and using a not registered Zephyr repository package
This commit adds the possibility of using a Zephyr repository package
base even when it has not been exported to CMake package registry.

It also introduces the possibility of locating and using Zephyr
CMake config package correctly when invoking CMake on an out-of-tree
project.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-03-27 16:23:46 +01:00
Torsten Rasmussen
3dd96d8927 cmake: Added possibility to disable the printing of version
When ZephyrConfig package is being version checked, then
ZephyrConfigVersion.cmake loads version.cmake.

This causes a print message, such as the following to happen:
-- Zephyr version: 2.2.0

Now, in case a user has multiple Zephyr installations, this could
result in something similar to:
-- Zephyr version: 2.2.0
-- Zephyr version: 2.x.0
-- Zephyr version: 3.x.0
being printed.

This commit add the possibility to disable version printing.

With new Zephyr base find_package, printing of ZEPHYR_BASE is added
after the version, in order to make it easy for users to see which
Zephyr is used.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>

suggested change: print ZEPHYR_BASE
2020-03-27 16:23:46 +01:00
Torsten Rasmussen
81007172a4 cmake: adding ZephyrConfig.cmake to allow an easy way to locate Zephyr
Adding ZephyrConfig.cmake and ZephyrConfigVersion.cmake allows projects
to use find_package to locate Zephyr.

This means that it will be possible to allow users to run CMake without
the need to source zephyr-env.sh or run zephyr-env.cmd.

This is especially useful for IDEs such as Eclipse or SES, where it will
no longer be required to source the above files before launching the
IDE.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-03-27 16:23:46 +01:00
Henrik Brix Andersen
261636ce69 tests: drivers: adc: adc_api: add support for MikroElektronika ADC Click
Add support for the MikroElektronika ADC Click shield to the ADC API
test.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-03-27 16:17:06 +01:00
Henrik Brix Andersen
5510d5f116 boards: shields: add MikroElektronika ADC Click shield
Add shield definition for the MikroElektronika ADC Click. The ADC
Click carries a MCP3204 12-bit Analog-to-Digital converter in a
mikroBUS form factor.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-03-27 16:17:06 +01:00
Henrik Brix Andersen
53615ab11b drivers: adc: add Microchip MCP320x driver
Add driver for the Microchip MCP3204/MCP3208 12 bit ADCs with SPI
interface.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-03-27 16:17:06 +01:00
Henrik Brix Andersen
bc4a472a14 dts: bindings: add bindings for Microchip MCP320x
Add devicetree bindings for the Microchip MCP3204/MCP3208 12 bit ADCs
with SPI interface.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-03-27 16:17:06 +01:00
Dominik Ermel
013dc70a9c west.yml: Update revision of TinyCBOR
Update introduces changes to TinyCBOR CMakeList.txt that removes
it from Zephyr interface libraries.

This also fixes problem with TinyCBOR include paths not being added into
compilation, unless MCUMGR has also been selected.

Addresses GH issue: #23324

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2020-03-27 16:15:07 +01:00
Kumar Gala
120674660e soc: xtensa: Convert to new DT_INST macros
Convert older DT_INST_ macro use the new include/devicetree.h
DT_INST macro APIs.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-27 10:06:14 -05:00
Kumar Gala
4d977e43ca drivers: flash: spi_nor: Convert to new DT_INST macros
Convert older DT_INST_ macro use the new include/devicetree.h
DT_INST macro APIs.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-27 10:05:46 -05:00
Kumar Gala
11c8de15a8 drivers: flash: spi_flash_w25qxxdv: Convert to new DT_INST macros
Convert older DT_INST_ macro use the new include/devicetree.h
DT_INST macro APIs.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-27 10:00:29 -05:00
Francois Ramu
b353fc6093 west.yml: update hal stm32xx modules
This updates the stm32cube/stm32xx to latest branches

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-03-27 08:34:19 -05:00
Francois Ramu
b5ae23e97b modules: stm32: define new symbol for ETH extended
This add the new symbol CONFIG_USE_STM32_HAL_DMA_EX

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-03-27 08:34:19 -05:00
Francois Ramu
97e333d4c3 modules: stm32: define new symbol for PSSI
This add the new symbol CONFIG_USE_STM32_HAL_PSSI
for the Parallel Synchronous Slave Interface

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-03-27 08:34:19 -05:00
Daniel Leung
5bb00573d6 west.yml: update Xtensa HAL revision
This updates the Xtensa HAL revision to latest master,
which includes updating the HAL to version 12.08, and
making it a named module.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-03-27 09:06:03 -04:00
Daniel Leung
f72e4fc723 cmake: gcc: no need to force add system include
There is no need to force add system include by adding
${SYSROOT_DIR}/include. Let GCC tell us what include paths
are needed with --print-file-name and feed them via -isystem.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-03-27 09:06:03 -04:00
Tomasz Bursztyka
df368e8094 samples/net: Adding relevant parts to test PM on echo server
Just to get something to test for PM, via frdm_k64f board. So only this
board will get PM enabled.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-03-27 14:48:30 +02:00
Tomasz Bursztyka
839bacc0f0 power management: Add k6x SOC core list
Just inserting mcux's ethernet device there.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-03-27 14:48:30 +02:00
Tomasz Bursztyka
cb0da79e7f net/shell: Add a quick way to suspend/resume a network interface
Meaningful for testing purpose only.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-03-27 14:48:30 +02:00
Tomasz Bursztyka
4322c66e4b net: Expose a way to know if the network interface is suspended or not
And use it in the shell to display such information then.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-03-27 14:48:30 +02:00
Tomasz Bursztyka
db6f896c00 drivers/ethernet: Add support for power management into MCUX
Requesting the clock controller to switch on or off the device.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-03-27 14:48:30 +02:00