Commit graph

41120 commits

Author SHA1 Message Date
Joakim Andersson
172dcec236 Bluetooth: controller: Fix unknown rsp received during enc procedure
Port fix for #14044 from legacy LL to split LL.

The master is using unknown rsp to terminate slave side initiated
procedures that has collided with the encryption procedure initiated by
the master.
We need to handle an unknown response that is sent in unencrypted during
the encryption procedure, even though we have already set up to receive
encrypted packets.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2019-05-15 10:10:42 +02:00
Joakim Andersson
289eab6ad5 Bluetooth: controller: Remove incorrect comment
Remove comment stating that UNKNOWN_RSP during encryption procedure
is a workaround.
The core spec mandates that connections should not be dropped if
receiving this control packet during encryption procedure.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2019-05-15 10:10:42 +02:00
Jakob Olesen
c8708d9bf3 misc: Replace uses of __builtin_*_overflow() with <misc/math_extras.h>.
Use the new math_extras functions instead of calling builtins directly.

Change a few local variables to size_t after checking that all uses of
the variable actually expects a size_t.

Signed-off-by: Jakob Olesen <jolesen@fb.com>
2019-05-14 19:53:30 -05:00
Jakob Olesen
0e65aab703 misc: Always test the portable version of the math_extras.h functions.
The implementation of the <misc/math_extras.h> functions will use the
portable C code when PORTABLE_MISC_MATH_EXTRAS is defined before
including the header.

Use this feature macro to make sure that the unit test always tests the
portable functions in addition to the ones using builtins for the
current compiler.

Signed-off-by: Jakob Olesen <jolesen@fb.com>
2019-05-14 19:53:30 -05:00
Jakob Olesen
b2945d304c misc: Implement math_extras.h function with GCC builtins.
When available, use the GCC / Clang builtins to implement the
math_extras functions. Otherwise, use the portable versions.

Signed-off-by: Jakob Olesen <jolesen@fb.com>
2019-05-14 19:53:30 -05:00
Jakob Olesen
f4f09dd7cd toolchain: Define a HAS_BUILTIN(x) macro in toolchain.h.
Compilers based on Clang provide a __has_builtin(x) macro which can be
used to detect in the preprocessor if a given builtin function is
supported by the compiler.

For other compilers (notably GCC), we provide an alternative definition
of HAS_BUILTIN(x) that depends on the toolchain-specific header file to
declare which builtin functions are supported based on the current
compiler version.

Signed-off-by: Jakob Olesen <jolesen@fb.com>
2019-05-14 19:53:30 -05:00
Jakob Olesen
e66c0da0c1 misc: Portable math_extras.h implementations.
Add a <misc/math_extras.h> header file with portable implementations of
a number of commonly used math and bit counting operations that are not
available in the C programming language.

The math_extras functions fall into two groups:

1. Unsigned integer arithmetic with overflow detection. Addition and
   multiplication are provides for the u32_t, u64_t, and size_t types.
   This commit doesn't include subtraction and division, and there are
   no signed operations. These could be added later if there is a need.

2. Bit-counting operations like clz, ctz, and ffs. These are provided
   for u32_t and u64_t only. I don't see a need for size_t operations,
   but they could be added if needed.

A follow-on commit will add more efficient implementations using
compiler builtins for those compilers that support it.

Another commit will replace other uses of "naked" compiler builtins with
calls to these functions.

Signed-off-by: Jakob Olesen <jolesen@fb.com>
2019-05-14 19:53:30 -05:00
Charles Youse
aaf91f0ccd interrupt_controller/loapic_intr.c: remove unused MPtables constants
Hygiene: We don't query MPtables (anymore?), so the related definitions
in the local APIC driver are unused. Removed.

Signed-off-by: Charles Youse <charles.youse@intel.com>
2019-05-14 14:25:43 -07:00
Henrik Brix Andersen
105aef98bf boards: twr-ke18f: add support for the NXP TWR-KE18F board
Add support for the NXP TWR-KE18F development board. This board
feautures an NXP MKE18F16 MCU, a selection of user LEDs and
push-buttons, potentiometer, thermistor, CAN interface, and FlexIO
header.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-05-14 15:00:11 -05:00
Henrik Brix Andersen
918579ebbf soc: arm: ke1xf: add NXP Kinetis KE1xF SoC series support
Add initial support for the NXP Kinetis KE1xF SoC series (MKE14F16,
MKE16F16, and MKE18F16).

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-05-14 15:00:11 -05:00
Henrik Brix Andersen
d4b9c0d600 drivers: clock_control_mcux_sim: add support for clkout
Add support for CLKOUT source selection and divider as found on the
NXP Kinetis KE1xF SoC series.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-05-14 15:00:11 -05:00
Henrik Brix Andersen
56dfb62e40 drivers: serial: uart_mcux_lpuart: add support for LPUARTs with two IRQs
Add support for NXP MCUX LPUART devices with separate IRQ lines for
transmit and receive status interrupts (e.g. the Kinetis KE1xF SoC
series).

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-05-14 15:00:11 -05:00
Henrik Brix Andersen
168e129175 clock_control: introduce mcux pcc driver
Add a new clock control driver for NXP Kinetis SoCs that have the
Peripheral Clock Controller module (PCC).

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-05-14 15:00:11 -05:00
Henrik Brix Andersen
3a953731a7 ext: hal: nxp: mcux: add device and driver files for KE1xF series SoCs
Add mcux 2.5.0 device and driver files for NXP Kinetis KE1xF series
SoCs (MKE14F16, MKE16F16, and MKE18F16).

Origins: NXP MCUxpresso SDK 2.5.0
URL: mcuxpresso.nxp.com
Maintained-by: External

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-05-14 15:00:11 -05:00
Henrik Brix Andersen
021e27cfed drivers: i2c: mcux_lpi2c: add support for I2C_0
Add support for I2C controller 0 in the NXP MCUX LPI2C driver shim.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-05-14 13:12:43 -05:00
Ryan QIAN
46289bed0c tests: change the min_ram for mbedtls and mem_protect
- Change the min_ram to 36K, since they can't be built on RT1015 which
has 32K ram.

Signed-off-by: Ryan QIAN <jianghao.qian@nxp.com>
2019-05-14 12:23:42 -05:00
Ryan QIAN
180df6dc69 boards: arm: mimxrt1015_evk: update the ram size
- use ram size with default size of dtcm

Signed-off-by: Ryan QIAN <jianghao.qian@nxp.com>
2019-05-14 12:23:42 -05:00
Ryan QIAN
d7efa1db77 boards: arm: mimxrt1020_evk: update board dts
- update board dts file to refer to nxp_rt1020.dtsi to include sram size
fix

Signed-off-by: Ryan QIAN <jianghao.qian@nxp.com>
2019-05-14 12:23:42 -05:00
Ryan QIAN
2dc141ea31 boards: arm: mimxrt1015_evk: update board dts
- update board dts file to refer to nxp_rt1015.dtsi to include sram size
fix.

Signed-off-by: Ryan QIAN <jianghao.qian@nxp.com>
2019-05-14 12:23:42 -05:00
Ryan QIAN
90dc25b256 soc: arm: nxp_imx: rt: update flash size of 32KB
- Add 32KB to flash size

Signed-off-by: Ryan QIAN <jianghao.qian@nxp.com>
2019-05-14 12:23:42 -05:00
Ryan QIAN
cc3358e04d dts: arm: nxp: Add dtsi for RT1015 and RT1020
The default flexram configuration for RT1015:
  - ITCM  0x0,         32KB
  - DTCM  0x200000000, 32KB
  - OCRAM 0x20200000,  64KB

The default flexram configuration for RT1020:
  - ITCM  0x0,         64KB
  - DTCM  0x200000000, 64KB
  - OCRAM 0x20200000,  128KB

Signed-off-by: Ryan QIAN <jianghao.qian@nxp.com>
2019-05-14 12:23:42 -05:00
Danny Oerndrup
cbbbdeaae5 cmake: Toolchain abstraction: Introduce toolchain_cc_warning_extended
This is placeholder for extended warning flags, likely to change between
toolchains.

The intent here is to abstract Zephyr's dependence on toolchains,
thus allowing for easier porting to other, perhaps commercial,
toolchains and/or usecases.

No functional change expected.

Signed-off-by: Danny Oerndrup <daor@demant.com>
2019-05-14 18:19:18 +02:00
Danny Oerndrup
bdb229faff cmake: Toolchain abstraction: Introduce toolchain_cc_warning_base
This is placeholder for base warning flags, common to most toolchains.

The intent here is to abstract Zephyr's dependence on toolchains,
thus allowing for easier porting to other, perhaps commercial,
toolchains and/or usecases.

No functional change expected.

Signed-off-by: Danny Oerndrup <daor@demant.com>
2019-05-14 18:19:18 +02:00
Danny Oerndrup
8650b150b9 cmake: Toolchain abstraction: Introduce toolchain_cc_warning_dw_[1-3]
The introduced macros are placeholders for the cmake parameter warning
level.

The intent here is to abstract Zephyr's dependence on toolchains,
thus allowing for easier porting to other, perhaps commercial,
toolchains and/or usecases.

No functional change expected.

Signed-off-by: Danny Oerndrup <daor@demant.com>
2019-05-14 18:19:18 +02:00
Benjamin Lindqvist
55e2014d99 drivers: nrf: Trigger STOP RX event and wait before disabling UARTE
Without first triggering TASKS_STOP{RX,TX}, I observed that the UARTE
was never disabled when using device_set_power_state which resulted in
the HFCLK never being shut down and several hundred microamps in
unnecessary current consumption when idle. This seems to fix the issue.

Also added special treatment of uarte if CONFIG_UART_ASYNC_API is
selected. Note that the #ifdef isn't enough, since it's possible that
the option is set, but only one of the UARTs uses it.

Signed-off-by: Benjamin Lindqvist <benjamin.lindqvist@endian.se>
2019-05-14 17:02:17 +02:00
Armando Visconti
75a3ee5240 drivers/i2s_ll_stm32.c: (FIX) Avoid warning in LOG_ERR
The LL_I2S_ReadReg() function returns uint32_t, while %d requires
'int' as a type.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-05-14 09:01:21 -05:00
Alexander Svensen
d9d85fd1d3 Bluetooth: controller: split: Refactor the lll_clock_wait() function
This is a pure refactoring of the k32src_wait function. It used the
following rules when refactoring:

Don't use the preprocessor when unprocessed C language suffices.

Don't undefine macro's.

Avoid global variables when possible.

Use consistent names for similiar things (hf_clock, lf_clock).

Signed-off-by: Alexander Svensen <alsv@nordicsemi.no>
2019-05-14 14:18:02 +02:00
Alexander Svensen
3d94df7e8e Bluetooth: controller: split: Fix master role RSSI measurement
Fix broken master role RSSI measurement. Since the original
contribution clean up into Zephyr, the radio shorts that was
set for measuring the RSSI for master role has been broken,
as it was cleared by the radio switching code further in the
Tx ISR.

Signed-off-by: Alexander Svensen <alsv@nordicsemi.no>
2019-05-14 14:08:11 +02:00
Ulf Magnusson
5c69e9810a ext: open-amp: kconfig: Add missing OPENAMP dep. to OPENAMP_SRC_PATH
Prevents the OPENAMP_SRC_PATH symbol from showing up in the menu when
OPENAMP is disabled.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-05-14 06:13:18 -05:00
Brett Witherspoon
2d4ec5f119 boards: cc1352r1_launchxl: enable TRNG entropy source support
Enable support for the TRNG entropy source on the CC1352R LaunchPad.

Signed-off-by: Brett Witherspoon <spoonb@cdspooner.com>
2019-05-14 06:10:52 -05:00
Brett Witherspoon
a016feb4a7 boards: cc26x2r1_launchxl: enable TRNG entropy source support
Enable support for the TRNG entropy source on the CC26x2R LaunchPad.

Signed-off-by: Brett Witherspoon <spoonb@cdspooner.com>
2019-05-14 06:10:52 -05:00
Brett Witherspoon
2bee500f06 drivers: add CC13xx / CC26xx entropy driver
Add driver for the TRNG entropy source on the TI CC13xx / CC26xx
series SoCs.

Signed-off-by: Brett Witherspoon <spoonb@cdspooner.com>
2019-05-14 06:10:52 -05:00
Antony Pavlov
3bcd188068 treewide: fix typos
Fix trivial typos.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
2019-05-14 06:07:40 -05:00
Antony Pavlov
62a8e49f4d boards/arm/mikroe_mini_m4_for_stm32: fix model&compatible dt properties
The mikroe_mini_m4_for_stm32 board is developed by Mikroelektronika
not by STMicroelectronics.
Also use more appropriate "mini-m4-for-stm32" board name for
compatible dt property.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
2019-05-14 06:07:40 -05:00
Antony Pavlov
b6c84a9472 boards/arm/olimexino_stm32: fix compatible dt property
The olimexino_stm32 board is developed by Olimex
not by STMicroelectronics.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
2019-05-14 06:07:40 -05:00
Antony Pavlov
3f9a792065 boards/arm/*/*dts: fix double whitespace in model property
There is no reason to use double whitespaces in the dt
model property.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
2019-05-14 06:07:40 -05:00
Jukka Rissanen
9552796361 net: arp: Drop request where src hw address is our address
We replied to an ARP request that has the same Sender Hardware Address
than that of ours. Such an ARP request must be discarded, no reply
should be sent and translation table should not be updated.

Fixes #16110

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-05-14 12:36:07 +03:00
Jukka Rissanen
a84e9345a6 net: arp: Use proper dest hw address after receiving a request
If a packet is received with Ethernet source address different
from ARP's sender hardware address field, then DUT must use the
latter address in response packets.

Fixes #16098

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-05-14 12:35:48 +03:00
Asger Munk Nielsen
58e9ac6811 bluetooth: Controller: Refactor node_rx footer to avoid ptr arithmetic
The old footer was appended after PDU using pointer arithmetic. Now
the footer fields have been moved to the header struct, the
footer fields are now statically located in the data structure,
this is type safe and fields can be referred to by their actual
names rather than indirectly through reference to other members,
thus avoiding pointer arithmetic. Secondly, this change will pave
the way for adding other meta data in the future.

Signed-off-by: Asger Munk Nielsen <asmk@oticon.com>
2019-05-14 10:56:16 +02:00
Carles Cufi
52ab40cb0d tests: counter: Enable nRF52810 testing
Enable the counter capability in the board and add a .conf file for the
nRF52810 running on the PCA10040 board.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-05-14 10:45:12 +02:00
Ulf Magnusson
e7be378a47 Bluetooth: kconfig: Put 'menuconfig BT' in top-level menu
The 'Bluetooth' menu contains just 'config BT' and its indented
children.

Remove one menu level by removing the 'Bluetooth' menu and turning BT
into a 'menuconfig' symbol. Also change the prompt from "Bluetooth
support" to just "Bluetooth", to make it consistent with e.g. "Logging".

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-05-14 10:27:11 +02:00
Ulf Magnusson
dbc2406a05 ext: lib: mcumgr: Remove 'External Sources -> Management' menu
This menu contains just the MCUMGR symbol and its children. Get rid of
one menu level by removing it.

Makes the 'External Sources' menu look like this:

      HALs  --->
      Cryptography  --->
  [ ] Fnmatch Support
  [ ] OpenAMP Support
  (open-amp) OpenAMP library source path
  [ ] mcumgr Support

('OpenAMP library source path' being visible there might be a separate
issue.)

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-05-14 10:26:42 +02:00
Carles Cufi
e0d96866d9 boards: holyiot_yj16019: Remove counter from supported
The supported field is used by sanitycheck to select which tests will be
run on a particular board. The issue with the counter drivers, and in
particular on nRF ICs, is that the timer peripherals are disabled by
default and need to be enabled on a per-board basis inside a .conf file.
Since this board doesn't have a .conf file in
tests/drivers/counter/counter_basic_api/boards/ the test cannot be run
on this board.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-05-14 09:52:57 +02:00
Jakub Rzeszutko
d9c18ff05e boards: arm: Add Nordic nRF52811 board
This commit adds support for board: nrf52811_PCA10056.

The nRF52840 DK: PCA10056 is the recommend development kit, it emulates
the nRF52811, and can be used as a starting point for development
before moving over to a custom board.

Please note that this development kit does not support Bluetooth
Direction Finding. What is more it cannot be used with most of Arduino
shields because of PCA10056 PIN layout.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-05-14 09:52:57 +02:00
Jakub Rzeszutko
0efddb63b7 arm: nrf: Add support for the nRF52811
This commit adds basic support for nrf52811 in the arch SoC, dts
and nrfx folders.

The nRF52811 is a Bluetooth 5.1 Direction Finding SoC with comprehensive
protocol support.
The nRF52811 SoC is capable of the latest features of Bluetooth 5.1,
the most prominent being Direction Finding.

The radio in the nRF52811 SoC has comprehensive protocol capabilities,
including Bluetooth 5.1 Directing Finding, all Bluetooth 5 features,
802.15.4, Thread, Zigbee, ANT and 2.4 GHz proprietary.
It has 4 dBm TX power and has been optimized to offer the best RX
sensitivity of all SoCs in the nRF52 series.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2019-05-14 09:52:57 +02:00
Ioannis Glaropoulos
fd97e44011 arch: remove unused tracing_arch.h
The API in tracing_arch.h is not used by the
kernel so we remove it.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-05-13 14:04:15 -07:00
Andrzej Puzdrowski
56be0fd5a9 boards/x86/qemu_x86: increase RAM size
Increase ram size as flash simulator need it for
emulated storage. The qemu_x86 flash size is puted back to
its original value of 4092K

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-05-13 14:39:34 -04:00
Kamil Piszczek
e81090cff6 tests: fs: nvs: added basic unittests for nvs
Added basic tests for the NVS file system. One of the tests covers power
down during the flash write operation.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2019-05-13 17:07:28 +02:00
Kamil Piszczek
4054d2bacf drivers: flash: flash_simulator: added max write calls param
Added a new runtime parameter to the Flash Simulator. It can be used to
ignore any writes to the simulated flash memory after a certain number
of flash write calls has been executed. This behaviour is useful for
simulating power down during the flash write operation.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2019-05-13 17:07:28 +02:00
Kamil Piszczek
6b772f9994 fs: nvs: format specifier alignment
Aligned format specifiers for the NVS FS. Now, the format specifier
matches the variable type for qemu_x86 types.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2019-05-13 17:07:28 +02:00