Commit graph

41120 commits

Author SHA1 Message Date
Johan Hedberg
1668624a2f Bluetooth: tests/shell: Remove unnecessary redefinition of AD types
Change-Id: I411618b1cc8ecdf67f84d6debb43bde314eaed10
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-07-22 09:18:02 +00:00
Johan Hedberg
cbf325a58d Bluetooth: Add warning for bt_pub_key_gen() when missing support
This makes it easier to track issues resulting from missing ECDH
support.

Change-Id: Iab104beed8cc622ea7bec2275ed69ca4ffe4cc87
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-07-22 09:17:51 +00:00
Johan Hedberg
d43f4c27d0 Bluetooth: Remove conn & SMP dependency from BLUETOOTH_TINYCRYPT_ECC
Ever since we expose ECDH as a more generic API that's not bound to
SMP we shouldn't be requiring selcting SMP in the configuration for it
to be available. Move it outside of the BLUETOOTH_SMP and
BLUETOOTH_CONN dependencies.

Change-Id: I4ac15ff92b1d4fcf3061a487718d364aa7d43bc8
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-07-22 09:17:42 +00:00
Arkadiusz Lichwa
65ab753fe7 Bluetooth: L2CAP: Fix debug message in l2cap_chan_destroy
Removes redundant parameter value to be printed.

Change-Id: Ib719135b4f99265312b3a08f051d35d10adb0bcf
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-07-22 09:00:09 +02:00
Inaky Perez-Gonzalez
3e63a74514 net/yaip: revert merge
Follow up to TSC decission for further discussion in the networking
WIG.

Change-Id: I148b484dfe308661573e47ed3e60cceed673bddf
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-07-22 04:43:09 +00:00
Kumar Gala
5249b8a52d Bluetooth: use sys_put_le16 macro instead of bswap
Use sys_put_le16 rather than having to explicitly have an ifdef
check in the code and use bswap_16.

Change-Id: Ia7b2b956c69993e29b1186da3d08e5eb449f096b
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-07-22 04:26:15 +00:00
Ramesh Thomas
1af3a40b9e power_mgmt: Add Deep Sleep support in sample PM app
Added changes to enhance device suspend/resume involving
core devices used by OS and app. Updated with Deep Sleep
power policy usage example. Moved the arch/soc dependent
code to soc/arch dependent areas in Zephyr in a separate
patch.  This app now uses api that abstracts the soc/arch
details in handling power states.

Jira: ZEP-511
Change-Id: I3b4eb0be973027dbf9bd046e16836f7863eee46e
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2016-07-21 11:25:31 -07:00
Ramesh Thomas
2ce3a59555 power_mgmt: Create arch/soc specific helper functions
Created set of functions that was designed in the original RFC to
contain arch and soc specific code.  This makes the interface to
the OS PM infrastructure cleaner and makes it easier to understand
the flow in the sample app. Also it makes code reuse easier across
soc/arch implementations.  These are open to change in future if
other means to achieve the same goals are in place.

Jira: ZEP-227 ZEP-225
Change-Id: Ief57871c370341c55009ad4f456b7f71f2c2a3c6
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2016-07-21 11:25:31 -07:00
Ramesh Thomas
53bc73a438 uart: qmsi: Adds device suspend/resume to uart_qmsi device
This adds some basic suspend/resume support in the uart_qmsi
driver. This is part of a change to enable device suspend/resume
and deep sleep support in sample PM application.

Jira: ZEP-512
Change-Id: I38cfbfb352d0027b7beaadebedbc10002dade50a
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2016-07-21 11:25:31 -07:00
Ramesh Thomas
1171348038 rtc: qmsi: Adds device suspend/resume to rtc_qmsi device
This adds some basic suspend/resume support in the rtc qmsi
driver. This is part of a change to enable device suspend/resume
and Deep Sleep support in sample application.

Jira: ZEP-512
Change-Id: I79ccfb56de5b3cbfb5bc91e9cacca68554aa46ee
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2016-07-21 11:25:31 -07:00
Ramesh Thomas
8f0fdb668a timer: Adds device suspend/resume to loapic timer
This is part of a change to enable device suspend/resume and
Deep Sleep support in applications. Adds suspend/resume handling
in loapic timer.

Jira: ZEP-512
Change-Id: I9da2c8419bd9109fb71ef5a6caf736de7c7de9e1
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2016-07-21 11:25:31 -07:00
Ramesh Thomas
02db5262b8 power_mgmt: Enhances the DEVICE_INIT_PM macros
Enhances the DEVICE_INIT_PM and SYS_INIT_PM macros so the drivers
can avoid #ifdef checks in C code.  This also prepares for future
merging of the different versions of these macros.

Change-Id: I2cc50686a2e2c6bdf675bff8b208f741231c2537
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2016-07-21 11:25:31 -07:00
Andrew Boie
56dded4435 qemu_nios2: run sanity checks with the emulator
Requires SDK 0.8.1

Change-Id: I2384508897bcd9f7a3d19962853f642c4ba815f4
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-21 16:32:19 +00:00
Andrew Boie
eb63710960 REVERTME exclude test_sha256 on Nios2
Daily build failing due to this test case timing out
execution after 3 hours. Locally this test takes about
a minute, the issues with CI are being looked into.

Change-Id: I27e40846dde25fc65281b4aea61d10b403c6512d
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-21 16:31:31 +00:00
Maureen Helm
1942a413fc net: tinydtls: Use assert.h from minimal libc
Now that minimal libc has assert.h, we can remove the workaround from
tinydtls.

Change-Id: I3bb001d1891f0b110b43133d30c262ba320450f7
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2016-07-21 16:22:20 +00:00
Murtaza Alexandru
0c83039a67 sensor: add driver for LPS25HB
Add driver for LPS25HB pressure and temperature sensor.

Datasheet:
http://www.st.com/content/ccc/resource/technical/document/datasheet/9a/4c/aa/72/1f/45/4e/24/DM00141379.pdf/files/DM00141379.pdf/jcr:content/translations/en.DM00141379.pdf

Change-Id: I6b616e879777b52f16f4e867c330e8beacf59fd3
Signed-off-by: Murtaza Alexandru <alexandru.murtaza@intel.com>
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-07-21 16:22:03 +00:00
Johan Hedberg
cac17e858f misc/byteorder.h: Add helpers to get & put unaligned integers
These helpers provide a way to read and write data buffers containing
multi-byte integers with a specific endianness. They are particularly
convenient for network protocol encoding and decoding.

Change-Id: I09ad125a1bbc4510b97a1d75c83cb70d893e22e8
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-07-21 16:19:27 +00:00
Johan Hedberg
55209323a1 misc/byteorder.h: Add documentation for existing APIs
Add doxygen documentation for existing documentation in byteorder.h.

Change-Id: I0de668e140eeb011807c31d47212f452ccd81627
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-07-21 16:19:26 +00:00
Jon Medhurst
93f49c20e9 samples: uart: Check return value from uart_fifo_fill
If the UART FIFO is already full at the start of the irq tests (e.g.
because the data from the previous polled mode test is still being
transmitted), then uart_fifo_fill() may not not be able to add the
requested character to the FIFO and so return zero.

Fix this issue by repeating retrying uart_fifo_fill() until success.

Change-Id: I055ca1d4c91d81488b89f2a9b00031b9f2b8b222
Signed-off-by: Jon Medhurst <tixy@linaro.org>
2016-07-21 16:16:24 +00:00
Andre Guedes
02dc270d5e samples: Add Quark SE power management application
This patch adds a reference Power Management Application (PMA) for
Quark SE based platforms.

This application demostrates how to interact with the PM subsystem
and how to put the SoC in different power states. The application
"modus operandi" is very simple. The application keeps transiting
between all power states supported by Quark SE SoC. For now, C1,
C2 and C2LP CPU states are implemented. Upcoming patches will
add support for the remaining states (LPS and Sleep states).

Change-Id: Id81aadb8bf170fbb2ecfd9483ae250c786619e43
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
Signed-off-by: Iván Briano <ivan.briano@intel.com>
2016-07-21 15:32:38 +00:00
Andrew Boie
eb53ebb885 x86: fix CONFIG_INIT_STACKS
The interrupt stack wasn't being initialized at boot.

Change-Id: Iec3e770d385643415641e15906c3a53f7c74a2e9
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-21 15:04:55 +00:00
Andrew Boie
3adcc45970 arm: assume irq stack and size are aligned
This is done in nano_init.c.

Change-Id: I86e170ecb51f0291a79f65847bb6043aa28731eb
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-21 15:04:41 +00:00
Andrew Boie
7a6272f846 nios2: assume IRQ stack pointer and size already aligned
This is now done in nano_init.c.

Change-Id: I6a55df8c33e23a0899fb4186696a6601e3f01aa3
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-21 15:04:05 +00:00
Andrew Boie
0a86fcbb2a x86: assume irq stack pointer and size already aligned
This is now done in nano_init.c

Change-Id: I2717ca54fd5e16b18c2dc506bc3972caf23f26d8
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-21 14:26:30 +00:00
Jesus Sanchez-Palencia
288f6cc889 build: Improve usage of the ISSM toolchain
With this fix now we can use the ISSM standlone toolchain [1] through
ZEPHYR_GCC_VARIANT=issm and ISSM_INSTALLATION_PATH=/path/to/toolchain
variables only, without the need of setting IA_VERSION and ARC_VERSION
always. These are always the same for a given toolchain release.

This is also a way for us to document the currently supported (and
tested) toolchain version.

Tested on Linux only.

[1]
https://software.intel.com/en-us/articles/issm-toolchain-only-download

Change-Id: I6fba8ea9564b2080bd73b627bc7150863401f18d
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
2016-07-21 02:48:03 +00:00
Kumar Gala
1c0bcc8cc5 toolchain.gccarmemb: Simplify setting of libgcc include path
Utilize the gcc -print-libgcc-file-name to determine the path to
libgcc.a.  Using this also resolve issues if we are building with
floating point and the various ABIs to pickup the right lib.

We can also simply a few Makefiles and remove the need to export
_CROSS_COMPILE_arm_isa.

Change-Id: I293394c921c18fa4984173ba51825d6f9a333697
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-07-21 02:42:56 +00:00
Fabrice Olivero
cad05129b9 samples/task_profiler: remove "dump" logging
This print showing when the profiler is flusing data to the
UART is annoying, especially when shell is used

Change-Id: I62c4466bd7f599ff995027ee19aea539d6679ec0
Signed-off-by: Fabrice Olivero <fabrice.olivero@intel.com>
2016-07-21 02:41:48 +00:00
Kumar Gala
a3d01314f9 samples: usb: dfu: Fix building of dfu code
We've transitioned to use $ZEPHYR_BASE instead of srctree due to how we
might invoke the kbuild system.  Change include paths to be $ZEPHYR_BASE
relative instead of $srctree.

Change-Id: Ib7428a1821a81a4537c6d5d98ee91e30f0cce435
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-07-21 02:38:23 +00:00
Paul Sokolovsky
454810fa3d samples: shell: Print ticks as unsigned
Both sys_tick_get_32() and sys_cycle_get_32() declared as return uint32_t,
so print them as such.

Change-Id: Iab12696f6cc466dc11fb41402e2e671e74e61a89
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2016-07-21 02:37:48 +00:00
Jesus Sanchez-Palencia
6d33683a7c samples/usb: Fix build for usb_dfu example
Change-Id: I1de08852abd212dd0ae636bbd3bf8ce60feb17bb
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
2016-07-21 02:18:24 +00:00
Maureen Helm
0a9e0d0a5e libc: Add assert.h to minimal libc
This is an adaptation of
net/ip/tinydtls/platform-specific/config-zephyr.h to allow external
imports such as KSDK to include assert.h.

Change-Id: I0afee37deb79447363037ba6b4bb9cdbc629be3a
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2016-07-21 02:09:44 +00:00
Kuo-Lang Tseng
aebe38465f qmsi: aon counter: Use locking mechanism to guard critical regions of API call
This will guard critical regions in the driver API so that the API
operation called from one thread (task or fiber) can complete
without the context being over-written by any simultaneous call
of the API from other thread (task or fiber).

The locking mechanism is by default disabled in the build. To enable it,
the following flag needs to be defined:

CONFIG_AON_API_REENTRANCY

Jira: ZEP-424
Change-Id: I1b0eae70a4ab97229931033153662874d7c4a68e
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-07-21 02:05:43 +00:00
Andrew Boie
5512105562 sanitycheck: add -R to build all tests with assertions
Some tests individually enable assertions; this forces them on
for all tests. Intended for use with daily builds. Disregard
footprint or benchmark data with this enabled.

Change-Id: I7a0822432d5cab7f3ab0767faf214fde536cd68e
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-20 23:41:05 +00:00
Andrew Boie
d2e1f875d7 __assert.h: format strings are not optional
If the reason strings were omitted, the build was only
failing if assertions were turned on, in printk().
Now it fails regardless of whether they are turned on.

Change-Id: I90721a5babb89b20bf8430e122eb03a4ec62c46f
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-20 23:40:48 +00:00
Ravi kumar Veeramally
f93771a25c Revert "net: Restructured Ethernet driver menu"
This reverts commit 6de5643eb1.

Patch breaks applications running over Ethernet.

Jira: ZEP-565

Change-Id: Id147b7089f175c769c42c4e3dfb95408ee17ba9e
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-07-20 22:57:55 +00:00
Andrew Boie
df72692fb6 sensor_bmi160: fix incorrect use of __ASSERT()
Change-Id: Ieb1d8b1aed3e9906d1377e1e4117b69eb8cae751
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-20 22:00:44 +00:00
Andrew Boie
fda08b0e43 x86: close EOI race condition when nested IRQs enabled
Until now, EOI had always been sent out to the APIC with interrupts
unlocked. Depending on timing, there is a race where the next interrupt
on the same line could arrive before _IntExit disables interrupts
and pops context. If this happens consecutively enough times, the
interrupt stack will overflow.

Now we disable interrupts at the beginning of _IntExitWithEoi and they
remain that way until 'iret'.

Change-Id: Ibb28e0db902ff483d7a885389f231ac2d1864657
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-20 21:48:00 +00:00
Andrew Boie
917159188c nano_init: force nanokernel stack alignment
The interrupt stack pointer is now aligned, and we error out if
the sizes of the interrupt and main task stacks aren't a multiple
of the stack alignment.

Change-Id: I2a70c82fc94e25cc6c7a9d5ec165bf2370b8a166
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-20 21:26:00 +00:00
Iván Briano
3c544a87ec ext qmsi: Build the power states support from QMSI
QMSI provides functions to set the SOC into its various power states,
and for Quark SE it also allows to control the voltage regulator, but
the files with these functions were not being built.

Change-Id: I40f08cdc970eb6696bc5f1d6cd0c407f64bec754
Signed-off-by: Iván Briano <ivan.briano@intel.com>
2016-07-20 19:21:44 +00:00
Szymon Janc
c8cb32c462 Bluetooth: shell: Add support for getting OOB data
This allows to query LE and BR/EDR OOB data.

Change-Id: I8bc281a9549092c1c4b40c346580abb5fd51d02d
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-07-20 20:20:44 +02:00
Szymon Janc
c6bcb591f6 Bluetooth: Add initial support for OOB data
This allows to query information needed for Out Of Band pairing
or connection creation. Currently supports only BT addresses.

Change-Id: I60bf9344baee552e7743fa8fc1b3cfb3a4765334
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-07-20 20:20:44 +02:00
Mariusz Okroj
ea808df0f5 microkernel: Fix fifo buffer name generation in DEFINE_FIFO
Creating FIFO using DEFINE_FIFO should result in a new buffer in noinit
section which can be used only by this particular FIFO. Currently all
FIFOs unintentionally use the same buffer (__name_buffer). Fixed FIFO
buffer name generation, so now each FIFO has its own unique buffer.

Change-Id: I7ee8250f70b141254a4c98f0ed1a7b9a29dec0c8
JIRA: ZEP-523
Signed-off-by: Mariusz Okroj <mariusz.okroj@intel.com>
2016-07-20 17:03:32 +00:00
Iván Briano
4b6a87e48e ext qmsi: Fix registers definition for LPSS
This is fixed in QMSI 1.1 already and this patch can be reverted when
the next released is merged into Zephyr.

Original commit message:
While performing power measurements in LPSS, it appeared that the value
for LPSS registers was incorrect. Fix this value to enable proper entry
in LPSS mode.

Change-Id: Ie6a4aa5c9aa01ebaad0cd2db722bb9b5c87df5e7
Signed-off-by: Julien Delayen <julien.delayen@intel.com>
Signed-off-by: Iván Briano <ivan.briano@intel.com>
2016-07-20 16:24:22 +00:00
Johan Hedberg
211ae314e8 Bluetooth: Pass net_buf_simple to scan callback
This lets the callback take advantage of the powerful net_buf API for
parsing the advertising data content.

Change-Id: Id65e6e83efd60c0f36c47bc5446a2e8ec2833d7c
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-07-20 16:19:01 +00:00
Szymon Janc
a0a52691f2 Bluetooth: Add support for rotating RPA
If privacy is enabled we always use RPA, even for active scan.
This makes single point of controlling current random address
making code simple and not prone to subtle bugs with concurent
advertising, scanning and connecting.

Currently used RPA is rotated to improve privacy. Timeout value is
controlled by Kconfig and by default is 900 seconds (15 minutes).

Change-Id: I27a15666a4f2e2962cf6eb20c7cd06f90b7f2bb1
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-07-20 16:18:50 +00:00
Ramesh Thomas
0022289ace fs: PUll in rev 0.12a of open source FAT FS code
Update latest revision of the FAT FS code.

Origin: ELM Chan
URL: http://elm-chan.org/fsw/ff/00index_e.html
Change-Id: I602c239055c171595a46986eaa774298117055b6
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2016-07-20 15:06:36 +00:00
Luiz Augusto von Dentz
c51bcbb9d9 Bluetooth: GATT: Add write struct parameter to its callback
This makes bt_gatt_write consistent with the rest of the API where the
parameters are passed back to its callback.

Change-Id: Ie94208aa661d3620d0cbc5be4a4fb5b3c3ef061c
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-07-20 13:40:55 +00:00
Johan Hedberg
e088b06e44 net: buf: Add API for saving & restoring parsing state
Occasionally it may be useful to pass a buffer to a subroutine and
have the routine do parsing of the buffer. However, since there isn't
necessarily a guarantee of how the subroutine performs the parsing it
may be necessary to restore to a well known state after the routine
returns.

This patch adds a simple struct for storing the parsing state as well
as two new functions to save and restore the state.

Change-Id: If9153ff9997021c76243ea9ebff13dfe94c45faa
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-07-20 14:51:24 +03:00
Luiz Augusto von Dentz
d84dcb9626 Bluetooth: shell: Loopback L2CAP data
This can be used to test if receiving and sending simultaneously is
working properly with tools such as BlueZ's l2test.

Change-Id: Ic6bcd00a4e1448bebd3ae74bcc58986872332bbe
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-07-20 05:34:50 +00:00
Sergio Rodriguez
6d5981bf28 lib: Adding the strstr() function
The strstr function finds the first occurrence of a substring
in another string, null terminated strings are not compared, this
function is added for compability for porting other libraries (like
mbedtls)

Jira: ZEP-327

Origin: http://www.leidinger.net/freebsd/dox/libkern/html/d3/d29/
strstr_8c_source.html

Change-Id: I52aac218ce0bd86373ec60f5afc49a92c85f6319
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-07-19 22:35:21 +00:00