Commit graph

41120 commits

Author SHA1 Message Date
Thomas Ebert Hansen
a202c14ff5 bluetooth: controller: Move Nordic specific code
Move the call to radio_is_idle into Nordic LLL.

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2019-05-01 10:40:41 -04:00
Peter A. Bigot
773bd98c73 doc: clarify behavior of k_poll_signal_raise on error
k_poll_signal_raise() returns an error code to indicate that the raise
was too late to notify an expiring poll.  Make clear that this does not
mean that the signal was lost: a subsequent poll will find it and expire
immediately.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-05-01 10:40:19 -04:00
Daniel Leung
a404bb76ee tests/kernel/device: extends test for code coverage
device_get_binding() compares pointers first before doing strcmp().
However, enabling coverage forces -O0 to disable any compiler
optimizations. There would be multiple copies of the same string,
and the code pathing doing pointer comparsion would not be tested
at all. So add this flag to merge string constants such that
the pointer comparison would be exercised.

This also adds a bad driver which fails initialization. This is
to make sure that execution path is covered.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-05-01 10:38:03 -04:00
Kamil Piszczek
6a0837b478 stats: changed API to use zephyr types
Changed API of the Statistics module. Now it uses Zephyr types.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2019-05-01 10:33:17 -04:00
Kamil Piszczek
78a39b80aa drivers: flash: covering more flash page with stats sections
Extended the maximum possible number of sections that track statistics
for each flash page.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2019-05-01 10:33:17 -04:00
Kamil Piszczek
c6d31905bc util: extending UTIL_DEC_N definitions
Extended the UTIL_DEC_N definitions to handle the UTIL_REPEAT macro with
up to 256 repetitions.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2019-05-01 10:33:17 -04:00
Kamil Piszczek
0a8c75f96e stats: extending api to handle statistics with more than 256 elements
Changed type of the paramater that determines the number of elements in
the stats group. Now it is possible to declared more than 256 elements.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2019-05-01 10:33:17 -04:00
Sören Tempel
ec2f503635 drivers: serial: sifive: Fix UART extern interrupts
IRQ_CONNECT and irq_enable calls in the SiFive UART driver were
misconfigured when the conversion to DeviceTree support occurred.

See also: https://github.com/zephyrproject-rtos/zephyr/pull/10613

Signed-off-by: Sören Tempel <soeren+git@soeren-tempel.net>
2019-05-01 10:29:28 -04:00
Maureen Helm
f940237057 boards: mimxrt1015_evk: Fix board image
The mimxrt1015_evk board image was corrupted and did not display
properly in the board documentation. Fix it.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-05-01 10:28:50 -04:00
Vinayak Kariappa Chettimada
a1cbbbe9bd Bluetooth: controller: Fix nRF52840 Coded PHY timings
Fix the nRF52840 Coded PHY radio timings based on testing
with conformance tester.

Fixes the following conformance tests:
LL/CON/MAS/BV-52-C [Master Receiving Data, LE Coded, CI Change]
LL/CON/MAS/BV-54-C [Slave Receiving Data, LE Coded, CI Change]

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2019-05-01 10:28:26 -04:00
Vinayak Kariappa Chettimada
f35dd8ece8 Bluetooth: controller: Fix regression in Coded PHY CI Change
Fix the regression in Coded PHY CI change implementation
introduced by reverting the commit 9d1ca9c390 ("Bluetooth:
controller: remove redundant PPI channel and TIMER CC").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2019-05-01 10:28:26 -04:00
Derek Hageman
d68666fc08 drivers: spi: sam0: Implement DMA async API
This adds support for the async API for SAM0 SERCOM SPI using
DMA to drive the device.  This implementation does the reload
for both transmit and receive in the receive DMA handler.
Doing this simplifies the implementation but means that the
transmit drains completely, resulting in the SPI clock pausing
between buffers while both are reloaded in the receive handler.

Tested with tests/drivers/spi/spi_loopback and several simple
programs monitored with a logic analyzer.

Signed-off-by: Derek Hageman <hageman@inthat.cloud>
2019-05-01 10:27:42 -04:00
Scott Worley
4b2a181a4a boards : arm : Add support for Microchip MEC15xx EVB ASSY 6853
This was tested with the hello world application. UART 0 was used
as console for displaying "Hello World! mec15xxevb_assy6853" to
the serial terminal.

Signed-off-by: Scott Worley <scott.worley@microchip.com>

soc : arm : microchip_mec Use rename fault clear function

The Cortex-M core function to clear faults was rename by
upstream. Update to use new name.

Signed-off-by: Scott Worley <scott.worley@microchip.com>
2019-04-30 14:08:23 -07:00
Scott Worley
37df256658 soc : arm : microchip_mec Add Microchip MEC1501 SoC
Initial support for Microchip MEC1501 series is added to the tree.
Additional support for UART is also included. This SoC supports
two operational modes for interrupts (Direct and Aggregated). For
this commit, the direct capable interrupt are configured in direct
mode.

Signed-off-by: Scott Worley <scott.worley@microchip.com>
2019-04-30 14:08:23 -07:00
Scott Worley
a0a9a1f905 dts : arm : Add Microchip MEC1501 SoC device tree
Initial support for Microchip MEC1501 series is added to the tree.
Additional support for UART is also included. This SoC supports
two operational modes for interrupts (Direct and Aggregated). For
this commit, the direct capable interrupts are configured in
direct mode.

Signed-off-by: Scott Worley <scott.worley@microchip.com>
2019-04-30 14:08:23 -07:00
Scott Worley
66cae83ff7 ext : hal : mec1501 Add the MEC1501 external headers.
Origin: Microchip CPG
Purpose: Peripheral firmware library for MEC1501
Version: 0.1
License: Apache
Maintained-by: External

Signed-off-by: Scott Worley <scott.worley@microchip.com>
2019-04-30 14:08:23 -07:00
Marc Herbert
a0d79f5f08 CODEOWNERS: include/cortex_m/csme/ -> include/cortex_m/csme.h
Typo fix as discussed in original PR #14475 for commit eb82bdd419

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2019-04-30 14:07:40 -07:00
Jukka Rissanen
960e6d9504 tests: net: getaddrinfo: Fix test to check the query is sent
As the getaddrinfo() test is suppose to be self contained, then
we will need to install handler for the sent DNS query. After we
receive the query in process_dns() thread, we verify that the
query was sent properly. We do not return DNS reply back to
the caller in this case as we do not want to create DNS server
just for this simple test application. This can be changed later
if we get DNS server functionality in Zephyr network stack.

Fixes #15193

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-04-30 09:56:01 -07:00
Jukka Rissanen
3d8fe9a8fa net: core: In RX check if the pkt is for loopback interface
If the loopback driver is enabled, then the packet might come
from localhost in which case mark it properly. Without this marking
the packet from/to 127.0.0.1 or ::1 would be dropped in later checks.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-04-30 09:56:01 -07:00
Jakub Rzeszutko
0e83ad65b4 shell: prompt configuration during project generation
Adding possibility to modify shell prompt in Kconfig and in prj.config
file.
Fixes #14547.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2019-04-30 10:40:04 -04:00
Håkon Øye Amundsen
66431d213d cmake: helper function for importing library
When importing a pre compiled imported library it is currently
required to perform three steps.
This commit introduces a helper function which allows the
user to import a library with a single function call.

Signed-off-by: Håkon Øye Amundsen <haakon.amundsen@nordicsemi.no>
2019-04-30 10:18:02 -04:00
Mark Ruvald Pedersen
65f02c04d5 cmake: Toolchain abstraction: introduce toolchain_ld_baremetal()
The intent of toolchain_ld_baremetal() is to collect the flags belonging
to non-hosted (i.e. POSIX-based) targets.

No functional change expected.

This is motivated by the wish to abstract Zephyr's usage of toolchains,
permitting non-intrusive porting to other (commercial) toolchains.

Signed-off-by: Mark Ruvald Pedersen <mped@oticon.com>
2019-04-30 10:13:41 -04:00
Mark Ruvald Pedersen
4080818300 cmake: Toolchain abstraction: move LINKERFLAGPREFIX under GNU ld
* LINKERFLAGPREFIX's value is GNU ld specific, and
* LINKERFLAGPREFIX is not a convention always honored by all linkers.

Thus we shall not set it from the common root CMakeList.txt.
So we move to linker/ld/target.cmake.

No functional change expected.

This is motivated by the wish to abstract Zephyr's usage of toolchains,
permitting non-intrusive porting to other (commercial) toolchains.

Signed-off-by: Mark Ruvald Pedersen <mped@oticon.com>
2019-04-30 10:13:41 -04:00
Ioannis Glaropoulos
02122bcace arch: arm: restrict IRQ lock to minimum during pendSV exception
When performing thread context-switch it is not necessary to
have IRQs locked while saving the current thread's callee-saved
(and possibly floating point) registers. We only need to lock
the interrupts when accessing the thread ready queue cache.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-04-30 10:04:26 -04:00
Antony Pavlov
43c4c9c507 ext/hal/st/stm32cube/stm32l1xx: rename SVC_IRQn -> SVCall_IRQn
SVCall_IRQn is used as enum value for SV Call Interrupt for Cortex-M
based SoCs for which CPU_CORTEX_M_HAS_BASEPRI=y. However stm32cube
for stm32l1xx uses SVC_IRQn enum value for this purpose.
This leads to this error:

  arch/arm/include/cortex_m/exc.h:101:19: error: 'SVCall_IRQn'
    undeclared (first use in this function); did you mean 'SVC_IRQn'?

    NVIC_SetPriority(SVCall_IRQn, _EXC_SVC_PRIO);
                     ^~~~~~~~~~~
                     SVC_IRQn

NB: ext/hal/st/stm32cube/stm32l1xx/soc/stm32l151xb.h file was already
fixed in 9f8260457b ('ext: hal: st: stm32cube: Add HAL for
the STM32L1x series').

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
2019-04-30 08:54:06 -05:00
Morten Priess
c741ef6efd bluetooth: controller: Mayfly yield after call under Kconfig
Added Kconfig BT_MAYFLY_YIELD_AFTER_CALL to support vendor requirement
of invoking all outstanding mayflies for a given callee in
mayfly_run().

Signed-off-by: Morten Priess <mtpr@oticon.com>
2019-04-30 15:42:20 +02:00
Morten Priess
d533dde0ad bluetooth: controller: Moved library source for lll_test.c
Moved library source for nordic/lll/lll_test.c under
CONFIG_BT_LLL_VENDOR_NORDIC condition.

Signed-off-by: Morten Priess <mtpr@oticon.com>
2019-04-30 15:41:56 +02:00
Morten Priess
23e1f4d2bc bluetooth: controller: Added missing variable initializations
In ull.c ll_rx_get, a configuration without CONFIG_BT_CONN would
sometimes return an uninitialized node_rx.
In ull_scan.c, the scanning channel was not initialized to 0 (37). This
would cause new scanning to start at random index (0,1,2).

Signed-off-by: Morten Priess <mtpr@oticon.com>
2019-04-30 15:41:23 +02:00
Oleg Zhurakivskyy
cbe74d46e0 cmake: llvm: Invalidate toolchain capability cache
Invalidate toolchain capability cache on toolchain configuration.

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2019-04-30 09:33:54 -04:00
Oleg Zhurakivskyy
bee7d1ec8b compiler: clang: Don't link libgcc for native_posix
libgcc isn't used by native_posix.

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2019-04-30 09:33:54 -04:00
Oleg Zhurakivskyy
60f1b8703c boards: native_posix: Add llvm to supported toolchains
Add llvm to supported toolchains.

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2019-04-30 09:33:54 -04:00
Oleg Zhurakivskyy
f616aa3736 posix: cmake: Abstract freestanding options
clang has problems compiling the native_posix with -fno-freestanding.

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2019-04-30 09:33:54 -04:00
Oleg Zhurakivskyy
ab2f00e9f1 cmake: clang: Fix comment
Fix comment, llvm -> clang.

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2019-04-30 09:33:54 -04:00
Oleg Zhurakivskyy
f2c4779b84 cmake: clang: Provide toolchain_cc_nostdinc() macro
native_posix should build with standard includes.

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2019-04-30 09:33:54 -04:00
Oleg Zhurakivskyy
a3999243a1 cmake: clang: Don't unconditionally use gcc's fortify
clang doesn't understand fortify at all, provide no op macro,
in order to handle the request to fortify in a generic way.

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2019-04-30 09:33:54 -04:00
Oleg Zhurakivskyy
2688bfad8e cmake: clang: Detect host installed clang
In case TOOLCHAIN_HOME isn't explicitly reuqested,
(or indirectly forced with CLANG_ROOT_DIR), detect
any host installed clang in the path.

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2019-04-30 09:33:54 -04:00
Oleg Zhurakivskyy
129ae378c0 cmake: llvm: Make the setup for host installed clang easier
The logic is practically intact and is the following:

1. Use any host installed llvm/clang in the path in case
   ZEPHYR_TOOLCHAIN_VARIANT=llvm is requested alone.
2. This can be further restricted with TOOLCHAIN_HOME.
3. And can be further overridden with CLANG_ROOT_DIR,
   like previously.

So, only the unconditional restriction to /usr is lifted.

Together with fixing the unconditional set of TOOLCHAIN_HOME
by host tools for non-toolchain needs, this makes the logic
more flexible.

Now, after the logic is controllable by TOOLCHAIN_HOME, 3)
might be an extra, but is left intact for backward compatibility.

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2019-04-30 09:33:54 -04:00
Oleg Zhurakivskyy
274a4a28df cmake: Set TOOLCHAIN_HOME for Zephyr's SDK
Host-tools don't unconditionally set TOOLCHAIN_HOME anymore,
but in case Zephyr's SDK toolchain is used, set TOOLCHAIN_HOME.

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2019-04-30 09:33:54 -04:00
Oleg Zhurakivskyy
de603c0c78 toolchain: Do not pollute TOOLCHAIN_HOME
Use it's own variable HOST_TOOLS_HOME for host tools and don't
unconditionally set TOOLCHAIN_HOME, preventing the detection of
llvm/clang host toolchain.

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2019-04-30 09:33:54 -04:00
Oleg Zhurakivskyy
d4ce29243b cmake: clang: Allow host's clang to be used for native_posix
Allow host installed clang to be used for native_posix when
ZEPHYR_TOOLCHAIN_VARIANT=llvm.

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2019-04-30 09:33:54 -04:00
Oleg Zhurakivskyy
b54f1a949a doc/getting_started: mention ZEPHYR_TOOLCHAIN_VARIANT=llvm
Mention that host installed clang can be used for native_posix.

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2019-04-30 09:33:54 -04:00
Oleg Zhurakivskyy
2211935ed6 cmake: clang: Make clang pick -T option on linking
When linking, clang doesn't pick -T for some reason and complains,
while -Wl,-T works for both, gcc and clang.

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2019-04-30 09:33:54 -04:00
Morten Priess
4596e155a3 bluetooth: controller: Minor refactoring in ticker.c
Moved duplicate code to function. Removed superfluous include.

Signed-off-by: Morten Priess <mtpr@oticon.com>
2019-04-30 15:11:55 +02:00
Morten Priess
21ae70504d bluetooth: controller: Source code documentation of ticker
Added source code documentation to ticker.c.

Signed-off-by: Morten Priess <mtpr@oticon.com>
2019-04-30 15:11:55 +02:00
Erik Brockhoff
5c3709c13f bluetooth: controller: Add def's re. update to slot reservation calc
Add defines to support updated slot reservation calculation in advertise
Note: Numbers used in added defines are subject to HW specific tuning

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2019-04-30 15:10:13 +02:00
Erik Brockhoff
1618c1b885 bluetooth: controller: Update to use new EVENT_IFS_US define
Added a new define (EVENT_IFS_US) to pdu.h - this is now used instead of
previous TIFS_US from vendor specific header

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2019-04-30 15:10:13 +02:00
Erik Brockhoff
1090b45225 bluetooth: controller: Update slot reservation time calculation for ADV
Correct slot reservation time calc for legacy advertise
Add dependency on data lengths for advertise and scan response

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2019-04-30 15:10:13 +02:00
Wayne Ren
b69ed0373e boards: iotdk: add mpu and fpu configuration
* iotdk supports fpu and mpu
* iotdk supports fast irq
* a fix in device tree

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2019-04-29 09:03:24 -07:00
Håkon Øye Amundsen
7411c0141e cmake: remove incorrect statement from doc
The function zephyr_append_cmake_library works with
libraries that does not have source files.

This change removes an incorrect statement related
to that.

Signed-off-by: Håkon Øye Amundsen <haakon.amundsen@nordicsemi.no>
2019-04-29 10:26:42 -04:00
Vinayak Kariappa Chettimada
5257fede63 Bluetooth: controller: Fix advanced XTAL feature regression
Fix regression by the addition of CONFIG_BT_CONN conditional
compilation that disabled the advanced clock (crystal)
oscillator management when only observer and/or advertiser
states supported in the controller build.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2019-04-29 13:08:12 +02:00