Commit graph

42249 commits

Author SHA1 Message Date
Mariusz Skamra
5b58da915e Bluetooth: Extend BTP specification to cover GATT Client tests
This patch extends Bluetooth Testing Protocol with commands used
while testing IUT as GATT client.

Commands are mapped to the procedures from Core Specification to make
use of Read Supported Commands command. Based on the response to this
command tester can determine which PTS test cases should be enabled.
If the IUT don't support eg. Reliable Writes, this command won't be
set in Read Supported Commands response, so that test cases that
test this functionality won't be executed.

Change-Id: I204a295698d4b69f73d0556b172770c4fd018009
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:24:50 -05:00
Arkadiusz Lichwa
ffda52a7cd Bluetooth: BR/EDR: Get max ACL packet length
Uses dedicated initializing routine to start getting controller's
internal buffer capabilities. At first initialize ACL packet length
(MTU) with max value controller can accept.

Change-Id: If90dd16ebb5c0751fb65555b06c9fb18ed394a54
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-02-05 20:24:50 -05:00
Arkadiusz Lichwa
0c3c6ddd90 Bluetooth: BR/EDR: Make room for controller internals
Defines instance for controller specific information.
Prepare room for max ACL packet length controller can get.

Change-Id: I5fb5f83b3f7383337b6b86683dff05b675815b98
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-02-05 20:24:50 -05:00
Arkadiusz Lichwa
a34d114085 Bluetooth: Refactor init LE ACL Tx semaphore
Moves initialization of bt_dev.le.pkts_sem object to handlers reading
controller buffer capabilities. Therefore no need to keep anymore
bt_dev.le.pkts member.

Change-Id: I126cb1d9ad9feed9c11f35b26c44055075734685
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-02-05 20:24:50 -05:00
Mariusz Skamra
05426296ee Bluetooth: tester: Fix invalid type of buffer length
Buffer size is 512, so uint16 type shall be used to store it's length.

Change-Id: I5abaf7d783032ff41819f7b838d4016932dece20
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:24:50 -05:00
Mariusz Skamra
f47b828be7 Bluetooth: tester: Factor out helper for converting uuid to bt_uuid
This patch separates helper for converting uuid received from btp
command to bt_uuid.

Change-Id: If7f5423a839379763928ba5e87678697b1721d83
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:24:50 -05:00
Szymon Janc
a204dd7bc3 Bluetooth: SMP: Reduce stack usage of cmac_subkey
This removes extra zero buffer and reuses l as initial zero buffer.
This reduces stack usage from:
rx stack (real size 1024):      unused 96     usage 896 / 992 (90 %)
to
rx stack (real size 1024):      unused 112    usage 880 / 992 (88 %)
when using LE SC.

Change-Id: I961e4270f7b86b6d2615e23d6ace9cc81026eaf7
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:24:50 -05:00
Szymon Janc
1e67671152 Bluetooth: SMP: Reduce rx fiber stack usage
Mark constants used in crypto as static const. This reduced stack
usage from:
rx stack (real size 1024):      unused 20     usage 972 / 992 (97 %)
to
rx stack (real size 1024):      unused 96     usage 896 / 992 (90 %)
when using LE SC.

Change-Id: Iac39ccb91cc94508fa36243d477f6df787250527
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:24:50 -05:00
Szymon Janc
33530ad054 Bluetooth: SMP: Make order of swap_buf parameters natural
Follow unix convention of foo(dst, src, len). This makes code
easier to read.

Change-Id: I1f8a2638e87d060dcf84f5a7074e0b734d4ea4f0
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:24:50 -05:00
Szymon Janc
d6894af702 Bluetooth: Allow to re-encrypt link with LE SC key
If P256 key is present use it to start encryption instead of starting
new pairing.

Change-Id: I7c8541359a785e6e22e63cdab5a92a402db83db3
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:24:49 -05:00
Szymon Janc
b036f916ce Bluetooth: Add LE SC keys support to LTK request event
If LE SC P256 key is available use it to encrypt link.

Change-Id: I21790d6641748f34aba4058beb424bd56793713c
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:24:49 -05:00
Szymon Janc
1ec6ba6d83 Bluetooth: SMP: Add LE SC smp_f6 init test
This run smp_f6 function with test vectors from Core Specification 4.2.

Change-Id: I6a29be3c8f90ca787d90c957cb6667853e823002
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:24:49 -05:00
Szymon Janc
f0c84eb756 Bluetooth: SMP: Add support for DHKey check
This implements LE SC f6 function use to calculate DH Key checks
values. Calculated value is compared to value received from remote
party and if match encryption is enabled.

Change-Id: Iee66cbd19c0aa6d83edc6482dfb87943e4e45069
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:24:49 -05:00
Szymon Janc
176ea6af6b Bluetooth: SMP: Generate DHKey on remote public key reception
When remote Public Key is received issue HCI command to calculate
DH Key.

Change-Id: I46ce03d6a8aafebaad2656ccf66cbb636ceb748a
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:24:49 -05:00
Szymon Janc
b1a1197d8c Bluetooth: SMP: Add LE SC smp_f5 init test
This run smp_f5 function with test vectors from Core Specification 4.2.

Change-Id: I1ef0ddf54c058bd7a9b7cc635fd785267a1bafd8
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:24:49 -05:00
Szymon Janc
5c97a0678c Bluetooth: SMP: Calculate LTK and MacKey for LE SC
This implementes f5 function and use it to generate LTK and
MacKey.

Change-Id: I86d9a958d5009796ea04f2447e1bad9eb63981ce
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:24:49 -05:00
Szymon Janc
41187cee88 Bluetooth: SMP: Add random PDU handling in LE SC
Allows to verify remote confirmation number.

Change-Id: I964533ce29e3a2862361642d43ee9dee4b204b11
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:24:49 -05:00
Szymon Janc
ce246c1289 Bluetooth: SMP: Add LE SC smp_f4 init test
This run smp_f4 function with test vectors from Core Specification 4.2.

Change-Id: If083d8c9c81b98af97ed900db2004482b3e886e3
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:24:49 -05:00
Szymon Janc
2eada0eb3c Bluetooth: SMP: Add initial bits of LE SC support
This adds initial pieces for LE SC support including pairing method
selection, authentication field updates, confirmation generation and
public key sending.

Change-Id: I91dcd0058c8f45ea19df89c2336142d927b08235
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:24:49 -05:00
Szymon Janc
c09e3123d7 Bluetooth: SMP: Move bt_smp_aes_cmac code up
This will be used for LE SC support.

Change-Id: I43aff863bb3ffe1d326858011f471b1c781859f7
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:24:49 -05:00
Szymon Janc
7426de527f Bluetooth: Read LE Local P-256 Public Key on init
This is needed for LE Secure Connection when tinycrypt is not used.

Change-Id: Ia0419da882d48d9d298b6674803b2e4987e6aa0c
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:24:49 -05:00
Johan Hedberg
463dba22f3 Bluetooth: Kconfig: Be consistent with terminology
We don't use "Bluetooth Smart" anywhere, so we shouldn't use
"Bluetooth Classic" either. Instead, stick to the more technical "LE"
and "BR/EDR" terms.

Change-Id: Iadfc1c090205e0f417081d63ebe43172c5708a18
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:24:49 -05:00
Mariusz Skamra
8dc991855e Bluetooth: tester: Response with error while writting with invalid offset
IUT shall response with Invalid Offset ATT error code, if it exceeds
value length.

Change-Id: I5c7148c96324482f198332d475742bfb44274957
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:24:49 -05:00
Arkadiusz Lichwa
e2f04214b5 Bluetooth: Kconfig: Make BLUETOOTH_DEBUG as common for LE & BR/EDR
Indicate to the user that the debug support is no longer LE-specific
but generic for Bluetooth subsystem.

Change-Id: I1a1c39fd03bf857ba673fbb5d15fa50ffba02afa
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-02-05 20:24:49 -05:00
Szymon Janc
ea8654d956 Bluetooth: Add support for LE Secure Connections LTK
This allows to store LE SC keys. Since LE SC and legacy
pairing are mutually exlusive there is no need for additional
storage space as keys.ltk can be used for it.

Change-Id: I784e670684e9047b4b90b8cb8505d9b581c47b50
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:24:49 -05:00
Szymon Janc
057f069734 Bluetooth: SMP: Add defines for LE Secure Connections
Change-Id: I94c31bc4656bc261892dbac4341f13a706594c2f
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:24:49 -05:00
Ruslan Mstoi
36b02569e3 Bluetooth: Remove wrong information about the LSB of opcode
The least significant bit of opcode is not used to distinguish between
command/response or events.

Change-Id: Icaa1b6d87968e095a7f231d43e74257f5acca379
Signed-off-by: Ruslan Mstoi <ruslan.mstoi@intel.com>
2016-02-05 20:24:49 -05:00
Mariusz Skamra
93adf39864 Bluetooth: tester: Remove not needed status variable
Change-Id: I3f91f5f5bd40912fee2095af340303203807cc11
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:24:49 -05:00
Anas Nashif
0c22192c3f quark se: add sensor subsystem platform to sanity
Run sanity for this platform

Change-Id: Ic317c63d720a420d3d02e382e17742dec8d08e07
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:49 -05:00
Anas Nashif
c34da1576c sanity: add Quark D2000 and Quark SE
Change-Id: I06494a5a0a3697b6ce9224f7f5c1a86052898b9d
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:49 -05:00
Anas Nashif
62f54743cf sanitychecks: run test_bluetooth only on supported platforms
Change-Id: I986dda905692f6e9ed23dd3371f9d41b78b4478e
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:49 -05:00
Anas Nashif
beb160d22c sanity: make boot_time test work for Quark SE and D2000
Add configuration files for new platform and adapt options
of the benchmarks for those platforms.

Change-Id: I7c5011966c3a99f0b1c2c3fc44ba05b67ac6f953
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:49 -05:00
Anas Nashif
b48e6b8a65 quark se: do not run test_prng on Quark SE
This test requires a huge stack and wont fit on Quark SE.

Generated binary is too large due to a large stack size defined.

Change-Id: I3446d614a58db1ab78941799ee41e898368db3b5
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:49 -05:00
Anas Nashif
c7eecba078 ipi: disable on footprint benchmarks
Change-Id: Ia90fabfe41414381b79b70e34bc12bd023d68ca7
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:49 -05:00
Anas Nashif
9c9fe856bd samples: disable kernel logger sample on Quark D2000
This sample depends on functions that are not available in
the MVIC driver.

Disabling while we wait for those to be implemented.

Change-Id: Icd03ef014cbcd890945c0e77e349cccfded62e22
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:49 -05:00
Dirk Brandewie
1e9992c4fb x86: reduce fiber stacksize for Quark D2000
This will allow tests to be built for this platform.

Change-Id: I2275ec71af6cdb6f71c131fa26c5eae2d91c2475
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:24:49 -05:00
Anas Nashif
42d94e5dbe x86: Add Quark D2000 platform with nanokernel support
The Intel Quark microcontroller D2000, is a low power, battery-operated,
32-bit microcontroller.  Within its small footprint, the Intel Quark
microcontroller D2000 includes an Intel Quark ultra-low-power core
running at 32 MHz, with 32k integrated flash and 8k OTP SRAM.

Change-Id: I6ba121996edb0b5fbe596bd6ef3d6e3979ff73e9
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:49 -05:00
Anas Nashif
ac1f343c9a timer: Support for no local Apic Timer divider
Change-Id: Ic9c167761e31233e821da364121c01f3971a8f13
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:48 -05:00
Anas Nashif
7625b098b9 MVIC: handle boards with fixed IRQ to vector mapping
Change-Id: I319bc2a18310a6a6808fced3e142640e225236d2
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:48 -05:00
Anas Nashif
00c4d32d42 x86: add Quark D2000 Interrupt Controller (MVIC)
This module is based on the standard Local APIC and IO APIC source modules.

This modules combines these modules into one source module that exports the
same APIs defined by the Local APIC and IO APIC header modules. These
routine have been adapted for the Quark D2000 Interrupt Controller which has
a cutdown implementation of the Local APIC & IO APIC register sets.

Change-Id: Ic80aa78918483663d76054ebadefa08d8a3f188a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:48 -05:00
Anas Nashif
b0b936b51c arc: add Quark SE Sensor Subsystem nanokernel support
Change-Id: I8178076e9f8bf98c3149f3622aa2236070446c62
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:48 -05:00
Juan Manuel Cruz
59cb73520a gpio: adds gpio dw register support for ss quark se
Adds the register definition for the DW GPIO hardware block.
This set of registers and offsets are specific for the SS
GPIO hardware block in the Quark SE platform.
In particular, the register BOTHEDGE (offset 0x68 in the
main GPIO block) does not exist on the SS GPIO block.

Change-Id: I4e16ec7c8e89015be1fc8bcdb1b7fa5377890b9d
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:24:48 -05:00
Daniel Leung
c6d527bc4b i2c: Add I2C driver for Quark SE Sensor Subsystem
This adds the I2C driver for the Sensor Subsystem on Quark SE.
This provides minimal support for the I2C controller, and does
only synchronous transfer at the moment.

Change-Id: I400b8ff3390d4b641bed5b8c617830c4217de3ff
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:24:48 -05:00
Anas Nashif
28af1ee421 Move RAM and NSIM option to architecture level
Change-Id: Ic47e263bebe4bc2fecb233856ddd1f5de85c11d8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:48 -05:00
Anas Nashif
401c4da142 kconfig: do not set default for frequency
Force setting the value in the platform kconfig instead of defaulting
to 0.

Change-Id: Iceeb6346afc4217dd09d31c28898e3693b08f781
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:48 -05:00
Anas Nashif
226404c4bf x86: go back to integers for ram/rom size
This cause problems with some configurations using hex.

Change-Id: I680c40d46e1fdf3da714f6412c8dda0e1ebb44f9
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:48 -05:00
Anas Nashif
4a4de7069e x86: add support for the Quark SE platform
Intel Quark SE Microcontroller with an onboard sensor subsystem.

Processor
* Intel Quark SE Processor Core
* Intel Pentium® Processor-based x86 ISA compatible CPU
* 32MHz clock, 32-bit address bus
* 8kB 2-way L1 instruction cache
Memory
* 384kB of on-die NVM +8kB OTP on-die NVM
* 80kB of on-die SRAM

Change-Id: I849ec5c1f1639e10a48c9ebab7d3653b88b23eb7
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:48 -05:00
Anas Nashif
98beac134e add physical RAM address variable
Keep things consistent across all platforms and make this
configurable and avoid hardcoding in linker.cmd file.

Change-Id: Iddeb5107854139249fda70378e07b83066d8a7a1
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:48 -05:00
Juan Manuel Cruz
a24b7a8895 adc: add DesignWare ADC driver
This commit adds the Synopsys source code for the arc ADC driver.

Change-Id: I140a63505685cda8ec9d3174b7cf4fc1e2e91b06
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:24:48 -05:00
Daniel Leung
a789cc0c02 aio: introduce DesignWare AIO/Comparator driver
This adds the driver to support DesignWare AIO/Comparator
under drivers/aio.

Change-Id: Id6cb1b507c0526098f163f74c188e990590797c2
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:48 -05:00