Commit graph

19237 commits

Author SHA1 Message Date
Johan Hedberg
251f1cbc28 Bluetooth: monitor: Add 32-bit timestamp support
Add support for the 32-bit timestamp (1/10th ms units) extended
header.

Change-Id: I67f481a35be6878605b8c2256f6e4bfb6afe55c8
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-05-04 21:19:49 +03:00
Andrew Boie
68b3b6135e errno: implement _get_errno() in common code
We really should have more faith in the compiler, it generates
code to implement this exactly like the arch-specific assembly
versions, and on ARM is actually 4 bytes shorter.

FUNC_NO_FP used to disable the usual C preamble to update the
frame/stack pointers, which is how the sizes are still the same
or less. It's debatable how useful the occasional use of
FUNC_NO_FP is in practice since it hinders debugging and in a
production build frame pointers should be globally disabled, but
we can address that later.

Change-Id: I6c4b64ab3e3a9b6f91d52fa8c92e6e79a986fc77
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-05-04 17:04:14 +00:00
Szymon Janc
2450a56ae5 Bluetooth: Use le_set_rpa in check_pending_conn
This makes code simpler and easier to understand as generating RPA and
setting random address are done in same place.

Change-Id: I1f9ebdf3ee322921258c92f3f1a40d6b7764b2fc
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-05-04 16:40:06 +00:00
Szymon Janc
ac52cffa32 Bluetooth: Refactor check_pending_conn error handling
If anything went wrong just report connection failed. This makes
code easier to read and less error prone. Also makes sure that
scanning is reenabled with correct parameters on failure.

Change-Id: I7387571f6dbf308511694a635aa47d5371a81616
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-05-04 16:34:55 +00:00
Szymon Janc
4031d6d160 Bluetooth: Fix connection leak if failed to generate RPA
If bt_smp_create_rpa failed connection object needs to be unreferenced.

Change-Id: Ie1f2905cafbf15db2970c0f07748d016cbe55c2b
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-05-04 16:33:54 +00:00
Mariusz Skamra
20c7f47fc0 drivers/nble: Pass read_params as nble user_data
Getting params from user_data seems to work now.

Change-Id: I81bccea9aa6994d3c09a3ff03a49fa6767e7305e
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-05-04 15:24:00 +00:00
Mariusz Skamra
ec8a92b93a drivers/nble: Fix NULL pointer dereference
In on_nble_gattc_discover_rsp conn->gatt_private is set to NULL prior
to calling this parser functions. This fixes this issue by passing
discover params pointer to these functions.

Change-Id: I6669cb0d16dc65d532e17f96ceb9cd94dbe6ce08
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-05-04 15:23:39 +00:00
Daniel Leung
aed8ef4d4c microkernel: events: fix undefined function error
The handler of the microkernel events are not declared properly.
This causes the public event objects to complain about
undefined functions. Fix this by declaring the function
before using it.

JIRA: ZEP-85
Change-Id: I68afe777bad66e010c92e637806a48911b2f52f4
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-05-04 15:16:55 +00:00
Chuck Jordan
6fd732f780 arch/arc/include: start_task_arch.h needed so ARC can build microkernel apps
Change-Id: Ibf23fb3545f98a4d5ade7640abde4819b95d0b8e
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
2016-05-04 14:55:33 +00:00
cjordan
42f7741712 drivers/interrupt_controller: initialize only NUM_IRQS interrupts
Change-Id: I33b4d09bc9255ab75bd25ef8938fc37e74e81038
Signed-off-by: cjordan <cjordan@synopsys.com>
2016-05-04 14:55:10 +00:00
Chuck Jordan
822b19ef74 arch/arc: add ICCM_BASE_ADDRESS and ICCM_SIZE
I am working on porting Zephyr to ARC EM Starterkit. This board has ARC 
CPUs with ICCM memories. On quark_se_ss ICCM is missing and ignored.

Change-Id: Ic49fc8ef3e6ad879ffc673b8baf34dd467f76c04
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
2016-05-04 14:54:54 +00:00
cjordan
9afe58de3e include/arch/arc: fix memory permissions
Change-Id: Ibb77088a7c9095f4725b6a65bc30a1db4220f254
Signed-off-by: cjordan <cjordan@synopsys.com>
2016-05-04 14:54:46 +00:00
Genaro Saucedo Tejada
736bda177b doc: Fixed broken link to development documentation
The fixed link was broken when development documentation started being
hosted at /doc instead of /doc/dev

Change-Id: I3621bf83beb030e7d80f60e1d148cd7311d25cdf
Signed-off-by: Genaro Saucedo Tejada <genaro.saucedo.tejada@intel.com>
2016-05-04 14:54:24 +00:00
Andrei Emeltchenko
6e60fc8d7c drivers/nble: Update RPC function names
Updating function names prepares for firmware RPC update, to this
moment only names changed.

Change-Id: I8d19e83c5c88a4b41ed803e276652eb15e0d87b1
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-05-04 14:23:17 +00:00
Andre Guedes
ea6eac35bb pinmux_dev: Remove PINMUX_SELECT_REGISTER from quark_mcu driver
This patch removes the PINMUX_SELECT_REGISTER macro definition from
pinmux_dev_quark_mcu.c since it is already defined in pinmux_quark_mcu.h
(which is included by the .c file).

Change-Id: I468cf6a54fc30d681f42a59eb2c8401d2b180849
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-05-04 13:53:00 +00:00
Baohong Liu
e4c1d07477 drivers: pinmux: Implement pinmux pin get API for QMSI shim driver
Add implementation for pinmux pin get API in the shim driver.
It is based on the function from pinmux_dev_quark_mcu.c

Jira: ZEP-189
Change-Id: Ib6673f90cfe8e367fcbd12ed546b1fa3af7e1dbf
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-05-04 13:48:26 +00:00
Tomasz Bursztyka
7cd63abccb ieee802154: cc2520: SPI workaround when QMSI drivers are in use
Current QMSI SPI API does not handle asymmetric tx/rx buffers, and thus
it's up to cc2520 driver to manage the tx dummy bytes.

Change-Id: I97900946bcd8d96e9f039646bccd765c574c363e
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-05-04 13:47:17 +00:00
Johan Hedberg
58ab2526e8 Bluetooth: Make UART draining logic consistent across drivers
There's no need to drain twice if NRF51_PM is enabled, the draining
shouldn't use rx_ready(), and it should happen after disabling
interrupts. Also rename uart.h to util.h to avoid conflicts with
include/uart.h and remove the left-over ISR prototype declaration.

Change-Id: Id38110dd38cf48edfe4a7b8e2e68cd358a9aa5ea
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-05-04 13:37:44 +00:00
Sebastien Griffoul
3a5eb1c742 net: timer_expired may not return the right value when called twice
timer_expired uses the nano_timer_test API to determine whether a
timer has expired. This API calls the private function
_nano_timer_expire_wait which returns the timer user data if this
timer has expired. Unfortunately _nano_timer_expire_wait clears the
user data pointer after returning it.
Therefore if timer_expired is called several times for the same timer
and if this timer has already expired then only the first call returns
the expected value (true). Other calls always return false.

In ipv6 this bug can be seen with the uip_ds6_periodic timer. Indeed
when expired this timer is going to be checked at least twice by
etimer_process function and the tcpip eventhandler function. Thus the
final uip_ds6_periodic callback is never called.

The fix consists in adding a expired field in the timer struct and
make timer_expired retain the nano_timer_test result when the timer
has expired.

Change-Id: I3c6aceaa0627be264b6d9913b629e7b619888938
Signed-off-by: Sebastien Griffoul <sebastien.griffoul@intel.com>
2016-05-04 13:37:10 +00:00
Sebastien Griffoul
abb86939ca net: Fix ethernet headers in ipv6
In ipv6 the type field of the ethernet header is
left blank and the net buffer size is not updated
with the ethernet header size. Therefor outgoing
ipv6 packets cannot correctly be received.

In ipv6 these two fields are updated by the function
uip_arp_out. However this function doesn't exist in
ipv6, therefore net_driver_ethernet_send has to take
care of the ethernet header.

Change-Id: Ib883a6553786d74dd2a5bca6893a0501f04ce7f4
Signed-off-by: Sebastien Griffoul <sebastien.griffoul@intel.com>
2016-05-04 13:36:56 +00:00
Andrei Emeltchenko
492448b0f9 drivers/nble: Refactor NBLE RPC function names
Update function names following firmware name changing.

Change-Id: I8b42c4d9f5c892abec10d8653544c3e03e4ee80d
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-05-04 13:19:04 +00:00
Laurentiu Palcu
5841aeae14 sensor: bmg160: add sample application
The application tests polling mode and trigger mode (both data ready and
anymotion triggers).

Origin: Original
Change-Id: Ic0f9400758aaf56ef95f0f3c68c872d1bfd51176
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2016-05-04 13:14:00 +00:00
Laurentiu Palcu
6f11e868b0 sensor: add support for BMG160 gyroscope
Datasheet:
http://ae-bst.resource.bosch.com/media/_tech/media/datasheets/BST-BMG160-DS000-09.pdf

Origin: Original
Change-Id: I27469da8ff04c2eb26e92cc5d747b1bb8fee627b
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2016-05-04 13:13:59 +00:00
Andrei Emeltchenko
ef3fd51ade drivers/nble: Refactor gap_internal headers
Change-Id: I9b3ea113df2759b6586c3767acbde644c4cd2fd4
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-05-04 13:07:31 +00:00
Grzegorz Kolodziejczyk
b4ea3209fa Bluetooth: tester: Add possibility to set scan response data
Patch extends le advertising repot with configurable scan response
data.

Change-Id: Ibcbe71d6158ece3e7f63daf33d188a9b0d525384
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
2016-05-04 13:07:02 +00:00
Johan Hedberg
caf50a52ea Bluetooth: Fix draining nRF51 FIFO during init
It's possible that there's a queued event from the nRF51 at the point
where we start resetting it, resulting in the stack receiving two NOP
events. To prevent this, make sure to drain the UART while the
controller is in a powered off state.

Change-Id: Ic009e11c11ac750fc76c881c0ffe9bd12d38da0a
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-05-04 15:05:13 +03:00
Szymon Janc
6d5ed390b1 Bluetooth: Simplify advertising API
Instead of requiring application to provide both advertising type
and address type used just require app to provide info if advertising
is connectable or not. Advertising type is set based on provided
SCAN_RSP and local privacy support.

When local privacy is enabled it is no longer possible to advertise
using identity address. If such feature is to be required later on
advertising options can be extended.

This gives BT stack full control over what type of address is used
for advertising and is a preparation for random address rotation
and OOB support.

Change-Id: I90e9a683ef3794f155707343c874f75585439325
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-05-04 11:11:34 +00:00
Anas Nashif
74326ec58b build: use gcc instead of ld for linking
We now have to supply location of libraries (libgcc, libc) and header
directories to the build system. This can be solved in the
Makefile.toolchain.* file for known toolchains but becomes a problem
when supporting 3rd party SDKs and cross compilers.

Linking with ld requires ld to know where all the artificats of the
compiler are. Use gcc instead to make use of the internal information
available in gcc about additional libraries and headers.

Jira: ZEP-241
Change-Id: I15a3b812467b7ae878226f7e5532d538d2720268
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-04 10:27:18 +00:00
Iván Briano
d03a6a7e59 qemu_x86: Make the FPU available if it's not building for IAMCU
Change-Id: I250d28cb93829d85e37b0e3e8db7a6f45774586b
Signed-off-by: Iván Briano <ivan.briano@intel.com>
2016-05-04 10:24:30 +00:00
Iván Briano
5e92acf9cf quark_x1000: The Quark X1000 does have an FPU
Change-Id: I2e23e7a950a055f31f01ccb871d476a9b9d8018b
Signed-off-by: Iván Briano <ivan.briano@intel.com>
2016-05-04 10:24:30 +00:00
Andrei Emeltchenko
2b7f0c8ede drivers/nble: Implement notification for all conns
In a case connection is not known implement notification for all
connections the same way it is done for HCI stack. Attribute database
is scanned for CCC attribute and notifications are sent to all
connections.

Change-Id: Id556b4aa5af124aea672891ca89b278c71519643
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-05-04 08:29:20 +00:00
Andrei Emeltchenko
d7a31fa726 drivers/nble: Implement bt_gatt_foreach_attr()
Implement foreach iterator for NBLE.

Change-Id: Iebc158121f7a860ce8827468d21a859e62753ed8
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-05-04 08:29:08 +00:00
Andrei Emeltchenko
bb96f90694 drivers/nble: Refactor CCC changed logic
Use similar to HCI stack cfg structure to keep value.

Change-Id: I54cf731971c5e2822385dc8eb295ce9951969af6
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-05-04 08:28:56 +00:00
Andrei Emeltchenko
21f23c21ad drivers/nble: Save peer address with CCC write
Save peer address to use it with bt_gatt_notify()

Change-Id: Ie5e3af4cdc2d225c9572e010359f59323ae493a7
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-05-04 08:16:10 +00:00
Andrew Boie
ced164e14f toolchain: common.h: define PERFOPT_ALIGN for Nios2
This is just a temporary value for now, need to research the best
value to use.

Change-Id: Icaadf75fa3ae98b087f3d51813f85003f398f378
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-05-03 23:18:47 +00:00
Andrew Boie
f6cf65d57c nios2: add prep_c to zero BSS and copy XIP data
Copied verbatim from arch/arc/core

Change-Id: I00c920064f75455010806951ad052289d0290654
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-05-03 23:18:46 +00:00
Andrew Boie
d380e555c6 nios2: turn on function and data sections
Change-Id: I5bd841873207d1106a82b3e05187ee401b6c5478
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-05-03 23:18:46 +00:00
Andrew Boie
f00671ab16 nios2: move cflags hacks to main Nios2 Makefile
These are for any Nios II at this stage of bring-up.

Change-Id: Ie4d0c80df164f81f6615ac35d3f42235b04870f1
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-05-03 23:18:46 +00:00
Andrew Boie
93230c012b altera_max10: enable RAM console
Change-Id: I6da3062c4944e6cc29c58b67c1cba91a99445165
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-05-03 23:18:46 +00:00
Andrew Boie
9433895954 nios2: basic build, non-functional
Basic build framework for Nios2. Everything is stubbed out,
we just want to have a build going so that we can start to
parallelize implementation tasks.

This patch is not intended to be functional, but should be
able to produce a binary for all the nanokernel-based
sanity checks.

Change-Id: I12dd8ca4a2273f7662bee46175822c9bbd99202a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-05-03 23:18:45 +00:00
Gerardo Aceves
6a578ad14f doc: Edit arch.rst markup
Edited and added minor markup for consistancy.
Edited some '/' to clarify 'and' 'or'.

Change-Id: I5aa84f278d65e79d12b634fcbef2a8b5070c8ebd
Signed-off-by: Gerardo Aceves <gerardo.aceves@intel.com>
2016-05-03 13:09:16 -05:00
Geoff Thorpe
ded3070c1c nanokernel: tighten _is_thread_essential()
Of the 3 related functions;
  _thread_essential_set()
  _thread_essential_clear()
  _is_thread_essential()

The first two are parameter-less and always operate on
"_nanokernel.current". The last one takes a 'thread' parameter but will
operate on _nanokernel.current if the parameter is NULL. All calls to
_is_thread_essential() pass NULL!

This change makes the 3 functions consistent by removing the parameter
to the 3rd function. This should also be marginally more efficient,
though consistency was the motivation. This change corrects the doc
preamble to all 3 functions.

(These functions would probably be better as inlines. Also, the choice
of when to use wrappers seems a bit arbitrary. E.g. there's nothing
for setting/testing the "FIBER" flag.)

Change-Id: Ie3589f8a28b227c6d7a3a31b664d3b3e6e9c6d17
Signed-off-by: Geoff Thorpe <geoff.thorpe@nxp.com>
2016-05-03 17:42:54 +00:00
Geoff Thorpe
8b16cac073 microkernel: use _thread_essential_set()
This wrapper exists so that the ESSENTIAL bit doesn't have to be set
explicitly in _nanokernel.current. (And a note is added to nano_init to
avoid a nasty gotcha there.)

Change-Id: I4026ac0cfeace60e36abdbccf15554759f2dbf7a
Signed-off-by: Geoff Thorpe <geoff.thorpe@nxp.com>
2016-05-03 17:42:54 +00:00
Daniel Leung
8f0ab3038c arm/nxp_kinetis/k6x: simplify uart init
The UART console init should be done after UART init. So it can be
folded into general UART init, thus one fewer SYS_INIT().

Change-Id: Ifb18c5308dfef790325e6bff5bc7b5976fcd421e
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-05-03 12:43:31 +00:00
Daniel Leung
ad6ed299b7 arm/nxp_kinetis/k6x: always inline clock init function
The clkInit() is always called so this can be inlined.
This saves 32 bytes of ROM space compared to non-inlined version.

Change-Id: I2cb6d02c0996acad16029be243f6059183938089
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-05-03 12:43:31 +00:00
Daniel Leung
b6f56d478a arm/atmel_sam3: always inline clock init function
The clock_init() is always called so this can be inlined.
This saves 32 bytes of ROM space compared to non-inlined version.

Change-Id: I1b95142da4c22f4b7fc7f7f6210503d90cf65cc9
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-05-03 12:43:31 +00:00
Johan Hedberg
68d1feee59 Bluetooth: SMP: Avoid using hard-coded constant
Change-Id: I9d82fde39cc3221c071ce709a10df53f55af87d8
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-05-03 14:28:00 +03:00
Johan Hedberg
31b37ba639 Bluetooth: Increase HCI_LE_rand delay for MyNewt
1 tick (10 ms on most current boards) doesn't seem to be enough to
completely eliminate the HCI_LE_Rand bug. Increase the delay to 20 ms
(i.e. 2 ticks).

Change-Id: Ibe87d5e4b2ec43b2f96afb2c4e0ac726ffe99bd6
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-05-03 13:05:06 +03:00
Johan Hedberg
3a473134c5 Bluetooth: Move bt_conn functions to conn.c
There's no reason to keep these in hci_core.c. Also remove the
duplicate bt_conn_update_param_le() and make bt_conn_set_param_le()
static since it's only accessed from within conn.c.

Change-Id: I1234e9d2e5d1d367732a7b66965cf10a338c07fb
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-05-03 13:05:06 +03:00
Vinayak Kariappa Chettimada
de999a81c5 Bluetooth: SMP: Fix unaligned access usage fault.
xor_128 function uses uint8_t instead of uint64_t XORs to avoid
unaligned access faults.

Change-Id: I0b0c73d64ce4158e3d8aeb4dd5416ead2bd7b664
Signed-off-by: Vinayak Kariappa Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2016-05-03 08:56:00 +00:00