Commit graph

41120 commits

Author SHA1 Message Date
Szymon Janc
51ac70d42b Bluetooth: GATT: Refactor subscription API
This removes destroy callback for userdata as bt_gatt_subscribe
doesn't take any user data parameters and that destroy callback
was acctually called with subscribe parameters.

We assume subscription is active if bt_gatt_subscribe returned 0
(ie write command was sent). This is due to remote might be sending
notifications before reply to write.

Also note that bt_gatt_subscribe doesn't take any user data parameters
and that destroy callback was acctually called with subscribe
parameters.

If application would require to pass user data along with parameters
it may use CONTAINER_OF macro along with bt_gatt_subscribe_params.

Change-Id: I58ac9cd481ffa08ccc2d7a0464ca75f61fb280c5
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-10 18:52:29 -05:00
Szymon Janc
c12c48c4b2 tinycrypt: Fix compilation with ECC enabled
Common ecc.c code was not compiled resulting in following link error:

crypto/tinycrypt/lib.a(ecc_dh.o): In function `ecc_make_key':
crypto/tinycrypt/source/ecc_dh.c:50: undefined reference to `vli_set'
crypto/tinycrypt/source/ecc_dh.c:51: undefined reference to `curve_n'
crypto/tinycrypt/source/ecc_dh.c:51: undefined reference to `vli_sub'
crypto/tinycrypt/source/ecc_dh.c:54: undefined reference to `curve_n'
crypto/tinycrypt/source/ecc_dh.c:54: undefined reference to `vli_cmp'
crypto/tinycrypt/source/ecc_dh.c:53: undefined reference to `vli_cond_set'
crypto/tinycrypt/source/ecc_dh.c:56: undefined reference to `vli_isZero'
crypto/tinycrypt/source/ecc_dh.c:62: undefined reference to `curve_G'
...

Change-Id: Ib590fd7330753c0ae8ef54159b0f2b7461b5b38e
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-10 22:14:58 +00:00
Szymon Janc
0f7bc9dd67 tinycrypt: Fix few typos in Kconfig help messages
Change-Id: Ia6442359e1ab5116083c065ae63e4b929e74ef76
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-10 22:14:58 +00:00
Andrew Boie
6bb087c511 sanitycheck: add testcase.ini field for slow tests
Some tests take a very long time to complete, add a directive in
testcase.ini to mark them as such. Unless --enable-slow is passed
on the command line, these tests are not executed, only compiled.

app_kernel and test_sha256 marked as slow test cases. It appears
test_sha256 was being skipped earlier due to platform_whitelist line
which has been removed; the test should be able to run on all
microkernel-supporting boards. Same with test_aes, which completes
very quickly and is not marked as 'slow'.

Change-Id: I39ec8212f3fa10122ff786c10b6659d22bae64e3
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-10 22:12:55 +00:00
Dan Kalowsky
0d8308ec3f samples : adc : fix build issues
Change-Id: I5ac198a5af2748ac5ac1be90e173a98887e9f559
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-10 11:23:56 -05:00
Dan Kalowsky
5d81be5c9d adc : rename device to just ADC
Part of making the device model work, is using a more generic name for
the devices.  Currently the ADC uses 2 possible solutions, when it should
be using just one name for them all.

Change-Id: Id9b78b3edf234391819847bb9b8534747d7d4409
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-10 11:23:56 -05:00
Dan Kalowsky
9ccd5ce785 adc : ti : only one instance
There can only be one instance of an ADC, but we have code setup for
multiple.

Change-Id: I94eae2450bdc6b138ebad66f80a7c451cefe32a9
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-10 11:23:56 -05:00
Dan Kalowsky
e97507a034 adc: dw: there is only one ADC
The ADC for DesignWare is currently setup to handle multiple dev entries,
but there only ever exists one.  No reason to add to complexity for multiple
if there is only going to be one.

Change-Id: I0b77ef91160776dcf0aea1a50b144fff2b2be9e2
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-10 11:23:56 -05:00
Dan Kalowsky
4743684e4f struct packing
Looking at all structs as to where we can pack them a little better, and
calling out the padding/stride at the end for future expansion.

Change-Id: I4a651092e950dd3d915af9fa0ee0d7d59803e58f
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-10 16:21:26 +00:00
Andrew Boie
f21ff23310 x86: add debug function to dump IDT
Looking at the IDT in a debugger is confusing, add a pretty-printing
function.

Change-Id: Iacc5e204e5d11e3e875c75ddf6d2e2e80b230299
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-10 16:02:17 +00:00
Andrew Boie
313ed31253 x86: fix IDT entry definition
It was, in a nutshell, wrong. Fortunately, the incorrectly
specified fields weren't being used by anything.

Change-Id: I0fa63fa16a267502744a7a2c82865c7de8b5446e
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-10 16:01:26 +00:00
Rodrigo Caballero
869181a994 doc: Edit the ADC driver APIs
Edit public API details for clarity, grammar, punctuation found
on file adc.h.

Used imperative verbs for all @brief descriptions.

Change-Id: Icd4787b450bb7cb2a706d38993f2a4c03d691994
Signed-off-by: Rodrigo Caballero <rodrigo.caballero.abraham@intel.com>
2016-02-10 04:08:53 +00:00
Anas Nashif
3f123c6b6e doc: fixed include path for input directories
Change-Id: Iec71dd19a676bd6a9349a386990034fc7ddd2f85
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-10 03:30:50 +00:00
Benjamin Walsh
48e4f82f3c device: fix race condition in device_sync if ISR runs before thread waits
If an ISR was enabled and ran before the thread that wants to wait for
completion actually does wait, the type of thread would not be
registered in the object. The ISR would thus not know what type of
semaphore to release. This caused the ISR to release the object for the
previous caller of device_sync_call_wait().

Instead, the ISR now looks if there is already a waiter: if not, it
marks the device as being ready in the object, which allows the thread
to skip taking the semaphore; if there is a waiter, the correct
semaphore type is released, as before.

Change-Id: Ib97480db8ba3e895812cf4bc209d9794639af325
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-10 02:08:30 +00:00
Daniel Leung
f42664554e sanitycheck: enable build tests for Arduino Due
This enables sanitycheck to build for Arduino Due.

Note that there is no on-board bluetooth so bluetooth tests
are skipped.

Change-Id: I4f564e68ec65f01b7b33a32f6d0d7749290c0e5b
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-10 01:35:33 +00:00
Daniel Leung
e20c79c154 samples: test_tickless: enable test for Atmel SAM3
This adds the necessary functions to enable the tickless idle test
for Atmel SAM3 family processor.

Change-Id: I19e2a8c898dbbc687c980d06bb6c19de693b97a4
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-10 01:35:33 +00:00
Benjamin Walsh
3c66686a43 sys_clock: start the microkernel ticker in the MICROKERNEL init level
The ticker was always initialized in the NANOKERNEL init level. In a
microkernel, this can cause problems if for the some reason the
initialization of the microkernel server is delayed, such as devices
initialization in the NANOKERNEL level taking non-insignificant time to
complete. What happens in that case is the ticker ISR will start firing
and piling up events in the microkernel server stack, and quite quickly
overrun it, since it has a finite size, causing random crashes.

So, in the microkernel, initialize the ticker once the microkernel
server is available. There is no point in sending ticker event before
anyway.

Change-Id: Ie9e13184f6ad35954023faf3bbff26242284b7be
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-10 01:35:14 +00:00
Benjamin Walsh
205d3a4265 device: fibers/idle task must wait when acquiring device_sync object
TICKS_NONE was mistakenly used when waiting on the nanokernerel
semaphore in the microkernel case, instead of TICKS_UNLIMITED, causing a
thread that wants to wait to return immediately, as if the device was
always ready.

Change-Id: Id2376ebef324339fec05c56655e705755a670973
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-10 01:34:37 +00:00
Daniel Leung
7cd4d5b9c4 samples/footprint-min: turn off IPM for ARC
On x86, IPM is not enabled for footprint min benchmark. Extends this
to ARC too.

Change-Id: I099fc00c9f8ee086118c63523ad28afd6c991732
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-10 00:38:22 +00:00
Peter Mitsis
08b353b8b4 minimal libc: stdlib.h no longer includes ctype.h
The libc 'ctype.h' header file is not supposed to be automatically
included when including 'stdlib.h'.

Change-Id: I821a9946894572a7b82804b1569b7b18c24316db
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-09 23:41:59 +00:00
Anas Nashif
fb44466164 doc: create api directory
Change-Id: Iecf09fd9b362f7c1ea25efdc5ac3d2345630766a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-09 17:15:56 -05:00
Juan Manuel Cruz
65ec185f79 logger: include task monitor in kernel event logger
Zephyr includes a Task Monitor feature that allows to
track events on the microkernel server scheduler.
Task monitor is integrated as a profiler point for the
Kernel Event Logger feature.

Change-Id: I7b8be5872439a333f976eada1aa3511d93b46388
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-09 13:53:41 -05:00
Javier B Perez
e7cf19bf1e doc: getting started: update SDK location
Change-Id: Iec3f73953c076dab75ae7a54344ad762dc83ac0a
Signed-off-by: Javier B Perez <javier.b.perez.hernandez@intel.com>
2016-02-09 18:11:51 +00:00
Anas Nashif
ef61a3e164 doc: simplify supported board page
Remove table which had redundant information and created a simple TOC
with boards. This will allow easy expansion of the list over time.

Change-Id: Ic94063cc99ddcb3d2140a4beef1067a9766d60a3
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-09 18:04:37 +00:00
Anas Nashif
df8db31f53 doc: add brief description for Kconfig in the reference
Change-Id: I8ba54feb9d684945177c7ecfb08255aaf796734f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-09 18:04:36 +00:00
Anas Nashif
dfee33269b doxygen: enable uart functions guarded by ifdef
Many of the UART interface functions are hidden behind ifdefs,
set those to 'y' when building documentation.

Change-Id: I1371e64b6fe4c269ce41c2c54e0f013d8088dbcf
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-09 18:04:36 +00:00
Anas Nashif
76bba72b97 trivial: fixed typo: sempahores -> semaphores
Change-Id: Ie119f8478c6a75c6ee8cab6277758b1cab85fcd6
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-09 18:04:36 +00:00
Juan Manuel Cruz
ee2b119877 doc: adds the task monitor documentation
Change-Id: I659bc206a636ffc723f3ac72b5b90f9a6ebcc565
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-09 13:03:19 -05:00
Juan Manuel Cruz
4601ccdbdf logger: updates logger sample to include task monitor events
Change-Id: I8fad34518d66194b349a6cac82e6a03332344132
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-09 13:03:19 -05:00
Juan Manuel Cruz
d481b3ff4c logger: removes TASK_MONITOR_CAPACITY symbol
Task monitor is being tracked as a profiler point of the kernel
event logger. Now, the capacity to register task monitor events
is dictated by KERNEL_EVENT_LOGGER_BUFFER_SIZE symbol.

Change-Id: Ia4fe04c7d46fe41524c53447ad51af2e03ea5a15
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-09 13:03:19 -05:00
Juan Manuel Cruz
a641710aea logger: removes old task monitor structures.
Kernel event logger keeps track of task monitor events.
Old structures are not needed anymore.

Change-Id: I2267bdb3c2f27ea87d8675c4ecf0646ea62761ae
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-09 13:03:19 -05:00
Juan Manuel Cruz
21b5da27ff adc: fixes unexpected error with interrupt handler
Interrupt handler needs to finish all the handler work before
returning to the sync call.
Before this fix, a call to the API read() method could unexpectedly
fail because a second read() call could start before the previous
read() call had not completely finished.

Change-Id: I74249a52b403e2a589d970fae05b9325b20fbe38
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-08 22:19:51 -05:00
Juan Manuel Cruz
ff8138595e adc: adjustments to dummy read
Per Curie documentation, the first sample from the Quark SE ADC
hardware after reset needs to be dropped.
This commits changes the location and the trigger event to do
a dummy read that drops the first sample.
Originally the driver did the dummy read on the API call enable()
and it was triggered if the ADC had awakened from suspend mode.
Because the SoC is not in suspend mode on power on and the API
enable() call has no information on the channels to be read the
dummy read could be missed.
Now the dummy read is done on the API call to read()
and triggered if it is the first time read() is called
since power on.

Change-Id: I1e1ad5f7f44d71ca88572ae242ad629471a9ab9b
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-08 22:19:51 -05:00
Andrew Boie
4455ee6d87 ARM: rebase available priority levels to 0
We have a new policy: users should not be able to configure
an interrupt with "forbidden" priority levels, and any priority
levels with special semantics will be activated by flags.

Change-Id: I757c19cfedcb1d0938eaf4da348ddafb71b3e001
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-08 21:47:35 -05:00
Genaro Saucedo Tejada
2b8673b571 doc: Linux Foundation registration steps
Updates Set Up steps from previous 01.org Gerrit to new Linux Foundation one.

Change-Id: Iab98864b405ff6dc4ea20d687fae77bd59284678
Signed-off-by: Genaro Saucedo Tejada <genaro.saucedo.tejada@intel.com>
2016-02-08 21:47:33 -05:00
Andrew Boie
b052bd282a x86: intconnect: convert some DEBUG to __ASSERT
DEBUG isn't tied to any config option. Just use assertions.
Most of the time return values aren't being checked anyway.

Change-Id: I7457dcf00e18505bd6bcd98d46288545c03b5fbc
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-08 21:45:07 -05:00
Andrew Boie
9fc3afc339 x86: rebase priority levels
Having priority levels 0 and 1 reserved on x86 due to implementation
details on how the CPU uses the vector table is confusing to users,
and makes it unnecessarily difficult to share drivers between arches.

Now on x86, priority levels 0 and 1 are available. Semantically, all
priority levels have had 2 subtracted from them.

It is no longer necessary to specify a priority level when the
vector itself is specified. If an IDT entry has a specific vector
associated with it, any priority argument is simply ignored.

In gen_idt, some simplifications have been made:
- The printed representation of a generated entry now fits on one line
- Some checks being done in validate_priority() were redundant, as
  generate_interrupt_vector_bitmap() also ensures that there are
  sufficient free vectors within a priority level.

Change-Id: I26669d8ee0a53f48fbc2283490a8c42d8b1daf8e
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-08 21:45:07 -05:00
Tomasz Bursztyka
4f88ff49e1 spi: dw: Improve debug output
Available only when CONFIG_SPI_DEBUG is set:
- Print out all exported functions with relevant infos
- Remove superfluous messages
- Make counter in push/pull not being instanciated when not debugging

Change-Id: Iaa96a897008d360a14bc83da54152c264f42c60d
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-08 21:45:07 -05:00
Tomasz Bursztyka
6ba201e288 spi: dw: If an error occurs, nothing should prevent to stop
It's a bug that did not happen, but is a valid one:
if there is an error, we should not care at all about current stage of
transmission, thus it will stop right away.

Change-Id: Iec2b519d8118233f570ded18d6c6eb4084371e5b
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-08 21:45:07 -05:00
Tomasz Bursztyka
ca37a84c66 cc2520: Rework the logic of reading packets
This helps saving stack but also fixes an error when unrelevant packet
detection is made and thus calls read_packet recursively.

Change-Id: I5c1130a369b573f204f30230417e5bcbb97257bc
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-08 21:45:07 -05:00
Tomasz Bursztyka
2a196eca8a cc2520: Reinstate the radio locking/unlocking logic
Original mechanism was useless, but it was due to the fact prototype
code was purely polling-based. Now that we are back to interrupt mode
only, it's actually required. It's done a different way than original
though as it was really redundant, and sometimes bogus (no release).

Change-Id: I36b55b072564ee2f9d331f49c69751d9d274bab2
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-08 21:45:07 -05:00
Jesus Sanchez-Palencia
636c46ce48 cc2520: Parametrize driver configs
The radio driver was using DW spi and gpio drivers hardcoded.
Now it will check if SPI_DW or SPI_QMSI is set.

Change-Id: I4e12ef7c071058218c1cc714c62fed90a9f5eb06
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
2016-02-08 21:45:07 -05:00
Andrew Boie
14308a9621 device: add DEVICE_DECLARE()
If an init or config function needs to configure a static interrupt or
otherwise do something that requires a build time reference to
a device with DEVICE_GET(), there is a dependency issue that so
far is usually resolved with a forward prototype of the init function.

In addition, there currently isn't a good way to declare a device in
a header so that DEVICE_GET() can be used in a different C file.

This patch should resolve both of these problems; the data structure
defined for the device is no longer static (the names have to be unique
anyway), and in cases where we need a forward declaration so that
DEVICE_GET() can be used, we have a new DEVICE_DECLARE() macro which
does this.

Change-Id: Ie8d53d0c344f61a130c735c86473562820190d70
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-08 21:45:07 -05:00
Vinicius Costa Gomes
42a8032fd9 samples: Add a sample SPI application for W25Q80BL
W25Q80BL is the SPI flash chip soldered on the Quark SE development
board, for communicating with it, having support for using GPIO as Chip
Select is necessary, so it will be useful when testing that feature.

Change-Id: Idbf571cdb3b1ae8704d7a932bc0ac56dc53f8ff1
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-02-08 21:45:07 -05:00
Vinicius Costa Gomes
cedfb1f16e samples: spi_test: Add support for using QMSI driver
Depending on the driver implementation, the name of the device will be
different.

Change-Id: I35395abe44727b39d930e4c123860fad7b13edfd
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-02-08 21:45:07 -05:00
Andrew Boie
6e83effea8 iamcu: fix dynamic exceptions
The argument to _common_dynamic_exc_handler() in the C domain
was still being set up the Sys V way. Arguments are popped off the
stack in reverse order, so _ExcEnt pushes *pEsf for arg 2, and then
the stub pushes the stub_num for Arg 1.

For IAMCU case, *pEsf is placed in EAX which is where argument 1
lives; static exception handlers take just one argument. However
since we're calling _common_dynamic_exc_handler we also need to
supply the stub_id, which we put in EDX (where arg 2 goes).

Rather than swapping things around at runtime the prototype for
_common_dynamic_exc_handler() is adjusted to fit the calling
convention in use.

Change-Id: Id43cbc3b86d90f941cea771678b2796ae5f1358d
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-08 21:45:07 -05:00
Daniel Leung
9d727d8bdb doc/boards: updates arduino_due for supported features...
... and adds a note about terminal and flashing.

Change-Id: I9b3fe9a8e9993ee68612d177aa4163fcf15e912d
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-08 21:45:07 -05:00
Daniel Leung
8d48828b3c i2c: adds driver for Atmel SAM3
Adds the driver to utilize the I2C/TWI interface on Atmel SAM3
family processors for I2C communication.

Note that this currently only supports master mode. Limited
testing has been done using the Fujitsu FRAM sample app.

Change-Id: Ibdb8277e47dd9450b49a66a95421eb1ffb1c4eb4
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-08 21:45:07 -05:00
Daniel Leung
aac003c0b1 boards/arduino_due: enable both I2C controllers if CONFIG_I2C=y
Change-Id: I24e510369e1b273e929acd4100366a239e708e4d
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-08 21:45:07 -05:00
Daniel Leung
dc8ddfcd1d arm/atmel_sam3: add PDC register struct
Adds the struct to describe PDC (Peripheral DMA Controller).
The PDC is being used by peripherals to initiate DMA
transfers.

Change-Id: Ida2a20810c4f2ef972e9669c45e22da07c1576ab
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-08 21:45:07 -05:00