Commit graph

41120 commits

Author SHA1 Message Date
Luiz Augusto von Dentz
ca9c8a2627 Bluetooth: ipsp: Remove requirements section
All supported driver are HCI based so there is no need have it state on
the README.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-07-17 17:45:46 +02:00
Andrew Boie
ebdcba7002 x86: linker.ld: support __kernel sections
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-07-15 12:17:54 -07:00
Andrew Boie
7ce3a79d80 toolchain.h: intoduce __kernel macros
In CONFIG_APPLICATION_MEMORY scenarios, these force
objects to be in kernel memory space.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-07-15 12:17:54 -07:00
Andrew Boie
2cb03c5cd6 toolchain.h: fix __in_section_unique()
_FILE_PATH_HASH appears to be a legacy Diab-ism that doesn't
expand to anything in GCC.

As a result, when linking the combined binary, it's quite
possible that objects in separate C files would be merged
instead of truly being in their own section. This can confound
--gc-sections and result in unused objects still being in
the final binary if one of the other objects with the same
generated section name was actually used.

We instead just use __FILE__. This results in sometimes absurdly-
long section names in the intermediate .o files, but there is no
actual limit to how long section names in ELF binaries can be;
they are not stored directly in headers but instead referenced
as an offset in the .shstrtab section, which has all the section
names stored in it.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-07-15 12:17:54 -07:00
Andrew Boie
08a9fcdb80 x86: ia32: set access based on linker regions
This will set program text and rodata as read-only even in
non-XIP systems.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-07-15 12:17:36 -07:00
Andrew Boie
bc6ad3cd82 x86: add MMU page alignment where necessary
Different areas of memory will need to have different access
policies programmed into the MMU. We introduce MMU page alignment
to the following areas:

- The boundaries of the image "ROM" area
- The beginning of RAM representing kernel datas/bss/nonit
- The beginning of RAM representing app datas/bss/noinit

Some old alignment directives that are no longer necessary have
been removed.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-07-15 12:17:36 -07:00
Andrew Boie
1cc35d601b x86: linker.ld: implement linker-defs.h changes
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-07-15 12:17:36 -07:00
Andrew Boie
efee38d458 linker-defs: add some new _image_* defines
1) start/end addresses for rodata
2) size of image ROM area
3) size of RAM (not including rodata/text) up to the limit of
   physical memory

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-07-15 12:17:36 -07:00
Carles Cufi
4e5757d2cc env: Remove usage of -P in grep
Since -P is not supported in non-GNU versions of grep, avoid using it
now that it is no longer required (no "|" operator anymore inside the
regex).

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-07-15 11:12:35 -07:00
Johann Fischer
a8d7659a63 samples: dfu: fix usb configuration descriptor length
The macros for calculating the length of the configuration
descriptors have been interchanged, fix it, and use the
correct macro for the length of the DFU mode configuration
descriptor.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-07-15 11:26:40 +03:00
Carles Cufi
35b34c2e65 Bluetooth: controller: Only add active slots to hw filter
When populating the hardware filter, add only slots that are marked as
taken to avoid the hardware being confused by all-0 addresses. This
solves an EBQ issue with whitelist filtering.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-07-14 22:11:40 +03:00
Carles Cufi
77b0108afd Bluetooth: controller: Avoid warning with privacy disabled
To avoid warnings (seen on some machines) that a function reaches its
end without returning a value, conditionally compile the function in a
way that this cannot happen.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-07-14 22:11:40 +03:00
Vinayak Kariappa Chettimada
52ee6622c0 Bluetooth: controller: Fix master terminate procedure
Fix master terminate procedure so that if slave responded to
the ack from master for the LL_TERMINATE_IND then the master
correctly disconnected.

This fixes TP/CON/MAS/BV-09-C [Master Accepting Termination]
in LL.TS.5.0.0.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Tested-by: Ulrich Myhre <ulmy@nordicsemi.no>
2017-07-14 22:11:25 +03:00
Vinayak Kariappa Chettimada
9fc4fefc47 Bluetooth: controller: Fix slave latency enable at conn setup
Fix implementation to maintain a connection in the slave
role not taking slave latency into use before receiving an
acknowledgement from the master.

This fixes TP/CON/ADV/BV-03-C [Master Missing Slave Packets]
in LL.TS.5.0.0.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Tested-by: Ulrich Myhre <ulmy@nordicsemi.no>
2017-07-14 22:11:25 +03:00
Marti Bolivar
3ac9ca0859 spi: dw: fix spi_dw_init()
It is incorrect to call spi_context_release() on a
spi_dw_data object's ctx field before data->ctx->config is first
set in spi_dw_configure(). This is because spi_context_release()
reads ctx->config->operation. In particular, during spi_dw_init(),
calling spi_context_release() reads the uninitialized memory in
spi->ctx->config->operation.

Call spi_context_unlock_unconditionally() instead to properly increase
the semaphore count.

Without this patch, the first call to spi_transceive() can block
forever depending on the value of the uninitialized memory holding
spi->ctx->config->operation.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-07-14 18:10:38 +03:00
Marti Bolivar
6318750837 spi: stm32: fix spi_stm32_init()
It is incorrect to call spi_context_release() on an STM32
spi_stm32_data object's ctx field before data->ctx->config is first
set in spi_stm32_configure(). This is because spi_context_release()
reads ctx->config->operation. In particular, during spi_stm32_init(),
calling spi_context_release() reads the uninitialized memory in
data->ctx->config->operation.

Call spi_context_unlock_unconditionally() instead to properly increase
the semaphore count.

Without this patch, the first call to spi_transceive() can block
forever depending on the value of the uninitialized memory holding
data->ctx->config->operation.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-07-14 18:10:38 +03:00
Marti Bolivar
d1fa43d99b dts: 96b_carbon: add flash partitions
Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-07-14 08:41:57 -05:00
Marti Bolivar
9f7f83d201 dts: 96b_nitrogen: add flash partitions
Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-07-14 08:41:57 -05:00
Marti Bolivar
f913639d00 dts: nrf52840_pca10056: add flash partitions
Analogously to the frdm_k64f, add flash partitions for the
nrf52840_pca10056.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-07-14 08:41:57 -05:00
Marti Bolivar
f58b36a65a dts: frdm_k64f: make application state partition a reserved area
A number of sectors are declared in the frdm_k64f flash partitions
node as part of an "application state" partition. Rather than require
users to treat this area of flash as a single partition, delete the
application-state node and leave a comment in its place describing its
purpose.

This enables use cases where the flash sectors must be split into
multiple partitions without defining overlapping partitions in overlay
files.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-07-14 08:41:57 -05:00
Marti Bolivar
0b92bbeaaa dts: move frdm_k64f flash partitions from SoC dtsi
Currently, flash partitions used by mcuboot are defined in the
SoC-level dtsi file for NXP K6X. This should be made more granular so
that product owners can choose partition layouts to suit their
needs. To that end, move the partitions into frdm_k64f.dts.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-07-14 08:41:57 -05:00
Kumar Gala
a9c92ffd9a dts: i2c: Add missing #address-cell & #size-cell properties
The I2C controller nodes are the root of the I2C bus for that controller
and thus may have children nodes that represent the I2C devices on that
controller.  Thus we need to specify the #address-cell & #size-cell
properties.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-07-14 08:40:44 -05:00
Nam Do
92dacb2a62 boards: arm: Add support for the VBLUno52 board
+ The VBLUno52 board
    nRF52832 ARM Cortex-M4F processor
    Bluetooth Low Energy 5.0
    DAPLink interface
    UNO pinout
    4 power

+ The following samples were tested:
    hello_world
    basic/button
    basic/blinky
    bluetooth/peripheral_hr
    bluetooth/beacon

Signed-off-by: Nam Do <robotden@gmail.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-07-14 08:40:44 -05:00
Gil Pitney
b70633b95f ext: simplelink: Update HAL for CC3220sf to version 1.40.00.03
The SimpleLink SDK provides a peripheral driver library and hardware
register access header files for the Texas Instruments SimpleLink
CC3220S and CC3220SF SoCs.

This patch updates the SDK version in Zephyr from 1.30.01.03
to 1.40.00.03.

The SDK can be downloaded from:

http://www.ti.com/tool/download/SIMPLELINK-CC3220-SDK

Jira: ZEP-1958

Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-07-14 08:40:44 -05:00
Justin Watson
8d012fcff5 arch: arm: Fixed SAM E70 UART DTS.
The DTS for the SAM E70 was missing UART4 definitions
in the fixup file.

Signed-off-by: Justin Watson <jwatson5@gmail.com>
2017-07-14 08:40:44 -05:00
Marcel Holtmann
cdeecb8db7 boards: arm: Add flash target for BLE Nano 2
Signed-off-by: Marcel Holtmann <marcel.holtmann@intel.com>
2017-07-14 14:54:52 +03:00
Marcel Holtmann
aefcf547ad Bluetooth: controller: Add skeleton for vendor HCI commands
Signed-off-by: Marcel Holtmann <marcel.holtmann@intel.com>
2017-07-14 14:54:52 +03:00
Carles Cufi
a8173b9033 Bluetooth: controller: Fix privacy whitelist allocation
Fix copy-paste issues when allocating devices in the privacy-enabled
whitelist.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-07-14 13:07:41 +02:00
Anas Nashif
7e61190d94 scripts: updated spelling.txt file
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-14 12:57:40 +03:00
Robert Chou
33c54ee6fd net: zoap: advance block context by checking M bit from block option
According to RFC7959 page 30, "The end of a block-wise transfer is
governed by the M bits in the Block options, _not_ by exhausting the
size estimates exchanges."

Therefore, we should check the M bit instead of total size (which
is not always available, too)

Signed-off-by: Robert Chou <robert.ch.chou@acer.com>
2017-07-14 11:06:54 +03:00
Vinayak Kariappa Chettimada
88dba0dd35 Bluetooth: controller: Fix cond. mayfly priority check
When the controller is configured to have its worker and job
be run at different interrupt priority, check for mayfly
priority being equal was incorrect.

Fixed by conditionally compiling the correct check of mayfly
priority level.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2017-07-14 10:01:15 +02:00
Vinayak Kariappa Chettimada
9dc7975b76 Bluetooth: controller: Fix to use correct anchor for scanner
Fixed a defect wherein anchor for first scanner event was in
the past (when looking for a free timeslice to avoid
overlapping with master role events) when actually there
were no master roles active. This defect caused the scanner
role to assert, when started with other roles active (eg.
advertiser), when trying to catch-up to current tick.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2017-07-14 09:23:28 +02:00
Vinayak Kariappa Chettimada
449295eee3 Bluetooth: controller: Revert fix for assert due to stale tick
This reverts commit 3c23c6f53d ("Bluetooth: controller:
Fix assert due to stale tick count") as this leads to
connection events to be skipped, failing conformance tests.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2017-07-14 09:23:28 +02:00
Vinayak Kariappa Chettimada
de6ed122a8 Bluetooth: controller: Revert fix for scanner Rx window hang
This reverts commit b5235207d3 ("Bluetooth: controller:
Fix for scanner Rx window hang") as this leads to
connection events to be skipped, failing conformance tests.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2017-07-14 09:23:28 +02:00
Jukka Rissanen
7474553543 net: Fix connectivity issues if only UDP or TCP is enabled
If either UDP or TCP is enabled but not both, then connectivity
fails. This was a side effect of commit 3604c391e ("net: udp:
Remove NET_UDP_HDR() macro and direct access to net_buf")

Jira: ZEP-2380

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-07-14 08:49:45 +03:00
Vinayak Kariappa Chettimada
f16f88555f scripts: Fix size_report to use correct objdump and nm
Commands for objdump and nm where hardcoded in size_report
script, which failed on MacOS as it tried to use ones from
Xcode. Fixed the script to pick the right objdump and nm
from the toolchain being used to build the application.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2017-07-13 14:27:49 -05:00
Kumar Gala
b8d7b4e0e1 scripts/extract_dts_includes: extract_reg_prop handle cells being 0
Its possible that #size-cells is 0 (ie i2c bus).  So we should handle
either #address-cells or #size-cells being 0 in extract_reg_prop.  This
means that the reg property in reduced map will end up being an integer,
so we need to convert it to a list with one element.  We also need to
not output any address-cell or size-cell related info if the respective
cell is 0.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-07-13 14:27:19 -05:00
Kumar Gala
e9ec91b7f2 ci: compliance: increase verbosity on gitlint
When we fail its nice to have more details in the CI logs about what
happened.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-07-13 13:04:49 -05:00
David B. Kinder
2c5b3c1605 doc: update source tree structure documentation
New top-level dts/ folder and description added.

Fixed error in bullet list in subsys/ description (needed
a blank like before the list.

Alphabetized folder list (subsys/ was listed after tests/)

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-07-13 10:09:55 -05:00
Jukka Rissanen
266792af9c net: ipv6: Fragmentation was accessing NULL pointer
When IPv6 fragments were sent, the last IPv6 fragmented packet
was accessing NULL pointer.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-07-13 15:45:35 +03:00
Vinayak Kariappa Chettimada
b07e7f2b5a Bluetooth: controller: Fix T_Terminate and other timeout calc.
Fix calculation of T_Terminate and other procedure timers by
using ceil on calculated connection interval units.

This fixes TP/CON/MAS/BI-02-C [Master T_Terminate Timer] and
TP/CON/SLA/BI-02-C [Slave T_Terminate Timer] in LL.TS.5.0.0.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Signed-off-by: Ulrich Solli Myhre <ulmy@nordicsemi.no>
2017-07-13 15:39:42 +03:00
Vinayak Kariappa Chettimada
2800961fe1 Bluetooth: controller: Fix supervision timeout countdown
Add missing supervision timeout countdown initiation on CRC
error.

This fixes TP/CON/ADV/BI-01-C [Connection Supervision
Timeout during Fail Connection Setup] and TP/CON/INI/BI-02-C
[Slave Packets Invalid CRC] in LL.TS.5.0.0.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Signed-off-by: Ulrich Solli Myhre <ulmy@nordicsemi.no>
2017-07-13 15:39:42 +03:00
Vinayak Kariappa Chettimada
97bfb1d9f4 Bluetooth: controller: Fix slave conn. failed to be established
Fix implementation so that both slave and master behave same
during connection setup and generate disconnection complete
with reason 0x3e (connection failed to be established).

This fixes TP/CON/ADV/BV-02-C [Accepting Connections
Timeout] in LL.TS.5.0.0.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Signed-off-by: Ulrich Solli Myhre <ulmy@nordicsemi.no>
2017-07-13 15:39:42 +03:00
Carles Cufi
6886f979cf Bluetooth: controller: Allow devices not in resolving list
Whenever not using the whitelist the resolving list is traversed to
verify that the device is allowed depending on its current privacy mode.
In the case where the device is not found by address in the resolving
list, allow the request to go through, since we are then dealing with an
unknown devices and the resolving list restrictions do not apply.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-07-13 14:07:27 +03:00
Carles Cufi
4666015323 Bluetooth: controller: Fix regression in WL filter population
Erroneous check conversion triggered a regression when populating the
whitelist filter.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-07-13 09:29:16 +02:00
Marti Bolivar
4995820acf dts: i2c: fix build issue by defaulting HAS_DTS_I2C to n
Commit 1bc2fdc70 ("dts: arm: STM32 boards use DT to configure I2C")
added a new Kconfig option, HAS_DTS_I2C, which should be set when the
target supports configuration of I2C peripherals via Device Tree.

Currently, STM32 targets select this. However, the fact that
HAS_DTS_I2C has no default is causing prompting when building Zephyr
on other targets with DTS. To avoid this and allow builds to complete
as usual, have HAS_DTS_I2C default to n.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-07-12 10:40:28 -05:00
Luiz Augusto von Dentz
16e6abbcfb Bluetooth: L2CAP: Don't reuse RX buffers to respond
This causes num of packets command handling to dead lock since it
is done on RX buffer destroy if used on TX it may not be destroyed
on time causing.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-07-12 17:37:45 +03:00
Luiz Augusto von Dentz
94409a14ae Bluetooth: ipsp: Disable debug options
This disable debug options in order for the image to fit in boards
such as arduino_101 and quark_se_c1000_devboard.

For convenience this adds another configuration file with as it was
available previously which can be build using:

make CONF_FILE=prj_dbg.conf

JIRA: ZEP-2378
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-07-12 17:37:45 +03:00
Carles Cufi
c9bd30aa90 Bluetooth: controller: Check AdvA in scan requests
The specification states that the AdvA in a Scan Request packet should
be identical to the one sent in the original advertising packet, so
check this when processing a Scan Request.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-07-12 14:53:29 +02:00
Carles Cufi
486dad9e4c Bluetooth: controller: Fix RL permission check
When the initiator is using an RPA and we match it using the filtering,
we should return early and allow the device packet through instead of
going through the whole resolving list.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-07-12 14:53:29 +02:00