Commit graph

41161 commits

Author SHA1 Message Date
Henrik Brix Andersen
8940c25145 drivers: can: flexcan: disable self-reception and support listen-only
Add work-around for the NXP MCUxpresso SDK not exposing APIs for
setting the listen-only (LOM) bit of the FlexCAN MCR register and the
self-reception disable (SRXDIS) bit of the CTRL1 register.

These bits can only be written when the FlexCAN module is in freeze
mode. Add a set of simplified functions (not supporting errata 9595) for
entering/exiting freeze mode.

This work-around can be removed again once the NXP MCUxpresso SDK
exposes the needed functionality.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-09-30 12:31:27 -05:00
Joakim Andersson
2ac5841928 Bluetooth: SMP: Handle both devices initiating security
Handle case where:
 - Peripheral sends security request after master has sent pairing
   request or started encryption procedure.
   This packet can be ignored, as long as the slave has not already
   responded with pairing response.
 - Central wants to start security after peripheral initiated security
   request, return error code busy in this case

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2019-09-30 10:29:56 -07:00
Joakim Andersson
eb6ae10745 Bluetooth: SMP: Move re-encryption handling into the SMP module
Move initiating security functionality and LTK requesting into the SMP
module so that SMP can track when the connection is in the encryption
process

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2019-09-30 10:29:56 -07:00
Joakim Andersson
d50b1ac301 Bluetooth: SMP: Move bt_smp_keys_check function up
Move the bt_smp_keys_check function above all usage of the function
in order to avoid prototype declaration when making the function static.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2019-09-30 10:29:56 -07:00
Andrei Emeltchenko
a6eb2ae299 adc: Trivial style cleanup
Cleanup adc header and API test.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-09-30 12:20:39 -05:00
Andrei Emeltchenko
582bb03296 drivers: adc: adc_mchp_xec: Add error logs
Adding error logs helps to find issue with incorrect mask and
channels.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-09-30 12:20:39 -05:00
Andrei Emeltchenko
2f6371c1ad drivers: adc: adc_mchp_xec: Fix incorrect channel mask check
Value MCHP_ADC_MAX_CHAN_MASK defined in microchip hal as
0x07u which is different method for mask calculation then used in Zephyr
API for 8 channels (MCHP_ADC_MAX_CHAN = 8).

Calculate bitmask ourselves using BIT_MASK().

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-09-30 12:20:39 -05:00
Andrei Emeltchenko
ad0c6688ff tests: adc: Correct tags
Removed unused peripheral tag and add drivers to
include test to drivers sanity check run.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-09-30 12:20:39 -05:00
Andrei Emeltchenko
c66b269ae6 boards: mec15xxevb_assy6853: Include counter, adc, watchdog to tests
Add counter, adc and watchdog tests to sanity check for the board.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-09-30 12:20:39 -05:00
Nicolas Pitre
b2a022baff K_MEM_POOL_DEFINE(): remove extra semicolon
Commit 223a2b950f ("mempool: move BUILD_ASSERT to the end of
K_MEM_POOL_DEFINE") left a redundant semicolon at the end.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-09-30 09:57:14 -07:00
Alberto Escolar Piedras
f520a221ab doc: contribution guidelines: Clarify use of uncrustify
A few new contributors, after reading the uncrustify section
of the contribution guidelines, have decided to run
existing Zephyr files thru uncrustify, and include in commits
with minor fixes lots of styles changes.
This is something we do not want to encourage.

To avoid this, modify a bit the uncrustify section to
discourage people from doing just that.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2019-09-30 17:54:57 +02:00
Joakim Andersson
3920844842 Bluetooth: Host: Fix usage of re-using Bluetooth log buffers
Fix calling bt_hex and bt_addr_le_str multiple times in the same logging
call could result in string overwritten since log_strdup is not
guaranteed to duplicate the string buffer in all logging configurations.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2019-09-30 17:47:43 +02:00
Anas Nashif
0bf1f9a408 tracing: add missing end_call for k_mutex_unlock
k_mutex_unlock had no end_call tracing call.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-09-30 10:49:37 -04:00
Anas Nashif
4abbd54cd5 tracing: remove useless ifdefing for CONFIG_TRACING
Tracing functions are noop if CONFIG_TRACING is disabled.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-09-30 10:49:37 -04:00
Anas Nashif
40ca638a00 arch: posix: fix function name in comment
posix_core_main_thread_start does not exist.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-09-30 10:49:37 -04:00
Anas Nashif
2051ad1846 tests: convert util test to a unit test
Merge tests/misc/util with existing util unit test.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-09-30 07:09:42 -04:00
Morten Priess
c1038de6e8 bluetooth: controller: Add vendor operations to TICKER_USER_ULL_HIGH_OPS
Added to allow vendor specific increase of user operation capacity for
ULL_HIGH, to support queuing additional ticker operations.

Signed-off-by: Morten Priess <mtpr@oticon.com>
2019-09-30 13:04:17 +02:00
Morten Priess
cd07fe94d6 bluetooth: controller: Use ticker must_expire to ensure ADV timing rand
Enabled use of ticker must_expire feature for ensuring ADV timing
randomization, even when ADV doesn't get air-time. This reduces ADV
collisions. Not active for nRF51 platform for now.

Signed-off-by: Morten Priess <mtpr@oticon.com>
2019-09-30 12:52:52 +02:00
Morten Priess
5ce4df2a67 bluetooth: controller: Connection meta property support in LLL
Added support for vendor specific meta data in LLL conn object. This
enables vendors to add state data to connection, for supporting
specialized BLE slave features.

Signed-off-by: Morten Priess <mtpr@oticon.com>
2019-09-30 12:52:33 +02:00
Vinayak Kariappa Chettimada
c38e2ee61a Bluetooth: controller: Fix refactored SWI regression
Fix regression introduced in refactoring of use of SWI.
Reduced use of SWI cannot be used in combination with
CONFIG_BT_CTLR_LOW_LAT as additional SWI is required
to split ticker WORKER and JOB contexts in order to
disable JOB but keep WORKER enabled.

Regression introduced in commit 78b461ae3e ("Bluetooth:
controller: Refactor use of SWI").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2019-09-30 12:25:10 +02:00
Charles E. Youse
5b57737817 arch/x86: multiboot.h: use BIT() macros instead of explicit shifts
Because that's how we do it with Zephyr.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-09-29 12:30:34 -07:00
Charles E. Youse
dc8b3b1094 samples/board/x86_info: move to tests directory
This application's primary purpose is to provide some useful data to
the author of an x86 board support package for Zephyr-- it's not a
good sample.  It's not a good test either, but as a test it at least
prevents regressions in multiboot/ACPI builds.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-09-29 12:30:34 -07:00
Charles E. Youse
7637571871 arch/x86: rename CONFIG_X86_ACPI and related to CONFIG_ACPI
ACPI is predominantly x86, and only currently implemented on x86,
but it is employed on other architectures, so rename accordingly.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-09-29 12:30:34 -07:00
Charles E. Youse
200056df2f arch/x86: rename CONFIG_X86_MULTIBOOT and related to CONFIG_MULTIBOOT
Simple naming change, since MULTIBOOT is clear enough by itself and
"namespacing" it to X86 is unnecessary and/or inappropriate.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-09-29 12:30:34 -07:00
Charles E. Youse
2cf52476ea arch/x86: add support for non-trivial memory maps
x86 has more complex memory maps than most Zephyr targets. A mechanism
is introduced here to manage such a map, and some methods are provided
to populate it (e.g., Multiboot).

The x86_info tool is extended to display memory map data.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-09-29 12:30:34 -07:00
Charles E. Youse
a414eb99cc samples/boards/x86_info: add platform information tool
This sample demonstrates basic use of the x86 multiboot and ACPI
systems, and also provides some useful information about the board
it's booted on: data handed over by the multiboot loader (which is
either QEMU or GRUB at this point), basic APIC CPU topology, and
timer driver frequency (computed empirically).

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-09-29 12:30:34 -07:00
Charles E. Youse
81eeff83b0 arch/x86: multiboot: migrate multiboot initialization to early C
Originally, the multiboot info struct was copied in the early assembly
language code. This code is moved to a C function in multiboot.c for
two reasons:

1. It's about to get more complicated, as we want the ability to use
   a multiboot-provided memory map if available, and
2. this will faciliate its sharing between 32- and 64-bit subarches.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-09-29 12:30:34 -07:00
Charles E. Youse
1ffab8a5f2 arch/x86: rudimentary ACPI support
Implement a simple ACPI parser with enough functionality to
enumerate CPU cores and determine their local APIC IDs.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-09-29 12:30:34 -07:00
Charles E. Youse
c0c4ba8516 kernel/idle.c: fix compilation failure (SMP && !SCHED_IPI_SUPPORTED)
An #endif and the brace terminating a compound statement were
transposed, causing compilation errors with the above-specified
combination of configuration options.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-09-28 17:32:33 -04:00
Peter A. Bigot
5639ea07f8 kernel: timeout: remove unused callback parameter from init function
The callback function has been ignored in z_timeout_init() since the
timer rework in fall 2018.  Passing real handlers to it in code is
distracting when they will be overridden by whatever callback is
provided in z_add_timeout().

As this function is an internal API deprecation is not necessary.
Remove the parameter and change all call sites to drop the argument.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-09-28 15:41:18 -04:00
David Lechner
f6fd8a7dab doc: fix dead kconfig links
Links to Linux kernel Kconfig documentation are broken, so replace them
with working ones.

Signed-off-by: David Lechner <david@lechnology.com>
2019-09-27 23:11:14 -04:00
Stephanos Ioannidis
2a1c6258fa scripts: gen_syscalls: Add compiler check to pragma.
This commit addresses the following portability issues:
1. gen_syscalls incorrectly assumes that the compiler is always GCC.
2. pragma GCC diagnostic push and pop are not supported in GCC < 4.6.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2019-09-27 23:10:04 -04:00
Charles E. Youse
ce46e0df4d cmake: samples/tests: update cmake_minimum_required() to 3.13.1
Some samples/tests are still referring to 3.8.x versions.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-09-27 23:09:24 -04:00
Jan Van Winkel
677050c2af kernel/idle: Correct SMP_FALLBACK define
Corrected the define of SMP_FALLBACK to prevent llvm warning.

llvm issues a warning as the behaviour of using defined(x) inside a
macro expansion is undefined (https://reviews.llvm.org/D15866).

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2019-09-27 20:32:26 -04:00
Yannis Damigos
2f4c1ea362 i2c_ll_stm32_v2: Send STOP manually after NACK
In master trasmitter mode AutoEndMode is
always disabled, so we need to send STOP
manually if NACK is received.

Fixes #19059

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2019-09-27 13:51:15 -07:00
Kumar Gala
0228c181b0 serial: mcux_lpc: Fix up driver to work on new SDK
The new SDK version 2.6.3 for LPC55S69 changes how CLOCK_GetFreq works.
Change to use CLOCK_GetFlexCommClkFreq which can work on both the old
and new SDK.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-09-27 13:41:13 -07:00
Kumar Gala
664166e531 modules: hal: nxp: update for LPC55S69 SDK update
Update to for LPC55S69 SDK 2.6.3 release.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-09-27 13:41:13 -07:00
Anas Nashif
96ad532b58 tests: move Bluetooth at tests under tests/bluetooth
this is not a unit test.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-09-27 15:23:26 -04:00
Anas Nashif
50d5e37b8a tests: move util test to be unit tests
Move to a unit test, no need to build this for every platform we have.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-09-27 15:23:26 -04:00
Anas Nashif
1caab558a1 tests: move intmath test to be unit tests
Move to a unit test, no need to build this for every platform we have.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-09-27 15:23:26 -04:00
Anas Nashif
e9156e04b4 tests: move list test to be unit tests
Move to a unit test, no need to build this for every platform we have.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-09-27 15:23:26 -04:00
Anas Nashif
cd60bd96ac tests: cleanup test_build
- Kconfig test does not really need to build on all platforms
- nmi test is already in tests/arch/arm/arm_runtime_nmi
- we have plenty of tests with newlib enabled.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-09-27 15:23:26 -04:00
Anas Nashif
9be0f1d251 tests: move xtensa_asm2 tests to tests/arch
This is a test, so move it under tests/arch/..

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-09-27 15:23:26 -04:00
Anas Nashif
04024aefa1 tests: move cmsis_rtos_v2 into portability
just to keep same class of tests under the same umbrella, otherwise
those tests do not belong in the top level tests/ directory.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-09-27 15:23:26 -04:00
Anas Nashif
8070643663 tests: move cmsis_rtos_v1 into portability
just to keep same class of tests under the same umbrella, otherwise
those tests do not belong in the top level tests/ directory.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-09-27 15:23:26 -04:00
Anas Nashif
9004eb68dc tests: make rbtree tests unit tests
Move to a unit test, no need to build this for every platform we have.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-09-27 15:23:26 -04:00
Anas Nashif
abf1d36ed9 tests: move crc to a unit test
Move to a unit test, no need to build this for every platform we have.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-09-27 15:23:26 -04:00
Anas Nashif
48c335486f tests: move base64 to a unit test
Move to a unit test, no need to build this for every platform we have.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-09-27 15:23:26 -04:00
Anas Nashif
bff8f31aec tests: unit: do not build with -m32 on macOS
on macOS, i386 is deprecated, so build as 64bit instead.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-09-27 15:23:26 -04:00
Anas Nashif
dffc944437 toolchain: check if __deprecated is defined
This macro is defined on some operating systems, so make sure we do not
redefine it.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-09-27 15:23:26 -04:00