Commit graph

18576 commits

Author SHA1 Message Date
Vinayak Kariappa Chettimada
e454862600 Bluetooth: controller: Fix PHY Update response state transition
PHY Update procedure timeout was started without transition
to the state that waits for the procedure to complete. This
prevented the timeout from being reset on successful
completion of the procedure and eventually leading to a
connection termination with reason LMP Response Timeout.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2017-10-11 14:07:33 +02:00
Vinayak Kariappa Chettimada
f64cccfea9 Bluetooth: controller: Fix CPR procedure's Conn Upd initiation
Fix Connection Parameter Request Procedure's Connection
Update Procedure initiation to calculate the offset rather
than selecting offsets from an out-of-bound memory area.

The symptoms of the bug was noticed as a supervision timeout
due to use of incorrect offset communicated to peer and a
wrong offset used in scheduling the connection events.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2017-10-11 09:57:36 +02:00
Andrew Boie
a949b50fe7 syscalls: rename __ZEPHYR_KERNEL__
__ZEPHYR_SUPERVISOR__ more accurately represents what this means: that
the code is intended for scenarios when the CPU is expected to be
running in supervisor (privileged) mode. This could be in the kernel or
in the application.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-10 22:42:06 -04:00
Kumar Gala
e401479fe3 dts: Cleanup 16550 device tree support
1. Use compatible "ns16550" to match upstream binding
2. Add reg-shift as optional property to binding yaml

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-10-10 12:35:50 -05:00
Jonas Pfaff
b62a353551 drivers: adc: Add SAM ADC driver
Tested on Atmel SMART SAM E70 Xplained board

Origin: Original

Jira: ZEP-2507

Signed-off-by: Jonas Pfaff <jonas.pfaff@gmail.com>
2017-10-10 11:56:47 -05:00
Maureen Helm
9c390d7655 scripts: Add support for passing daparg argument to pyocd commands
pyocd occasionally throws USB timeout exceptions when running in
VirtualBox, and recently added a command-line option to limit the USB
packet count as a workaround. Introduce an environment variable
PYOCD_DAPARG so Zephyr can pass the argument to pyocd. For example:

$ make BOARD=frdm_k64f PYOCD_DAPARG='limit_packets=True' flash

This workound comes with a performance penalty when flashing and
debugging with pyocd, so it should only be used when running pyocd in
VirtualBox.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-10-10 11:56:47 -05:00
Christian Taedcke
ae895a00ea boards: arm: Add support for Silabs EFM32WG-STK3800
The EFM32 Wonder Gecko Starter Kit contains sensors and
peripherals demonstarting the usage of the EFM32WG MCU
family. This patch add basic support for this board.

Signed-off-by: Christian Taedcke <hacking@taedcke.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-10-10 11:56:47 -05:00
Christian Taedcke
4b586157d6 drivers: serial: Add uart driver for Silabs EXX32 MCUs
Signed-off-by: Christian Taedcke <hacking@taedcke.com>
2017-10-10 11:56:47 -05:00
Christian Taedcke
158b635b57 drivers: gpio_gecko: Add gpio driver for Silabs EXX32 MCUs
Signed-off-by: Christian Taedcke <hacking@taedcke.com>
2017-10-10 11:56:47 -05:00
Christian Taedcke
3959282359 arm: exx32: Add Silabs EFM32WG soc files
The Silicon Labs EFM32 Wonder Gecko MCU includes:

        * Cortex-M4F core at 48MHz
        * up to 256KB of flash and 32KB of RAM
        * USB with host and OTG support
        * multiple low power peripherals

Signed-off-by: Christian Taedcke <hacking@taedcke.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-10-10 11:56:47 -05:00
Christian Taedcke
04dd357e11 ext: Integrate Silabs Gecko SDK into Zephyr
The Silicon Labs Gecko SDK provides a set of low-level
header files that give access to different hardware
peripherals of Silabs EXX32 SoCs.

This patch adds build infrastructure files like Makefile
and Kconfig to introduce the Gecko SDK into Zephyr.

Signed-off-by: Christian Taedcke <hacking@taedcke.com>
2017-10-10 11:56:47 -05:00
Christian Taedcke
73f2c5537c ext: gecko: Add Silabs Gecko SDK for EFM32WG SoCs
This includes:
* the Gecko SDK files for the EFM32WG SoCs
* the emlib peripheral driver files

Origin: Silicon Labs Gecko SDK
URL: https://github.com/SiliconLabs/Gecko_SDK
Version: v5.1.2 (SHA: 938464c68e6c3b2237388a692f767bb0767ec010)
Purpose: Add support for Silicon Labs EXX32 SoCs
License: Zlib
Maintained-by: External

To update the Gecko SDK, download the current version from the given URL
and replace the following folders:
* Gecko_SDK/platform/Device/ should replace ext/hal/silabs/gecko/Device/
* Gecko_SDK/platform/emlib/ should replace ext/hal/silabs/gecko/emlib/

Signed-off-by: Christian Taedcke <hacking@taedcke.com>
2017-10-10 11:56:47 -05:00
Johann Fischer
52923e6a93 boards: add USB-KW24D512 support
Jira: ZEP-1472

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-10-10 11:56:47 -05:00
Johann Fischer
af1a8fc9f1 arch: nxp_kinetis: initial import KW2XD SiP
Jira: ZEP-1471

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-10-10 11:56:47 -05:00
Johann Fischer
24a4bc25cc ext: mcux: import mcux device headers for MKW22D5 and MKW24D5 SiP
Origin: NXP MCUXpresso KSDK 2.2
URL: https://mcuxpresso.nxp.com/
Maintained-by: External

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-10-10 11:56:47 -05:00
Andrew Boie
3a0f6848e4 kernel: policy change for uninitailized objects
The old policy was that objects that are not marked as initialized may
be claimed by any thread, user or kernel.

This has some undesirable implications:
- Kernel objects that were initailized at build time via some
  _<object name>_INITIALIZER macro, not intended for userspace to ever
  use, could be 'stolen' if their memory addresses were figured out and
  _k_object_init() was never called on them.
- In general, a malicious thread could initialize all unclaimed objects
  it could find, resulting in denial of service for the threads that
  these objects were intended for.

Now, performing any operation in user mode on a kernel object,
initialized or not, required that the calling user thread have
permission on it. Such permission would have to be explicitly granted or
inherited from a supervisor thread, as with this change only supervisor
thread will be able to claim uninitialized objects in this way.

If an uninitialized kernel object has permissions granted to multiple
threads, whatever thread actually initializes the object will reset all
permission bits to zero and grant only the calling thread access to that
object.

In other words, granting access to an uninitialized object to several
threads means that "whichever of these threads (or any kernel thread)
who actually initializes this object will obtain exclusive access to
that object, which it then may grant to other threads as it sees fit."

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-10 09:26:29 -07:00
Erwan Gouriou
6e272b14bd dts: stm32: fix dependency between stm32f405 and stm32f407
stm32f407 SoC is an extension of stm32f405 SoC with additional
support of ethernet and DCMI. Hence, in dts description, this
should be represented by stm32f407.dtsi including stm32f405.dtsi.
The opposite was proposed today in stm32 .dtsi files.
This commit fixes the inclusion model and renames
stm32f407-pinctrl.dtsi into stm32f405-pinctrl.dtsi

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-10-10 11:13:38 -05:00
Jukka Rissanen
cab505f0c2 net: tcp: Use real MTU size for MSS for IPv6
Instead of hard coded 1280 bytes MSS, use the MTU of the link
for MSS. The minimal MSS is still 1280 which is mandated by
IPv6 RFC.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-10-10 10:53:00 -04:00
Piotr Mienkowski
c4688ea58c tests: tickless: Add support for Atmel SAM family
This patch updates tickless testcase replacing existing support
for Atmel SAM3X with support for the whole Atmel SAM family.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2017-10-10 10:50:55 -04:00
Vinayak Kariappa Chettimada
8ab1a1112b Bluetooth: controller: Fix Conn Param Req response timeout
When the peer slave rejects a Connection Parameter Request
Procedure, the controller proceeds to perform a Connection
Update Procedure without clearing the procedure timer that
causes the connection to terminate eventually. This is
fixed by clearing the procedure timeout when the Connection
Update Procedure completes.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2017-10-10 10:10:23 -04:00
Vinayak Kariappa Chettimada
c707c82fc8 Bluetooth: controller: Fix slave from initiating conn upd ind
If a peer master role has support for Connection Parameter
Request Procedure set in its supported features but would
send an Extended Reject Ind as response to the procedure
then the controller incorrectly initiated a Connection
Update Procedure which is not permitted in a slave role.

This would lead to connection timeout after the used instant
in the invalid Connection Update Procedure.

This is fixed by initiating a Connection Update Procedure
only if in a master role.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2017-10-10 10:09:49 -04:00
Tomasz Bursztyka
53ca9a3f9b drivers/spi: Run CS/GPIO logic only when relevant
If given gpio dev pointer is NULL, it will silently ignore the CS
control.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-10-10 09:42:45 -04:00
Tomasz Bursztyka
5ad0cfc90d Revert "spi/api: extend with vendor specific configs"
This reverts commit a3a57b4db1.

There is _no_ need for any vendor specific gremlin bit anywhere.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-10-10 09:42:45 -04:00
Tomasz Bursztyka
5f1360e27d drivers/bluetooth/spi: Do not initialize vendor attribute
As commit introducing it will be reverted.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-10-10 09:42:45 -04:00
Tomasz Bursztyka
24199b234c drivers/spi/stm32_ll: Configure NSS behavior according to cs pointer
If CS (Chip Select, known also as Slave Select...) is managed externaly
of the stm32_ll SPI controller, just config NSS line management
accordingly.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-10-10 09:42:45 -04:00
Leandro Pereira
e1effa0e73 drivers: esp32: I2C driver implementation
Supports both master and slave mode, standard and fast modes,
configurable timeouts, and a few other tunable settings.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-10-09 20:53:22 -04:00
Leandro Pereira
5f22dab17a esp32: Prefix ROM routines with esp32_rom_
Also provide their prototypes in `soc.h`.  This should help
readability, since some ROM functions, with their names as provided by
Espressif, have sometimes the same prefix as Zephyr APIs.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-10-09 20:53:22 -04:00
Leandro Pereira
095424c416 drivers: gpio: esp32: Configure GPIO drive strength
Configuring an open drain driver is required by the I2C driver,
but the GPIO driver didn't support setting the drive strength.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-10-09 20:53:22 -04:00
Leandro Pereira
fd25931228 drivers: gpio: esp32: Use PIN_FUNC_GPIO definition from ESP-IDF
PINMUX_FUNC_A is set to 0, which coincides with the GPIO function in
many of the ESP32 pins.  Use PIN_FUNC_GPIO by default inside the
GPIO driver, however, so the correct function is always selected.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-10-09 20:53:22 -04:00
Leandro Pereira
712ce26fa0 docs: drivers: Fix syntax errors in "Single Driver, Multiple Instances"
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-10-09 20:53:22 -04:00
Leandro Pereira
357d6004be boards: esp32: Add note about fetching an older version of ESP-IDF
ESP-IDF is in constant development and it's likely that files Zephyr
depends on will be moved, removed, or renamed.  Make a note that an
older version of ESP-IDF should be used instead.

Closes #1538.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-10-09 18:50:24 -04:00
Gil Pitney
e1f0abdba9 ext: simplelink: Build files for the SimpleLink host driver and DPL.
This patch adds files to build the SimpleLink host driver
and its DPL port to Zephyr.

It disables the host driver build by default.

Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2017-10-09 14:27:52 -04:00
Gil Pitney
d3b7e80ab5 ext: simplelink: Add SimpleLink DPL porting layer to Zephyr
This ports the SimpleLink WiFi host driver via its OS adaptation
layer to Zephyr OS primitives.

This was validated using an out-of-tree SimpleLink shell
application including functions for:
* WLAN connect, disconnect and scan
* Socket: UDP server and client

Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2017-10-09 14:27:52 -04:00
Gil Pitney
ed81815dee ext: simplelink: dos2unix EOL conversion on wifi/porting files
Convert some files in the Linux SimpleLink SDK installation
which had DOS line endings.

Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2017-10-09 14:27:52 -04:00
Johan Hedberg
44d4c06b70 Bluetooth: Mesh: Fix missing initialization of bt_mesh.local_queue
The local_queue was never being initialized.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-10-09 20:40:36 +03:00
Andrew Boie
8487cd1fe7 x86: fix syscall optimization issue
These needed "memory" clobbers otherwise the compiler would do
unnecessary optimizations for parameters passed in as pointer
values.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-09 10:25:36 -07:00
Johan Hedberg
d1dd19880d Bluetooth: Mesh: Fix revoking app keys
The needed code for taking updated app keys into use and revoking the
old ones was missing.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-10-09 19:46:10 +03:00
Andrew Boie
1d483bb4a3 kernel: provide more info on object perm checks
We now show the caller's thread ID and dump out the permissions array
for the object that failed the check.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-09 08:42:45 -07:00
Andrew Boie
c5c718725f kernel: sem: fix k_sem_take return value
This API has a return value which was not being propagated back to the
caller if invoked as a system call.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-09 08:36:44 -07:00
Anas Nashif
a8d259939b checkpatch: define typedefsfile to deal with a few false positives
checkpatch expects typedefs to be suffixed with _t and has different
rules when typedefs are being used as arguments of a function. This
seems to be a known issue and defining typedefs in a file resolves this
issue.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-09 10:43:05 -04:00
Andrew Boie
6cdc8e90a1 xtools: fix some build issues
$DTC wasn't exported, causing a build failure if it wasn't
defined outside the build system.

The provided ct-ng configuration files define
CT_TARGET_VENDOR="zephyr". Fix CROSS_COMPILE definition so
that the compiler can be found.

Change-Id: I4e25c775e1f02a435704b6a874adb221c677b13a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-09 09:10:39 -04:00
Jukka Rissanen
faccf55dd3 doc: Fix regexp in .known-issues networking.conf file
This fixes following error:

ERROR: zephyr/.known-issues/doc/networking.conf: bytes 622-1441:
     bad regex: bad escape \I at position 119 (line 2, column 2)
ERROR: E: zephyr/.known-issues/doc/networking.conf: can't load
     config file: bad escape \I at position 119 (line 2, column 2)

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-10-09 14:35:21 +03:00
Tomasz Bursztyka
dedecdaed8 tests/net: Add a test for net_mgmt_event_notify_with_info()
As previous test without info, this one will be thrown with/without
receiver 1 and 2 times.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-10-09 10:53:17 +03:00
Tomasz Bursztyka
c3a7b4342d tests/net: Fixing parameters alignment in mgmt test
Commit be8a106cb3 messed up the alignment. Removing also the useless
comments.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-10-09 10:53:17 +03:00
Tomasz Bursztyka
efab82232b net/mgmt: Cleanup a bit Kconfig
Remove "depends on" and replace with an if/endif.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-10-09 10:53:17 +03:00
Tomasz Bursztyka
8e25695937 net/mgmt: Make event notifiers able to pass info to listeners
Adding net_mgmt_event_notify_with_info() which lets the event notifier
to pass dedicated data along with the event. The size of data that can
be passed must be limited to the biggest data passed (which will be
currently IPv6 + prefix).

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-10-09 10:53:17 +03:00
Thiago Silveira
1d8c8ac3af clock_control: nrf5_power: Let the LF clock be configured at least once
If the LF clock was already started, but wasn't initialized with
_k32src_start yet, allow it to run once. This is needed because if a
soft reset is triggered while watchdog is active, the LF clock will
already be running, but won't be configured yet (watchdog forces LF
clock to be running).

If the LF clock isn't configured with _k32src_start, the nRF5 RTC
won't count and the whole system will malfunction, as the kernel
depends on the clock source being working properly.

Signed-off-by: Thiago Silveira <thiago@exati.com.br>
2017-10-08 23:05:34 -04:00
Tomasz Bursztyka
743e50751f net/ieee802154: Always set ACK flag to 0 on data broadcast
commit d02fe29616 did not manage this
case.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-10-08 16:38:32 +03:00
Andrew Boie
c74983e8b4 kernel: remove some kernel objects from tracking
These are removed as the APIs that use them are not suitable for
exporting to userspace.

- Kernel workqueues run in supervisor mode, so it would not be
appropriate to allow user threads to submit work to them. A future
enhancement may extend or introduce parallel API where the workqueue
threads may run in user mode (or leave as an exercise to the user).

- Kernel slabs store private bookkeeping data inside the
user-accessible slab buffers themselves. Alternate APIs are planned
here for managing slabs of kernel objects, implemented within the
runtime library and not the kernel.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-07 10:45:15 -07:00
Andrew Boie
82edb6e806 kernel: convert k_msgq APIs to system calls
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-07 10:45:15 -07:00