Commit graph

99014 commits

Author SHA1 Message Date
Andrei Emeltchenko
61367b415d Bluetooth/shell: Correct attribute write error
Return correct errors for long write.

Change-Id: Idfd54d961db9b2023d05a0dcfa7082d63e9c0261
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-05-25 16:44:51 +03:00
Andrei Emeltchenko
094a2cd8f0 Bluetooth/peripheral_csc: Add configuration for nble
Change-Id: I102f4a178f22d93b5b673944f34138e7579e5901
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-05-25 16:44:51 +03:00
ktseng
256efc40a8 sample/flash: update sample usage for flash erase operation
Demonstrated sequence of flash API calls to show write and erase
operations with the use of flash_write_protection_set API.

Jira: ZEP-383
Change-Id: I36e5b94519dbdf424dcfbcf7f38e5cf6437da7b8
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
2016-05-25 13:31:13 +00:00
ktseng
be4ac5a3e9 flash: update API documentation
Fixed doxygen comments for flash API usage. Clarified the use of
flash_write_protection_set API for write and erase operations.

Jira: ZEP-383
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
Change-Id: I6a323915c63a393b7be8f96fe3fcd9616a9b21d1
2016-05-25 13:30:41 +00:00
Mariusz Skamra
13d0832142 Bluetooth: tester: Fix invalid type cast
This fixes invalid cast from struct bt_gatt_attr to bt_gatt_chrc.

Change-Id: Idc2c016e26b5d38d2d4772a7bd79af8357a4da58
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-05-25 13:23:19 +00:00
Kumar Gala
8870a72e0d quark_se_ss: Remove duplicate QMSI Kconfig symbols
config QMSI & QMSI_BUILTIN got duplicated in Kconfig.defconfig.
Remove the duplicates.

Change-Id: I5b318ab73fa7e3dbc4943534e42d283e0382ff92
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-05-25 12:45:38 +00:00
Kumar Gala
7584a1273f ext: plumb out Kconfig support for external source code
Add missing Kconfig files and connections to expose Kconfig options
in ext/ directories.  Fixup QMSI to only be exposed on platforms that
utilize it.

Change-Id: I6c6c5011b2bf2966f65aa8279dc594a244821956
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-05-25 11:28:34 +00:00
Johan Hedberg
942bbadbf6 Bluetooth: Increase HCI_LE_Rand delay for Arduino 101
20ms doesn't seem to always be enough.

Change-Id: If5ff255d3f043e50e6e1d9ff481607dc17c604d1
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-05-25 11:32:31 +03:00
Szymon Janc
44a306293c Bluetooth: shell: Enable TinyCrypt ECC for nimble
This allows to use LE SC with nimble firmware running on Arduino 101
board.

Change-Id: I3a9a485dc87c367160da98010d0189dfef09d5de
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-05-25 09:52:08 +02:00
Szymon Janc
7a82d7f661 Bluetooth: Offload bt_recv to fiber if run from task
Task can be preempted and bt_recv is expected to be atomic. Since
on microkernel with TinyCrypt ECC enabled this can be called from
task context we need to make it run in critical section.

Change-Id: I24414e8d98b0dfe8affc18058eb164ba0cba7b17
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-05-25 09:52:08 +02:00
Szymon Janc
684ffd1e23 Bluetooth: Offload ECC calculations to task
If TinyCrypt ECC is used for LE SC calculations need to be done
in task to avoid hogging CPU from non-preemptible fiber. To keep
upper layers of stack independent of crypto used (TinyCrypt or
controller) this patch adds HCI ECC emulation.

If ECC emulation is enabled it is always used regardless of ECC
support being present in controller.

Change-Id: I7c5ca873a18c10237e1c0b2f09e6da2a75fb334e
Origin: Original
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-05-25 09:52:08 +02:00
Maureen Helm
d6f950c918 ksdk: Import Kinetis SDK device support for K64F
Import device-specific header files and clock configuration for K64F.

Origin: NXP KSDK 2.0
URL: kex.nxp.com
Maintained-by: External

Change-Id: I8b4cc0fc0a832c736067459afec57939643181a7
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2016-05-24 16:04:47 -05:00
Maureen Helm
2b143fdc47 ksdk: Import Kinetis SDK drivers
The Kinetis SDK provides device header files and peripheral drivers for Kinetis
SOCs. Importing a subset of the SDK to support the K64F peripherals. This will
make it possible to implement a shim layer to adapt the drivers to Zephyr APIs.

Origin: NXP KSDK 2.0
URL: kex.nxp.com
Maintained-by: External

Change-Id: Ie14b42f75dab9126eb1ca4653538c5707b830cb5
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2016-05-24 16:04:45 -05:00
Maureen Helm
728f32ffac cmsis: Import CMSIS-CORE header files
The ARM Cortex Microcontroller Software Interface Standard (CMSIS) defines a
set of standard interfaces to ARM Cortex-M SOCs. In particular, the CMSIS-CORE
component standardizes the software interface to core and peripheral registers,
as well as exception names and the system clock frequency. Multiple SOC
vendors, including NXP and Nordic Semiconductor, include the CMSIS-CORE header
files in their SOC header files. These SOC header files are in turn used by
the vendor's peripheral drivers.

Origin: ARM CMSIS v4.5.0
URL: https://github.com/ARM-software/CMSIS.git
commit: f25cf2c15304ad872a5b9761651d3f57d6202906
Maintained-by: External

Change-Id: I15c3ddd04619a7608fecb8b710eb115b30cd9632
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2016-05-24 16:04:44 -05:00
Chuck Jordan
0fc41677b2 i2c: fix some spelling errors/grammar in comments
Some minor fixes to some comments

Change-Id: I0244d70c31b59ba189673e44c3919710414e9810
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
2016-05-24 10:14:10 -07:00
Andrei Emeltchenko
db6f45823f drivers/nble: Improve logging for long characteristic
Print flag for write_evt() to distinguish between write and
prepare_write. Add offset printing when reading.

Change-Id: I8b53d8f49657ade39b190ab33e99097bb172077c
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-05-24 13:19:35 +00:00
Andrei Emeltchenko
1216cf0ac4 Bluetooth/shell: Add test vendor service support
Adding test service makes possible to test Bluetooth PTS test cases
with the shell. Currently long and auth characteristic.

Change-Id: I153efd3f7fa266f93873ef978025faf72c664076
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-05-24 13:19:25 +00:00
Anas Nashif
df7f29124e quark_se_devboard: do not configure uart0 by default
the flow control and baudrate configuration is for BLE, so
make this dependent on BLE being configured.

Change-Id: I35f8e00ac31658fb1ad4a2751169c076f1e78532
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-24 12:02:28 +00:00
Murtaza Alexandru
c4425fd816 sensor: fix typo resulting in compile error
Fix a compile error when trying to set I2C address of LSM9DS0 Gyro to
VCC (0x6B) caused by a typo.

Change-Id: I27850ecd70e715a10b96572aedea0d237dd55cd5
Signed-off-by: Murtaza Alexandru <alexandru.murtaza@intel.com>
2016-05-24 11:36:33 +00:00
Chuck Jordan
2ae9689678 adc: some symbols didn't have depends on ADC and should
I noticed that even though I was building w/o ADC, that some
ADC config symbols were still defined. Adding some "depends on"
to clean that up.

Change-Id: Ie73d131ba1ad63b5f3d920e17b4c7b5a0d785609
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
2016-05-24 11:33:48 +00:00
Jukka Rissanen
6509f657ea net: Clear the connection pointer when net_buf is allocated
This fixes "No matching connection found" error when a packet
is received.

Change-Id: I9f9bba73f9858a9a3a45de26abd378d7c48aa9a7
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-05-24 04:51:58 +00:00
Jithu Joseph
09a0c2f619 pm/loapic: suspend/resume support for LOAPIC
Provide functions of saving and restoring LOAPIC
states to support deep sleep.

Jira: ZEP-223
Change-Id: I1fb427989b021ec8e3a4f6dd0f4766a214360621
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
2016-05-24 00:31:38 +00:00
Jithu Joseph
b1625df534 pm/ioapic: Add suspend/resume support for IOAPIC
Save and restore IOAPIC flags and irq to vector translation
info for supporting deep sleep.

Jira: ZEP-223
Change-Id: Ifc50a5a72699ff6782ad194d8e96b18fac34da18
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
2016-05-24 00:31:38 +00:00
Jithu Joseph
05158f76d7 pm/apic: Keep irq to vector table in RAM when needed by PM
In scenarios where device PM is enabled and dynamic irqs are
used, move the irq to vector table to RAM and keep it updated,
so that we can use this to restore IOAPIC/LOAPIC vector entries.

Jira: ZEP-224
Change-Id: I0d4350d4e30f8ca337a2a1d4f012748c3cb450f4
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
2016-05-24 00:31:38 +00:00
Jithu Joseph
7c29fefd7d apic : Refactor some macros into a header
Moving few macros into a header file.

Change-Id: I975e19ba518bd6184038d6c1715224be7190b3ad
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
2016-05-24 00:31:37 +00:00
Chuck Jordan
bc04903bdd arc: disable i-cache in early init because ARC CPUs start with it on
The ARC CPU comes up from reset with i-cache enabled.
It can have garbage in it from a previous run.
The fix is to check the build register for the i-cache, and if its
present, invalidate it fully, and then disable it.
_icache_setup() is called later to turn it on.

Change-Id: I26fae915153841c61e9530d5af2ddb9d0553275b
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
2016-05-24 00:02:17 +00:00
Chuck Jordan
568101259d arc: linker.ld modified to handle DRAM configuration as well
For EM Starter Kit, one of the SOC choices has DRAM and no FLASH.
If FLASH_SIZE is 0, the linker command file will create
SRAM, ICCM and DCCM memories (and no FLASH). SRAM is really DRAM.

Also, the linker.ld file is extended to handle microkernel
objects.

linker_harvard.ld has "all rights reserved". added to banner.

Change-Id: Ia433578b94ce91722f3670819f44befafeecf878
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
2016-05-24 00:02:17 +00:00
Chuck Jordan
95dd06737f arc: Adding EM11D SOC
EM11D is a ARC CPU configuration that can be selected for the
ARC EM Starter Kit. The board support for this board will be
submitted separately to expidite review.

Change-Id: Ifc4d48e1f5e01d44d1706e6426bd3b2d77ebe2f8
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
2016-05-23 23:48:00 +00:00
Chuck Jordan
aa9d180309 arc: Adding ARC EM Starter Kit board support
Board support for the ARC EM Starter Kit provides for a board
that can select one of two SOCs. The EM9D and EM11D commits
will be done separately to expidite review. Also submitted here
is doc/board/em_starterkit.rst to explain details about this
Zephyr board choice.

Change-Id: Icd9fac045c700ad8dcb95161fdd63c130f665778
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
2016-05-23 23:36:33 +00:00
Chuck Jordan
7bfe11b3e1 arc: Adding EM9D SOC
EM9D is a ARC CPU configuration that can be selected for the
ARC EM Starter Kit. The board support for this board will be
submitted separately to expidite review.

Change-Id: I2c85bdab6ea7bfb257e94e4c72b11b4568dbac19
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
2016-05-23 23:18:36 +00:00
Anas Nashif
489f42328c qmsi: move drivers and hal to ext/hal
This is external source code maintained somewhere else. Put it
under ext/ for clarity and maintainability.

Change-Id: I9e7c9d0948a2ba893006e316dc21d9b1a9edfa93
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-23 21:32:30 +00:00
Anas Nashif
59b34a37d8 uart: use qmsi driver for quark_se sensor subsystem
Move away from native driver and use the UART driver provided
by QMSI.

All peripherals on Quark MCUs will use QMSI drivers developed
specifically for Quark and optimized for this MCU line.

Change-Id: If4e27f38736849ea3e12c269886e2a03d957b671
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-23 21:32:20 +00:00
Anas Nashif
613304c95d uart: qmsi: do not include ioapic.h on non x86 systems
Change-Id: If3d63ec04003fbe97f4b981d9220bc6a8ba3e8f0
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-23 21:32:10 +00:00
Anas Nashif
c6343f5271 apds9960: Fix reference to i2c driver
Also make the CONF_FILE  variable overridable

Change-Id: I44251cfd66648a665ff04dfcd38e750c24af5734
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-23 21:32:01 +00:00
Anas Nashif
229980f33c adc: quark se: Add QMSI 1.1-based ADC shim driver
Change-Id: I330be6ae1fa16d66bfca0c2ae36664fc9c6d080d
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-23 21:31:51 +00:00
Anas Nashif
9739d11125 quark_se: i2c: use qmsi i2c driver
Now that we have QMSI sensor subsystem drivers, lets use them.

Change-Id: Icd301b6c044280b5b25d719b6dcc16d556a2ea8d
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-23 21:31:41 +00:00
Sergio Rodriguez
92e9ffe481 i2c: quark se: Add QMSI 1.1-based I2C shim driver
Add I2C QMSI shim driver for sensor system based on QMSI 1.1

Origin: Original
Change-Id: I9c8efe49e8e9b7a5f8496fa49beb68e409148be7
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-23 21:31:27 +00:00
Anas Nashif
862cff1eab quark_se: gpio: use qmsi gpio driver
Now that we have QMSI sensor subsystem drivers, lets use them.

Change-Id: I1340ba8930fc8676f7b706540a105250ce3e51b9
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-23 21:31:16 +00:00
Baohong Liu
2ddfe381b8 gpio: quark se: Add QMSI 1.1-based GPIO shim driver
Add QMSI 1.1 based GPIO sub-driver for sensor system.

Origin: Original
Change-Id: Ida5565a5911eb55651a11a4ac0b240c624f8e1ca
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-23 21:31:05 +00:00
Anas Nashif
1619e264dd quark_se: spi: use qmsi spi driver on sensor sub-system
Now that we have QMSI sensor subsystem drivers, lets use them.

Change-Id: I1776178ad6fb984d6e293dbfa8bb1d718e4c2566
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-23 21:30:53 +00:00
Baohong Liu
35633586f2 spi: quark se: Add QMSI 1.1-based SPI shim driver
Add SPI sub-driver for sensor system.

Use SPI irq number definitions already in Zephyr header file.

Origin: Original
Change-Id: I215db3acc535093dd75c0817cbe5af77e6e76e16
Signed-off-by: Baohong Liu baohong.liu@intel.com
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-23 21:30:43 +00:00
Anas Nashif
f7c5820f28 quark se: build sensor subsystem files
Change-Id: I4490823450dd5fab0c04bece9e61481958ab3843
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-23 21:30:25 +00:00
Anas Nashif
f35d6e04e3 qmsi: update qmsi to 1.1 alpha
Change-Id: Ib35ebcb32954f764ef8e33f6a1c11ad9f63931bc
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-23 21:30:04 +00:00
Fabrice Olivero
9cceb8c627 samples/task_profiler: fix #if to #ifdef
Change-Id: I6b0f6f14cab6df99c3bfe82062732e9f1eeef2bd
Signed-off-by: Fabrice Olivero <fabrice.olivero@intel.com>
2016-05-23 21:28:12 +00:00
Fabrice Olivero
f9f606b641 samples/task_profiler: disable UART0 on galileo to fix crash
On galileo, UART_0 IRQ is incorrectly mapped to IRQ 0
UART_0 IRQ should be mapped to IRQ 17 (same as UART_1 IRQ)
but NS16550 driver doesn't support mapping same IRQ for
different devices.
This is creating crashes when dumping profiler data on UART
CONSOLE (UART_1) with UART console enabled (UART in interrupt
mode)

This patch is disabling UART_0 in sample apps and adding a note
in the README file

This problem appeared due to following commit:
e643cede3a uart: add ISR callback mechanism for UART drivers
Since that commit, UART driver is setting the ISR for all
UART device instances when interrupt mode is enabled

Change-Id: Ic9d0207e5e5c7e3d8e8a8bf90f3132801bc6c2b1
Signed-off-by: Fabrice Olivero <fabrice.olivero@intel.com>
2016-05-23 21:28:09 +00:00
Fabrice Olivero
8a1c4e642b samples/task_profiler: add RTC/counter support as timestamp
On Quark SE, using system timer as event timestamp creates
inconsistencies since the timer is handled by software in
timer_int_handler and tickless_idle_exit. So timestamp does not
reflect timing of certain events like timer IRQ.

This patch introduces the usage of RTC or AON counter as kernel
event logger timestamp

Change-Id: I070254446dd98dd448e119892c34abf12efca719
Signed-off-by: Fabrice Olivero <fabrice.olivero@intel.com>
2016-05-23 21:28:04 +00:00
Fabrice Olivero
128dcbbe13 kernel event logger: add possibility to use custom timestamp
By default, kernel event logger is using the system timer. But on
some platforms where the timer driver maintains the system timer
cycle accumulator in software, such as ones using the LOAPIC timer,
the system timer behavior leads to timestamp errors. For example,
the timer interrupt is logged with a wrong timestamp since the HW
timer value has been reset (periodic mode) but accumulated value not
updated yet (done later in the ISR).

This patch is adding the possibility to register a timer callback
function that will be used by the kernel event logger. For example,
on Quark SE, this allows using RTC or AON counter which accuracy is
sufficient and behavior more straight forward compared to system
timer.

Change-Id: I754c7557350ef29fc10701e62a35a5425e035f11
Signed-off-by: Fabrice Olivero <fabrice.olivero@intel.com>
2016-05-23 21:27:49 +00:00
Caio Marcelo de Oliveira Filho
e450b2db00 build: use export to pass CFLAGS to zephyrmake
If CFLAGS have spaces, the existing zephyrmake leaks part of it as
arguments for make. Instead of explicitly setting, just the export the
CFLAGS to make it visible to the inner call to make.

Change-Id: I7b083cbc19a49e8dede39333443c701567d214c0
Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
2016-05-23 17:44:47 +00:00
Anas Nashif
60b18711f3 tests: remove duplicate kernel configs and usage of ARCH
Many test configs are the same, remove complexity and duplication by
using just one kernel config where applicable.

This removes the usage of ARCH which is a remnant from the days where
we had to specify the architecture of the board, the architecture is now
part of Kconfig and determined basded on the board configuration.

This will also make it easy adding new architectures to test cases without
having to add an architecture specific config file when it is actually not
needed, for example now that we will enable micro-kernel support on ARC.

Jira: ZEP-238
Change-Id: I143fa3c4629c58329cfeb0c761c7a896fc1ef63a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-23 16:46:08 +00:00
Anas Nashif
f59708b1e5 checkpatch: exclude ext/ from checks
File and directories under ext/ are not original to Zephyr and have
different coding style.

Change-Id: Ie09eb324c35eb6e7be2cc3bcbc6ce6676376e346
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-23 16:05:42 +00:00