Commit graph

19237 commits

Author SHA1 Message Date
Johan Hedberg
a36a4920ec boards/arduino_101: defconfig: Enable nRF51 PM if NBLE is selected
To avoid explicitly having to state this in every application's config
file simply set the defaults to the sanest values.

Change-Id: I2c2bbd2424a12ec9a36bbd6d0c9cd9a1d259e5e5
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-08 12:52:27 +00:00
Jukka Rissanen
01771500ee net: contiki: Fix the timer expiration check
We need to check the timer expiration properly. The nano_timer_test()
will return user data to caller if the timer is expired.

The issue that is fixed by this commit started to appear after
the commit 9b2452047d which combined
nano_timers and nano_timeouts.

Change-Id: I9cf10e605f1c4767caa1aad9dcf29a159af55e28
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-08 11:33:19 +00:00
Jukka Rissanen
0be1fa53b4 net: Add Kconfig debug option for REST API
User can activate debugging in REST by setting
CONFIG_NETWORK_IP_STACK_DEBUG_REST_ENGINE option in config file.

Change-Id: I1c1c62803c0fcc5fb3a37d3d76de94754b33506a
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-08 11:33:19 +00:00
Jukka Rissanen
6c703542d5 net: coap: Make sure that local endpoint IP address is set
When initializing the CoAP engine, make sure that we
initialize the local IP address properly.

Change-Id: I8ddc670371c3a58095cd5db6b435c5b1793c268b
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-08 11:33:19 +00:00
Jukka Rissanen
21161a39fe net: coap: Delete network context when CoAP context is deleted
Network context must be cleared when CoAP context using that
is removed.

Change-Id: Id8deb798919fccf025af67c18f3a246cfa46598f
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-08 11:33:18 +00:00
Jukka Rissanen
70ffc56a95 net: coap: Add debugging support for CoAP internals
Print info about packet serialization if debugging is turned on.

Change-Id: I578ecb4e85ab34c74a960cbce9aa4f9bf5b9473d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-08 11:33:18 +00:00
Jukka Rissanen
24911b81bd net: contiki: Enhance the IPv6 prefix calculation routine
The routine does not check prefixes properly which are not
multiple of 8.

Change-Id: I421456720541894eb4d9a2839361095a50587513
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-08 11:33:18 +00:00
Jukka Rissanen
7eb15eeb56 net: coap: Add debug activation support to Kconfig
User can select various coap debugging options from Kconfig.

Change-Id: I97cc82278c230b9678f506063fed5683dc271c8a
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-08 11:33:18 +00:00
Luiz Augusto von Dentz
5680396aaa net: Use TICKS_UNLIMITED if there are no timers
This makes the fiber_sleep sleep indefinitely until fiber_wakeup is
called.

Change-Id: Id674c1f689376784599fc79c86d1c406474bb48f
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-04-08 13:09:52 +03:00
Tomasz Bursztyka
a1adbcb125 ieee802154: Replace the CC2520 driver with a new implementation
This is a complete new cc2520 driver for zephyr. Intention is to fit
better within Zephyr device driver model.

- It's (almost*) ready to be instanciated as many times as necessary
- It's fully interrupt based on SFD and FIFOP (no pin polling)
- It's nicer to other sub-systems (it sleeps, no busy-wait loop)
- It still loosely complies to old legacy radio device driver model

*: GPIO API needs to be fixed in order to accept multiple callbacks, as
well as enabling callbacks to retrieve private data.

Notes:
- Hardware filtering does not work yet as the net stack, above, needs to
  provide the relevant information for it (src/dst ieee802154 extended
  addresses, short addresses...)
- A embryo of generic functions (txpower, channel, addresses...)
  have been implemented but don't belong yet to any radio device driver
  model. Such new driver model will come afterwards (soon?)
- SPI API would need to be improved to avoid as much as possible memcpy
  as well as spi_slave_select() call.

Change-Id: I1fd6dfff28fba3984f6006d394ea12f1e763ac18
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-04-07 17:25:02 +00:00
Tomasz Bursztyka
f7d5d2c8f5 drivers: Renaming directory "802.15.4" into "ieee802154"
ieee802154 is a more relevant name. Applying the change in
include/drivers as well.

Change-Id: I7f7188ed0421045d7667303c375eeb8af1298b97
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-04-07 17:24:55 +00:00
Murtaza Alexandru
fbd45861f3 sensor: lsm9ds0-gyro: fix FULL_SCALE attribute
SENSOR_ATTR_FULL_SCALE attribute now expects the value as radians per
second.

Change-Id: I8082a1f112f1ed8efb511de39e3a8e5ae3d3ed0c
Signed-off-by: Murtaza Alexandru <alexandru.murtaza@intel.com>
2016-04-07 17:00:09 +00:00
Bogdan Davidoaia
9773fdaade samples: add environmental sensing sample for Arduino 101
The ARC application collects temperature, humidity and pressure data from
a set of sensors connected to the Arduino 101 and sends it to the x86 core
through IPM. The collected data is also displayed on a Grove LCD.

The x86 application exposes the received sensor data as a simple Bluetooth
Environmental Sensing Service.

This version of the sample does not offer notifications when the sensor data
values change.

Change-Id: Iee456d5d2455c7ccb7c5923ef3c94ecb20b5cecb
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-04-07 16:55:38 +00:00
Tomasz Bursztyka
814f5d0b5e sys_clock: Add a helper to compute micro seconds
As for SECONDS() and MSEC, now sys_clock.h provides a USEC() macro.

Change-Id: I43e8b132d2deeb862d8cfda1f785115f339d6ddb
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-04-07 16:51:07 +00:00
Arkadiusz Lichwa
9385a47e53 Bluetooth: Fix not using endianess helper in LE L2CAP conn req
Corrects response 'result' protocol field to right endianess when
responding to LE L2CAP connection request on error case.

Change-Id: I066bad2f0f3173739676e918f42d425581084dbe
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-04-07 09:20:17 +00:00
Johan Hedberg
7f07d28f37 Bluetooth: Fix BLUETOOTH_NRF51_PM Kconfig definition
Clarify the name of the option and add a dependency to Arduino 101
which is the only known board that is currently known to need it.

Change-Id: Ibfb96cba202f34464b45b922da599da70c038d12
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-07 10:50:52 +03:00
Bogdan Davidoaia
3bdf498716 sensors: fix coding style regarding max line length
Fix coding style so line length does not exceed 80 chars.

Change-Id: Iddebdf55593736cfa288a03a750cc927665f9065
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-04-07 01:03:40 +00:00
Daniel Leung
ba4099430b ethernet/dw: remove kconfigs that are SoC specific
Remove those kconfig options that are SoC specific, and
should not be configurable via kconfig.

Change-Id: Ib483419be5199b52cf281b4b106cd8a3be95b7be
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-07 00:58:57 +00:00
Daniel Leung
1bdc6f8b22 sanitycheck: fix initlevel section being mentioned twice
The "initlevel" section is being metioned twice. It does not affect
the final size calculation, but just remove it just for reader's
sanity.

Change-Id: I0e7d6e82c730631d2c83ca09dde0f675805840f3
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-07 00:56:41 +00:00
Sergio Rodriguez
1b41169828 rtc/qmsi: Fix the IRQ priority setting according to the SoC specific option
The configuration option CONFIG_RTC_IRQ_PRI does not longer exist, and have
to use the specific QMSI driver IRQ priority

Change-Id: I8074c6d8e095596d03e51a94f26a73c3a9ff91b7
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-04-06 12:05:23 -07:00
Grzegorz Kolodziejczyk
bae91cf980 Bluetooth: tester: Use bt enable cb to indicate cmd rsp success
This is needed especially for nble. If bluetooth is not enabled we
cannot send another commands to tester.

Change-Id: I17e639301bba6efd127f2c743b8942c1b493f9da
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
2016-04-06 17:25:11 +00:00
Grzegorz Kolodziejczyk
355ded1863 drivers/nble: Add support to bt_gatt_attr_next
This function is needed to get next attribute of  passed to function
attribute.

Change-Id: Iefe2015f2d6bcb650012b1f9d5b1ea98e8fa8f48
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
2016-04-06 12:35:49 +00:00
Andrei Emeltchenko
bd5f745e25 Bluetooth: Enable Nordic BLE chip using PM helpers
When Nordic BLE chip is flashed with HCI firmware use H:4 UART driver
and enable chip the same way we enable for NBLE.

Change-Id: Ie14734266803088feadb0d0eb20c49c3615f0267
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-04-06 12:10:21 +00:00
Johan Hedberg
f72063e214 Bluetooth: drivers/nble: Require callback for bt_enable()
The nble nRF51 firmware cannot handle situations where it receives
data before it is ready. The RPC calls otoh cannot be blocking.
Combine this with the fact that bt_enable(NULL) is supposed to be
blocking means we cannot support this mode of operation with nble.

Change-Id: Ib9c2c322b44b04bc48be243c2ba1c1bc4becb8ea
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-06 11:51:27 +00:00
Andrei Emeltchenko
f7da2220d7 quark_se_devboard: Remove UART default name from soc config
Remove UART default configuration to make it default UART_0. This
makes default working fine with Nordic BLE chip using H:4 driver.

Change-Id: Icb6d9f068b586bbf04694bc77ed968211de94c8a
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-04-06 14:00:56 +03:00
Andrei Emeltchenko
3252f6cf1a drivers/nble: Refactor PM code to make it reusable
Refactoring Power Management related code to special file nrf51_pm
making it possible to reuse the functions for H:4 UART driver when
Nordic BLE is flashed with HCI firmware.

Change-Id: If389c1f4af13fa786e5866129624527cec0928e0
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-04-06 14:00:56 +03:00
Andrei Emeltchenko
8e4440674e Bluetooth: Add option for PM with Nordic BLE chip
The config option handles enabling, disabling and power management
operations with Nordic nRF51 BLE chip.

Change-Id: I816062a7fb17c9e57c234113a2cecdebceb407b6
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-04-06 14:00:55 +03:00
Andrei Emeltchenko
ecc35267da drivers/nble: Move Nordic Bluetooth LE driver inside drivers/bluetooth
Move NBLE code to the place where other Bluetooth drivers code resides.

Change-Id: Ibcf9ffb016e9b842bed66a61dff5c101b1573aaa
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-04-05 14:04:44 +03:00
Johan Hedberg
bc706e2a88 Bluetooth: Add stub for bt_storage_clear()
Change-Id: I7ab9ee4ca1d9702e7aef23aadfa627554907d145
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-05 12:29:14 +03:00
Johan Hedberg
d0e4e0183e Bluetooth: Rename bt_register_storage to bt_storage_register
Keep a single bt_storage_* name space for current and future storage
APIs.

Change-Id: If158eb7408cce7c06cd8f98d78a061b9f9585265
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-05 12:29:14 +03:00
Johan Hedberg
e70771d3c8 Bluetooth: Export bt_storage inside the stack
It's likely that other files besides hci_core.c will be needing to
read/write the storage. Export it therefore through hci_core.h (same
time adding a missing 'const' to the declaration).

Change-Id: I7c08bc0d69c752bef68f9da9e4aee1acfa00de72
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-05 12:29:14 +03:00
Johan Hedberg
499b44201b Bluetooth: Don't update random address unnecessarily
If the wanted address is already programmed to the controller there's
no need to send a HCI command to change it.

Change-Id: Ib73d09cc5b20cd6820e603f0828f000f8310a89e
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-05 12:29:14 +03:00
Johan Hedberg
5ccb20c591 Bluetooth: Use bt_addr_t inside bt_addr_le_t
In many cases when we want to access the 'val' member of bt_addr_le_t
it's in situations where the type needed is actually bt_addr_t. To
avoid unnecessary typecasts in these places simply embed bt_addr_t
inside bt_addr_le_t.

Change-Id: I7eecf129bee1dcf085abc83ec2f32e1a10b0b5aa
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-05 12:29:14 +03:00
Johan Hedberg
13be3947ab Bluetooth: Add Privacy Feature support
Add initial support for the Privacy Feature, including the ability to
manage a local IRK and to use Resolvable Random Addresses.

Change-Id: I1c70aea67078dd2a5d07f3b797c37746ebe9ab61
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-05 12:29:14 +03:00
Andrei Emeltchenko
24732e8fb9 drivers/nble: Fix typo in compatible_firmware name
Change-Id: I81a211892e61bc11db5e5e8c1715f7971d64ace1
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-04-05 11:18:53 +03:00
Andrei Emeltchenko
8f5e21154b drivers/nble: Update RPC to Nordic firmware 0404 version
Update RPC headers and change compatible_firmware version 0404.

Change-Id: Ie9920d302f3787c07181bc6aa519a96556463a79
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-04-05 11:18:53 +03:00
Andrei Emeltchenko
f0f91d4a7b drivers/nble: Refactor Nordic BLE chip enable functions
Move NBLE pin handling to the driver from gap.c.

Change-Id: I4b7fd408c623971d19da12784c656c5c605852a5
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-04-05 11:18:53 +03:00
Andrei Emeltchenko
36748b9f33 ia32: Allow to connect Nordic chip to qemu
Allow to connect Nordic Devkit or dongle to qemu. Simple
configuration for the current NBLE firmware is following:

Connect Nordic board to PC, ttyACMX gets created.
$ socat -x /dev/ttyACMX,raw,b1000000 unix-listen:/tmp/bt-server-bredr
Build app with prj_nble.conf and run with make qemu

Change-Id: I354644b465ad09ab0ca62fbd97f15d9bb3c87d6a
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-04-05 11:18:53 +03:00
Andrei Emeltchenko
53c5979c2e quark_se_devboard: Configure UART0 for quark_se_devboard
UART0 is connected to Nordic BLE chip, copy the configuration from
arduino_101 where there is the same chip.

Change-Id: Ic9fe30f4562d261920c0cfd359ea34be4e7e2476
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-04-05 11:18:53 +03:00
Andrei Emeltchenko
feaa25315e quark_se_devboard: Enable NBLE for quark_se_devboard in Kconfig
Enable GPIO and select UART0 for Nordic BLE chip.

Change-Id: Ic1bf82a8b97fcc231eb857ee0bd05381a24a2d25
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-04-05 11:18:52 +03:00
Johan Hedberg
ad7912422f Bluetooth: Introduce SMP helper to generate RPAs
This will be needed to implement local privacy support.

Change-Id: I6222a7d396d47929d6f8946793bbf3f49eaae179
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-04 17:35:02 +03:00
Johan Hedberg
5c45a3bce1 Bluetooth: Export is_bonded through hci_core.c
There will be other uses, so rename this to bt_addr_le_is_bonded and
export it through hci_core.h.

Change-Id: Ia033a215255f2ec2e513c785dd1b9862faaf5ac8
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-04 17:35:02 +03:00
Andrei Emeltchenko
777a76297d drivers/nble: Implement GATT read Characteristic Presentation Format
Implement bt_gatt_attr_read_cpf() for NBLE.

Change-Id: Ia99db05a3f67bef3c1617df37fd371a8b1e8beb6
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-04-04 14:34:18 +00:00
Andrei Emeltchenko
0fd771acfc samples/nble: Remove default driver debug for samples
CONFIG_BLUETOOTH_DEBUG_DRIVER provides too low level information to be
useful for samples. Remove it from default settings.

Change-Id: I9d99f9953d4e6b839eeb51ed393e4aed1eeeb01b
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-04-04 14:33:50 +00:00
Johan Hedberg
0537c2c579 Bluetooth: Add support for reading local address from storage
If the local controller doesn't have a public address we need to
generate a static random address and use that as our Identity Address.

Change-Id: I3db261b630c670d285c6bfacbe090184cccb5e8c
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-04 14:01:59 +03:00
Johan Hedberg
7e7eee0fb4 Bluetooth: Add skeleton for persistent storage API
Add initial skeleton for the persistent storage API.

Change-Id: I7a6cc283aa88e7d861af18a6f0db2ed8c71e44a0
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-04 14:01:59 +03:00
Johan Hedberg
03ea90db8f Bluetooth: Rework local address tracking
Store the Identity Address and Random Address in their own variables.
If the controller doesn't have a public address a static random
address is set as the Identity Address. Also keep properly track of
which address was used for advertising and initiating connections so
that the connection object contains the right information.

Change-Id: I3e9dc2036b330c19c2725b180fd061da2df8a0fa
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-04 13:56:55 +03:00
Daniel Leung
8425568a8a gpio/dw: remove kconfigs that are SoC specific
Remove those kconfig options that are SoC specific, and
should not be configurable via kconfig.

Change-Id: Ib7e0b81b2df1a0225fc244fea3035416d0a4f282
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-02 23:11:07 +00:00
Daniel Leung
16d0b8b0a3 tests: enable pinmux build tests
Enable building pinmux drivers to catch build breakage.

Origin: Original
Change-Id: I86ec02423bf23ee6aca41b9413e240e984313fcf
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-02 23:11:06 +00:00
Laurentiu Palcu
7dd2372dd5 spi_dw: use SPI bus frequency in spi_dw_configure()
The SPI API states:

"max_sys_freq is the maximum frequency supported by the slave it
will deal with"

However, currently, for DW the max_sys_freq is a divider which confuses
the user.

This patch adds a small hack to allow users to use both dividers and
frequencies when configuring the bus. The only trade-off is one has to
use dividers for bus frequencies smaller than 65536Hz. However, since
most devices nowadays can run at clock frequencies more than 100kHz,
this is a good compromise.

Change-Id: I44386cc8ad501b08eeaf71bc7588661ff36e108b
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2016-04-02 23:08:49 +00:00