Commit graph

41120 commits

Author SHA1 Message Date
Manivannan Sadhasivam
0f02adfb0e lora: Make the LoRa support Experimental
The LoRa APIs are expected to undergo some change as the usecase get's
increased. So let's mark it as experimental until the APIs got
stabililized.

Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
2020-05-04 19:01:09 +02:00
Manivannan Sadhasivam
e177ab6c42 drivers: lora: Get rid of counter support
The RTC/Counter implementation doesn't fit for the upcoming LoRaWAN
as most of the Counter drivers in Zephyr works with 1s granularity
which is not enough for LoRaWAN stack. So, k_timer calls are used in
place of Counter's alarm and k_uptime_get() APIs are used in place of
Counter's time keeping.

While at it, lets also fixup the broken alarm implementation.

Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
2020-05-04 19:01:09 +02:00
Frank Li
a298c890ee arm: linker.ld: move bss section to ram end
fix bss section be copy to binary.

When compiling with non-xip.
All sections will be placed in the ram.
If NOBITS section isn't placed at the end of ram,
objcopy will placed these section to binary file.

The modify only for no-userspace.
In userspace the section will be adjust,
kobject_data size increase,
the bss be shifted, the content of kobject_data
will no mactch to kernel obj of bss.

Signed-off-by: Frank Li <lgl88911@163.com>
2020-05-04 18:46:40 +02:00
Kumar Gala
dff8715615 drivers: ethernet: sam_gmac: rework pin config
Reworked sam_gmac driver to get pin ctrl/mux configuration information
from the device tree instead of via Kconfig and defines in soc_pinmap.h

We remove defines from soc_pinmap.h that are no longer needed due to
getting all that information from devicetree.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-04 11:32:10 -05:00
Stephanos Ioannidis
77e0b498ac boards: arm: atsame54_xpro: Use emulation reset for OpenOCD
The OpenOCD JTAG reset causes the SAM E54 SoC to prematurely start code
execution before the SoC is ready, and this causes hard faults when the
MPU is enabled -- causing OpenOCD to hang.

This commit disables the JTAG SRST reset mechanism and falls back to
using the Cortex-M SYSRESETREQ emulation reset mechanism, which does
not have experience this issue.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-05-04 17:14:35 +02:00
Stephanos Ioannidis
d90bcaa66c boards: arm: atsame54_xpro: Enable MPU
This commit enables the ARM memory protection unit for the SAM D54
Xplained Pro board, since `CPU_HAS_ARM_MPU` is now selected by the SoC
Kconfig.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-05-04 17:14:35 +02:00
Stephanos Ioannidis
7efa38583a soc: arm: same54: Add MPU selection
This commit adds the missing `CPU_HAS_ARM_MPU` selection for the Atmel
SAM E54 series SoC.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-05-04 17:14:35 +02:00
Stephanos Ioannidis
319227de20 soc: arm: same53: Add MPU selection
This commit adds the missing `CPU_HAS_ARM_MPU` selection for the Atmel
SAM E53 series SoC.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-05-04 17:14:35 +02:00
Stephanos Ioannidis
e4c83ddcf4 soc: arm: same51: Add MPU selection
This commit adds the missing `CPU_HAS_ARM_MPU` selection for the Atmel
SAM E51 series SoC.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-05-04 17:14:35 +02:00
Stephanos Ioannidis
2c416a9d50 soc: arm: samd51: Add MPU selection
This commit adds the missing `CPU_HAS_ARM_MPU` selection for the Atmel
SAM D51 series SoC.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-05-04 17:14:35 +02:00
Stephanos Ioannidis
d2cd8a71bd dts: arm: atmel: Add MPU node for SAM D5x and E5x
The Atmel SAM D5x and E5x series SoCs include the ARM memory protection
unit that supports up to 8 memory regions.

This commit adds the missing device tree MPU node to `samd5x.dtsi`,
which is used by both the SAM D5x and E5x series SoCs.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-05-04 17:14:35 +02:00
Stephanos Ioannidis
4d59f4af60 soc: arm: atmel_sam: Add devicetree.h inclusion in soc.h
This commit adds the `devicetree.h` header inclusion in the Atmel SAM-
family SoC header files, as required by the ARM SoC conventions.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-05-04 17:14:35 +02:00
Stephanos Ioannidis
d1e0bd2c5d soc: arm: atmel_sam0: Add devicetree.h inclusion in soc.h
This commit adds the `devicetree.h` header inclusion in the Atmel SAM0-
family SoC header files, as required by the ARM SoC conventions.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-05-04 17:14:35 +02:00
Joakim Andersson
fdb3da8aff Bluetooth: host: Rename BT_LE_CONN_OPT to BT_CONN_LE_OPT
Rename connection options to be consistent with the rest of the API
names in conn.h

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-05-04 17:48:22 +03:00
Joakim Andersson
8b70079ebe Bluetooth: host: Remove BT_LE_CONN_OPT_2M option
Remove the BT_LE_CONN_OPT_2M option and update documentation.
This was a misunderstand about the init PHY HCI parameter.
The init PHY in the extended connection create command does not
determine which PHYs are accepted as the initial PHY of the
connection. This is instead determined by the secondary PHY of the
extended advertiser.
The init PHY parameter only specifies which conn parameters are
provided, and since we only provide one conn parameter this option
has no effect.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-05-04 17:48:22 +03:00
Francois Ramu
280baaecbf tests: drivers: spi loopback on nucleo_f411 board
This configures the nucleo_f411re board for testing the SPI loopback
with DMA V1 transfer. DMA instance 2 is used.
This test requires pin SPI_A_MISO (D12) to be connected
to pin SPI_A_MOSI (D11) on the nucleo_wb55rg boardtest dma_V1

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-05-04 09:46:07 -05:00
Francois Ramu
3ae853797f tests: drivers: spi loopback on nucleo_l476 board
This configures the nucleo_l476rg board for testing the SPI loopback
when with DMA transfer.
It requires pin MOSI to be connected to pin MISO of the SPI1
SPI tx/rx are assigned to the request ID 1 of dma1 channels 3 and 2

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-05-04 09:46:07 -05:00
Francois Ramu
28ff24d0ac dts: arm: stm32l4: configure dma instances
This patch is defining the DMA1 & 2 for the sm32l4 series
with 7 channels and support of mem2mem transfers

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-05-04 09:46:07 -05:00
Francois Ramu
18f5a83475 tests: drivers: spi loopback testcase to reload dma on stm32
This adds a new testcase in the spi_loopback test application
to use several buffers for the DMA transfer.
It requires the MOSI to be connected to the MISO of the SPI1.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-05-04 09:46:07 -05:00
Francois Ramu
9f497bf154 tests: drivers: spi loopback test application for dma on stm32
This changes the spi_loopback test application to use the DMA transfer.
In case of DMA, some testcases are useless.
It requires the MOSI to be connected to the MISO of the SPI1.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-05-04 09:46:07 -05:00
Francois Ramu
1bd195e654 tests: drivers: spi loopback test application
This adds some commments to the spi_loopback test application

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-05-04 09:46:07 -05:00
Francois Ramu
4c5d9da02e dts: bindings: define the bindings for SPI dma client on stm32 series
This includes the dma cells as client for the spi
An example of the client part is defined in the dma.yaml
Consequently, bindings for the dmas property becomes then 'not required'
Including dma.yaml is not needed as dma properties
are now part of base.yaml

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-05-04 09:46:07 -05:00
Francois Ramu
469e505278 drivers: spi: control of the dma callback on spi client for stm32
The DMA callback function now controls the tx or rx buffers
and reload dma in case of multiple trnasfer before the transfer ends

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-05-04 09:46:07 -05:00
Francois Ramu
ce093dc35e drivers: spi: Enable dma transfer for SPI on stm32
Enable dma operations with or w/o a dmamux on STM32
for SPI periph/memory operations.
Use the pi dma client with dma macros

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-05-04 09:46:07 -05:00
Francois Ramu
bea0a95578 drivers: dma: stm32 dma_reload function must re-enable
This patch is disabling the dma channel before reloading
source and dest for memory and peripheral addresses
Then the channel is enabled to re-launch the transfer.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-05-04 09:46:07 -05:00
Stephanos Ioannidis
28e2bfc68e boards: arm: mps2_an521: Enable QEMU icount mode
This commit enables the QEMU icount mode for `mps2_an521`, in order to
decouple the host clock from the emulated guest clock.

This prevents guest timing instability from causing test failures when
the host CPU load is very high.

The icount `shift` value of 7 was empirically chosen to allow the tests
to complete in both realistic and reasonable amount of time.

The following are quick notes on the parameters used:

* -icount shift=7: Execute one instruction every 128ns of virtual time
* -icount align=off: Do not synchronise the host and guest clocks
* -icount sleep=off: Advance virtual time without sleeping/waiting
* -rtc clock=vm: Isolate the guest RTC time from the host

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-05-04 09:16:09 -05:00
Kumar Gala
59d3cc213e tests: Convert DT_ALItAS_* to new DT_ALIAS() macro
Convert DT_ALIAS_* defines to use DT_ALIAS() plus other macros from
include/devicetree.h.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-04 09:11:38 -05:00
Kumar Gala
42a2d99a1a tests: uart_async_api: Convert to use new dts macros
Convert DT_UART_{0,1}_NAME to DT_NODELABEL() references as the cases are
board specific and this allows us to remove DT_UART_{0,1}_NAME defines
in dts_fixup.h

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-04 09:08:59 -05:00
Anas Nashif
19ad25fc9b ci: fix whatchanged script matching
When files were added, matching did not work and we were counting added
files twice. Use sets to make sure we have a unique list of files.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-05-04 09:07:00 -05:00
Peter Bigot
786208656e checkpatch: suppress SPDX license line check
Zephyr has not committed to complying with the upstream requirement
that the SPDX declaration be on the first line of a file, so disable
the warning.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-05-04 09:06:31 -05:00
Kumar Gala
024ea0e44e adc: Kconfig: Remove per instance ADC_{0..2} Kconfig symbols
No code utilizes CONFIG_ADC_{0..2} so we can now remove the Kconfig
sybmols for them.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-04 09:04:16 -05:00
Alberto Escolar Piedras
2bc5499651 doc: native_posix: Add section about 32 and 64 bits
native_posix supports for some time now generating a 64bit
binary with the native_posix_64 target, but we never got
to document it.
Add a section describing it, and correct the WSL1
note/warning (also with a link with instructions on how to hack
WSL1 to make it run 32 bit binaries)

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2020-05-04 15:57:33 +02:00
Torsten Rasmussen
92507405d7 doc: cmake: using common python.cmake code
Fixes: #24903

This commit now includes ${ZEPHYR_BASE}/cmake/python.cmake to locate
python3.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-05-04 08:39:36 -04:00
Kumar Gala
8101a0f661 flash: dts: replace DT_FLASH_{ERASE,WRITE}_BLOCK_SIZE with new macros
Replace:
	DT_FLASH_ERASE_BLOCK_SIZE ->
	DT_PROP(DT_CHOSEN(zephyr_flash), erase_block_size)

	DT_FLASH_WRITE_BLOCK_SIZE ->
	DT_PROP(DT_CHOSEN(zephyr_flash), write_block_size)

As this allows us to phase out the old generator.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-04 13:26:04 +02:00
Marek Porwisz
673b1da46d tests: subsys: openthread: OpenThread radio interface tests
Currently there are no test for openthread on zephyr.
Created tests for OpenThread platform radio interface.

Signed-off-by: Marek Porwisz <marek.porwisz@nordicsemi.no>
2020-05-04 12:00:02 +02:00
Marek Porwisz
d9f8a6f8e9 subsys/testsuite: Extended mocking API to support arrays
I was missing mocking api to compare data under an address pointed
by a parameter as some functions may copy buffers before passing
further.
Created ztest_expect_data and ztest_check_expected_data.

Signed-off-by: Marek Porwisz <marek.porwisz@nordicsemi.no>
2020-05-04 12:00:02 +02:00
Johan Hedberg
e1dddf7bef Bluetooth: Fix NULL pointer dereference when bt_send() fails
The last parameter to hci_cmd_done() is expected to be a valid net_buf
since the function immediately tries to dereference it. Fix this by
passing the appropriate buffer reference to the function.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2020-05-04 10:59:39 +03:00
Andrew Boie
9b055ecf82 qemu_x86: use icount for 32-bit
Options summary:

 -icount shift=5: Execute one instruction every 32ns of virtual time
 -icount align=off: Do not synchronise the host and guest clocks
 -icount sleep=off: Advance virtual time without sleeping/waiting
 -rtc clock=vm: Isolate the guest RTC time from the host

64-bit still has some issues that are being looked at.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-05-03 21:43:13 -04:00
Anas Nashif
fc828fde6f doc: can: use :c:macro for K_FOREVER
use :c:macro for K_FOREVER instead of a single tick.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-05-02 15:41:43 -04:00
Anas Nashif
262bf14c63 doc: kernel: add section about queues
We did not have any reference to queues and doxygen information were not
linked correctly. Add a placeholder and pull in doxygen data so whenever
someone adds a reference, a link is created.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-05-02 15:41:43 -04:00
David Brown
99374d7808 doc: security: Update vulnerability disclosure
Changes to the security vulnerability reflecting policy changes approved
by the board.

Signed-off-by: David Brown <david.brown@linaro.org>
2020-05-02 11:37:43 -04:00
Kumar Gala
897652a536 adc: adc_shell: Rework device name extraction from devicetree
Replace having dts_fixup.h files define DT_ADC_{0..2}_NAME with using
the new devicetree.h macros.  We test to see what driver compat is
enabled via DT_HAS_COMPAT and set DT_DRV_COMPAT to that compat.  Than we
can utilize the DT_INST_LABEL() macro to extract the name of the device.

We also replace the Kconfig ADC_{0..2} symbols with DT_HAS_DRV_INST.
This will allow us to remove those Kconfig symbols as this was the only
usage.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-02 10:27:07 -05:00
Peter Bigot
1ec9d2a9df clang-format: Update with latest FOR_EACH macro list
Correct the shell fragment to use the spelling Zephyr uses, and re-run
it to update the list.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-05-02 11:23:13 -04:00
Peter Bigot
afe8a3777a scripts: modify checkpatch to respect Zephyr for_each spelling
Linux uses for_each in macros that produce loops; Zephyr uses
FOR_EACH.  Update the corresponding checks to match Zephyr's spelling.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-05-02 11:23:13 -04:00
Peter Bigot
5b10fac97e scripts: update checkpatch to latest from the linux kernel
This takes the linux diffs between
a8c964eacb21288b2dbfa9d80cee5968a3b8fb21 and
16fbf79b0f83bc752cee8589279f1ebfe57b3b6e and applies them to the
Zephyr copy.  Three changes did not apply cleanly:

* linux added a comment to the line that enables C99 comments;
  Zephyr disallows them.
* linux uses vendor-prefixes.yaml; zephyr uses the older .txt file
* manual addition of colon in a check before BRACKET_SPACE error

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-05-02 11:23:13 -04:00
Stephanos Ioannidis
0eaa495ccb samples: drivers: can: Rename directory for consistency
This commit renames the CAN sample directory name from `CAN` to `can`
to be consistent with others.

Noting that the CAN driver test directory is named `tests/drivers/can`,
we have no excuse for naming the CAN driver sample directory
`samples/drivers/CAN`.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-05-02 09:54:06 -04:00
Luiz Augusto von Dentz
ec5603da8d Bluetooth: L2CAP: Add status flag to track encrypt pending
This adds a new flag to track if the L2CAP channel is pending waiting
for encryption to be changed to resume connecting.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2020-05-02 15:59:14 +03:00
Luiz Augusto von Dentz
70271435dd Bluetooth: shell: Enable BT_EATT
This enables BT_EATT for shell samples so it can be build test by CI and
gives user the ability of test it using shell commands.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2020-05-02 15:59:14 +03:00
Luiz Augusto von Dentz
e0cbdf3b87 Bluetooth: GATT: Add support for new PDUs
This adds support for ATT_MULTIPLE_HANDLE_VALUE_NTF,
ATT_READ_MULTIPLE_VARIABLE_REQ and ATT_READ_MULTIPLE_VARIABLE_RSP.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2020-05-02 15:59:14 +03:00
Luiz Augusto von Dentz
f4192bda26 Bluetooth: ATT: Add support EATT bearer
This adds support for EATT bearer which was introduced in 5.2, they work
as extra channels to have GATT traffic, at the moment it is completely
transparent to application when they are in use since the allocation
happens automatically.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2020-05-02 15:59:14 +03:00