Commit graph

41120 commits

Author SHA1 Message Date
Jukka Rissanen
420b195b5e drivers: console: uart_mux: Initial UART muxing support
Create support for muxed UARTs which are attached to a real
UART and which use GSM 07.10 muxing protocol to create virtual
channels that can be run on top of the real UART.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-04-17 10:15:54 +03:00
Jukka Rissanen
b5525a0f91 drivers: gsm_mux: Support GSM 07.10 muxing protocol
Add support to GSM 07.10 muxing protocol which is used to
share the same UART for PPP and AT commands among other things.
This allows e.g., the modem to send SMS and have PPP connection
active at the same time.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-04-17 10:15:54 +03:00
Gerson Fernando Budke
894dcbbf15 lib: updatehub: Improve probe security
Improve buffer overflow security on probe_cb. This ensures that socket
buffer have fixed lenght and content received by COAP fills properly on
metadata buffer. After that, ensures that metadata content is a valid
string with length lower than metadata size.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2020-04-17 10:09:56 +03:00
Gerson Fernando Budke
6238e52062 lib: updatehub: Refact to use bin2hex
Use bin2hex instead inline conversion.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2020-04-17 10:09:56 +03:00
Gerson Fernando Budke
0801aef3fb lib: updatehub: Fix variable-size string copy
A malformed JSON payload that is received from an UpdateHub server
may trigger memory corruption in the Zephyr OS. This could result
in a denial of service in the best case, or code execution in the
worst case.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2020-04-17 10:09:56 +03:00
Vincent van der Locht
d1f51db366 drivers: eth: Kconfig.sam_gmac: Add sam4e support for queues
Fixed the ETH_SAM_GMAC_QUEUES config by adding if-statements per SoC
series.

Signed-off-by: Vincent van der Locht <vincent@vlotech.nl>
Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-04-17 09:23:33 +03:00
Gerson Fernando Budke
93a0e4aa6d boards: arm: sam_v71_xult: Fix dts model and compatible
Set model according with SoC revision A or B. Compatible follows
same approach.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-04-17 09:23:33 +03:00
Gerson Fernando Budke
033761d651 boards: arm: sam_e70_xplained: Fix dts model and compatible
Set model according with SoC revision A or B. Compatible follows
same approach.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-04-17 09:23:33 +03:00
Gerson Fernando Budke
afcfd2b52c drivers: ethernet: eth_sam_gmac.c: Fix macro name
Fix macro name from disable_all_queue_interrupt to
disable_all_priority_queue_interrupt.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-04-17 09:23:33 +03:00
Gerson Fernando Budke
d197ef9861 boards: sam4e_xpro: Enable GMAC in device tree
This commit enables the newly added GMAC instance in the `sam4e_xpro`
device tree.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-04-17 09:23:33 +03:00
Gerson Fernando Budke
2266d7a21c boards: arm: sam4e_xpro: Add GMAC defaults
This enable GMAC driver by default if the end application selects
NETWORKING. The driver will set MII interface since is the only one
available for SAM4E and will select a random MAC value.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-04-17 09:23:33 +03:00
Gerson Fernando Budke
15c048a1dd drivers: eth: sam_gmac: Use DT max_frame_size option
This commit updates the Atmel SAM GMAC driver to select max frame size
value from the device tree. Now GMAC driver can operate with the three
different frame size options available.

The current supported values are: 1518, 1536 and 10240.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-04-17 09:23:33 +03:00
Gerson Fernando Budke
3c4fbfddf5 drivers: eth: sam_gmac: Fix phy layer setup
The current setup of physical layer forces RMII interface. The code was
refactored to have only one point to select proper phy interface. Now,
GMAC driver works with both RMII or MII interface. The phy connection
type is now selected by device tree. The default phy connection is RMII.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-04-17 09:23:33 +03:00
Gerson Fernando Budke
0ec1df07ca dts: arm: atmel: Add SAM4E GMAC phy-connection-type
The SAM4E GMAC version can use only MII as phy-connection-type. This
update the current default RMII value to MII.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-04-17 09:23:33 +03:00
Gerson Fernando Budke
2470292613 dts: bindings: eth: Add GMAC options
This add the following options to GMAC device tree bindings:
 - max-frame-size
 - max-speed
 - phy-connection-type

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-04-17 09:23:33 +03:00
Gerson Fernando Budke
4df817d273 drivers: eth: Kconfig.sam_gmac: Fix NOCACHE dependency
The NOCACHE_MEMORY can be enabled only for those MCU that support data
cache. The currently SoC that doesn't have data cache is SAM4E.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-04-17 09:23:33 +03:00
Gerson Fernando Budke
84ecfd9b57 drivers: eth: sam_gmac: Add data cache checks
Improve data cache conditional build. Now data cache code is build
only if device have support to it. This enables GMAC driver for use
with devices that don't have data cache instructions.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-04-17 09:23:33 +03:00
Vincent van der Locht
c6fb9c3d31 include: linker: section_tags.h: Add __nocache fallback
Some drivers support NOCACHE_MEMORY sections. To have a default
fallback for systems where this isn't available or disabled a
fallback define is added.

Signed-off-by: Vincent van der Locht <vincent@vlotech.nl>
Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-04-17 09:23:33 +03:00
Gerson Fernando Budke
f765e2300d soc: arm: atmel: Add sam4e gmac pins
Add sam4e gmac pin definitions to use ethernet driver.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-04-17 09:23:33 +03:00
Gerson Fernando Budke
03d02fab50 dts: arm: atmel: Add SAM 4E GMAC instance
This commit adds a GMAC instance to the SAM 4E device tree.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-04-17 09:23:33 +03:00
Gerson Fernando Budke
8c2a1597db drivers: eth: eth_sam_gmac: Split DMA queue flags
This cleans up DMA flags by separating the necessary flags for devices
with one or multiple RX/TX queues.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-04-17 09:23:33 +03:00
Lukasz Maciejonczyk
3ba7a3c82a net: l2: openthread: Add config option to enable OpenThread CoAP api
There was no way to use Openthread CoAP api in zephyr application so
far. These changes enable the feature. Now you can fully use CoAP
communication in an application working in Thread network.

Signed-off-by: Lukasz Maciejonczyk <Lukasz.Maciejonczyk@nordicsemi.no>
2020-04-17 09:21:41 +03:00
Robert Lubos
a9eda4f622 net: openthread: Set proper FPB matching mode
Set FPB handling mode to Thread in OpenThread radio platform driver.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-04-17 09:17:38 +03:00
Robert Lubos
f1f2405eb1 drivers: ieee802154_nrf5: Handle frame pending bit mode
Configure FPB handling in the radio driver.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-04-17 09:17:38 +03:00
Robert Lubos
04ddf6f957 net: ieee802154_radio: Extend frame pending bit handling configuration
Thread and Zigbee differ in how do they handle Frame Pending Bit field
in their frames. Introduce a new enum, `ieee802154_fpb_mode`, which
allows to configure the radio driver in an appropriate mode.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-04-17 09:17:38 +03:00
Robert Lubos
6afdd613d1 net: openthread: Set information about ACK FPB on receive
Set information about Frame Pending Bit from the ACK response in the
frame passed to OpenThread.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-04-17 09:17:38 +03:00
Robert Lubos
c39d0b6914 drivers: ieee802154_nrf5: Notify about FPB value in ACK reponse
The radio driver will now notify the upper layer about Frame Pending Bit
value in the ACK response it sent.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-04-17 09:17:38 +03:00
Robert Lubos
00d1f6e772 net: pkt: Add ACK Frame Pending Bit information for ieee802154
OpenThread expects information, whether Frame Pending Bit was set in the
ACK response sent by the radio driver. Carry this information in the
net_pkt structure.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-04-17 09:17:38 +03:00
Kumar Gala
2cd4681bd5 drivers: timer: sam0_rtc_timer: Fix incorrect DT_INST conversion
clock-generator is a normal property.  To access it we should use
DT_INST_PROP(0, clock_generator) and not DT_INST_CLOCKS_CELL().

Fixes: #24399

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-16 14:09:23 +02:00
Martí Bolívar
d6f5f51f37 scripts: fix west zephyr-export error handling
Fix two issues:

1. The script assumes the default CMake generator build tool
   platform is installed. On Linux at least, that's Make instead
   of Ninja, but Make might not be installed since Zephyr recommends
   Ninja. On Windows, that might be VS Code or nmake.

   Calling `cmake -P pristine` instead of `cmake --build <path>
   --target pristine` has the benefit of removing the dependency on a
   build command, and hence the default generator is not relevant.

2. It also assumes run_cmake() returns control, and therefore pristine
   can be run.

   However, if the cmake command fails hard (say, due to issue #1
   before this patch), run_cmake() throws an exception instead.

   Fix that by trying to run the pristine target in a finally block
   instead, and adding some manual cleanup steps in case the build
   system is in a bad state and pristine fails too.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Signed-off-by: Torsten Rasmussen <torsten.rasmussen@nordicsemi.no>
2020-04-16 07:46:18 -04:00
Torsten Rasmussen
94de3e9f60 cmake: FindPython3: Adjust python3 program search
Fixes: #24340

Using find_package(Python3 3.6) will select the highest available
python3.

This means that in case user has:
/usr/bin/python  --> python2.7
/usr/bin/python3 --> python3.6
/usr/bin/python3.6
/usr/bin/python3.8

then CMake will choose python 3.8.
This commit changes that behavior, so that in the above scenario, then
Python 3.6 will be preferred.

It also adds the following, python will be preferred over python3, if
both meets the minimum requirement.
For example:
/usr/bin/python  --> python3.6
/usr/bin/python3 --> python3.7
then Python 3.6 is prefered.

It further introduces PYTHON_PREFER variable, which can be used to
further control the behavior.
As example -DPYTHON_PREFER=python3.7 will choose Python 3.7 if
installed.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-04-16 07:43:14 -04:00
Kumar Gala
9aefdaff2e cmake: kconfig: pass EXTRA_DTC_FLAGS to kconfig for EDT init
Pass EXTRA_DTC_FLAGS to kconfig so the EDT object we have in
kconfigfunctions can use that to set warn_reg_unit_address_mismatch
properly.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-16 06:07:24 -05:00
Maureen Helm
1b6d4dd223 drivers: spi: Set dummy data in mcux drivers
Sets the "dummy data" value to send when the transmit buffer is null.
Fixes the spi_null_tx_buf test in tests/drivers/spi/spi_loopback on the
lpcxpresso54114 board.

Tested on frdm_k64f, mimxrt1050_evk, and lpcxpresso54114_m4 boards.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-04-16 06:01:43 -05:00
Peter Bigot
97a5ec0d4f doc: gsg: provide a working link to the Zephyr SDK download page
The command-line is correct but specifies a particular release, which
may be out of date, and is not formatted as a URL that can be clicked.
Add a proper link.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-04-16 10:24:38 +02:00
Ruth Fuchss
8b9d7a2c52 doc: boards: fix capitalization of chip name
Fix the capitalization of "nRF52840".

Signed-off-by: Ruth Fuchss <ruth.fuchss@nordicsemi.no>
2020-04-16 10:22:08 +02:00
Oleg Zhurakivskyy
4fbf3c3672 net: tcp2: On active connection close go to FIN_WAIT_1
In order to implement active connection close with the
TIME_WAIT state, send FIN and enter FIN_WAIT_1 state.

We actually send FIN+ACK as most of the implementations do.

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2020-04-16 11:10:36 +03:00
Oleg Zhurakivskyy
40799bc986 net: tcp2: Implement FIN_WAIT_1 state
On active close, wait for FIN+ACK and subsequently
enter TIME_WAIT state.

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2020-04-16 11:10:36 +03:00
Oleg Zhurakivskyy
52fca0a8d2 net: tcp2: Add a TIME_WAIT timer and state
In order to support TIME_WAIT state during the TCP connection
termination, add a TIME_WAIT timer and the corresponding state.

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2020-04-16 11:10:36 +03:00
Oleg Zhurakivskyy
f95ceec35b net: tcp2: Remove extra flags reset in TCP_CLOSED
After the check for unconsumed flags was removed,
this is no longer needed.

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2020-04-16 11:10:36 +03:00
Oleg Zhurakivskyy
3dc72dffb0 net: tcp2: Readability rename of TCP_FIN_WAIT states
In order to improve readability, rename TCP_FIN_WAIT
states into TCP_FIN_WAIT_1, TCP_FIN_WAIT_2.

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2020-04-16 11:10:36 +03:00
Jeanina Dragusin
40ee38a945 bluetooth: controller: enable privacy for RV32M1
This patch adds the selection of the necessary CONFIG_*
options for allowing the use of privacy on VEGA platform

Signed-off-by: Jeanina Dragusin <ancajeanina.dragusin@nxp.com>
2020-04-15 13:43:00 -05:00
Jeanina Dragusin
6099e0f928 bluetooth: controller: openisa/RV32M1: add RPA support
The radio on the VEGA platform will now be able to resolve Resolvable
Private Addresses through the use of the CAUv3 hardware. With this
patch the RPA feature is now fully supported on the Controller:
RPA addresses are generated with local IRK and resolved with
previously exchanged peer IRK.

Signed-off-by: Jeanina Dragusin <ancajeanina.dragusin@nxp.com>
2020-04-15 13:43:00 -05:00
Martí Bolívar
4fad53522c sanitycheck: infer ZEPHYR_BASE if unset
Now that the main Zephyr build system (and the documentation's) no
longer require ZEPHYR_BASE in the environment, the sanitycheck
script's continuing to require this makes less sense.

We can easily find ZEPHYR_BASE starting from a given sanitycheck
script, so let's just do that. Preserve the ability for a user to
override the ZEPHYR_BASE location in the environment as usual for
compatibility.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-04-15 14:42:21 -04:00
Bjarne Steinsbo
4034ef0633 boards: arm: black_f407ve: Add support for on-board SPI flash
This board contains an on-board Winbond W25Q16.
The chip is connected to spi1 using PB3-PB5 and PB0 as CS.

Signed-off-by: Bjarne Steinsbo <bjarne@gmail.com>
2020-04-15 13:15:29 -05:00
Kumar Gala
7b6796ee79 soc: arm: nordic_nrf: 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-04-15 11:17:32 -05:00
Kumar Gala
f72bfda53c drivers: pwm: pwm_nrf5_sw: 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-04-15 11:17:32 -05:00
Kumar Gala
a152f147db drivers: ipm: ipm_nrfx_ipc: 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-04-15 11:17:32 -05:00
Kumar Gala
f04490e300 drivers: flash: nrf_qspi_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-04-15 11:17:32 -05:00
Stephanos Ioannidis
a426175e00 boards: qemu_cortex_r5: Remove ignore tags for working tests
While the Cortex-R arch port does not currently support memory
protection and userspace, the `memory_protection` and `userspace` test
tags should not be ignored because doing so can unintentionally disable
other relevant tests.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-04-15 15:49:27 +02:00
Stephanos Ioannidis
2d6194170b arch: arm: aarch32: Fix read_timer_end_of_isr register preservation
The current implementation to preserve r0 and r3 registers around the
call to `read_timer_end_of_isr` function has the following problems:

1. STM and LDM mnemonics are used without proper suffixes, in attempt
   to implement PUSH and POP (i.e. STMFD and LDMFD). The suffix-less
   STM mnemonic is equivalent to STMEA (increment after), which clearly
   is not a PUSH operation, and this corrupts the interrupt stack,
   leading to crashes on the Cortex-R.

2. The current implementation unnecessarily preserves additional r1, r2
   and lr registers. There is no need to preserve r1 and r2 because the
   values contained in these registers are not used after the function
   call; as for the lr register, it is already pushed to the stack when
   the interrupt service routine enters.

This commit removes all the unnecessary register preservations and
fixes the incorrect STM and LDM usages.

Note that the PUSH and POP aliases are used in place of the STMFD and
LDMFD mnemonics because they are used throughout the rest of the code.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-04-15 15:49:27 +02:00