Commit graph

41120 commits

Author SHA1 Message Date
Andrei Emeltchenko
ac59405268 Bluetooth: nble: Include all functions to build
Include all functions using previously defined stubs.

Change-Id: If9ab3f02d2e3e1f27c09b0d666fcf531cf76898d
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:26 -05:00
Andrei Emeltchenko
d5100a0672 Bluetooth: nble: Enable GAP functions
Use debug stubs for now

Change-Id: I8e25ba8bb0fc4eec4d789c51e1599a17fa78cf5c
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:26 -05:00
Andrei Emeltchenko
228d0cb292 Bluetooth: nble: Enable GATT functions
Use debug stubs for now

Change-Id: Ia6f73ce3d289f3759a93eee42439fe7001770eab
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:26 -05:00
Andrei Emeltchenko
acc88b8a71 Bluetooth: nble: Refactor header include logic
Change-Id: I4f4475360c317ba69584b34b33a1dd0f27edb022
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:26 -05:00
Andrei Emeltchenko
702b151e47 Bluetooth: nble: Move receive logic to fiber
Move receiving logic to fiber rx_fiber(). rx_queue is registered with
uart driver and all data is sent there for processing. Clean up old
ipc_channel interface since there will be only one interface to uart
driver.

Change-Id: I292863b1f38e5adb8ca4e6ac63aed09c83de56bf
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:26 -05:00
Andrei Emeltchenko
96aaaadca8 Bluetooth: nble: Adding NBLE ready callback
Refactored Johan Hedberg's code adding callback to be called when NBLE
is up.

Change-Id: I2a8a2238942c0adae2a5c47cfe94d8f2b1112810
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:26 -05:00
Andrei Emeltchenko
500b59809f Bluetooth: nble: Drive BTWAKE high
Refactored Johan Hedberg's code adding writing to NBLE_BTWAKE_PIN one
to drive it high, needed to wake up NBLE chip.

Change-Id: I63b9583281db897f2326e4570716c25ce181128f
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:26 -05:00
Andrei Emeltchenko
cc190488ee Bluetooth: nble: Add basic RPC transmit code
Refactored Johan Hedberg's code adding initial transmit logic.

Change-Id: I44b0166c281d526fbd12b895b5777486c7392260
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:26 -05:00
Andrei Emeltchenko
14613089e5 Bluetooth: nble: Add RPC deserialization functions
Port RPC deserialization to Zephyr upstream.

Change-Id: Icc9e055565185e907f51832443386f929a752586
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:26 -05:00
Andrei Emeltchenko
79f47c65ba Bluetooth: nble: Add RPC Serialization IPC
Port RPC Serialization to Zephyr upstream

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Change-Id: I315d52dc6576254a6928520d1353856d41a25c69
2016-02-05 20:25:26 -05:00
Andrei Emeltchenko
124795afed Bluetooth: nble: Implement bt_enable
Resets Nordic BLE chip and opens communication channel to UART.

Change-Id: Ie516869a4d978fc1622361ebc42894430fdf9ea6
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:26 -05:00
Anas Nashif
abb6e223cf NBLE: Nordic BLE is not a feature of quark se
Move BLE configuration to board and enable GPIO for NBLE.

Change-Id: I99c309656430936edf6766fc99fe83b011801bb4
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:26 -05:00
Johan Hedberg
4218572c13 Bluetooth: samples/peripheral: Set right board for nble testcase
Change-Id: Ie0b1dceeb94a760dc9990a5c573616522169ea76
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:25:26 -05:00
Andrei Emeltchenko
baeb34a950 Bluetooth: nble: Add UART driver for Nordic BLE chip
Adds basic support for communication with Nordic BLE (NBLE) chip
connected to UART.

Change-Id: I3651e291ec18805a63ecd3d240dce62273e3c498
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:26 -05:00
Andrei Emeltchenko
d325faa670 arduino_101: Set UART0 default options and baud rate
Set options and baud rate to communicate with NBLE chip.

Change-Id: I338aad3b1dc03b809aade29eedac7093ea346a5e
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:26 -05:00
Jukka Rissanen
f5a58453d4 net: contiki: Fix the RA ICMPv6 sending
The ICMPv6 RA payload was ignored and not sent. This was seen
as malformed packet by receiver. We must update the length of
the message by calling net_buf_add().

Change-Id: I3dc64cfce669de54283db290cfb009b2c6ea7225
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:25:26 -05:00
Jukka Rissanen
a38fc2fc11 net: contiki: Fix the NS ICMPv6 sending
The ICMPv6 NS payload was ignored and not sent. This was seen
as malformed packet by receiver. We must update the length of
the message by calling net_buf_add().

Change-Id: I5bf53695c811c27a75320fea7331d91782a9748a
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:25:26 -05:00
Jukka Rissanen
209119cd63 net: contiki: Fix the RS ICMPv6 sending
The ICMPv6 RS payload was ignored and not sent. This was seen
as malformed packet by receiver. We must update the length of
the message by calling net_buf_add().

Change-Id: Iddedb7b6674f30c7943c0ba59c0afc7d244a1e0d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:25:26 -05:00
Arkadiusz Lichwa
ea3b162bac Bluetooth: BR/EDR: Add support for Link Key request
Delivers a valid Link Key to controller if found or responds negative
to Link Key request to controller.

Change-Id: I98061110a60b066421f35db44455925cbcd3076e
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-02-05 20:25:25 -05:00
Arkadiusz Lichwa
9b0d42930c Bluetooth: BR/EDR: Define HCI Link Key request
Enable HCI protocol for handling Link Key request event and
responses.

Change-Id: Ib3e24782257a87028b63198d210203b442883211
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-02-05 20:25:25 -05:00
Arkadiusz Lichwa
a68db1fc57 Bluetooth: BR/EDR: Enable encryption handlers
Get access to available link encryption related handlers.

Change-Id: Ifcf4cf3af11368ca68cd93d3023a020bb01a7b74
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-02-05 20:25:25 -05:00
Michael LeMay
fa484be4f4 net: ipv4: Add missing includes
This patch adds two missing includes necessary for building IPv4
support.

Change-Id: I381d0951df4ee615867743dbde551666b603fecc
Signed-off-by: Michael LeMay <michael.lemay@intel.com>
2016-02-05 20:25:25 -05:00
Tomasz Bursztyka
838c98b023 cc2520: Use DEVICE_INIT() relevantly
Fix a build issue, as DEVICE_INIT() is the only macro used now and
others have been removed.

Change-Id: I69f7df168f5c4284104068b79ba9097d9a1904c1
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:25:25 -05:00
Andrew Boie
897ffaeb2c irq: rename irq_connect() to IRQ_CONNECT()
It's not a function and requires all its arguments to be build-time
constants. Make this more obvious to the end user to ease confusion.

Change-Id: I64107cf4d9db9f0e853026ce78e477060570fe6f
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:25:25 -05:00
Benjamin Walsh
a4ec963138 init: use SYS_INIT() where it makes sense
Mostly SoC initialization and some kernel subsystems, but also some
device drivers like the interrupt controllers.

Change-Id: I8dc1844c33acd877c075b6b03558fdca6f87500b
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:25:25 -05:00
Benjamin Walsh
629e1dd861 init: add SYS_INIT()
This is to be used by subsystem that don't really want to create a
device but rather only want to be initialized automatically during the
kernel init sequence. It is just a wrapper around DEVICE_INIT(), and
thus still uses a device object, but it hides that fact and can be
replaced in the future without changing its model.

It can be used when a device created does not have objects associated
with it, but only an init function, and also when the device name
(DEVICE_INIT(<dev_name>, ...) does not matter.

Change-Id: I5488f430a6fb757cdcb499ef352775dc67aa0565
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:25:25 -05:00
Benjamin Walsh
47c04f4ac2 device: rename the device objects created by DEVICE_INIT()
Rename them from __initconfig_XXX to __device_XXX, which is more
indicative of what they are.

Change-Id: Ia63ae40c16a2b6f0413c37863cddc39f04839b72
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:25:25 -05:00
Benjamin Walsh
dcfd4e96f4 device: remove obsolete DEVICE_DEFINE/INIT_CONFIG_DEFINE()
They have been replaced by DEVICE_INIT().

Change-Id: I06551f37593a3debb7eb221badd267bb5c7040c0
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:25:25 -05:00
Benjamin Walsh
d340d4cb3f device: use DEVICE_INIT everwhere
This is the last step before obsoleting DEVICE_DEFINE() and
DEVICE_INIT_CONFIG_DEFINE().

Change-Id: Ica4257662969048083ab9839872b4b437b8b351b
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:25:25 -05:00
Benjamin Walsh
ef33dc32e5 device: add DEVICE_INIT()
DEVICE_INIT() is a consolidation of DEVICE_INIT_CONFIG_DEFINE() and
DEVICE_DEFINE(), which are always used in pairs.

Change-Id: I263ac195970483e1bb8bf709ef807ba054db9c32
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:25:25 -05:00
Benjamin Walsh
f027902305 net: use DEVICE_GET() instead of referencing __initconfig_xxx directly
Change-Id: I5cca7bf5f882cd2870c53f29dceb64faaf5b0d6e
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:25:25 -05:00
Benjamin Walsh
f2f719a523 device: move device APIs from init.h to device.h
Change-Id: I7f0d489be95242fe9899a1bfc0f3565839b5ffca
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:25:25 -05:00
Benjamin Walsh
a740cd96a9 doc: add device_ namespace to the naming code conventions
Change-Id: I3404a675a965ed196721f3cf825780c607ed2d40
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:25:25 -05:00
Benjamin Walsh
2c1a95aee6 device: rename SYS_GET_DEVICE_NAME/SYS_GET_DEVICE
Rename them to DEVICE_NAME_GET and DEVICE_GET to fit in the 'device'
namespace.

Change-Id: I407a7f284ed4d1c071961b46615eea859c2e825f
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:25:25 -05:00
Benjamin Walsh
0303d8cab9 device: rename SYS_DEFINE_DEVICE()
Rename it to DEVICE_DEFINE() so that it fits in the 'device' namespace.

Change-Id: I3af3a39cf9154359b31d22729d0db9f710cd202b
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:25:25 -05:00
Andrew Boie
2ee9aca31a irq: size _irq_to_interrupt_vector_table
Most systems have far less than 256 IRQ lines available, so
save some bytes in ROM by making this a config option.

On systems with MVIC, omit the table entirely as the mapping
is fixed.

The build cmd_gen_idt is slightly easier to read and will fail
immediately if any of the commands in the sequence error out.

Change-Id: I411f114557591e5cd96b618e6f79f97e8bedadf0
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:25:25 -05:00
Juan Manuel Cruz
ba15d18d94 adc: updated the adc read api description
The ADC read API has changed from asynchronous read to
synchronous read. There is no callback support anymore.

Change-Id: I2fdd10916dc6acb7b352bc549cd886929f7cd764
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:25:25 -05:00
Benjamin Walsh
bfc27206b2 device: rename DECLARE_DEVICE_INIT_CONFIG()
Rename it to DEVICE_INIT_CONFIG_DEFINE(), because (a) it was not fitting
in any namespace and (b) it is not used to declare, but rather define a
object.

Change-Id: I1da5822f06b85a9fb024b5b184afd0ccc01012ec
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:25:25 -05:00
Andrew Boie
bd18487727 x86: if no dynamic irqs, omit _interrupt_vectors_allocated
This bitfield is only needed to find unused vectors in the IDT
for installing dynamic interrupts.

Change-Id: I34ecd330774a0e50f240b4396527682eded29627
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:25:25 -05:00
Andrew Boie
630280c464 build: fix issue with static interrupts on ARC/ARM
Static interrupts rely on a trick where the _sw_isr_table array
is declared with each element in a different .gnu.linkonce
section, initially pointing to the spurious IRQ handler.

When drivers or apps declare their own interrupts, they override
the element with their own containing the real ISR and parameter.

However, this only works if the initial declaration of the
_sw_isr_table array with the spurious handlers is linked last.
App-specific code was being linked later than the core code,
causing static interrupts declared in apps not to be installed
correctly.

If the _sw_isr_table is moved from SOC-specific code to core arch
code, interrupts configured under soc/ should still also work.

Change-Id: Iec7df47386dfbbf2956a807da27dc8aa6e01b268
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:25:25 -05:00
Rodrigo Caballero
d1ff13e68f doc: Fix cross-reference and toctree on index.rst and about_zephyr.rst
Change-Id: I315a4d90dc2c98062ca84ec01f915bf47d6f15c1
Signed-off-by: Rodrigo Caballero <rodrigo.caballero.abraham@intel.com>
2016-02-05 20:25:25 -05:00
Fabien Chereau
4ec9758034 irq: fix declared _sw_isr_table size on ARC
On ARC, the _sw_isr_table has an actual size of CONFIG_NUM_IRQS - 16
because the 16 first IRQ are reserved.

This patch has no impact on the generated binary but allows the
debugger to display valid information instead of displaying 16 false
entries containing garbage.

Change-Id: Iae2756c1bc333dc822e9f80c2115fba6521792a2
Signed-off-by: Fabien Chereau <fabien.chereau@intel.com>
2016-02-05 20:25:25 -05:00
Fabien Chereau
78b2670032 irq: added a check for dynamic IRQ table overflow
Change-Id: I0128f752f8e42ee38331fa937b7616354bf346e0
Signed-off-by: Fabien Chereau <fabien.chereau@intel.com>
2016-02-05 20:25:24 -05:00
Benjamin Walsh
c5bb958db4 arm: add software reboot for QEMU
This simulates a reboot by jumping back to the address stored in the
reset vector in vector table found at address 0. It is supported from
interrupt/exception level, which means that sys_arch_reboot() in this
case finds out if it is called from thread mode or handler mode, and in
the latter case, it unwinds the nested exception stack as needed.

Change-Id: Ib67f850f8411f1ee8fc592a5f31f2f70d0af14a4
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:25:24 -05:00
Benjamin Walsh
62c65d7f00 arm: in non-XIP image, make __start alias of __reset
The bootloader expects the entry point to be called __start, not __reset.

Change-Id: I5a5f7f45c248b9398e58fb026c731f8617fe4856
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:25:24 -05:00
Benjamin Walsh
ec47784a28 test_mem_safe: support ARM
Test works for ARM, but not testing sys_mem_safe_write_to_text_section()
since base ARM image are XIP images.

This test could be enhanced to  boot a secondary non-XIP image for ARM
to test writing to .text.

Change-Id: I56aef68afabe88588b61c273901491de0c24a39b
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:25:24 -05:00
Benjamin Walsh
2e27adb569 mem_safe: prevent writing to .text in XIP systems
The sys_mem_safe_write_to_text_section() now always fails in XIP
systems, since their .text section is in ROM.

Change-Id: Ie47a5dbf5f75a4bfe8e9fc9852d0037a3546aae8
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:25:24 -05:00
Benjamin Walsh
7b526e2447 cache: add implementation for cache-less systems
Add NOP functions to allow writing cache-availabiliy-agnostic code.

Change-Id: Id8e392271329095abad3db6856a4e621702d1dae
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:25:24 -05:00
Benjamin Walsh
bd94d98255 arm: add connecting exceptions at runtime
Add sys_exc_connect() (and its x86-compatible alias nanoCpuExcConnect())
that allows connecting an exception handler at runtime.

The current implementation is a bit of a bastard, to avoid disturbing
the current implementation of the exception handlers. Instead of hooking
_exc_wrapper() in all vectors and adapting the exception handlers, the
current exception handlers are still hooked directly in the vectors.
When an exception is hooked at runtime, _exc_wrapper() gets installed in
the vector and the real handler gets inserted in _sw_exc_table; this
means that the scheme only works with non-XIP kernels.

This should be enhanced so that _exc_wrapper() is hooked in all vectors,
and that current exception handlers (for faults mostly) are reworked to
be inserted in the _sw_exc_table and wrapped in _exc_wrapper().

Change-Id: Icaa14f4835b57873d2905b7fbcbb94eeb3b247d1
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:25:24 -05:00
Benjamin Walsh
f8807dae89 arm: rename _VectorTableROM
For non-XIP systems, it's not in ROM, so remove the "ROM" part. Adapt it
to coding conventions at the same time, and export it to C code.

Change-Id: Id09a6be8bc9c462667ed71b53be7fa5382c88db3
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:25:24 -05:00