Commit graph

41120 commits

Author SHA1 Message Date
Anas Nashif
00664b5a41 galileo: set priority of ADC to 95
ADC should come after SPI.

Jira: ZEP-217
Change-Id: I1f72d675604b83d54a9268014be3b46d197d746d
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-11 17:59:46 +00:00
Szymon Janc
1fefa34e08 Bluetooth: SMP: Fix ecc_make_key return code check
This function returns TC_FAIL and not negative value on failure.

Change-Id: I36e51e39aca07264339fc6c10a9c2b8db61b580d
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-05-11 17:19:12 +00:00
Luiz Augusto von Dentz
1157a8f26f Bluetooth: GATT: Remove authorization permission
The application can return BT_ATT_ERR_AUTHORIZATION on the callback
already so there is no reason to have it as a permission as once set
it always fails.

Change-Id: Ia634e3f313993dd36c06bff48f36d4ddf1264376
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-05-11 15:18:09 +00:00
Luiz Augusto von Dentz
ffd0d3e36a Bluetooth: Omit implicit permission flags
This is no longer needed since commit:
7834061d12

Change-Id: If6436204b886d31be20c27e4f3d74a5c5a979e8c
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-05-11 15:17:59 +00:00
Anas Nashif
0f515c1497 doc: use table for Kconfig option reference
Do not use a TOC, instead put all options in a table and use references.

Jira: ZEP-149
Change-Id: I23821759c64ce28241ee8260ad7cba235df72d86
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-11 15:15:44 +00:00
Vlad Dogaru
d217705329 nanokernel: Add fiber_config structure and wrapper
Many drivers need to start fibers whose parameters are based on user
configuration.  Make it easier to specify such parameters by creating a
fiber_config structure and a wrapper to use it.

Change-Id: I26917ada71acbc676c0f32b6ee081aff7bb1d6d8
Signed-off-by: Vlad Dogaru <vlad.dogaru@intel.com>
2016-05-11 14:25:05 +00:00
Chuck Jordan
4ad41d8d7f arc: early init should invalidate d-cache and set vector table
Some ARC targets can have a data-cache. Although there is no special
instruction to clear exceptions during early init, it is necessary to
invalidate the d-cache BEFORE any data is fetched. The ARC on arduino 101
doesn't have d-cache, and will thus skip this d-cache invalidate.

Also, it is important to set the vector table base register to point to
the interrupt vector table EARLY, so that if an exception is encountered,
the correct vector table is found. Set this base only if it is found to be
different from the one compiled in to the code.
These initialization steps assure that proper exception handling
is in place during early init.

Change-Id: Ie8b5928e5813e104680a6d6510c85d32dc8ed8f3
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
2016-05-11 11:10:52 +00:00
Chuck Jordan
bd012c92b3 arc: initialize the i-cache ONLY if it is present
The aux register named _ARC_V2_I_CACHE_BUILD can be read
to determine if the ARC has an i-cache. If it does not,
don't attempt to initialize it because this would cause an exception.

Change-Id: I3ff519befcc5ebb7745b58401f12cf3015a9e2e9
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
2016-05-11 11:10:52 +00:00
Grzegorz Kolodziejczyk
486de7aa84 Bluetooth: tester: Fix setting nonconn advertising type
BTP API allows to set only advertising and scan response data without
declaring advertising type. Advertising type is deduced from current
flags status. Scan response data is static in tester - to set non
connectable mode in current BTP API scan response length must be
considered.

Change-Id: I742cd8ec774c24f317d639835844a4743bb25445
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
2016-05-11 11:34:28 +02:00
Luiz Augusto von Dentz
20bfb62308 drivers/nble: Make sure gatt_private is reset properly
gatt_private should be reseted whenever used otherwise other commands
may fail when attempt to use.

Change-Id: I8bdda3d5136368a8f37fd9e2afd97e0957c4e04e
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-05-11 11:29:08 +03:00
Johan Hedberg
cceb766411 mailmap: Fix a couple of incorrect git author names
Some git commits have slipped into the tree with incorrect author
information. Add entries for these to .mailmap so shortlog shows them
correctly.

Change-Id: Ie60ea08bb5a94f12eeb6c3ef3010b46e1c426c43
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-05-10 18:45:22 +00:00
Luiz Augusto von Dentz
777033f710 Bluetooth: GATT: Make bt_gatt_write take a struct
This makes bt_gatt_write similar to bt_gatt_read where the parameters are
stored in a struct which can be used to store intermediate values while
the operation is in progress.

Change-Id: I3c62af137b99985690cf88dcc37a977a0be891f5
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-05-10 17:55:06 +00:00
Szymon Janc
c7982b65d2 Bluetooth: Use tinycrypt for ecc in LE SC only sample
This makes sure LE SC are always enabled regardles of controller used.

Change-Id: I015213eb95f97793d1a1962a1cb392c652489568
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-05-10 16:50:06 +00:00
Szymon Janc
232e934351 Bluetooth: SMP: Reduce stack usage when generating ECDH keys
Only 8 random uint32_t digits are required by ecc_make_key function.

Change-Id: Ib0b4d6923b339828281e13b2a1d960d3bb72e65a
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-05-10 16:49:44 +00:00
Luiz Augusto von Dentz
8171965f75 Bluetooth: GATT: Fix coding style
Code shall not have more than 80 columns.

Change-Id: I2ba53c971be1d6936b5092d86c1e2196c100339e
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-05-10 15:48:29 +03:00
Andrei Emeltchenko
6a3d32cbee drivers/nble: Update RPC version to 0510
Change-Id: Ied97eaedacfe8d3a053b0732f56791486d8c9561
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-05-10 10:41:52 +00:00
Mariusz Skamra
3828a2008a drivers/nble: Fix NULL pointer dereference
Due to the recent changes, read parameters pointer is passed as user_data,
not as gatt_private.

Change-Id: I08b59164acfec8d71801ae2a23ce51abad080dc8
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-05-10 11:44:05 +02:00
Andrei Emeltchenko
a146f9ef28 Revert "drivers/nble: Update RPC to Nordic BLE to 0509"
Revert to RPC to BLE Radio Module 0425 as it is going to be official
open source release beta.

This reverts commit a52d7d7fe0.

Change-Id: Ibdb98b26bcad0a04849e89622527884a2b67c8d4
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-05-10 11:56:02 +03:00
Flavio Santes
ac594f1da0 net/loopback: add missing license
Add the license to the loopback driver header

Change-Id: I9cb2d93c8de6fe490912684fc3dfb20526be812d
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-05-10 05:16:20 +00:00
jgarcia
5b6175d00c net: configure TCP receive window size
Tweak TCP receive window size from Kconfig.

Change-Id: I0d43809d5f36727a86d68b45a38ec136ca0b69cf
Signed-off-by: jgarcia <jeremie.garcia@intel.com>
2016-05-10 05:15:23 +00:00
Chuck Jordan
7e8e620ddf gpio: For EM Starterkit, some additional GPIO register defines are needed
Comparing the Synopsys GPIO driver with the one here in Zephyr revealed
that some register symbols are missing. I am adding them now, and will
be working on getting GPIO working on ARC EM Starterkit board.

Change-Id: Ifccd1e225eb1373a31c6a5c51cf3927e42601d1a
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
2016-05-09 21:51:54 +00:00
Chuck Jordan
f1874fabdd arc: do lr and sr instructions together, avoid instruction pipeline bubble
The lr and sr instructions cause a pipeline bubble. There is an efficiency
to be gained if pairs of lr or sr instructions are done right next to
each other. This can avoid some stall cycles.
Also, r14 and r15 can be used with isa-16 instructions.

Change-Id: I4165365b49da910db31e0699a1a6e47114962942
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
2016-05-09 20:56:52 +00:00
Chuck Jordan
a364a628b0 arc: Add CONFIG_HARVARD since some ARC CPU Architectures are Harvard.
Some ARC SOC implementations will need CONFIG_HARVARD so as to
select a different initial stack pointer (one at the top of DCCM memory),
and also to select a different linker command file that uses
ICCM and DCCM. Quark_se_ss will have HARVARD equal to n.

Change-Id: Idb7c4126866c9604e1924200ad5fdd2bc9d28269
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
2016-05-09 20:56:51 +00:00
Chuck Jordan
49dec0dad5 arc: clarify in comment that ARC must have timer0
The timer implementation for ARC currently requires timer0 to be present.
I've added a comment that this is an assumption and to encourage developers
to build the ARC CPU with Timer0, when it is to be used with Zephyr.
There is also an optional provision for a Timer1. In future, this
code could be conditional to use either timer.

Change-Id: I4eb3aec59ba4e85f8b70d5531b21bdaab00b93bb
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
2016-05-09 20:56:51 +00:00
Chuck Jordan
12e29fe653 console: fix spelling error in comment
consloe changed to console

Change-Id: Ie6d6bd7762f1ab1dae64a1f5ccbe7dbc651e8c0f
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
2016-05-09 20:56:51 +00:00
Chuck Jordan
ac6f97893b arc: more improvements to use isa-16 instructions
By using isa-16 instructions, a bit of code-size can be saved,
and code can be a little faster.

Change-Id: I0567d8274372748f579610e2bd4236ce52c5d6c8
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
2016-05-09 20:56:50 +00:00
Chuck Jordan
f5912a46ce arc: Add defines for many more useful auxiliary registers
The ARC CPUs have several other features controlled by aux registers.
Specifically, I will be needing ones for i-cache, d-cache and various
BUILD registers that indicate which features are present.

Change-Id: If15a330f4ea5aa519655f88526fbb5f600d7cc0b
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
2016-05-09 20:56:50 +00:00
Andrew Boie
7ff96dc4a4 nios2: implement _arch_irq_lock / unlock
Change-Id: I16fd64577f45db9531dd0d472279c255c5b8ff13
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-05-09 18:09:29 +00:00
Andrew Boie
c5a62dcc9c nios2: implement asm_inline_gcc functions for sys_io.h
Nios II has no special instructions for testing bits, ffs, etc.
However, when poking memory-mapped peripherals, special *io variants
of ld and st instructions must be used to avoid issues with the
caches.

find_msb_set / find_lsb_set are implemented using universal GCC
compiler built-ins. It's not clear why this approach was not taken
on other arches.

The sys_in/sys_out/sys_io functions are completely removed as there
is no concept of these on Nios II.

sys_read/sys_write functions implemented using special GCC builtins
for the Nios II so that we don't have to use inline assembly.

Rest of the operations implemented in C, there is no requirement that
they be atomic.

Change-Id: Ic251fc7d7f342543dace4ccb3e429937b303215e
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-05-09 18:09:29 +00:00
Andrew Boie
a43a4ba258 kernel_event_logger: disable on nios2
Pending implementation, see ZEP-289

Change-Id: Idb483ac916dff7eace6a1457b41d9cb0164f0c8a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-05-09 18:09:29 +00:00
Andrew Boie
3395211a0b newlib: treat x86 as the special case
Although it's unclear why x86 has a different naming convention,
this scales better.

Change-Id: I939b9d4d04b1833391304700a7c12c9c8607192f
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-05-09 18:09:29 +00:00
Andrew Boie
e91f7101c6 nios2: update _new_thread prototype to latest changes
Now matches kernel/nanokernel/include/nano_internal.h.

Change-Id: I4dbbf50aa05c55de42100a6896fe0fa3b26955ec
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-05-09 18:09:28 +00:00
Andrew Boie
cfe645cef3 nios2: add config-independent CPU defines
This file is taken verbatim from the Altera Nios II HAL
source and includes various useful processor defines
and macros.

Change-Id: Idbf0b49bebe33bb5a53f5155d927bafadda9a2fe
Origin: nios2.h Altera Nios II HAL
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-05-09 18:09:28 +00:00
Andrew Boie
8564875a98 nios2: provide and include soc-specific headers
BSP builds for Nios II generate a linker.h and system.h which reflects
the configuration for that CPU. This can vary depending on how the CPU
is wired up in QSYS, so it needs to be at the SOC level--we essentially
treat any given CPU configuration as a SOC in Zephyr build terms.

Include these files from <arch/cpu.h>.

Change-Id: I12f76600107fec1a14a2f9cb82b0f55915ec03a6
Origin: Altera Quartus tools, machine generated
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-05-09 18:09:28 +00:00
Andrew Boie
352f853803 nios2: add missing linker script
Got lost in the .gitignore when these files had .cmd
extension.

Change-Id: I8a8d51014b621026b739525f3f9a3e8a20cb5ad0
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-05-09 18:09:27 +00:00
Andrew Boie
7f7337a0fe nios2: fatal: add _SysFatalErrorHandler and _Fault stub
ZEP-252 will handle implementation of the code here.

Change-Id: I3e9a6c7cdf2d5a3b0240317b772628fead528095
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-05-09 18:09:27 +00:00
Andrew Boie
2d5645e57a nios2: add minimal crt0.S
At the moment this just jumps into prep_c, with comments left
on other things that need to be done. Having this here ensures that
the early boot code isn't discarded by gc-sections.

vector_table.c removed, it isn't the right approach for this CPU.
Proper method for initializing reset and exception vectors still
being investigated.

Change-Id: Id7965c671f1a55c42ecfb65119497405a646bec4
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-05-09 18:09:26 +00:00
Andrew Boie
ff872dc349 build: rename non-generated linker scripts to .ld extension
Avoids confusion with .gitignore rules, which were inadequate to
cover all the places where these files are found. At least in
VIM, these files are now syntax highlighted correctly.

Change-Id: I23810b0ed34129320cc2760e19ed1a610afe039e
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-05-09 18:09:26 +00:00
Arkadiusz Lichwa
bc5497f239 Bluetooth: BR/EDR: Reset pairing context when needed
When pairing procedure ends regardless of the status, reset flags
strictly related to pairing phase and reset security level.
Thanks that next authentication will get known initial pairing 'context'.

Change-Id: Ie3108c6e28e136ea929e564a6820675cc770cb95
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-05-09 16:54:14 +00:00
Andrei Emeltchenko
22ac4fd13e drivers/nble: Fix passing uninitialized write request structure
Fixes using uninitialized structure nble_gattc_write_param in
nble_gattc_write_req().

Change-Id: I476a3b833994c422691bf96dc0b2174368c47fa6
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-05-09 16:34:19 +03:00
Andrei Emeltchenko
9178dce953 drivers/nble: Fix passing uninitialized scan parameters
Initialize req to zero, fixing passing uninitialized use_whitelist,
scan_type in nble_gap_connect_req().

Change-Id: I57f957db81f6d7cd3e24e3e7393ba1f055b42330
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-05-09 16:33:24 +03:00
Andrei Emeltchenko
4616f07f51 drivers/nble: Increase RX buffer pool
Since RPC to the Nordic BLE module has no flow control increase
receive buffer pool to handle events from the module. Without this
NBLE stack is not capable of handling all events and we get "No
buffers" error message.

Change-Id: I0566b30a95ef0a027d4533c83c3c2915018a650a
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-05-09 15:15:43 +03:00
Andrei Emeltchenko
5a97415bd5 drivers/nble: Fix memory leak with double connection create
on_nble_gap_connect_evt() gets called in a case of incoming connection
but also with outcoming one. In this case connection is already
created so we should use conn_get() instead of conn_new().

Change-Id: I2ed2d0a1844f653000a12eb0f54f52533856bf0d
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-05-09 15:13:14 +03:00
Johan Hedberg
c1ae16adc5 Bluetooth: Use bt_hci_cmd_send_sync in set_ad to catch errors
Using send_sync lets us return an immediate error to the application
if the HCI command fails. This also reduces the pressure on available
buffers since we don't allocate multiple command buffers before
starting to process the command queue.

Change-Id: I5613e4e9dd8dcc0db45bad051d7c4980b49e428d
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-05-09 13:44:41 +03:00
Szymon Janc
a5b6daaee3 Bluetooht: Don't mix ssize_t and int error codes
struct bt_storage callbacks return ssize_t while other functions in
set_static_addr return int.

Change-Id: Ic09db711ccf5e85b3118739abb0d5e50ed49d20f
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-05-09 11:49:41 +02:00
Szymon Janc
2471d506b2 Bluetooth: Use set_random_address for setting Static Random address
There is no need to open code this as we have helper for this.

Change-Id: I77ab39206d0c5b10f30624e90e864192b9519d0c
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-05-09 11:48:20 +02:00
Szymon Janc
838206f603 Bluetooth: Fix using NRPA for creating connection
If adapter is using Static Random address as Identity Address and
privacy is disabled we need to restore correct random address (ID)
before creating connection. Otherwise NRPA used for active scan
could be used resulting in SMP confirmation failed due to invalid
initiator address being used.

Change-Id: I7201890ab9475ade3a825f9ea791a30af6b657a5
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-05-09 11:41:14 +02:00
Arkadiusz Lichwa
c8c078442f Bluetooth: shell: Add BR/EDR PSM server registration
Sets new command in BT shell app to allow register one BREDR PSM server.
Syntax:
>br-l2cap-register <PSM>

Change-Id: Iec6b1f5639d987b0f41b933ab894069fda5dfdc8
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-05-07 07:07:10 +00:00
Juan Manuel Cruz
8c1c45cfad event_logger: add arc support for sleep event
Jira: ZEP-53
Change-Id: I54e1a677a3d0cd5f08efefe45058115e79c062f9
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-05-06 18:52:45 +00:00
Anas Nashif
301572949a qemu: disable vga and avoid annoying warning message
supress warning message about missing rom file

qemu-system-i386: pci_add_option_rom: \
       failed to find romfile "vgabios-cirrus.bin"

Change-Id: I335369cf40b0891cbc96b4ff4d9e5e2f4740ee96
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-06 15:13:49 +00:00