Commit graph

41120 commits

Author SHA1 Message Date
Benjamin Valentin
74f95c499e spi: sam0: Add support for SAME54
The SPI SERCOM peripheral found on the SAMD5x/SAME5x is very much alike
the one found in previous SAM0 MCUs.

Only the clock setup is different.

Signed-off-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2019-12-18 22:12:15 +01:00
Stephanos Ioannidis
7aa01ff0b0 boards: qemu_cortex_r5: Remove ignored tags for working tests.
This commit removes any ignored testing tags for working tests.

In the future, this ignored testing tag list will be further reduced
as critical bugs for the qemu_cortex_r5 platform are addressed
(see #20217).

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2019-12-18 22:11:25 +01:00
Stephanos Ioannidis
59cb2acd9e boards: qemu_cortex_r5: Add a temporary hack to support CI testing.
This commit adds a temporary hack to support CI testing of the
qemu_cortex_r5 platform.

The Xilinx QEMU, required to run the tests for this platform, is
currently not available in the default SDK for CI (version 0.10.3) and
attempting to run any tests with the AArch64 QEMU included in this SDK
will cause failures (see #20217).

Since the latest SDK (version 0.11.0-alpha-8) has been added to the CI
image to allow initial testing, this hack automatically detects this
and uses the Xilinx QEMU for testing the qemu_cortex_r5 platform.

When the Zephyr SDK 0.11.0 is available as the default SDK for CI in
the future, this commit should be reverted.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2019-12-18 22:11:25 +01:00
Stephanos Ioannidis
f36b39a713 boards: arm: qemu_cortex_r5: Use arm-generic-fdt machine type.
This commit modifies the 'qemu_cortex_r5' board qemu emulation to use
the arm-generic-fdt machine with the Xilinx-provided zcu102 device tree
instead of the hard-coded xlnx-zcu102 machine, which is very primitive
and cannot properly emulate the Cortex-R5 RPU of ZynqMP.

The QEMU zcu102 FDT (fdt-single_arch-zcu102-arm.dtb) in this commit was
generated from the v2019.2 release of the Xilinx/qemu-devicetrees.

Zephyr SDK version 0.11 Alpha 4 or above is required to use this, as
arm-generic-fdt is supported only by the Xilinx QEMU fork which was
added to the Zephyr SDK in the version 0.11 Alpha 4.

For more details, refer to the issue #20217.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2019-12-18 22:11:25 +01:00
Siddharth Chandrasekaran
850f355be1 drivers/crypto: Add macro to simplify access to ctx->drv_sessn_state
The conversion of struct cipher_ctx * to mtls_aes_context * happens in
a bunch of places. Add a macro MTLS_GET_CTX() to simplify this.

Signed-off-by: Siddharth Chandrasekaran <siddharth@embedjournal.com>
2019-12-18 22:10:29 +01:00
Siddharth Chandrasekaran
bf45e32fec samples: crypto: Add AES ECB mode sample
Add sample for AES ECB mode with FIPS-197 ECB test vetors

Signed-off-by: Siddharth Chandrasekaran <siddharth@embedjournal.com>
2019-12-18 22:10:29 +01:00
Siddharth Chandrasekaran
e21164cfb0 samples: crypto: Refactor variables for clarity
Rename global variable ciphertext used in cbc_mode() to
cbc_ciphertext and move it closer to cbc_mode(). Also, move
global variable iv into cbc_mode() to be consistent with
other *_mode() methods.

Signed-off-by: Siddharth Chandrasekaran <siddharth@embedjournal.com>
2019-12-18 22:10:29 +01:00
Siddharth Chandrasekaran
5fbaf9f0e5 drivers/crypto: Add support for AES ECB mode in mbedTLS shim
Add support for AES ECB mode of operation in mbedTLS shim driver.

Signed-off-by: Siddharth Chandrasekaran <siddharth@embedjournal.com>
2019-12-18 22:10:29 +01:00
Siddharth Chandrasekaran
30f0b3a37c drivers/crypto: Add support for AES CBC mode in mbedTLS shim
Add support for AES CBC mode of operation in mbedTLS shim driver.
Refactor mtls_session_setup() to allow multiple cipher modes to
co-exist.

Signed-off-by: Siddharth Chandrasekaran <siddharth@embedjournal.com>
2019-12-18 22:10:29 +01:00
Krzysztof Chruscinski
b29d141dab tests: subsys: logging: Add test suite for immediate mode
Added test suite with test cases which performs stress test
of the logger in immediate mode. There are multiple threads continuesly
logging and being preempted. Test verifies that system does not
ends up in assert or fault.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-12-18 13:08:46 -08:00
Krzysztof Chruscinski
0e14a95f83 logging: Use single byte log_output buffer in an immediate mode
Ensure that RTT and xtensa_sim backends are using single byte
log_output buffer.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-12-18 13:08:46 -08:00
Krzysztof Chruscinski
117fab3004 logging: log_output: Improve immediate mode handling
When in immediate mode ensure that buffering is not used in log output.
Every byte is pushed to the transport.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-12-18 13:08:46 -08:00
Peter Bigot
50a54f4a4a samples: sensors: isl29035: add sample
Add a sample to demonstrate and test the Renesas/Intersil ISL29035
light sensor driver.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-12-18 15:07:02 -06:00
Filip Brozovic
19d1ea2646 boards: stm32g0316-disco: add support for the ST STM32G0316-DISCO board
Add support for the ST STM32G0316-DISCO development board. This board
features an ST STM32G031J6 MCU on a breakable SO8 to DIL8 module, a user
LED and a button.

Signed-off-by: Filip Brozovic <fbrozovic@gmail.com>
2019-12-18 22:06:39 +01:00
Filip Brozovic
e541e63653 soc: arm: stm32g0: add STM32G031 SoC series
This commit adds support for the STM32G031xx SoCs
by STMicroelectronics.

Signed-off-by: Filip Brozovic <fbrozovic@gmail.com>
2019-12-18 22:06:39 +01:00
Filip Brozovic
9e92babca2 stm32: clock_control: fix APB2 peripheral clock control on stm32g0
The STM32G0 series of MCUs only has one APB, but two reset and clock
enable registers. Fix enabling/disabling the clock and getting the rate
for peripherals in the second register.

Signed-off-by: Filip Brozovic <fbrozovic@gmail.com>
2019-12-18 22:06:39 +01:00
Filip Brozovic
5756c00017 soc: arm: stm32g0: add hw flow control property for usart1 to dts fixup
This commit adds the missing USART1 HW_FLOW_CONTROL property to the
stm32g0 DTS fixup file.

Signed-off-by: Filip Brozovic <fbrozovic@gmail.com>
2019-12-18 22:06:39 +01:00
Filip Brozovic
fc2dfae64f drivers: i2c: add STM32G0X I2C support
Add I2C driver support for STM32G0X SoC series.

Signed-off-by: Filip Brozovic <fbrozovic@gmail.com>
2019-12-18 22:06:27 +01:00
Vinayak Kariappa Chettimada
b0826a7f65 Bluetooth: controller: split: Reduce time to setup tIFS switch
Refactor to reduce the setup next tIFS switch within tIFS
period of the Radio ISR.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2019-12-18 22:02:02 +01:00
Vinayak Kariappa Chettimada
7ba5e012f7 Bluetooth: controller: nordic: Tune tIFS switching
Remove the 4us advanced radio reception, the implementation
passes all timing conformance tests without this.
This change should reduce some radio power consumption by
avoiding redundant reception duration.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2019-12-18 22:02:02 +01:00
Pushpal Sidhu
2ce8fa1e42 spi: stm32: Enable sending 16bits at a time in 8bit mode if possible
If possible, allow sending 16bits at once instead of 8bits. I found
large delays (up to 3us) between sending bytes due to Zephyr SPI
overhead, so allowing 16bits at a time if possible helps save that
time.

Signed-off-by: Pushpal Sidhu <psidhu.devel@gmail.com>
2019-12-18 22:01:20 +01:00
Pushpal Sidhu
8f0788ee69 spi: stm32: remove spi_stm32_next_tx helper
Remove usage of this helper to stage for 16bit frame transfers in 8bit
mode.

Signed-off-by: Pushpal Sidhu <psidhu.devel@gmail.com>
2019-12-18 22:01:20 +01:00
Pushpal Sidhu
cf228ec2f8 spi: stm32: Add ll_func_set_fifo_threshold_16bit helper
Add this function to allow the fifo to be set for 16bits.

Signed-off-by: Pushpal Sidhu <psidhu.devel@gmail.com>
2019-12-18 22:01:20 +01:00
NavinSankar Velliangiri
e5328b8931 drivers: wifi: Fix the use of net_pkt_write() in eswifi driver
net_pkt_write() function returns 0 on success. But in this driver a
warning is thrown when zero is returned. Hence fix the driver to throw
the warning only when the negative value is returned.

Signed-off-by: NavinSankar Velliangiri <navin@linumiz.com>
2019-12-18 21:58:21 +01:00
Kwon Tae-young
94e419c624 samples: i2c_scanner: support output like i2c_detect
Supports output in the same format as the i2c_detect command.

Signed-off-by: Kwon Tae-young <tykwon@m2i.co.kr>
2019-12-18 21:54:43 +01:00
Josh Gao
9f2916b943 logging: fix LOG_HEXDUMP_* in C++.
Previously, there were two issues when attempting to use LOG_HEXDUMP_*
from C++:

First, gcc and clang in C mode both allow implicit pointer conversion
by default, but require -fpermissive, which no one should ever use, in
C++ mode. Furthermore, -Wpointer-sign, the warning emitted in C for
convertion between pointers to types of different signedness (e.g. char*
vs u8_t*) is explicitly disabled in Zephyr. Switch the various hexdump
functions to void*, which is guaranteed to work in both languages.

Second, the soon-to-be-standardized C++20 version of designated
initializers requires that the designators appear in the same order as
they are declared in the type being initialized.

Signed-off-by: Josh Gao <josh@jmgao.dev>
2019-12-18 21:54:18 +01:00
Alberto Escolar Piedras
66bdb76e7c POSIX arch: Fix C++ main() linkage issue
To be able to define main() in C++ code we need to have its
prototype defined somewhere visibly. Otherwise name mangling
will prevent the linker from finding it.
Zephyr assumes a void main(void) prototype and therefore
this will be the prototype after renaming:
void zephyr_app_main(void);

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2019-12-18 21:53:47 +01:00
Peter A. Bigot
2802fa4e6d treewide: avoid address-of-compound-literal idiom in headers
In C99 the construct (T){init-list} is called a compound literal, and
is an lvalue.  In C++ it is simply a cast expression to non-rvalue
type, which is a prvalue.  In both languages the expression is a
temporary, but in C99 taking its address is well-defined while in C++
it is an error diagnosed as "taking address of temporary".

Headers that may be used in C++ application code must avoid invalid
expressions.  Replace all uses of &(T){init-list} in headers with the
functionally equivalent but C++-legal (T[]){{init-list}}.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-12-18 21:53:17 +01:00
Anas Nashif
0c69c285ec sanitycheck: cleanup hardware map display
Add a static method for dumping hardware map and reuse it across the
script reducing duplicated code.

Fixes #21475

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-12-18 21:52:02 +01:00
Tomasz Bursztyka
9abc0e2efd include/drivers: Move 2 specific intc headers into public location
sam0 and stm32 specific interrupt controller headers are meant to be
public, and as such should be found in
include/drivers/interrupt_controller and not in
drivers/interrupt_controllers.

Fixing documentation issues as well.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-12-18 21:49:46 +01:00
Tomasz Bursztyka
4ada2f65d2 drivers/interrupt_controller: Renaming s1000 to cavs
If it is such a thing (a CAVT intc), it will not be targeting Intel
s1000 SoC only. UP squarde ADSP use the same intc. So renaming it to
CAVS. Though CAVS name might be wrong (CAVS being an overall
architecture name, and not an IP block specification).

Reducing the amount of lines by using if/endif as well.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-12-18 21:49:46 +01:00
Tomasz Bursztyka
ff0625185f drivers/interrupt_controller: Split Kconfig for clarity
Let's move loapic and dw related options into there own Kconfig file.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-12-18 21:49:46 +01:00
Tomasz Bursztyka
c30600d4ab drivers/interrupt_controller: Adopt file naming as other drivers
Pattern being <domain>_<model>.<c/h>.
Here interrupt_controller as a domain would be far too long so
shortening it to "intc", as DTS does actually.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-12-18 21:49:46 +01:00
Pauli Salmenrinne
ca6eee5444 boards: stm32f411e_disco: Add pwm to drive green led
This enables the fade_led example to work with this board.

Signed-off-by: Pauli Salmenrinne <susundberg@gmail.com>
2019-12-18 14:48:06 -06:00
Nick Ward
537f3332f0 samples: bluetooth: peripheral_hr: Fix advertising UUID16 service list
CTS UUID was used instead of DIS UUID

Signed-off-by: Nick Ward <nix.ward@gmail.com>
2019-12-18 21:46:51 +01:00
Peter A. Bigot
60ca2333dc cmake: toolchain: generalize exclusion of CXX options
-Wold-style-definition is not a supported option for C++ builds.  To
prevent it being passed:
* the list of compiler flags to be excluded from C++ builds is moved
  to be toolchain-specific;
* -Wold-style-definition is added to that list for gcc and clang;
* -Wold-style-definition is moved from zephyr_compiler_options to
  zephyr_cc_option so the option checking code is executed for it.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-12-18 21:45:00 +01:00
Robert Lubos
cb3670c1b5 cmake: dts fixups
Trivial dts.cmake cleanups.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2019-12-18 21:42:43 +01:00
Andrew Boie
7d29f3b06e ztest: do teardown in main thread
If the test exits from some APIs like ztest_test_pass(),
ztest_test_skip(), or a test crashes out, the teardown
function is never run.

Fixes: #16329

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-12-18 11:17:33 -08:00
Andrew Boie
9a9f0ed84a tests: thread_init: disable SMP
This test has a race condition between the start of
its statically initialized threads running on another CPU,
and the assignment of those threads to a memory domain in the
ztest_main() function. Disable SMP for this test.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-12-18 11:17:33 -08:00
Andrew Boie
33c3e4a4de tests: timing_info: use only 1 cpu for userspace
The regular version of this test has CONFIG_MP_NUM_CPUS=1,
but this was omitted in the userspace version, and I am
seeing crashes on an SMP-enabled target that supports
user mode.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-12-18 11:17:33 -08:00
Andrew Boie
a26b9e3dd5 tests: mem_protect: fix cast warning
tc_number is passed to a child thread as a parameter, which is
void *. We want to treat it as an integer, but a direct cast
to int causes a warning on 64-bit platforms; cast to uintptr_t
first to suppress it.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-12-18 11:17:33 -08:00
Andrew Boie
12b76253f6 tests: queue: fix SMP issue
test_queue_supv_to_user() invokes a child thread which does some
work which must take place before the call to k_queue_cancel_wait()
is called by the parent.

However, with SMP enabled, the child thread will just run on another
CPU and we have a race between when child_thread_get() calls
k_queue_get(q, K_FOREVER) and the parent calls k_queue_cancel_wait().
If the parent thread gets there first, the whole test hangs as
the call to k_queue_get(q, K_FOREVER) sits forever.

The fix is to have test_queue_supv_to_user() be a 1cpu test, which
ensures that only one CPU is used.

It's not clear to me why this wasn't causing CI failures on other
SMP targets, but I am able to reproduce reliably on qemu_x86_64
with my user mode patches applied.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-12-18 11:17:33 -08:00
Anas Nashif
81b2f37a9d ci: run sanitycheck in verbose mode
Call sanitycheck in verbose mode

Fixes #21483

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-12-18 12:07:49 -05:00
Sebastian Bøe
fa8f9d423d cmake: assert: Reduce the verbosity of the assert warning
The warning about CONFIG_ASSERT being enabled is too loud. This patch
reduces it's verbosity and omits the explanation about performance as
this is believed to be obvious.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2019-12-18 17:11:02 +01:00
Jukka Rissanen
9d8f12b2dd net: stats: Fix RX traffic class time statistics update
The commit 8892406c1d ("kernel/sys_clock.h: Deprecate and convert
uses of old conversions") changed code to not use deprecated macro.
Unfortunately there was some changes done to RX TC stats update that
were missing from that commit. This commit fixes the issue and removes
the last user of the deprecated SYS_CLOCK_HW_CYCLES_TO_NS64() macro.

This is follow up to commit 5bbdf56769 ("net: stats: Fix RX time
statistics update") which failed to remove all users of the deprecated
macro.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-12-18 17:59:54 +02:00
Erwan Gouriou
825b4d66b5 boards: nucleo_f746zg: Update reference for user manual
Wrong reference was provided for board user manual.
Fix this.


Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-12-18 10:51:24 -05:00
Krzysztof Chruscinski
48ca5b703a west.yml: Update hal_nordic to align to clock_control
hal_nordic required update in ieee802154 radio driver which
is controlling the clock.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-12-18 16:50:11 +01:00
Andrew Boie
13b8b41676 drivers: watchdog: add system calls
wdt_install_timeout() was skipped as it installs an ISR-context
callback handler function. The rest are simple wrappers.

Added myself as the maintainer of the syscall handlers. WDT
subsystem appears to not currently have an owner.

Fixes: #21432

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-12-18 09:28:52 -05:00
Ulf Magnusson
b292f7643b kconfig: Remove assignments to promptless SOC_FAMILY_NRF symbol
SOC_FAMILY_NRF has no prompt. Assignments in configuration files have no
effect on symbols without prompts. A prompt means the symbol is
user-configurable.

SOC_FAMILY_NRF is instead enabled indirectly through being selected by
other symbols.

Detected through some work-in-progress improved error checking.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-18 14:42:58 +01:00
Erwan Gouriou
af7e093ae6 soc: stm32f446 : update default gpio configuration
Fix GPIO default configuration for F446.
Default config for GPIO should be `y`.


Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-12-18 07:36:13 -06:00