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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
We need ICMPv6 support if IPv6 is enabled.
Change-Id: I5e6ffe83d8299916bb268d136264f3e5cf6f91e6
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
This enables this test case for arduino_101 platform.
Change-Id: I2a94fb90f4c57022ddf1ec11ab06bb5e59de9b6e
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Board already defined in platform_whitelist
Change-Id: I2fed4b3c0663fd15d43ee697837a89439f7bd07a
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
!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>
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>
In some cases we need the raw 16-bit UUID value instead of a full UUID
object. Add definitions of these values so that the code doesn't need
to do complicated tricks to get hold of them.
Change-Id: I98f276402f20fe03fea2777743f15ca7fcae42c6
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Don't use NULL pointer if aquiring net buffer failed.
Change-Id: I11a22b832d1da9559b90abe0cb83eed56d14722f
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This adds conversion of advertising data (adv_data) to be used by
bt_le_adv_start function.
Change-Id: I403ff7ebed89dbf763d258b5dcdabfbb2cb68260
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
Test can be verified with
$ sanitycheck -s bluetooth/shell/test_nble -v
arduino_101 bluetooth/shell/test_nble PASSED
Change-Id: Icfc5892524041d169973bd6eb7d23b6ecffb98fc
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Fix compiler errors when CONFIG_BLUETOOTH_BREDR is not enabled.
Change-Id: I003985a9769120b3314eaf1b9563a3bf9712e32a
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Move buf_data to the place it is used reducing errors when dynamic
channels are disabled.
Change-Id: I82f640ffa8046e1c9b5805658e69cb722856d445
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
This reuses the existing code since that is not driver specific, with
this samples such as tester can be build using nble driver.
Change-Id: I6d9f3edf8deb2e84fce233ef02d1cd0ad6f52526
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This enables simpler permissions as it is not longer needed to include
BT_GATT_PERM_READ or BT_GATT_PERM_WRITE.
Change-Id: I0c749b75bedb125bda8ea451474c82eec13d3c38
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>