Commit graph

41120 commits

Author SHA1 Message Date
Georgij Cernysiov
3de55daab1 drivers: serial: stm32: remove forced RXNE clearance
Removed RXNE clearance. RXNE is cleared upon reading DR|RDR register.

Signed-off-by: Georgij Cernysiov <g.cernysiov@elco-automation.de>
2019-04-17 15:51:43 -05:00
Karsten Koenig
c9090caad7 drivers: can: mcp2515: Fixes for DT SPI cs
Fixed using chipselect with seperate chipselect GPIOs and how they were
referenced from/in DeviceTree.
Also configure the device during initialization so it's ready to go
after init.

Signed-off-by: Karsten Koenig <karsten.koenig.030@gmail.com>
2019-04-17 16:12:30 -04:00
Karsten Koenig
bf52bfea90 samples: can: Added project configuration for MCP2515
Project configuration to run the CAN sample with the MCP2515 attached
via SPI as the CAN controller.

Signed-off-by: Karsten Koenig <karsten.koenig.030@gmail.com>
2019-04-17 16:12:30 -04:00
Karsten Koenig
4f7761047b drivers: can: mcp2515: Rework for DTS SPI bindings
Adjusted the MCP2515 driver to switch from KConfig SPI configuration to
DTS based configuration.

Signed-off-by: Karsten Koenig <karsten.koenig.030@gmail.com>
2019-04-17 16:12:30 -04:00
Karsten Koenig
35b9308488 drivers: can: mcp2515: Add driver for MCP2515 CAN controller
The MCP2515 is a CAN controller that can be connected via SPI to an
host MCU. This driver adds support for the MCP2515 as a new driver in
the CAN subsystem.
As it is a SPI peripheral it uses a thread for its interrupt
handling and the received message filtering is done inside this
interrupt thread, as the MCP2515 filter capabilities are not sufficient
for the Zephyr CAN interface.
The driver was validated with an external CAN logger and the adjusted
CAN sample application.

Signed-off-by: Karsten Koenig <karsten.koenig.030@gmail.com>
2019-04-17 16:12:30 -04:00
Ioannis Glaropoulos
b8774ae8f6 CODEOWNERS: code-owner for SAM3X
Adding Code-Owner for Atmel SAM3X SOC (Cortex-M3).

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-04-17 15:03:32 -04:00
Ioannis Glaropoulos
51a563dc7d soc: arm: sam3x: add MPU capability
Add Memory Protection (MPU) capability to the Atmel SAM3X SoC.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-04-17 15:03:32 -04:00
Kumar Gala
f92abffe5f ieee802154_kw41z: Fix build error with SYS_LOG_INFO
The following fix:

commit c8b17ec403
Author: Tobias Aschenbrenner <tobias.aschenbrenner@blik.io>
Date:   Tue Dec 18 14:16:00 2018 +0100

    fix: kw41z: Use correct mapping for dBm

Was using SYS_LOG_INFO and should be using LOG_INFO.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-04-17 13:46:07 -05:00
Charles E. Youse
e039053546 uart/ns16550, drivers/pcie: add PCI(e) support
A parallel PCI implementation ("pcie") is added with features for PCIe.
In particular, message-signaled interrupts (MSI) are supported, which
are essential to the use of any non-trivial PCIe device.

The NS16550 UART driver is modified to use pcie.

pcie is a complete replacement for the old PCI support ("pci"). It is
smaller, by an order of magnitude, and cleaner. Both pci and pcie can
(and do) coexist in the same builds, but the intent is to rework any
existing drivers that depend on pci and ultimately remove pci entirely.

This patch is large, but things in mirror are smaller than they appear.
Most of the modified files are configuration-related, and are changed
only slightly to accommodate the modified UART driver.

Deficiencies:

64-bit support is minimal. The code works fine with 64-bit capable
devices, but will not cooperate with MMIO regions (or MSI targets) that
have high bits set. This is not needed on any current boards, and is
unlikely to be needed in the future. Only superficial changes would
be required if we change our minds.

The method specifying PCI endpoints in devicetree is somewhat kludgey.
The "right" way would be to hang PCI devices off a topological tree;
while this would be more aesthetically pleasing, I don't think it's
worth the effort, given our non-standard use of devicetree.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-04-17 10:50:05 -07:00
Andrew Boie
4cf4040af0 arc: print human-readable exception info
Right now only numerical values are printed which must
be looked up in the Designware ARCv2 ISA Programmer's
Reference, which is not public.

Add a non-default Kconfig to print more information at
the expense of footprint, and enable it for all the simulator
targets.

We only print code/parameter details for machine check and
protection violations, more may be added later as desired.
This should cover all the exceptions we commonly encounter
for memory protection.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-04-17 09:16:27 -07:00
Henrik Brix Andersen
36ff55cba0 gpio: rv32m1: enable GPIO port clocks
Enable the clock for GPIO ports on the RV32M1 SoC before attempting to
access the port controller registers.

Fixes: #15339

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2019-04-17 10:40:37 -05:00
Patrik Flykt
3e798dfd88 net: ethernet: Send sender IP address in ARP announce packets
In addition to checking that the ARP entry does not exist as the
implementation is done currently, also check if the ARP packet
is due to IPv4 link local address configuration. In both cases
use the provided IPv4 address instead of the one set for the
interface.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2019-04-17 10:38:49 -05:00
Patrik Flykt
7e14cff8d7 net: ethernet: Set NET_ETH_PTYPE_ARP for IPv4 link local packet type
IPv4 link local uses ARP to detect conflicting addresses. Properly
set the ethernet packet type to NET_ETH_PTYPE_ARP when probing
for address duplicates.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2019-04-17 10:38:49 -05:00
Georgij Cernysiov
a3ec56c1ba drivers: counter: stm32: fix LSE clock source for not F4 SoC
Fixes the STM32 counter driver when LSE is the clock source
and SoC is not F4.

Signed-off-by: Georgij Cernysiov <g.cernysiov@elco-automation.de>
2019-04-17 10:38:04 -05:00
Patrik Flykt
91ca8aabc8 net/ip/dhcpv4: Set source IP address in DHCP Request
The source address in unicast DHCPv4 Request packets was found out
to be all zeros address 0.0.0.0. This address is only acceptable if
the destination is a multicast one, where the host in question is
acquiring a DHCP address lease. This is true for the DHCP Discover
and the initial DHCP Request message from the client towards the
server. As subsequent DHCP Request renewal messages are sent as
unicast to the server, the server will drop such packets.

Fix this issue by explicitely specifying what source IP address is
to be used, if none is specified, the all zeros address 0.0.0.0 is
used in multicast addresses. The source address in the other
unicast cases is identical to the 'ciaddr' in the DHCP message.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2019-04-17 10:35:38 -05:00
Marcin Szymczyk
fa0083ad0e cmake: fix support for out of tree shields
After the rework in #12403, specifying a shield which has overlay
out of the tree causes unnecessary inclusions of overlays.
For every board root, overlays that have same index as
expected overlay are being included.
Fix this by removing already included overlays from SHIELD list.

Signed-off-by: Marcin Szymczyk <Marcin.Szymczyk@nordicsemi.no>
2019-04-17 10:35:11 -05:00
Tomasz Gorochowik
a000ba797c drivers: eth: gmac: Fix MAC address info log
Each MAC byte should be printed with the %02x format.

Signed-off-by: Tomasz Gorochowik <tgorochowik@antmicro.com>
2019-04-17 10:34:22 -05:00
Krzysztof Chruscinski
3a6c786c56 drivers: counter: nrfx_rtc: Fix lack of interrupt when CC=0
According to documentation Compare event will not be triggered
if CC=0 and CLEAR task is set. Added handling of that situation.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-04-17 10:32:15 -05:00
Krzysztof Chruscinski
431c450a42 drivers: clock_control: nrf: Fix lfclk source settings for nrf9160
Aligned lfclk source values for nrf9160.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-04-17 10:31:06 -05:00
Derek Hageman
a17730da18 soc: sam0: Fix SAMD20 IRQ assignments
SAMD20 does not have the DMA or USB peripherals and as a result
the IRQs for all subsequent lines are shifted down from SAMD21.
This splits the interrupt assignment for the SERCOMs into the
SoC specific DTS file and moves the USB definition to SAMD21 only.

Signed-off-by: Derek Hageman <hageman@inthat.cloud>
2019-04-17 10:26:36 -05:00
Tobias Aschenbrenner
c8b17ec403 fix: kw41z: Use correct mapping for dBm
The radio API expects the setting of the TX-power in dBm. The actual
TX-power is however set by a 6bit register, which mapping between
register value and power in dBm is a lookup-table in the datasheet.

This mapping for the kw41z was off, which not only lead to incorrect
output power, but also to a maximal output power of only -1.9 dBm
instead of the possible +3.5 dBm.

Signed-off-by: Tobias Aschenbrenner <tobias.aschenbrenner@blik.io>
Signed-off-by: Franco Saworski <f.saworski@posteo.de>
2019-04-17 10:26:19 -05:00
Loic Poulain
14aa624c6b ext: mcux: csi: Fix wrong circular queue delta calculation
This error causes various instabilities during capture.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2019-04-17 10:23:56 -05:00
Josef Gajdusek
f01a7250f0 drivers: usb_dc_stm32: Reinitialize the write semaphores on bus reset
If the user attempts to send data before the USB connection is
established (see the HID sample for an example of such code), the
DataInCallback never gets called which leaves the write semaphore in a
taken state forever.

Signed-off-by: Josef Gajdusek <atx@atx.name>
2019-04-17 09:58:09 -05:00
Josef Gajdusek
29ffcae80c drivers: usb_dc_stm32: Make pin remapping part of the device tree
The SYSCFG_CFGR1_PA11_PA12_RMP define is present even on packages where
the remap isn't strictly required. This commit makes the remap optional
based on a DT property.

Also fixes syntax error caused by a missing );.

Signed-off-by: Josef Gajdusek <atx@atx.name>
2019-04-17 09:58:09 -05:00
Jukka Rissanen
6bf369f306 tests: net: pkt: Verify that net_pkt_write() writes correct data
Write the net_pkt using net_pkt_write() and then verify that the
data is actually written into net_buf.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-04-17 10:50:09 -04:00
Carles Cufi
b7c75915e0 west: build: Add new pristine cmd-line and config option
Add a new command-line and build config option, `pristine`, that the
user can pass to `west build` or set in its configuration file(s) in
order to automatically trigger a pristine build on every build or
whenever west considers it required.

The option can take the following values:

- never: Never run the target
- always: Always run the pristine target before building
- auto: Run the pristine target when required

With `auto`, the pristine target will be run when running
west with an existing build folder containing a build system and:

- Selecting a different board from the one currently in the build system
- Selecting a different application from the one currently in the build
  system

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-04-17 10:02:46 -04:00
Carles Cufi
3c6584d6d5 west: build: Use officially documented CMake options
The -B option has always existed but was first officially documented in
CMake 3.13.0. In that same release the -S option was introduced,
replacing the old undocumented -H. Switch to using the officially
documented options.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-04-17 10:02:46 -04:00
Anas Nashif
22a624a81e ci: only build on specified branches
Do not start CI on random branches created in the tree.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-04-17 09:53:31 -04:00
Alberto Escolar Piedras
0eec5dba53 doc: labels: Add links to feature process
Added a few links in the labels description section
to the feature process section.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2019-04-17 09:39:44 -04:00
Brett Witherspoon
88a1fd7dd9 net: fix errno returned without promiscuous mode support
If promiscuous mode support is disabled in Kconfig and promiscuous.h is
included the build will fail. The returned errno should be ENOTSUP.

Signed-off-by: Brett Witherspoon <spoonb@cdspooner.com>
2019-04-17 15:39:04 +03:00
Marc Herbert
39131dc3ce git.cmake: let the environment override BUILD_VERSION
This is needed to remove noise when comparing binaries across git
commits and more generally for anyone who wants to manual
control/override the version number when building with or without a
.git/ subdirectory.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2019-04-17 08:30:41 -04:00
Marc Herbert
0f7255c3b8 sanitycheck: order results.csv and discards.csv deterministically
One of the first things needed when comparing builds of tests across
different environments/systems is to make sure the same (sub)tests were
selected and run in the first place. For that purpose sort the output of
--testcase-report and --discard-report as they were in random order.

Actually make the entire class TestInstance sortable by adding a
standard __lt__() method comparing unique instance names; it could be
useful again.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2019-04-17 08:28:54 -04:00
Marc Herbert
f098b44a1a cmake: atomic rename to fix toolchain cache creation race
While this race seems unlikely and harmless let's play it safe and
implement the usual solution: temporary file + atomic rename.

The race is unlikely and maybe even harmless because:

- Only sanitycheck seems to invoke cmake concurrently.
- Users rarely delete their ~/.cache/zephyr/ToolchainCapabilityDatabase/
- All concurrent cmake processes write the same, single byte to the same
  files.
- Creating a single byte is at least very fast, so extremely short
  window for others to read an empty file.

For additional background see links in issue #9992

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2019-04-17 08:28:24 -04:00
Marc Herbert
3061c92aaf file2hex.py: new --gzip-mtime option that defaults to zero + test
This makes the output of file2hex.py deterministic by default while also
letting the user set the mtime in the gzip header manually if desired.

Use the option without any argument to restore the previous behavior
that sets the current (and obviously changing) "now" timestamp.

To test:  ./sanitycheck --tag gen_inc_file

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2019-04-17 08:27:40 -04:00
Marc Herbert
28a5657f1f cmake: zephyr_cc_option(-fmacro-prefix-map=${ZEPHYR_BASE}=.)
If the compiler supports it, strip the ${ZEPHYR_BASE} prefix from the
__FILE__ macro used in __ASSERT* macros, in the
.noinit."/home/joe/zephyr/fu/bar.c" section names and in any application
code. This saves some memory, stops leaking user locations in binaries,
makes failure logs more deterministic and most importantly makes builds
more deterministic.

- .noinit section names now look like this in objdump -h:

 17 .noinit."./kernel/init.c".2 00001100  00000000  ...

 18 .noinit."./kernel/init.c".1 00001200  00000000  ...

 19 .noinit."./kernel/init.c".3 00001800  00000000  ...

- The output of __ASSERT* macros now looks like this:

  ASSERTION FAIL [0] @ ./samples/hello_world/src/main.c:13
    The world comes crashing down
  ***** Kernel Panic! *****
  Current thread ID = 0x00400040

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2019-04-17 08:08:14 -04:00
Vikrant More
47b7c79e39 samples: mesh: enable SMP service for DFU
This commit enable Bluetooth SMP Service which will help
us to do Device Firmware Upgrade over thr air. By default
it is not enable.

Reference: $zephyr/samples/subsys/mgmt/mcumgr/smp_svr

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2019-04-17 10:19:16 +03:00
Reham Tarek
a1d69fb725 Bluetooth: Mesh: AES-CCM: Fix output MIC with additional data
General MIC fix for AAD lengths up to 14 bytes.
This case doesn't concern the mesh stack because it uses 16 bytes.

Signed-off-by: Reham Tarek <reham.tarek@si-vision.com>
2019-04-17 10:08:03 +03:00
Marek Pieta
321fec4a38 bluetooth: hci_core: Remove misleading log
Changed misleading log of all stack sizes.
Only leaving stacks from hci_core.c file.

Signed-off-by: Marek Pieta <Marek.Pieta@nordicsemi.no>
2019-04-17 10:06:04 +03:00
Luiz Augusto von Dentz
951822391d Bluetooth: GATT: Store database hash
This stores the database hash and check if it has changed on commit
skipping service changed if hash matches.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-04-17 10:05:19 +03:00
Luiz Augusto von Dentz
f7b4069ac2 Bluetooth: Settings: Fix not allowing custom handlers without arguments
Custom handlers without any arguments don't since there is a check for
argc > 1, to fix this behavior removing the check.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-04-17 10:05:19 +03:00
Luiz Augusto von Dentz
755a6e503e Bluetooth: GATT: Fix iterating over requested handle range
If handle is over the range end return since handles are always placed
in ascending order.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-04-17 10:05:19 +03:00
Luiz Augusto von Dentz
4154f27ab5 Bluetooth: GATT: Skip ahead if handle is not within service handles
This reduces bt_gatt_foreach_attr complexity (O(n)) so it can skip
ahead when the start handle is not within its service handles.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-04-17 10:05:19 +03:00
Johan Hedberg
1a3d9fa0ba Bluetooth: Mesh: Add error checks for scan start/stop
It may be very important information for the developer if scanning
fails to start or stop, so add proper logs. There's no need to log
EALREADY errors, since the mesh stack doesn't track the current scan
state and simply relies on the under lying GAP layer to return this
error if the desired state is already set.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-04-17 09:59:04 +03:00
Kamil Piszczek
da4e3cad7a Bluetooth: hci: adding AD types used for OOB pairing
Added new AD Types that can be used to encode the OOB data.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2019-04-17 09:54:37 +03:00
Bradley Bolen
4198ba71f2 cmake: Fix missing dependency
DRV_VALIDATION should depend on any changes to the tool that generates
it, gen_kobject_list.py.

Signed-off-by: Bradley Bolen <bbolen@lexmark.com>
2019-04-16 22:53:49 -04:00
David B. Kinder
9d04f03bab doc: add missing doc top labels
All docs should have a label at the top that would
permit cross-document linking via :ref:`labelname`.

Update "testing" label that would have conflicted and fix the only
reference to the old "testing" label in development process
documentation.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-04-16 18:11:30 -04:00
Kumar Gala
f90acbf2ba release: Post-release patch level update
Set patch level correctly.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-04-16 15:50:31 -05:00
Kumar Gala
cebe11544e release: Zephyr 1.14.0
Bump version to 1.14.0 final.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-04-16 15:50:24 -05:00
Kumar Gala
cdf55d813b doc: changes for 1.14 documentaiton release
Doc changes listed in the release checklist (#9898)

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-04-16 14:48:23 -05:00
Wayne Ren
0e4d4fa67f include/linker: .object_access.* should be in ROM
.object_access.* sections should be with

GROUP_LINK_IN(ROMABLE_REGION) as other sections in
common-rom.ld

Fixes #15481

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-04-16 13:32:20 -05:00