Commit graph

41120 commits

Author SHA1 Message Date
Arkadiusz Lichwa
fcb6e03021 net: buf: Add net_buf_add_le32() helper API
The function gets 32bits wide data, converts host order to little
endian and then puts the data on protocol stack to be send.

Change-Id: I29e4040b302a16b551a0922133c327ff694fec5d
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-05-13 07:55:39 +00:00
Vlad Dogaru
3a66946b0f sensor: Rework core to use workqueue API
Remove the homegrown sensor delayed work API in favor of using the
system-wide workqueue.  Drivers still have the option of using their own
fiber.

In a second step, drivers can be refactored to start and use their own
workqueue.

Change-Id: I70dea6fc2abcbc9e04ac1ed3c837483a3d3c4424
Signed-off-by: Vlad Dogaru <vlad.dogaru@intel.com>
2016-05-12 15:27:40 +00:00
Vlad Dogaru
efa3b6fa99 tests: Add nano_work test
Change-Id: I78359bdd75aa2aa5e2f4b34347d838747d60015f
Signed-off-by: Vlad Dogaru <vlad.dogaru@intel.com>
2016-05-12 15:27:24 +00:00
Vlad Dogaru
818a2e2975 nanokernel: Introduce workqueue API
Add a generic API for drivers to start workqueues and submit work
items.  This is needed by drivers which need to schedule code that might
sleep from an ISR to run in fiber context.

Also add the option to start a system-wide workqueue.

Both additions are optional.  They can be deactivated for systems that
do not need them.

Change-Id: Ia843568fde5daf6d4279ef7bf241c26c1e3dcfb7
Signed-off-by: Vlad Dogaru <vlad.dogaru@intel.com>
2016-05-12 15:26:39 +00:00
Andrei Emeltchenko
a1f7e480b1 drivers/nble: Call bt_conn_security() on start pairing event
Call bt_conn_security() the same way it is done in upstream code for
NBLE. Currently use BT_SECURITY_MEDIUM as default sec level.

Makes at least following cases pass:
...
1/6   GATT   TC_GAR_CL_BI_05_C   PASS
2/6   GATT   TC_GAR_CL_BI_17_C   PASS
3/6   GATT   TC_GAR_CL_BI_22_C   PASS
4/6   GATT   TC_GAR_CL_BI_27_C   PASS
5/6   GATT   TC_GAR_CL_BI_33_C   PASS
6/6   GATT   TC_GAW_CL_BI_06_C   PASS
...

Change-Id: I2a0c177a187db931e88e2f82a5bda1c0cc04a112
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-05-12 15:10:21 +00:00
Andrei Emeltchenko
c4ec82cc89 drivers/nble: Implement bt_smp_auth_cancel()
Implement bt_smp_auth_cancel()

Change-Id: Id37709f3a86619ece400d1502da2ed7b83436e9b
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-05-12 15:10:07 +00:00
Anas Nashif
9100752caa doc: arduino101: change kconfig option for GDB debugging
Jira: ZEP-313
Change-Id: I85341c3c804283fdbb2a17f59709861f68e3ff52
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-12 13:00:55 +00:00
Bogdan Davidoaia
2064f4a9cc grove: add temperature sensor
Add driver for the Grove Temperature Sensor which measures ambient
temperature.

Sensor reference page:
	http://www.seeedstudio.com/wiki/Grove_-_Temperature_Sensor

Change-Id: I4f56224be5fa7a968749d5d4df8cb99a462c3c21
Origin: original
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-05-12 12:11:04 +00:00
Bogdan Davidoaia
62c7a1338a grove: add light sensor
Add driver for the Grove Light Sensor which detects changes in ambient light.

Sensor reference page:
	http://www.seeedstudio.com/wiki/Grove_-_Light_Sensor

Origin: Original
Change-Id: I88ae20cc9faa8ab8f274b0bd7a114db5c1a87a91
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-05-12 12:11:04 +00:00
Anas Nashif
059d97839e add a new option for debugging quark se
We had wrong logic and confusing config options for debugging
Quark SE sensor subsystem. The new option will be used for GDB
debugging. The existing DEBUG option will be used for printing
additional messages on the screen while booting the sensor
sub-system.

Change-Id: Ia54d22e872edafe531ccde271e7504fe9c48a73a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-12 10:57:52 +00:00
Anas Nashif
f62d86c42b samples: get rid of obsolete usage of ARCH variable
Using ARCH variable to select different configurations for the different
architectures is misleading and conflicts with the variable ARCH being used by
the build system.  The variable is not needed, it is application specific and
an application can be built without the need to specify ARCH on the command
line.

This is yet another item specific to samples and test cases that
wrongfully being used and documented for every application.  We need to use
another variable and just make it clear it is specific to samples and how they
are written.  One possible solution is to have a script that gets the
architecture based on the board being used.  Attachments

Jira: ZEP-238
Change-Id: Ieccbc087a41858fb96fb361c0aaa04705e968a4e
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-12 10:57:28 +00:00
Anas Nashif
7e5692d914 device: add documentation for device_get_binding
Moved comments from code to header.

Jira: ZEP-160
Change-Id: Ifd0f3c930289256e682b5941d77433aca3d3f941
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-12 10:57:27 +00:00
Anas Nashif
90db02786c eth_dw: use sys log interface for debugging
Change-Id: I40ad4d2aa0419a7439a2fc0883a83430fa755b84
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-12 10:57:27 +00:00
Anas Nashif
ae97f6a4d4 spi: use syslog infratructure for debugging
Remove custom debugging macros and use SYS_LOG

Change-Id: I235935eeb9c14cba3f3c10a766a79e39d8a3971d
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-12 10:57:27 +00:00
Anas Nashif
fbe7d90ead spi: consalidate and simplify
Use the same Kconfig infrastructure and options for all SPI drivers.

Jira: ZEP-294
Change-Id: I7097bf3d2e1040fcec166761a9342bff707de4dd
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-12 10:57:26 +00:00
Anas Nashif
a2b9b4b71a spi: remove kconfig variables that can be define in headers
Most of the values are SoC specific and come from the SoC definition,
not need to define them in Kconfig.

Jira: ZEP-294
Change-Id: I962ce36b7e2361ea77ae4178bb7c86c19a241c4e
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-12 10:57:26 +00:00
Anas Nashif
9096daa53f spi: intel: move soc specific values to header file
Most of the values are SoC specific and come from the SoC definition,
not need to define them in Kconfig.

Jira: ZEP-294
Change-Id: I7688ca523915e3fa8a1d28dea7a1d84a66b39d56
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-12 10:57:25 +00:00
Anas Nashif
d0c4b30679 adc: unify kconfig variables and make them consistent
Change-Id: Icf102cf845f0917263d4286fec7a85112c7f8ffc
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-12 10:57:25 +00:00
Anas Nashif
1d547699a5 aio: unify kconfig variables and make them consistent
Change-Id: Ic3e4f1142a3d4dcde5947586bb4ad86372b3f70b
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-12 10:57:24 +00:00
Anas Nashif
1ee7175de9 rtc: unify kconfig variable names
Change-Id: I2adc0b21944fc0af85d40c09deac14bdbf134178
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-12 10:57:24 +00:00
Anas Nashif
72bf29eb03 watchdog: unify kconfig variables
Use consistent naming for watchdog drivers.

Change-Id: Idcec987253ce1b6230ccdf29cd8149d0bd705052
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-12 10:57:24 +00:00
Anas Nashif
82c969c8ae gpio: use consistent names for IRQ priority variables
Change-Id: I35ca4a13bb9dc0fd86298fa4fb17158b275dc9cc
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-12 10:57:23 +00:00
Anas Nashif
e1fea59671 gpio: GPIO_DW_BOTHEDGES_SUPPORT unused
Change-Id: I57adb395d308f01e469a2a88e0ad658169ffff72
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-12 10:57:22 +00:00
Anas Nashif
0140da310b i2c: unify kconfig options and share them across drivers
Reduces Kconfig variables by ~20

Change-Id: If39f7d49482d62417c621f98bc8c0c78df0d4139
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-12 10:57:22 +00:00
Mariusz Skamra
4108321181 Bluetooth: tester: Add Kconfig for nimble stack
Add config file for Arduino 101 board with the MyNewt nimble stack.

Change-Id: I061b1831457d6780af2ea757da918fb17fdcdaf0
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-05-12 10:50:57 +00:00
Mariusz Skamra
4e68ea947e drivers/nble: Notify about updated connection parameters
This adds a notify_le_param_updated function to call registered
le_param_updated callbacks with new connection parameters.

Change-Id: Idd660f7ca024c2f7712a6a41a51db77e4fc82a00
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-05-12 10:08:39 +00:00
Mariusz Skamra
f4451c7030 drivers/nble: Update connection parameters on_nble_gap_connect_evt
This issues connection parametrs update on new connection event,
to mimic Zephyr stack behaviour.

Change-Id: Ic3fa86a02ff9a5135a026dfff6d2fbfb890656c1
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-05-12 10:08:29 +00:00
Mariusz Skamra
5a9a5259e2 drivers/nble: Add bt_conn_le_param_update implementation
This adds implementation of bt_conn_le_param_update function.
Connection parameters can be only issued while in slave role,
because, nRF51 supports this procedure over L2CAP only.
Closes ZEP-222.

Change-Id: I2bb5f718b60b8be279f333c9721629662c029a32
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-05-12 10:08:14 +00:00
Johan Hedberg
3258ecad80 Bluetooth: SMP: Minor coding style fixes
Use appropriate scope for 'random' and remove unnecessary empty lines.

Change-Id: Idb8d527fa0a88ca738e91887b56a123a5a8831ce
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-05-12 10:05:55 +00:00
Mariusz Skamra
0b76866bab drivers/nble: Store new connection parameters
on_nble_gap_conn_update_evt gives information about new
connection parameters. These shall be stored in conn.
Closes ZEP-222.

Change-Id: I69e36136cfae98821b1f5467c72c94dbc6f1d10f
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-05-12 09:39:11 +00:00
Mariusz Skamra
31f6af2e34 drivers/nble: Move bt_le_conn_params_valid function
This function will be used by bt_conn_le_param_update to validate
parameters.

Change-Id: Icd60d74dae3bf467af4b7277d1516b978ba937a5
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-05-12 09:38:52 +00:00
Mariusz Skamra
4e0f6b8758 drivers/nble: Fix setting connection role
According to the data from nble_gap_connect_evt,
role_slave is "0 if connected as master, otherwise as slave",
so to be consistent with our API, this shall be mapped to
either BT_CONN_ROLE_MASTER or BT_CONN_ROLE_SLAVE.

Change-Id: Icf31ef02ea178e04cb28b2611e09b06c23f49704
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-05-12 09:38:39 +00:00
Arkadiusz Lichwa
742c71a186 Bluetooth: L2CAP: Enable handle BR/EDR signal channel traffic
Separates LE and BR/EDR L2CAP signal channel context and starts accept
incoming PDU traffic on BR/EDR signal channel. For now all valid L2CAP
commands are send back as rejected on BR/EDR signal channel.

Change-Id: If4392b2d3ccbe157cb7eeafcaa0804e90f44e2be
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-05-12 09:16:04 +00:00
Szymon Janc
32da5e6748 Bluetooth: Add comment clarifying condition check in bt_le_adv_start
It is valid to call set_ad with NULL data as long as length is 0.
Improve code comment for unusual condition check explaning why it
is correct.

Change-Id: I29440fb04747f6df06dc4df466eb43e160ff3be4
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-05-12 09:11:29 +00:00
Andrei Emeltchenko
7a51619d89 drivers/nble: Implement on_nble_gatts_write_exec_evt()
Implementing on_nble_gatts_write_exec_evt makes pass test case:
...
GATT   TC_GAW_SR_BV_06_C   PASS
...
Fixes: ZEP-221

Change-Id: I39a78887a990e37a75d9b025b3baf4dee3475bba
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-05-12 10:18:50 +03:00
Andrei Emeltchenko
51d607f9bd drivers/nble: Fix passing uninitialized req parameters
Fixes passing structure nble_gatt_write_params uninitialized.

Change-Id: Ic092257693eb50b902936f3a5355a6d0e31bc3fe
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-05-12 09:51:09 +03:00
Arkadiusz Lichwa
bc6a2cd7d6 Bluetooth: L2CAP: Implement bt_l2cap_br_connected() notifier
Adds implementation of the BR/EDR connection L2CAP notifier. It makes,
for each registered BR/EDR fixed channel, basic validation and channel
initialization using two local helper functions.

Change-Id: I6393a43b25ff0d9f23deaf93562add08861ea1d2
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-05-12 06:38:10 +00:00
Arkadiusz Lichwa
c071b3e770 Bluetooth: L2CAP: Move bt_l2cap_br_fixed_chan_register() to l2cap_br.c
Moves, specific for BR/EDR transport, register fixed channel handler
to l2cap_br.c file and make it local. Then using it register BR/EDR
signal channel (CID 1) context during channel layer initialization
in 'bt_l2cap_br_init'.

Change-Id: I5e23fc5d43ae3d7838ecb44ad4fa631eccc8cb4c
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-05-12 06:37:01 +00:00
Arkadiusz Lichwa
51044bf5f8 Bluetooth: L2CAP: Introduce internal BR/EDR connection L2CAP notifier API
Adds dedicated function informing L2CAP layer about established BR/EDR
connection. Existing 'bt_l2cap_connected()' connection notifier is
refactored to use new API 'bt_l2cap_br_connected()' which is implemented
in l2cap_br.c file.
Currently the new handler is just stub since proper internals of
BR/EDR L2CAP signal channel management are not yet implemented
in l2cap_br.c file.

Change-Id: Idef9be63338c6bb4b3315ec0452d84f2431fbaa2
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-05-12 06:36:11 +00:00
Arkadiusz Lichwa
bc1423f441 Bluetooth: L2CAP: Move init BR/EDR pool signal buffers to l2cap_br.c
Moves initialization of signal buffer for BR/EDR transport to
l2cap_br.c unit and removes existing references to signal buffer in
l2cap.c file to prevent compiler complains.

Change-Id: I784b926df814e632944f3a12b0b6d03d144d2438
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-05-12 06:34:52 +00:00
Fabrice Olivero
35dcc0a4cb qemu: Add possibility to redirect serial port to pseudo TTY
Change-Id: I9a3b6ecd85b88ec59db29af727ed3ccbd47e42a2
Signed-off-by: Fabrice Olivero <fabrice.olivero@intel.com>
2016-05-12 02:20:31 +00:00
Fabrice Olivero
26b0b4c920 Add interrupt stub label for profiler (interrupt event)
The stub label is created with ISR and IRQ number since the same
ISR can be used by several IRQs

Change-Id: I0ea909fddbce7a70c754befd095b7a3b36fffab4
Signed-off-by: Fabrice Olivero <fabrice.olivero@intel.com>
2016-05-12 02:19:56 +00:00
Fabrice Olivero
f39b9b85a1 kernel event profiler: add dynamic enable/disable/configure
Added CONFIG_KERNEL_EVENT_PROFILER_DYNAMIC flag for enabling that
capability. When set, nothing will be logged by default

Change-Id: I03552483e5a6bfd9e2505eda56908f0d0ae98618
Signed-off-by: Fabrice Olivero <fabrice.olivero@intel.com>
2016-05-12 02:19:19 +00:00
Fabrice Olivero
68e7fca45c Set kernel event logger timestamps to HW cycles
OS tick period (usually 10 ms) is not sufficiently precise for task
execution analysis (like processing CPU load per context)

With that modification, the timestamp used by the kernel event logger
is 32-bit LSB of platform HW timer (for example Lakemont APIC timer
for Quark SE).
This timer period is very small and leads to timestamp wraparound
happening quite often (e.g. every 134s for Quark SE).

This wraparound must be considered when analyzing kernel event logger
data and care must be taken when tickless idle is enabled and sleep
duration can exceed maximum HW timer value.

Change-Id: Idc545da8f828a7357a69d83ff25c9afd09dab3c4
Signed-off-by: Fabrice Olivero <fabrice.olivero@intel.com>
2016-05-12 01:51:09 +00:00
Chuck Jordan
61c5531430 i2c: IC_CON_SPEED_MASK should be 2 bit mask
IC_CON_SPEED_MASK isn't used, but I see it was defined wrong.
It should be a 2 bit mask.

Change-Id: I1003ae13b831ff481574bcf956daf2c54dbe7e47
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
2016-05-11 15:09:15 -07:00
Flavio Santes
feb131fd6c net/ip: Fix Makefile typo
Change "Zypher" by "Zephyr".

Change-Id: Ifc10da5cb0de7904096a5c231b200cb3d495c587
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-05-11 21:18:56 +00:00
Chuck Jordan
0ed3cf29c8 i2c: fix i2c_dw.c to have correct decl for i2c_dw_isr()
The function i2c_dw_isr() in this file appears to have the wrong
decl for the IRQ_CONNECT macro. It should be: void i2c_dw_isr(void *arg).
Also, at the 2nd use of IRQ_CONNECT there was a variable created
and then marked as UNUSED. I've removed this.

Change-Id: I3f2c4ecb5c13147d577c82a0ec4fe486ae38a475
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
2016-05-11 21:18:48 +00:00
Javier B Perez
63bdf1c55b checkpatch: change default kconfig help length warns
Added default value for min-conf-desc-length = 1 for kconfig help.

Jira: ZEP-303
Change-Id: Ieab66a5cb76e2ab8dea4e80b056600173c333c01
Signed-off-by: Javier B Perez <javier.b.perez.hernandez@intel.com>
2016-05-11 20:23:51 +00:00
Benjamin Walsh
1b5b6e44f7 kernel: add _IS_IDLE_TASK()
Add a way of finding if a microkernel task is the idle task instead of
of duplicating:

  task_priority_get() == (CONFIG_NUM_TASK_PRIORITIES - 1)

which could be subject to change.

Only available for microkernel, since there is no such concept in the
nanokernel.

Change-Id: Ie8930981f1a2ac5ff16f905f4eb4e333c8b59c5d
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-05-11 20:22:24 +00:00
Andrei Emeltchenko
3ca348dde8 quark_se_devboard: Update flash and debug openocd configuration
Update openocd configuration file allowing to flash with make
flash for the majority of boards. Old versions still might be flashed
with zflash. This also helps debugging boards.

Change-Id: Ie9701c09e1806e0c4de39f95bd34bce9f66051cc
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-05-11 20:21:35 +00:00