Commit Graph

4852 Commits

Author SHA1 Message Date
Anas Nashif 416525849a toolchain: add support for external libc on arm/arc
Both ARM and ARC did not have the right include path defined.

Change-Id: I8322b49ffa1830ef7b06cddef686ceb83a85fdfa
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:29 -05:00
Anas Nashif 5cf903f22b x86/iamcu: build with -miamcu only when CONFIG_X86_IAMCU=y
Change-Id: I57727893f37bea88ab3b6e6f47f36569d9eef97d
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:29 -05:00
Anas Nashif c8b31705a1 tests: add build tests for various options
This test builds the syncronisation app using the following config
options to verify if the build is successful:
- CONFIG_DEBUG
- CONFIG_NEWLIB_LIBC

Change-Id: Idf2fe948ab58982244b3590da938a83206103be3
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:29 -05:00
Anas Nashif 51be9a50a4 Add flash support for boards using latest SDK
Using the latest SDK (0.7.2) you can flash directly using make
by specifying the board, for example

make BOARD=arduino_101 flash

This will build and flash the generated binary to the board.

Change-Id: I90254abd69874efbb449ef318079958980c23074
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:29 -05:00
Anas Nashif c4c919dbe0 Move compiler optimization to the SoC
Decisions on compiler optimizations were done on the architecture level,
this does not scale and some SoCs will have different optimization levels
or compiler options needed. Moving this to the SoC makes it easy to optimize
differently when using the same CPU which we use to set the right optimization
now on the architecture level.

For IAMCU platforms, use the right architecture and tuning.

-march=lakemont -mtune=lakemont -miamcu -msoft-float

Change-Id: I458afca5feb9be5de8dcae559d6dcac3c6d6a2a7
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:29 -05:00
Daniel Leung ed98af00e0 samples: gpio: extends to support gpio_atmel_sam3 driver
This adds code to the gpio sample apps to run on Arduino due,
using the gpio_atmel_sam3 driver.

Change-Id: Ida16ceeabf55eb7efedc94c56ff875d8fad6456d
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:25:29 -05:00
Daniel Leung a8a5597e94 arm/atmel_sam3: fixes incorrect rename to SYS_INIT()
Change-Id: I0c2ce73cd758e5e7472fa7bf66e48d12b1cdf6af
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:25:29 -05:00
Daniel Leung bf0e5089dc arm/atmel_sam3: fix SRAM base address for SAM3X8E
The default Kconfig option is missing a condition for the SRAM
base address on SAM3X8E. Add it back so the correct default
can be used.

Change-Id: Ib4103366f693648c76630cbbd71ca98109381d5c
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:25:29 -05:00
Daniel Leung db359d2219 samples: apps: rename gpio_dw to gpio
This renames the gpio_dw sample app to gpio, as this can be used
for multiple drivers.

Change-Id: I6f21237b5b8df10f531e47ad9f75cadfd619cd34
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:25:29 -05:00
Daniel Leung f6a5bfcfa1 gpio: add driver for Atmel SAM3 PIO controllers
The PIO controllers on Atmel SAM3 family processors can be
used for GPIOs, so this is the driver.

Change-Id: I3d5712f3a0a71025b820ca1c08dd767ee1e136d8
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:25:29 -05:00
Daniel Leung cae35e2460 gpio: allow pins to be enabled/disabled
Some GPIO controllers allow individual pins to be detached
from the controller (i.e. the controller no longer affects
the pin output, or can read its state).

This adds the configuration bits to the API so this feature
can be used by apps.

Change-Id: I355fd5910a5439dcabe01ab40cd887dda30eab72
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:25:29 -05:00
Daniel Leung 9c9ad646e1 boards/arduino_due: add pinmux driver
This adds the pinmux driver for use with Arduino Due.
The default for pinmux (mostly) reflects the pin layout
on the board.

Change-Id: I80827ee8bc507567e0cc04b3c8c48580aadf2b3f
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:25:29 -05:00
Andre Guedes dacf54de68 i2c: Enable interrupts for QMSI shim driver
Due to an issue with the interrupt-based transfer API from QMSI driver,
the 'transfer' callback from the shim driver (i2c_qmsi_transfer) is
implemented with polling APIs. This is not ideal because we are not able
to sleep the current thread (so another task can be scheduled in) while
the i2c operation is carried out.

The interrupt issue with the QMSI driver has been solved then this patch
fixes the shim driver so it uses the interrupt-based API and adds extra
code to handle the thread synchronization.

Finally, this patch also moves all 'struct device' related definitions
from the bottom to the top of the i2c_qmsi.c file so the DEVICE_GET
macro can be used in transfer_complete() and removes the init.h include
since it is not needed anymore.

Change-Id: I7ef7ce4cea6fcc939e310e5fe12c406645f6a16e
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-02-05 20:25:29 -05:00
Andre Guedes 4c3a1afbac i2c: Add multi controller support for QMSI shim driver
Currently, the I2C QMSI shim driver supports only the "I2C 0"
controller instance. This patch extends the driver so it supports
the "I2C 1" instance as well.

The controller instances can be enabled independently.

Change-Id: Ieb64df46816026f3f4fb262a1682c98ee36bedd5
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-02-05 20:25:29 -05:00
Ido Yariv 3db6a541c8 Quark: Set up IRQ routing for PCIe explicitly
IRQAGENT3 is initialized explicitly, but IRQAGENT0 isn't and its value
is based on the value the BIOS or bootloader had set before. Fix this by
explicitly initializing IRQAGENT0, and swizzle the IRQs to reduce
conflicts.

Update the pci_pin2irq function to accommodate for these changes.
Also remove pci_irq2pin function since it is unused.

Change-Id: I7b1dfc7659ab227fe66711a3af5a1f34fd4a7972
Signed-off-by: Ido Yariv <idox.yariv@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Ido Yariv <ido@wizery.com>
2016-02-05 20:25:29 -05:00
Ido Yariv 6b6ef8bbb7 QEMU: Add optional PCI support
To debug PCI drivers on QEMU, it may be desired to enable CONFIG_PCI for
QEMU targets. Since the PCI driver requires a SOC pin2irq translation
function, add such function to IA32's SOC header file.

Change-Id: Icf6f88aa14ae29d70fe12dc80a708e6a2e992ba8
Signed-off-by: Ido Yariv <idox.yariv@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Ido Yariv <ido@wizery.com>
2016-02-05 20:25:29 -05:00
Daniel Leung 631c3b1242 samples: adds a sample for using aio_dw_comparator driver
Change-Id: Idcfe266db237a0f2aaa6376562cf92bb49e626cc
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:25:28 -05:00
Daniel Leung 1b6c88ffe2 aio/aio_dw_comparator: adds Kconfig for IRQ priority
Adds a Kconfig for setting IRQ priority, and set the default to 3.

This fixes an issue where the interrupt vector as placed in wrong
slot in the IDT table since the priority was zero, and thus
no interrupts from the comparator was received by ISR.

Change-Id: Ief2100c1d79e42f8cedc4e0ca21ed5f6970d62e2
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:25:28 -05:00
Daniel Leung 985c0b1de4 aio/aio_dw_comparator: use Kconfig to define device name
This makes the aio_dw_comparator driver to follow others by using Kconfig
to define device name. This makes using the device in apps a bit easier.

Change-Id: I4fbcb0c009c863a2216a15a78a8aa6324d95690b
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:25:28 -05:00
Daniel Leung 9709c1008a samples: adds a sample for interfacing with APA102C LED
Change-Id: I653a47c942a36ce4002f0acad29c4978aa47080a
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:25:28 -05:00
Dmitriy Korovkin 9183e1f4de device: Make device_sync_call_complete aware of the caller context
device_sync_call_complete can be called from ISR, fiber or task, thus
needs to be aware not only of the waiter context, but also on the actual
caller one.

Change-Id: I76652a2c44d854db9c34e7192355d455d43f61e3
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-02-05 20:25:28 -05:00
Andrew Boie f0a1d22f28 x86: leave the GDT in ROM by default
We don't normally need a runtime-mutable GDT; make it optional to
activate a second copy in RAM. Regardless of whether it is in RAM
or ROM, it can be accessed by the '_gdt' symbol.

Change-Id: I5ce955f4b8875eb60040917ceaacc07d7e5941ac
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:25:28 -05:00
Daniel Leung cb76f11259 arch/arc: fixes native C version of atomic_nand
Change-Id: I2f493e2c7cb841ef1273e628701d3b087d402e3f
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:25:28 -05:00
Peter Mitsis 61e6f4a299 sys_clock: Lock interrupts when processing announced ticks
Interrupts must be locked when processing announced ticks in
_nano_sys_clock_tick_announce().  This prevents higher priority
interrupts from interrupting the tick announcement and possibly
corrupting the timeout and/or timer queues.

Change-Id: I4e87fc5b3ad36161e0accb50b2691f975f5877e5
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:25:28 -05:00
Jukka Rissanen 1b7b470cb0 net: contiki: Fix the debug printing support for ICMPv6 code
Change-Id: I01ea438e946ec597ac389bd26f0f26c307efa65e
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:25:28 -05:00
Jukka Rissanen d9f50cdb9d net: contiki: Make sure ICMPv6 support is activated
We need ICMPv6 support if IPv6 is enabled.

Change-Id: I5e6ffe83d8299916bb268d136264f3e5cf6f91e6
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:25:28 -05:00
Jukka Rissanen 2822ed6537 net: contiki: Fix the NA ICMPv6 sending
The ICMPv6 NA (neighbor advertisement) packet length was not set
correctly so no NA message was sent.

Change-Id: I7ddf41545f4b07da669d29f2529f5b04d3bc8b75
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:25:28 -05:00
Jukka Rissanen 1e9fd8da9b net: Enable IPv6 neighbor discovery by default
The IPv6 neighbor discovery is needed when dealing with real
brearers like 802.15.4, so enabling ND by default.
In Qemu and if SLIP is used, then the ND needs to be disabled
as it does not work properly with tun devices.

Change-Id: I8baf11e71fb546b698a0a3d18fcacb142744db60
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:25:28 -05:00
Johan Hedberg a9404225e5 Bluetooth: Use NULL for "any" connection with bt_conn_lookup_state_le()
An all zeroes address is in principle not valid, but prototype devices
have been seen using it. To avoid false-positives with the
bt_conn_lookup_state_le() API use a NULL pointer rather than
BT_ADDR_LE_ANY to indicate that any connection in the specified state
is of interest.

Change-Id: I42a1946e47173b17be295b1b7e97a654dbdcdc6a
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:25:28 -05:00
Johan Hedberg 27fe6fcb46 Bluetooth: L2CAP: Further simplify l2cap_chan_create_seg()
Change-Id: I57d45fcb0647459d9b5b465d175064fa3a194601
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:25:28 -05:00
Johan Hedberg aa1d49041b Bluetooth: L2CAP: Take advantage of net_buf_push_le16 helper
Change-Id: Iff5e2b8f7d16f829b93832f513113c6c6c292d37
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:25:28 -05:00
Johan Hedberg 8d98247c8f net: buf: Add net_buf_push_le16 helper function
Change-Id: Icce051392d1523df8ebfeccf76477a6264d3d216
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:25:28 -05:00
Szymon Janc 66413dad20 Bluetooth: L2CAP: Fix not sending all bytes of SDU
There are always 2 additional bytes for SDU length in first packet
and those needs to be taken into account.

Change-Id: I3c202cd969524036b42d919bc001e75b8c2faaa0
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:25:28 -05:00
Szymon Janc 47f0279502 Bluetooth: samples/shell: Fix printk modifier
Use %d for printing signed integer.

Change-Id: I6fbf387969e97561430ea0d2d422842c599f1457
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:25:28 -05:00
Szymon Janc 719e8e4710 Bluetooth: Fix not updating LE keys on Key Refresh Event
If link is already encrypted controller issues "Encryption Key
Refresh Complete" for "LE Start Encryption".

Failing to update keys resulted in invalid security level being set.

Change-Id: I8d8dd1682937bd35a35111366ec6ebdaa619db7c
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:25:28 -05:00
Johan Hedberg 56ba2ffb6b Bluetooth: Remove unused bt_uuid_copy() API
There are no more users of this API, and the only user it had in the
past was quite a special corner case. Just remove it for the time
being.

Change-Id: I696139b493f9ca75530665de25a4a4e03fc0ac5b
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:25:28 -05:00
Johan Hedberg d5e23e86d2 Bluetooth: UUID: Introduce new API
Introduce new UUID API with bt_uuid, bt_uuid_16 and bt_uuid_32
structs. The specific size structs are derived from the common bt_uuid
struct to make it possible to use CONTAINER_OF().

Change-Id: I9cb03c73406acb7768d410fdf29eae75d252163c
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:25:28 -05:00
Szymon Janc 4e29c31512 Bluetooth: L2CAP: Fix not calling disconnect callback
Destination CID identifies the channel endpoint on the device
sending the response. So in disconnection response DCID matches
CID used for TX.

Change-Id: Id42d61536bcc208e868ac889c738e7c40bcf5a9a
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:25:28 -05:00
Andrei Emeltchenko 81b4ffbf93 Bluetooth: bttester: Trivial style correction
Change-Id: I39e2c414ec1e972112bda0ba3ca1d1626c32bb18
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:28 -05:00
Luiz Augusto von Dentz 60ea587c59 Bluetooth: L2CAP: Fix bt_l2cap_chan_send
The l2cap_chan_le_send_sdu code was not taking into account that
bt_l2cap_send adds its on headers which means buf->len != ret won't
stop once the last remaining segment is sent since it reuses the
original buffer len is not consumed.

Change-Id: I774da976fb4f71127ae30adf1e02d52946fb9592
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:25:28 -05:00
Luiz Augusto von Dentz 23ac865f33 Bluetooth: L2CAP: Fix bt_l2cap_chan_send documentation
bt_l2cap_chan_send does actually return the number of bytes sent.

Change-Id: I9dd79da992577f2e1e8d30d42eeb0c398e48ff33
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:25:28 -05:00
Luiz Augusto von Dentz 5506ec6f09 Bluetooth: Shell: Fix l2cap-send
bt_l2cap_chan_send does actually return the number of bytes sent.

Change-Id: I862a8519c752c6b26250a21be02a927a9326617c
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:25:28 -05:00
Andrei Emeltchenko ca57c08e0f Bluetooth: nble: Implement get_version_rsp()
Implementing on_ble_get_version_rsp() allows to check firmware version
of Nordic BLE chip.
Current output is (stripped):
...
bt: on_ble_get_version_rsp: VERSION: 0.0.0 ATP1BLE000-1604C5546
...

Change-Id: I98d3cd659cbed86b31eb90aac0e3ae876daf616a
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:28 -05:00
Luiz Augusto von Dentz bcea32a2ca Bluetooth: shell: Don't call bt_enable blocking
Now that nble driver is supported bt_enable cannot be called blocking
since it is not supported, futhermore the call to bt_gatt_register
should be done after bt_enable is complete.

Change-Id: I404f8cd8b8339dba0fd26d24edeb718eba4bf225
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:25:27 -05:00
Andrei Emeltchenko 26e152f734 Bluetooth: doc: Add notes for building with NBLE enabled
Change-Id: I77f4c25bacd4f6233152d44d36f3057f4ac108e7
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:27 -05:00
Szymon Janc dfb9441221 Bluetooth: L2CAP: Fix missing unref if link was disconnected
Buffer returned by l2cap_chan_create_seg should be unreffed if
disconnected.

Change-Id: Ib794ecc98618eddc9d92b2dc2edf829c50123418
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:25:27 -05:00
Andrei Emeltchenko 4124327525 Bluetooth: nble: Correct platform name for Arduino 101
This enables this test case for arduino_101 platform.

Change-Id: I2a94fb90f4c57022ddf1ec11ab06bb5e59de9b6e
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:27 -05:00
Andrei Emeltchenko af6d20461b Bluetooth: tests: Remove extra board definition for NBLE
Board already defined in platform_whitelist

Change-Id: I2fed4b3c0663fd15d43ee697837a89439f7bd07a
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:27 -05:00
Anas Nashif 4414d2f308 Do not set BT config options if NBLE is not enabled
!BLUETOOTH is almost always when not using BLE, so depend
on NBLE being configured as well to set various options.

Change-Id: Idc61cee277fe0f09086a9f2ed6eb419aee5fd69c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:27 -05:00
Johan Hedberg 44541091dc Bluetooth: GATT: Remove unnecessary usage of full UUID structs
To access the 16-bit value of GATT UUIDs it's quite overkill to first
create anonymous UUID structs and then access the value member from
them. We can simplify this a lot with the help of the recently added
UUID value definitions.

Change-Id: Ib58012c20d07b3e60e5911cea6feb73301d1323c
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:25:27 -05:00