Commit graph

41120 commits

Author SHA1 Message Date
Maksim Masalski
33336e78f6 drivers: spi: Support PM busy state where relevant in DW
Need to set device busy when enter into transceive function
in SPI DW driver.
In current SPI DW driver the transceive function don't set busy state,
but that is important for PM busy state.
This will lead to unexpected behaviors when system calls this
function and enter into idle state.

Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-01-13 11:33:12 -05:00
Henrik Brix Andersen
6f680cffc6 tests: board_shell: enable sensor shell
Enable the sensor shell in the board_shell test application.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-01-13 09:23:35 -06:00
Maureen Helm
88fcded3b0 dts: boards: Define dts aliases at soc level for lpc socs
Defines device tree aliases for on-chip peripherals at the soc level
instead of the board level for all lpc socs. The eliminates some
duplicate code in the board level device trees, and will allow drivers
to use device-tree generated macros directly instead of through dts
fixups.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-01-13 10:22:44 -05:00
Maureen Helm
ecd24bccd1 dts: boards: Define dts aliases at soc level for i.mx 6/7 socs
Defines device tree aliases for on-chip peripherals at the soc level
instead of the board level for all i.mx 6/7 socs. The eliminates some
duplicate code in the board level device trees, and will allow drivers
to use device-tree generated macros directly instead of through dts
fixups.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-01-13 10:22:44 -05:00
Maureen Helm
201f8897cd dts: boards: Define dts aliases at soc level for i.mx rt socs
Defines device tree aliases for on-chip peripherals at the soc level
instead of the board level for all i.mx rt socs. The eliminates some
duplicate code in the board level device trees, and will allow drivers
to use device-tree generated macros directly instead of through dts
fixups.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-01-13 10:22:09 -05:00
Vincent Wan
ce90e24d25 kconfig: deprecate TI cc2650_sensortag and cc2650 SoC
Adding Kconfig settings to warn anyone trying to build for this
platform of its pending deprecation in 2.2.0.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2020-01-13 10:21:12 -05:00
Vincent Wan
180b4df229 soc: kconfig: add SOC_DEPRECATED_RELEASE
Adding a Kconfig parameter so that we can indicate an SoC is to be
deprecated, similar to what is being done for BOARD_DEPRECATED_RELEASE.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2020-01-13 10:21:12 -05:00
Vincent Wan
a2bc514653 boards: Kconfig: rename BOARD_DEPRECATED to BOARD_DEPRECATED_RELEASE
Renaming this Kconfig option given it corresponds to a version string
for a particular release.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2020-01-13 10:21:12 -05:00
Andrew Boie
c1fdf98ba5 kernel: show what spinlock was used incorrectly
Also helps identify corruption cases where the spinlock pointer
used wasn't actually a spinlock.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-01-13 10:17:16 -05:00
Henrik Brix Andersen
89d23e891a Revert "boards: nxp: pinmux: enable ftm pwm outputs based on DT_INST_* defines"
The DT_INST_* defines for the PWM controllers enabled in the device
tree are always defined causing the LED pins to always be set as PWM
outputs in the pinmux. Revert to using CONFIG_PWM_* for pinmux
configuration for now.

This reverts commit eb42a24dc6.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-01-13 09:14:12 -06:00
Henrik Brix Andersen
9c52a3f189 boards: riscv: rv32m1_vega: document PWM support
Document PWM support for the OpenISA RV32M1 VEGAboard.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-01-13 09:12:34 -06:00
Henrik Brix Andersen
030ea45ab3 boards: riscv: rv32m1_vega: enable PWM support for the RGB LED
Enable PWM support for the onboard RGB LED present on the OpenISA
RV32M1 VEGAboard.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-01-13 09:12:34 -06:00
Henrik Brix Andersen
b702e5fdde soc: riscv: rv32m1: enable the RV32M1 Timer/PWM driver
Enable the driver for the Timer/PWM (TPM) module present in the
OpenISA RV32M1 when PWM is enabled.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-01-13 09:12:34 -06:00
Henrik Brix Andersen
eb185d1443 CODEOWNERS: take ownership of the RV32M1 Timer/PWM driver
Take ownership of the driver for the OpenISA RV32M1 Timer/PWM (TPM)
module.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-01-13 09:12:34 -06:00
Henrik Brix Andersen
3e7ca8f2ad drivers: pwm: add driver for the RV32M1 Timer/PWM module
Add driver for the OpenISA Timer/PWM (TPM) module present in the
RV32M1 SoC.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-01-13 09:12:34 -06:00
Henrik Brix Andersen
f3144644bd soc: riscv: rv32m1: enable peripheral clocks for Timer/PWM modules
Enable the peripheral clocks for the OpenISA RV32M1 Timer/PWM (TPM)
modules.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-01-13 09:12:34 -06:00
Henrik Brix Andersen
575c211f97 dts: riscv: rv32m1: add timer/pwm modules
Add device tree nodes for the Timer/PWM (TPM) modules present in the
OpenISA RV32M1 SoC.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-01-13 09:12:34 -06:00
Henrik Brix Andersen
2461d6996c west: update openisa hal
Update the OpenISA HAL to pull in Timer/PWM module source if enabled.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-01-13 09:12:34 -06:00
Henrik Brix Andersen
ce9141236b modules: vega: add option for indicating the presence of RV32M1 TPM
Add Kconfig option for indicating that a given SoC contains the
OpenISA RV32M1 Timer/PWM module (TPM).

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-01-13 09:12:34 -06:00
Henrik Brix Andersen
c989ab8b05 dts: bindings: add binding for RV32M1 Timer/PWM module
Add device tree binding for the Timer/PWM module (TPM) present on the
OpenISA RV32M1 SoC.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-01-13 09:12:34 -06:00
Paul Sokolovsky
57d538cef8 include: crypto: Cleanup docstrings
Fix typos, use punctuation and capitalization more consistently. In
a few cases, rewrite sentences for clarity.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2020-01-13 08:33:21 -06:00
Maureen Helm
519661748e dts: boards: Define dts aliases at soc level for kinetis socs
Defines device tree aliases for on-chip peripherals at the soc level
instead of the board level for all kinetis socs. The eliminates some
duplicate code in the board level device trees, and will allow drivers
to use device-tree generated macros directly instead of through dts
fixups.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-01-13 08:30:53 -06:00
Trond Einar Snekvik
5b14ab4481 Bluetooth: Add dynamic le scan listener interface
Adds a way to register listeners for incoming scanner packets, in
addition to the callback passed in bt_le_scan_enable.

This allows application modules to add multiple scan packet listeners
without owning the scanner life cycle API, enabling use cases like
beacon scanning alongside Bluetooth Mesh.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2020-01-13 14:27:01 +01:00
Ulf Magnusson
776de86dc7 menuconfig: Update to work around resizing crash on macOS
Update menuconfig (and kconfiglib and guiconfig, just to sync) to
upstream revision 424d0d38e7, to get this commit in, which works around
a crash on some macOS Python installations.

    menuconfig: Work around crash on resize on some macOS systems

    get_wch() has started raising curses.error when resizing the
    terminal on some macOS Python installations. Work around for now by
    falling back on getch(), which still works.

    See https://github.com/ulfalizer/Kconfiglib/issues/84. Needs more
    investigation, but I don't have a Mac handy.

    Based on https://github.com/ulfalizer/Kconfiglib/pull/85, but with
    some more comments.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-13 14:03:12 +01:00
Joakim Andersson
e04e4c27e8 kernel: panic: Option ASSERT_NO_FILE_INFO controls panic or oops print
Use option ASSERT_NO_FILE_INFO to control panic or oops location print.
The cause of the exception can be backtraced using the stackframe
instead, which would give the user a way to reduce the footprint of the
panic implementation.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-01-13 13:59:55 +01:00
Joakim Andersson
27bbfb66b4 assert: Completely remove file info and condition expression
Completely remove the file info and condition expression from the
the print statement if they are not enabled. This saves a little code
space which adds up when there are many assert calls.

In bluetooth shell test this saves around 4.5k bytes.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-01-13 13:59:55 +01:00
Joakim Andersson
662ee8eacf net: buf: Switch from net buf assert to system assert
Remove net bufs own assertion mechanism and use the system assert
instead. This changes the assertion messaged printed from printing
expression to printing the line and file name. This provides more
context as the same expression could be asserted upon multiple times and
would then not provide enough clarity in the message.

This removes the option to enable only net buf assertions.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-01-13 13:59:55 +01:00
Joakim Andersson
08168f60f7 Bluetooth: assert: Change printed expression to printing line and file
Change assertion messaged printed from printing expression to printing
the line and file name. This provides more context as the same
expression could be asserted upon multiple times and would then not
provide enough clarity in the message.

Also using a formatted string would save code space as we can use the
same string for all messages instead of creating a unique one for each
condition.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-01-13 13:59:55 +01:00
Joakim Andersson
8aecf14928 assert: Disable line number printing together with file printing
Disable printing the line number in assertions when file name has been
disabled. Knowing the line number is not very useful when the name of
the file is unknown.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-01-13 13:59:55 +01:00
Joakim Andersson
4af5815bf4 assert: Add option to disable assertion messages
Add option to disable the assertion message, this makes all __ASSERT
behave as __ASSERT_NO_MSG instead.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-01-13 13:59:55 +01:00
Joakim Andersson
7a433325f5 assert: Add verbose option to assertion messages
Add verbose option which would control if the assertion mechanism prints
any information at all. With this disabled they application will have to
use the stack-frame to locate the assertion location.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-01-13 13:59:55 +01:00
Joakim Andersson
000d9b15ff assert: Move __ASSERT_LOC so it can be used when asserts are disabled
Move __ASSERT_LOC macro so that it can be used by other modules even
when CONFIG_ASSERT are disabled.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-01-13 13:59:55 +01:00
Joakim Andersson
94d331b2eb assert: Add option to disable condition from assertion message
Add Kconfig option to disable the conditional expression in the assert
that failed. This would save code space, and file and line provides
better information than the conditional expression in case where
the same expression would be asserted upon.

For example __ASSERT_NO_MSG(buf) wouldn't make much sense in
configuration where CONFIG_ASSERT_NO_FILE_INFO was enabled.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-01-13 13:59:55 +01:00
Joakim Andersson
9483e432d8 tests: net: arp: Fix net_buf assert in ARP unit test
Fix ASSERTs that appears when enabling asserts in net buf.
Asserts are:
 - Pulling from net buf before any data has been added.
 - Pulling more data than has been allocated for the buf.

Fix warning:
W: You have 1 IPv4 net_if addresses but 2 network interfaces
W: Consider increasing CONFIG_NET_IF_MAX_IPV4_COUNT value.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-01-13 13:59:55 +01:00
Joakim Andersson
0484c5af4d tests: net: buf: Fix byteorder test writing beyond buffer
Fix byteorder test writing past the data pointer. This would otherwise
have been caught by the assert, but net buf asserts were not enabled in
the test. Reset the buffer between different tests to re-use the same
16-byte buffer.

Turning on asserts gives:

starting test - net_buf_test_byte_order
ASSERTION FAIL [net_buf_simple_tailroom(buf) >= len] @
	ZEPHYR_BASE/subsys/net/buf.c:775
E: r0/a1:  0x00000004  r1/a2:  0x00000307  r2/a3:  0x00000000
E: r3/a4:  0x00006d79 r12/ip:  0x00000000 r14/lr:  0x000028ad
E:  xpsr:  0x61000000
E: Faulting instruction address (r15/pc): 0x000050b0
E: >>> ZEPHYR FATAL ERROR 4: Kernel panic on CPU 0

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-01-13 13:59:55 +01:00
Joakim Andersson
3797832030 tests: net: ipv6: Fix net_buf asserts in fragment unittest
Fix ASSERTs that appears when enabling asserts in net buf when adding
more data than has been allocated for the buf.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-01-13 13:59:55 +01:00
Ulf Magnusson
04f966ed3e tests: all: Remove assignment to promptless NET_GPTP_CLOCK_ACCURACY
Assignments have no effect on promptless symbols. Flagged by
https://github.com/zephyrproject-rtos/zephyr/pull/20742.

Also remove the assignments to the other NET_GPTP_CLOCK_ACCURACY_*
symbols. They are all in the same choice (in
subsys/net/l2/ethernet/gptp/Kconfig), meaning only one of them can be
enabled, and the choice already defaults to
NET_GPTP_CLOCK_ACCURACY_UNKNOWN, which is the symbol assigned last.

The symbol assigned last becomes the choice selection when multiple
symbols in a choice are assigned to. The other choice symbols still
become n. Dependencies override assignments.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-13 13:51:16 +01:00
Ulf Magnusson
02dab5a5a8 dts: gen_defines.py: Add helper for outputting {} initializers
The

    "{" + ", ".join(...) + "}"

pattern is in a bunch of places now. Add an out_dev_init() helper for
it, with the same parameters as out_dev().

Also makes "{" vs. "{ " consistent, picking the first one.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-13 13:50:15 +01:00
Ulf Magnusson
405daa0081 dts: edtlib: Add helper for testing error messages and test _slice()
Add a helper function verify_error() to testedtlib.py that takes a DTS
source and verifies that it generates a particular EDTError.

Use it to test the hints that the previous commit added to errors
generated by _slice().

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-13 13:49:33 +01:00
Ulf Magnusson
57b2d2749c dts: edtlib: Improve error for wrong reg/ranges/interrupts size
Show how the element size was calculated in the error message when a
'reg', 'ranges', or 'interrupts' property has the wrong size. This
should help with debugging. Also mention that #*-cells properties come
from the parent node, which can be subtle.

Came up in https://github.com/zephyrproject-rtos/zephyr/issues/21607
(though it seems the comment disappeared).

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-13 13:49:33 +01:00
Ulf Magnusson
7a3f7e02d2 boards: litex_vexriscv: Remove unused /chosen/zephyr,timer property
Added in commit f9efca4b4f ("boards: riscv32: add LiteX VexRiscV
board"), never used.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-13 13:48:48 +01:00
Ulf Magnusson
b4e18072a8 kconfig: Fix wrong max argument count for some preprocessor functions
dt_chosen_reg() and dt_node_reg() take between 1 and 3 arguments, not
between 1 and 4 arguments. The implicit name argument isn't included in
the count.

These functions implement $(dt_chosen_reg_*) and $(dt_node_reg_*).

Giving the right max argument count makes Kconfiglib generate error
messages that give the location of the call, instead of getting a
cryptic generic Python error.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-13 13:48:17 +01:00
Henrik Brix Andersen
a809878365 boards: arm: reel_board: add spi cs gpio
Add SPI CS GPIO line to reel_board device tree. This is needed to make
the board work with Arduino SPI compatible shields.

Tested on reel_board (1507.1) and reel_board_v2 (1507.2).

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-01-13 12:50:43 +01:00
Ioannis Glaropoulos
e53be989e7 soc: arm: nrf5340: move shared SRAM to the upper part of App MCU SRAM
We move the SRAM partition that is used as shared memory with
the Network MCU to the upper part of the Application MCU
memory. In this case we can allocate all lower SRAM to the
application, if we are building a Zephyr image without
support for Trusted Execution.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-01-13 12:48:46 +01:00
Ioannis Glaropoulos
7175896a77 soc: arm: nrf5340: introduce and define SRAM partitions for APP MCU
With this commit we introduce SRAM partitioning for nRF5340
Application MCU. We define fixed partitions for the Secure
and the Non-Secure images, when building with trusted
execution environment enabled (Secure and Non-Secure images).

For (Secure image) builds without trusted execution environment
enabled we now allocate all available Application MCU SRAM into
the single image, except for the SRAM being used as shared memory
with the Network MCU.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-01-13 12:48:46 +01:00
Ioannis Glaropoulos
1e492b2b1d dts: arm: nrf5340: adding device_type property in sram nodes
Add device_type DTS property in sram0 and sram1 nodes,
for nRF5340 Application and Network CPU, respectively.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-01-13 12:48:46 +01:00
Fabio Utzig
6d60ce5642 dfu: allow MCUBoot configured without scratch
When no scratch parition was defined in the DTS file, just assume that
MCUBoot was built to use swap with move strategy, and never touch
scratch.

Signed-off-by: Fabio Utzig <utzig@apache.org>
2020-01-13 12:47:04 +01:00
Kwon Tae-young
f2c345a407 boards: arm: 96b_wistrio: Use stm32flash runner
Now that stm32flash runner is available, let's use it.

Signed-off-by: Kwon Tae-young <tykwon@m2i.co.kr>
2020-01-13 12:25:12 +01:00
Martin Jaeger
ca795434c9 boards: nucleo_g431rb: Default serial port fixed
The virtual COM port of the STlink in the Nucleo board is connected to
LPUART1, but the board was configured to use UART1 instead. For this
reason, hello world sample did not work.

In addition to that, PA2 was assigned to both LPUART1 and UART2. UART2
TX is now muxed to PA14.

Signed-off-by: Martin Jaeger <17674105+martinjaeger@users.noreply.github.com>
2020-01-13 12:03:28 +01:00
Erwan Gouriou
d9e6009a73 boards: nucleo_g071rb: Enable comman line flashing using pyocd
On nucleo_g071rb, flashing using pyocd requested to hold reset button
during flashing operation.
Using newly available pyocd arguments this is no more needed and
nucleo_g071rb can now be flashed in a fully automated way.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-01-13 11:49:57 +01:00