Commit graph

44498 commits

Author SHA1 Message Date
Erwan Gouriou
252a623ca2 drivers/serial: stm32: Enable use of dt pinctrl as serial signals
When available, use dt pinctrl to configure a variable number of
serial signals.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-10-01 11:08:42 -05:00
Erwan Gouriou
d1afd83df0 drivers/pinmux: stm32: provide dt pinctrl to gpio driver interface
Provides tool set to be used by device drivers in order to be able
to configure device signals.
This does not involve the implementation of a dedicated pinctrl
driver. In this regard, this is equivalent to implementation used
for treatment of current pinmux.c files.

Since STM32F1 uses a different GPIO configuration scheme, its
support is exlcuded for now.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-10-01 11:08:42 -05:00
Erwan Gouriou
ccd6b72bc0 drivers/serial: stm32: Fix indentation in STM32_UART_INIT
Looks better this way

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-10-01 11:08:42 -05:00
Erwan Gouriou
b48ba090e4 include/dt-bindings: stm32: provide stm32-pinctrl-common.h binding
Provide stm32-pinctrl-common.h matching st,stm32-pinmux binding.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-10-01 11:08:42 -05:00
Erwan Gouriou
14be1f3cd7 dts/bindings: stm32: provide st,stm32-pinctrl binding
Remove unused st,stm32-pinmux binding.
Provide st,stm32-pinctrl binding, equivalent to Linux stm32 one.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-10-01 11:08:42 -05:00
Erwan Gouriou
b9e59b5e9d drivers/pinmux: stm32: minor fixes
Update stm32_pin_configure prototype to use more appropriate
unsigned arguments
Additionally, fix documentation for z_pinmux_stm32_set function

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-10-01 11:08:42 -05:00
Erwan Gouriou
2223d7b4fc dts: stm32: Rename compatible st,stm32-pinmux to st,stm32-pinctrl
Rename compatible st,stm32-pinmux to st,stm32-pinctrl to better
reflect the nature of upcoming child nodes.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-10-01 11:08:42 -05:00
Carlo Caione
871bdd0712 arch: arm64: Deprecate booting from EL2
We are deprecating booting and running in EL2.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2020-10-01 10:42:47 -04:00
Carlo Caione
fb2bf23ec1 arch: arm64: Remove EL2/EL3 code
Zephyr is only supposed to be running at EL1 (+ EL0). Now that we drop
in EL1 from ELn at start we can remove all the EL2/EL3 unused code.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2020-10-01 10:42:47 -04:00
Carlo Caione
7d40208ef7 arch: arm64: Remove CONFIG_SWITCH_TO_EL1
Remove the useless CONFIG_SWITCH_TO_EL1 since there should be no reason
to run Zephyr in EL3. So just drop to EL1 by default when booting from
EL3. Remove also non-reachable code.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2020-10-01 10:42:47 -04:00
Carlo Caione
46b42e347f boards: qemu_cortex_a53: Start in EL3
No need anymore to start QEMU in EL1. Start directly from EL3 and let
the code drop to EL1 like it would happen on a real hardware.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2020-10-01 10:42:47 -04:00
Jan Pohanka
74dbcfebab drivers: wifi: fix simplelink driver to use zsock_ functions
This fix removes dependency on CONFIG_POSIX_API
or NET_SOCKETS_POSIX_NAMES.

Signed-off-by: Jan Pohanka <xhpohanka@gmail.com>
2020-10-01 17:35:45 +03:00
Jan Pohanka
91adf41dd4 net: sockets: tls: fix using of zsock_ functions
Use zsock_ variants of socket functions to be independent on
NET_SOCKETS_POSIX_NAMES config.

Signed-off-by: Jan Pohanka <xhpohanka@gmail.com>
2020-10-01 17:35:45 +03:00
Jan Pohanka
9e5dc213cb net: mqtt: fix tests to use zsock_ functions
Use zsock_ variants of socket functions in mqtt tests.

Signed-off-by: Jan Pohanka <xhpohanka@gmail.com>
2020-10-01 17:35:45 +03:00
Jan Pohanka
c737cca7be net: mqtt: fix sample to use zsock_ functions
Use zsock_ variants of socket functions in mqtt sample application.

Signed-off-by: Jan Pohanka <xhpohanka@gmail.com>
2020-10-01 17:35:45 +03:00
Jan Pohanka
fff28ad8ae net: mqtt: use zsock_ functions
Using zephyr's internals zsock_ calls make mqtt library more compatible,
now it does not depend on NET_SOCKETS_POSIX_NAMES.

Signed-off-by: Jan Pohanka <xhpohanka@gmail.com>
2020-10-01 17:35:45 +03:00
Erwan Gouriou
ee3dab3082 boards: nucleo_l552ze_q_ns: Use dts flash partitioning.
Provide device tree flash partition in order to configure
and flash non secure binary.
Flash partitioning depends on TFM configuration and use case,
so it is provided as an overlay in the sample it is used.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-10-01 15:43:28 +02:00
Lingao Meng
f16c653be9 Bluetooth: Mesh: Move Replay Protect to seperate module
Move RPL to seperate module, and remove it in `bt_mesh`
structure.

Signed-off-by: Lingao Meng <mengabc1086@gmail.com>
2020-10-01 16:20:24 +03:00
Paul Sokolovsky
601e00376b samples: sockets: dumb_http_server: If send() fails, print errno
Helps with debugging TCP stack issues.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2020-10-01 15:46:51 +03:00
Anas Nashif
994bd5b876 sanitycheck: tests: adapt testsuite to new filter
Make testsuite pass with new changes.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-10-01 07:28:01 -05:00
Anas Nashif
405f1b62f3 sanitycheck: support --filter to limit number of tests built
Use --filter=runnable for example to limit the tests being built to
those which actually can run on a device or a emulation platform.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-10-01 07:28:01 -05:00
Anas Nashif
9603fe40bd sanitycheck: adapt testsuite for build_only cleanup
Change tests to sync with changes in the library.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-10-01 07:28:01 -05:00
Anas Nashif
4ca0b95956 sanitycheck: build_only ambiguity cleanup
build_only was being used in different contexts and was confusing, so
clean this up and in some places just set if a test is runnable, a
testcase should always be buildable if the filters are matching.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-10-01 07:28:01 -05:00
Kumar Gala
9c45673d8e net: sntp: Remove deprecated API function
Remove sntp_request as its been marked deprecated since at least Zephyr
2.3 release.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-10-01 07:14:08 -05:00
Kumar Gala
55be783c85 settings: Remove deprecated SETTINGS_USE_BASE64 support
Remove code and associated tests and Kconfig related to
SETTINGS_USE_BASE64 that was deprecated in Zephyr 2.2

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-10-01 07:05:27 -05:00
Luke Starrett
4800b03e56 arch: arm64: cosmetic changes to register dump
- Display full 64-bits register width in crash dumps
- Some values were prefixed 0x, some not.  Made consistent.

Signed-off-by: Luke Starrett <luke.starrett@gmail.com>
2020-10-01 07:29:27 -04:00
Luke Starrett
169e7c5e75 arch: arm64: Fix arm64 crash dump output
- x0/x1 register printing is reversed
- The error stack frame struct (z_arch_esf_t) had the SPSR and ELR in
  the wrong position, inconsistent with the order these regs are pushed
  to the stack in z_arm64_svc.  This caused all register printing to be
  skewed by two.
- Verified by writing known values (abcd0000 -> abcd000f) to x0 - x15
  and then forcing a data abort.

Signed-off-by: Luke Starrett <luke.starrett@gmail.com>
2020-10-01 07:29:27 -04:00
Jukka Rissanen
8bb83454b4 net: tcp2: Do not assert when cancelling send timer
No real need to assert when the send timer is cancelled. Just
check if there is re-transmission going on and do nothing if
there is not.

Fixes #28758

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-10-01 14:19:07 +03:00
Jukka Rissanen
cace577d68 net: tcp2: Local accepted socket was not bound
The local and accepted socket was not bound which caused the
local address to be set as NULL. This then caused issues when
zsock_getsockname() was called by the application.

Fixes #28735

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-10-01 14:19:07 +03:00
Vinayak Kariappa Chettimada
8f203e46ca Bluetooth: shell: Fix PER SYNC conditional compilation
Fix conditional compilation to allow building test shell
with Periodic Advertising Sync alone.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-10-01 12:54:06 +02:00
Vinayak Kariappa Chettimada
416d7ee32a Bluetooth: controller: Fix latency cancel on LLCP initiation
Fix controller implementation to cancel peripheral latency
when initiating new control procedures.

Fixes #28699.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-10-01 12:53:53 +02:00
Vinayak Kariappa Chettimada
b6fb074d6e Bluetooth: controller: Connection termination race condition
Add checks to abort connection radio event preparation and
start, if the connection terminates with a race condition
with new radio event being prepared or being in prepare
pipeline.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-10-01 11:47:35 +02:00
Vinayak Kariappa Chettimada
3e2dc0d706 Bluetooth: controller: Add branch prediction hints
Add branch prediction hints in critical control paths in the
code.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-10-01 11:47:35 +02:00
Vinayak Kariappa Chettimada
d64bbd5a06 Bluetooth: controller: Add missing debug pin toggle
Add missing debug pin toggle on abort of connection event.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-10-01 11:47:35 +02:00
Jennifer Williams
1342d12500 codeowners: add owners for x86 development
Adding myself @jenmwms and @aasthagr as codeowners for
/arch/x86/, /soc/x86/, /boards/x86/, and
/drivers/serial/*ns16550* for x86 development.

Signed-off-by: Jennifer Williams <jennifer.m.williams@intel.com>
2020-09-30 19:32:37 -04:00
Andrew Boie
391935bea1 x86_64: add dedicated MEMORY area for locore
This had been hacked into the linker script, define
a proper MEMORY region for it.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-09-30 14:14:07 -07:00
Andrew Boie
7f4901b8a6 x86: 32-bit: remove mmu region list
This related to old infrastructure which has been removed
from Zephyr.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-09-30 14:14:07 -07:00
Andrew Boie
3807c51e4e x86: add common memory.ld
We need the same logic for each SOC, instead of copypasting
things just put this in a common file. This approach still
leaves the door open for custom memory layouts if desired.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-09-30 14:14:07 -07:00
Andrew Boie
27e00f497a x86: 32-bit: set _image_text_start properly
Strictly speaking, should bee a virtual, not physical address.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-09-30 14:14:07 -07:00
Andrew Boie
c3c7f6c6d3 x86: don't define _image_rom_* unless XIP
Meaningless if we are not a XIP system and are running
from RAM.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-09-30 14:14:07 -07:00
Andrew Boie
c74c388764 linker: use SECTION_DATA_PROLOGUE for app_smem
This is data and needs the implicit ALIGN_WITH_INPUT that
is provided with SECTION_DATA_PROLOGUE. Otherwise misalignment
may occur if XIP is turned on.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-09-30 14:14:07 -07:00
Andrew Boie
e0ca403f4c kernel: add assert for mis-used k_thread_create()
k_thread_create() works as expected on both uninitialized memory,
or threads that have completely exited.

However, horrible and difficult to comprehend things can happen if a
thread object is already being used by the kernel and
k_thread_create() is called on it.

Historically this has been a problem with test cases trying to be
parsimonious with thread objects and not properly cleaning up
after themselves. Add an assertion for this which should catch
both the illegal creation of a thread already active, or threads
racing to create the same thread object.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-09-30 14:11:59 -04:00
Andrew Boie
9c9312c8c5 tests: thread_stack: add idle stack size scenario
Show that trampolining thread self-aborts to the idle thread
works and that we have sufficiently set the idle stack size
for this, PM hooks, and dynamic kernel object cleanup.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-09-30 14:11:59 -04:00
Andrew Boie
f5a7e1a108 kernel: handle thread self-aborts on idle thread
Fixes races where threads on another CPU are joining the
exiting thread, since it could still be running when
the joiners wake up on a different CPU.

Fixes problems where the thread object is still being
used by the kernel when the fn_abort() function is called,
preventing the thread object from being recycled or
freed back to a slab pool.

Fixes a race where a thread is aborted from one CPU while
it self-aborts on another CPU, that was currently worked
around with a busy-wait.

Precedent for doing this comes from FreeRTOS, which also
performs final thread cleanup in the idle thread.

Some logic in z_thread_single_abort() rearranged such that
when we release sched_spinlock, the thread object pointer
is never dereferenced by the kernel again; join waiters
or fn_abort() logic may free it immediately.

An assertion added to z_thread_single_abort() to ensure
it never gets called with thread == _current outside of an ISR.

Some logic has been added to ensure z_thread_single_abort()
tasks don't run more than once.

Fixes: #26486
Related to: #23063 #23062

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-09-30 14:11:59 -04:00
Andrew Boie
e3796b95a2 tests: metairq: add extra verbosity
No functional change, just add some extra printouts and comments
to make it a little clearer the expected sequencing.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-09-30 14:11:59 -04:00
Andrew Boie
36361f7793 tests: heap: exclude on qemu_xtensa
This test takes a pathologically long time to run. The PR
this is part of takes 10x as long to run the test as it did
before.

Such behavior cannot be reproduced on real Xtensa hardware,
where the test completes on an Intel S1000 in 4 seconds.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-09-30 14:11:59 -04:00
Erwan Gouriou
3ab5ac81ca boards: stm32: Turn hardware stack protection on by default
Enable HW stack protection by default on all STM32 when possible.
This excludes all series based on M0(FO) and M0+(G0/L0).
Also this is made only on boards with enabled MPU (SRAM > 64K).

Cf similar change on nRF boards: #28470

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-09-30 10:46:16 -05:00
Noelle Clement
762b806c3d soc: arm: stm32: Add support for STM32L151xC SoC
STM32L151xC SoC differs from other L1 SoCs in RAM (32KiB) and
flash (256KiB) size, and amount of interrupts (57, see STM32Cube).
Devicetree and Kconfig support.

Signed-off-by: Noelle Clement <noelleclement@hotmail.com>
2020-09-30 10:32:33 -05:00
Erwan Gouriou
8efd1d7767 boards/arm: Remove soc compatible from board compatible
There's no reason to add soc compatible at this level.


Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-09-30 09:54:41 -05:00
Marcin Niestroj
c083548f80 drivers: wifi: esp: support reconfiguration of UART baudrate
Allow to reconfigure UART baudrate on ESP and on host MCU, so a
non-default baudrate can be used for communication. This option helps
for example to increase network bandwidth without touching ESP chip
firmware.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-09-30 17:05:22 +03:00