Commit graph

41120 commits

Author SHA1 Message Date
Ulf Magnusson
53376394b7 kconfig: Remove blank lines at the beginning/end of files
Maybe this is some "just in case" thing that got copied around. There's
no need to have a blank line at the beginning or end of Kconfig files.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-03-13 07:29:42 -05:00
Kumar Gala
7aa8e43add libc: newlib: Cleanup/fix setting of system include paths
When we build with newlib we don't set -nostdinc.  In that case make
sure that we leave it to the toolchain to set the system include paths.

The one exception to leaving to the toolchain to set the system include
paths is the path to the newlib headers.  Since we build
with -ffreestanding we need to make sure the newlib header path is the
before the toolchain headers. Otherwise the toolchain's 'freestanding'
headers get picked up and that causes issues (for example getting PRI*64
defined properly from inttypes.h due to __STDC_HOSTED__ being '0').

For newlib we accomplish this by having the only system header specified
by zephyr_system_include_directories() being just the newlib headers.

Note: for minlibc we leave things alone as things just happen to work as
the -I include of the libc headers takes precedence over -isystem so we
get the libc headers over the toolchain ones.  For the newlib case it
appears that setting both -I and -isystem for the same dir causes the
-I to be ignored.

Fixes #14310

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-03-13 06:50:23 -05:00
Maureen Helm
54ae600cde boards: mimxrt1064_evk: Enable mcux elcdif driver and pins
Enables the mcux elcdif shim driver and pin muxes on the mimxrt1064_evk
board. Configures lvgl defaults accordingly.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-03-13 06:02:42 -05:00
Maureen Helm
f8c4808d96 boards: mimxrt10{50,60}_evk: Set lvgl defaults in board defconfigs
Configure lvgl defaults for imx rt boards in their respective board
defconfigs rather than the lvgl sample application.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-03-13 06:02:42 -05:00
Yong Jin
4ce6b69093 boards: stm32f769i_disco: supports ethernet
add support ethernet for the stm32f769i_disco borad.

Signed-off-by: Yong Jin <jinyong.iot@foxmail.com>
2019-03-13 06:01:48 -05:00
Tomasz Gorochowik
f6a95a02ed drivers: eth: gmac: fix qav bandwidth sharing issues
Removing the TX timeout handling in the GMAC driver (commit 18b07e09e0)
revealed some issues with the way hardware priority queues work.

For cases with both hardware priority queues enabled, with the default
recommended delta bandwidths (0% - 75%), the lower priority queue (0%)
is hardly able to send any packets. This became visible, because without
the timeout mechanism, we quickly ran out of available TX buffers if
there were multiple packets being queued to the queue.

Here is an excerpt from 802.1Q, chapter 34.3.1 which describes how Qav
bandwidth sharing SHOULD work:

  The deltaBandwidth(N) for a given N, plus the deltaBandwidth(N) values
  for any higher priority queues (larger values of N) defines the total
  percentage of the Port’s bandwidth that can be reserved for that queue
  and all higher priority queues. For the highest priority queue, this
  means that the maximum value of operIdleSlope(N) is deltaBandwidth(N)%
  of portTransmitRate. However, if operIdleSlope(N) is actually less
  than this maximum value, any lower priority queue that supports the
  credit-based shaper algorithm can make use of the reservable bandwidth
  that is unused by the higher priority queue. So, for queue N-1, the
  maximum value of (operIdleSlope(N) + operIdleSlope(N-1)) is
  (deltaBandwidth(N) + deltaBandwidth(N1))% of portTransmitRate.

However in reality, the lower priority queues (N-1) on the SAM GMAC
hardware DO NOT use the bandwidth available from the higher priority
queues (N).

This commits fixes the issue by changing the defaults. These are still
set to the recommended 75% (total), but this percentage is split between
the priority queues manually.

Signed-off-by: Tomasz Gorochowik <tgorochowik@antmicro.com>
2019-03-13 06:00:04 -05:00
Tomasz Gorochowik
3c0c92ab3f drivers: eth: gmac: normalize queue init messages
There is a log message printed for the non-priority queue (Queue 0). Add
the same message for the priority queues too when they are enabled, and
a corresponding message when the queue is not used (set to idle).

Signed-off-by: Tomasz Gorochowik <tgorochowik@antmicro.com>
2019-03-13 06:00:04 -05:00
Tomasz Gorochowik
21aaa9958e drivers: eth: gmac: Swap Qav queue registers
Throughout the manual, the queues GMAC is equipped with are identified
by a number - Queue 0, Queue 1 and Queue 2.

However in the context of Qav, the queues are identified with a
character (note that there are only two queues as Qav is not used for
the non-priority queue) - Queue A and Queue B.

Queue B and Queue 2 are also called "the highest priority queues".

Based on that, the previous implementation was using the following
mapping:

  Queue 1 - Queue A
  Queue 2 - Queue B

However when running some specific tests, that is for example forcing
all the traffic to Queue 1, it showed that this queue is actually
affected by the Queue B registers. Similarly, Queue 2 seems to be
affected by the Queue A registers.

Based on that observation, this commit changes the registers used to
work with the following mapping:

  Queue 1 - Queue B
  Queue 2 - Queue A

Note that this is based solely on observations, there is nothing in the
datasheet that confirms this, and the "highest priority" label suggests
it is otherwise.

Signed-off-by: Tomasz Gorochowik <tgorochowik@antmicro.com>
2019-03-13 06:00:04 -05:00
Tomasz Gorochowik
b54f528951 drivers: eth: gmac: Add option to force packets to a specific queue
This option is meant to be used only for debugging. Use it to force all
traffic to be routed through a specific hardware queue. With this option
enabled it is easier to verify whether the chosen hardware queue
actually works.
This works only if there are four or fewer RX traffic classes enabled as
the SAM GMAC hardware supports screening up to four traffic classes.

Signed-off-by: Tomasz Gorochowik <tgorochowik@antmicro.com>
2019-03-13 06:00:04 -05:00
Jukka Rissanen
bb97343bee can: Make frame and filter conversion function params const
One of the function parameter in conversion functions can be
make const (because we are not changing it).

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-03-13 05:58:30 -05:00
Jukka Rissanen
e7ce08a2ac samples: net: can: Send and receive can_frame type of data
The CANBUS sockets require "struct can_frame" to be used in order to be
compatible with Linux code.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-03-13 05:58:30 -05:00
Jukka Rissanen
d2ce588441 samples: net: can: setsockopt() requires can_filter
The CANBUS sockets require can_filter to be used in order to be
compatible with Linux code.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-03-13 05:58:30 -05:00
Jukka Rissanen
5a9fa72ef2 net: socket: can: Convert between can_frame and zcan_frame
The socket-can code expects to have "struct can_frame" from
application when it calls send(). We then have to convert to
"struct zcan_frame" as that is what the driver expects.

Same thing when receiving data. We just convert to
"struct can_frame" and pass that to application.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-03-13 05:58:30 -05:00
Jukka Rissanen
fc36d56aca drivers: can: socket: Use proper filter when setsockopt is called
Check that the received filter is can_filter type when setsockopt()
is called.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-03-13 05:58:30 -05:00
Marcin Szymczyk
c8dfdb63f9 usb: samples: mass: add warning for no conf and nrf52840 conf
Added a warning that will abort build without disks.
Added a default configuration for nrf52840_pca10056.

Signed-off-by: Marcin Szymczyk <Marcin.Szymczyk@nordicsemi.no>
2019-03-13 05:48:35 -05:00
Andrei Emeltchenko
d293d0c682 usb: netusb: Remove unused helpers and cleanup
Remove try_write() which is not used anymore and general cleanup.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-03-13 05:46:01 -05:00
Andrei Emeltchenko
db311047d0 usb: rndis: Use usb_transfer() for data transfer
Use USB transfer API for data transfer. Simplify notification count,
removing delayed work, use usb_transfer() logic instead.

Fixes #14127

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-03-13 05:46:01 -05:00
Andrei Emeltchenko
31ed124692 usb: netusb: rndis: Cleanup code
Remove unnecessary line breaks.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-03-13 05:46:01 -05:00
Andrei Emeltchenko
fd496a5e67 usb: netusb: ecm: Remove forward declaration
Make code more readable.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-03-13 05:46:01 -05:00
Andrei Emeltchenko
8a5cbb47cc usb: netusb: eem: Use sys_get_le16() helper
Use helper to make code cleaner.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-03-13 05:46:01 -05:00
Jukka Rissanen
6301ae74d9 tests: net: tcp: Check null ptr dereference
If pkt allocation fails, then prepare to handle NULL pointer.

Coverity-CID: 195819
Coverity-CID: 195860
Coverity-CID: 195921

Fixes #14412
Fixes #14399
Fixes #14388

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-03-13 05:39:41 -05:00
Jukka Rissanen
55cd97bc43 tests: net: dhcpv4: Check null ptr dereference
If pkt allocation fails, then prepare to handle NULL pointer.

Coverity-CID: 195880
Coverity-CID: 195816

Fixes #14413
Fixes #14395

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-03-13 05:38:26 -05:00
Paul Sokolovsky
7e81aca961 samples: sockets: echo: Better error checks
Check socket fd return results.

Fixes: #11086, #11087
Coverity-CID: 189519, 189520

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-03-13 05:38:10 -05:00
Tedd Ho-Jeong An
19ed83c723 samples: sockets: echo_async: Check return value of setsockopt
This patch checks the return values of setsockopt.

Fixes: #14392, #14402
Coverity-CID: 195897, 195848

Signed-off-by: Tedd Ho-Jeong An <tedd.an@intel.com>
2019-03-13 05:37:28 -05:00
David B. Kinder
8164505aad doc: Release notes initial (empty) draft
Get things started for the 1.4 release notes.
Individual teams will update their appropriate sections.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-03-13 05:36:39 -05:00
Johan Hedberg
0299db7303 Bluetooth: Mesh: Fix checking for bt_mesh_provision() error
There isn't much we can do if this fails, but at least log an error
about it.

Fixes #13855

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-03-13 05:35:58 -05:00
Andrei Emeltchenko
f8e1dfc331 usb: dc: native_posix: Fix Coverity bug
Fixes Untrusted array index read bug.

Fixes #14406

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-03-13 05:35:25 -05:00
Jukka Rissanen
bafdf5b329 tests: net: ipv6: Check null ptr dereference
If pkt allocation fails, then prepare to handle NULL pointer.

Coverity-CID: 195835
Fixes #14409

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-03-13 05:34:46 -05:00
Jukka Rissanen
179d520777 drivers: eth: native_posix: Null terminate interface name
The interface name is IFNAMSIZ long so we must not copy it
full which would overwrite the terminating null byte.

Coverity-CID: 195770
Fixes #14419

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-03-13 05:34:03 -05:00
Luiz Augusto von Dentz
269935dca9 doc: Bluetooth: Add initial documentation for the GATT layer
Add initial sections for GATT layer.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-03-13 10:40:05 +01:00
Luiz Augusto von Dentz
258cd01152 doc: Bluetooth: Add initial documentation for the L2CAP layer
Add initial sections for L2CAP layer.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-03-13 10:40:05 +01:00
Johan Hedberg
00cabc6381 doc: Bluetooth: Add initial guide for the host stack
Add initial sections for the Bluetooth host stack, as well as a simple
diagram of the various protocol & profile layers.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-03-13 10:40:05 +01:00
Johan Hedberg
6721dec2e7 doc: Bluetooth: use :cpp:func: instead of :c:func:
:c:func: doesn't seem to generate proper hyperlinks, whereas
:cpp:func: works as expected.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-03-13 10:40:05 +01:00
Carles Cufi
8f05a4c6d5 doc: Bluetooth: Documentation overhaul
Overhaul the Bluetooth documentation to split it into manageable units
and include additional information, such as architecture and tooling.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-03-13 10:40:05 +01:00
Wolfgang Puffitsch
d7fac9bf8c Bluetooth: controller: Support big-endian archs in split controller.
Use reverse order for bitfields on big-endian architectures. Treat
all PDU data as little-endian and add conversions as needed. Treat
access address as 4-byte value instead of u32_t to avoid flipping
endianness.

Signed-off-by: Wolfgang Puffitsch <wopu@oticon.com>
2019-03-13 10:37:40 +01:00
David B. Kinder
ebc4e83a20 doc: update windows installation guide
Add a note installing programs manually on your Windows system: you may
need to update the Windows PATH so the system can file these programs.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-03-13 10:13:38 +01:00
Jukka Rissanen
6368ed4edf samples: net: zperf: Fix the readme file
As there is no shell submodules any more, the "zperf" command
needs to be written in every command.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-03-13 01:52:09 +01:00
Jukka Rissanen
b9f6bdfe08 samples: net: zperf: Fix TCP download command
The TCP download command was not handling TCP session and
connection closing properly.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-03-13 01:52:09 +01:00
Jukka Rissanen
0cd9b3e267 samples: net: zperf: Make client work in native_posix
As the clock does not run same way in native_posix, do some
tricks here.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-03-13 01:52:09 +01:00
Marc Herbert
0c465bbec1 sanitycheck: make --subtest and --test mutually exclusive
They're effectively mutually exclusive already because
options.sub_test in main() immediately discards any --test
argument(s). This commit preempts user confusion thanks to this new
message:

 sanitycheck: error: argument --sub-test: not allowed with
    argument -s/--test

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2019-03-13 01:44:52 +01:00
Andy Ross
f992e97bb5 arch/x86_64: Fix printf format string
There was a spot where the early boot code was logging using %p to
emit an integer, and Coverity doesn't like that.  Fixes #14420 and
Fixes #14418

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-03-12 19:03:50 -05:00
Andrew Boie
67c4c2e6f0 qemu_x86_iamcu: disable spec execution mitigations
This build target is intended to verify that enabling the
IAMCU ABI doesn't have any bit-rot since we can easily
run this under emulation.

However, the QEMU boards all derive from the generic IA32
SOC definition, which is any pc-like hardware. We need
to disable these mitigations for this target since the
IAMCU compiler doesn't even recognize instructions like
'lfence'.

Fixes: #14315

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-03-12 18:39:49 -05:00
Georgij Cernysiov
8104c6c7df drivers: serial: stm32: l4 pinmux fix usart6 rx define
Fix invalid USART6 RX definition.

Signed-off-by: Georgij Cernysiov <g.cernysiov@elco-automation.de>
2019-03-12 14:09:58 -05:00
Ioannis Glaropoulos
58e24f37fb arch: arm: introduce sync barriers in _arch_irq_unlock()
The ARM Cortex-M 321 application note is stressing that
when enabling interrupts by executing CPSIE i(f), or by MSR
instructions (on PRIMASK, FAULTMASK, or BASEPRI registers),
there is a need for synchronization barrier instructions,
if there is a requirement for the effect of enabling
interrupts to be recongnized immediately. _arch_irq_unlock()
is invoked in several places, therefore, we add the
barriers to make the interrupt enabling function
applicable to all usage scenarios.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-03-12 12:01:49 -07:00
Kumar Gala
276f766317 libc: rename _zephyr_fputc to zephyr_fputc
For some reason we missed _zephyr_fputc in commit
4344e27c26.  Rename _zephyr_fputc to just
zephyr_fputc and fixup associated code to build.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-03-12 13:59:06 -05:00
Kumar Gala
c82f23cada libc: Fix fwrite function name
Commit 4344e27c26 changed the reserved
function names, but got the naming wrong for fwrite.  Just use the
name zephyr_fwrite everywhere.

Fixes #14275

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-03-12 13:59:06 -05:00
Thomas Stenersen
c1a18fb514 bluetooth: host: Specify controller in BT_HCI_TX_STACK_SIZE defaults
By specifying the controller directly when selecting the default
BT_HCI_TX_STACK_SIZE, an external controller may rely on the final
default value when none of the in-tree controllers are used.

The value is increased to 1024 to accomodate the current worst-case
stack size.

Signed-off-by: Thomas Stenersen <thomas.stenersen@nordicsemi.no>
2019-03-12 19:42:40 +01:00
Thomas Stenersen
923658a981 drivers: clock_control: nrf: add choice variable
Add choice variables for CLOCK_CONTROL_NRF_SOURCE and
CLOCK_CONTROL_NRF_ACCURACY such that the choices may be augmented
out-of-tree.

Signed-off-by: Thomas Stenersen <thomas.stenersen@nordicsemi.no>
2019-03-12 19:42:40 +01:00
Thomas Stenersen
a3fc1a1f53 drivers: nrf5: Don't force specific drivers from soc/arm/nordic_nrf
Redefining the config will not let another (out-of-source) driver be
chosen instead of the default. The driver is practically forced by the
soc settings. This commit moves default settings from soc/arm/nordic_nrf
into the drivers themselves.

Signed-off-by: Thomas Stenersen <thomas.stenersen@nordicsemi.no>
2019-03-12 19:42:40 +01:00
Thomas Stenersen
caa4f7baae kconfig: bluetooth: Let BT_HCI_VS be configurable from controller
This moves the vendor-specific HCI command/event configuration
definitions out of bluetooth/common into bluetooth. This allows
the controller itself to indicate its support for vendor-specific
commands/events.

Signed-off-by: Thomas Stenersen <thomas.stenersen@nordicsemi.no>
2019-03-12 19:42:40 +01:00