Commit graph

41120 commits

Author SHA1 Message Date
Nicolas Pitre
b1d3742ce2 linker generated list: introduce Z_STRUCT_SECTION_ITERABLE()
This convenience macro wraps Z_DECL_ALIGN() and __in_section() to
simplify static definitions of structure instances gathered in dedicated
sections. Most of the time those go together, and the section name is
already closely related to the struct type, so abstracting things behind
a simpler interface reduces probability of mistakes and makes the code
clearer. A few input section names have been adjusted accordingly.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-06-06 14:21:32 -07:00
Nicolas Pitre
8bb1f2a947 linker generated list: explicit alignment on data definitions
The alignment fix on struct device definitions should be done to all
such linker list tricks. Let's abstract the declaration plus alignment
with a macro and apply it to all concerned cases.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-06-06 14:21:32 -07:00
Nicolas Pitre
7daa5451cf DEVICE_DEFINE(): properly align struct device instances
The DEVICE_DEFINE() macro creates instances of struct device that are
gathered into a contiguous list by the linker. However, some assemblers
pad sections to the next 16-byte boundary or so by default, screwing up
the list walk in z_sys_device_do_config_level(). This is especially
true for 64-bit compilation where sizeof(struct device) isn't a
multiple of 16.

Enforcing an alignment at the linker level would solve this issue when
instances of struct device are gathered from different object files.
However it doesn't solve it when multiple instances are created within
the same object file where the first instance still has a gap with the
next instance, as the assembler does add padding upon section switch
even though the object file ends up with a single section with both
instances. In that case the linker would get rid of the trailing padding
only, leaving the inner gaps between instances in place.

The actual fix is to provide an explicit alignment attribute to the
section for every instances, using __alignof(struct device) which is
the alignment expected by the compiler for that structure.

This also means that the x86_64 workaround in the struct device
definition may go as the "edge case" it refers to is now properly
handled.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-06-06 14:21:32 -07:00
Anas Nashif
6ecbe713b5 doc: redirect old board pages to new location
Redirect old style board pages to old stype URL with board name.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-06 15:38:09 -04:00
Jakub Rzeszutko
e943c27458 CODEOWNERS: update due to nickname change
Modified nickname from jarz-nordic to jakub-uC

Signed-off-by: Jakub Rzeszutko <jakubr@uber.com>
2019-06-06 14:21:41 -04:00
Alexey Brodkin
40dbec4cd1 ARC: Mention ARC EM family instead of EM4 template
ARC EM4 is just a baseline configuration of ARC EM family of CPU cores.
But with addition of more featuers like caches, DSP extensions etc
we're effectively getting EM6, EM5D etc templates.

So to not confuse users let's talk about families of ARC cores
as that's what makes sense together with extra features but not
templates itself.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
2019-06-06 14:20:42 -04:00
Alexey Brodkin
c5663caf77 board/nsim: Refactor device tree description
Instead of blind copy of nsim_em.dts re-structure this way:
 * nsim.dtsi     - Top-level "board" description re-usable for
 |                 all nSIM-based "boards".
 |
 |                 Even though it's not needed right now but it
 |                 allows to add other ARC core families in the future.
 |
 \_ nsim_em.dtsi - Common definitions for boards with ARC EM cores
    |
    \_ Real boards with ARC EM cores
      |
      \ nsim_em.dts
      \ nsim_sem.dts
      \ nsim_em_mpu_stack_guard.dts
      \ nsim_sem_mpu_stack_guard.dts

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
2019-06-06 14:20:42 -04:00
Alexey Brodkin
797165044f board/nsim: Move CPU selection in defconfigs
This will allow us to easily specify other CPUs looking
forward and not rely on any default value.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
2019-06-06 14:20:42 -04:00
Alexey Brodkin
b1dcf05c68 board/nsim: Make it CPU-family independent
ARC nSIM simulates all flavors or ARC cores so there's
no point in limiting its usage to ARC EM family only.

Moreover with upcoming addition of ARC HS family support
in Zephyr we'll be re-using nSIM "board" for them as well.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
2019-06-06 14:20:42 -04:00
Alexey Brodkin
bceaed67b3 simulation: ARC EM in nSIM to use nsim_em.props
This matches a naming scheme used for other flavour of ARC EM
SoC flavors.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
2019-06-06 14:20:42 -04:00
Alexey Brodkin
d0d752ab78 soc/nsim: Minor clean-up
1. Rename "nsim" to the canonical nSIM, see [1]
2. Fix SoC description - it's obviously not EMSK

[1] https://www.synopsys.com/dw/ipdir.php?ds=sim_nSIM

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
2019-06-06 14:20:42 -04:00
Charles E. Youse
4c63e29aec arch/x86: drivers/display: add framebuffer driver w/ multiboot support
A basic display driver is added for a generic 32-bpp framebuffer.
Glue logic is added to the x86 arch to request the intitialization
of a linear framebuffer by the Multiboot loader (GRUB) and connect
it to this generic driver.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-06-06 10:47:29 -07:00
Charles E. Youse
a1a3a4fced arch/x86: add support for Multiboot boot information structure
When booting using GRUB, some useful information about the environment
is given to us via a boot information structure. We've not made any
use of this information so far, but the x86 framebuffer driver will.

A skeletal definition of the structure is given, and provisions are
made to preserve its contents at boot if the configuration requires it.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-06-06 10:47:29 -07:00
Andrew Boie
55ff4ba5df x86: add qemu_x86_coverage target
Builds with coverage enabled are in a continuous state
of bit-rot as no CI job enables it. Introduce a dedicated
x86 target that builds with coverage enabled.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-06-06 09:29:12 -07:00
Andrew Boie
324ae6fd56 tests: tickless_concept: disable for coverage
This test is already flaky, but becomes even flakier when
coverage is enabled.

Disable until we put a stake through the QEMU timing issues
being worked on in #14173.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-06-06 09:29:12 -07:00
Andrew Boie
4d4cc4ddc3 samples: philosophers: pause before main() exit
On some systems the sample was failing validation because
the coverage data would be emitted before the sample had
a chance to print anything else.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-06-06 09:29:12 -07:00
Andrew Boie
930a5f8fb7 samples: cmsis philosophers: adjust stack size
Fixes crashes when running with code coverage
enabled.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-06-06 09:29:12 -07:00
Kumar Gala
442df97366 scripts/dts: Remove alias defines for labels
We added generation of aliases for "alt-label" (which was the outer
label of a node) for use with shields and connectors.  However we've
never used these defines and the generation is a bit inconsistent.

This removes generation of defines like for label 'arduino_spi':
	#define ARDUINO_SPI_BASE_ADDRESS ... (already deprecated)
	#define DT_ST_STM32_SPI_FIFO_ARDUINO_SPI_BASE_ADDRESS ...

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-06-06 09:08:16 -06:00
Piotr Zięcik
a45ce52253 tests: timer_api: Fix timer synchronization
The test_timer_periodicity waits for first timer expiration
in order to extract timer firing time. The wait is performed
using k_timer_status_sync() API call, which blocks thread
until timer expiration. However if the timer expired before
call the this function, it will return immediately, triggering
test failure.

This commit adds the second call to the k_timer_status_sync()
to ensure that the following part of the test will be executed
as soon as possible after timer expiration.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-06-06 09:31:26 -04:00
Anas Nashif
2fb19fcbdd style: samples/tests: add braces around if/while statements
Per guidelines, all statements should have braces around them. We do not
have a CI check for this, so a few went in unnoticed.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-06 15:20:21 +02:00
Anas Nashif
4c32258606 style: add braces around if/while statements
Per guidelines, all statements should have braces around them. We do not
have a CI check for this, so a few went in unnoticed.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-06 15:20:21 +02:00
Asger Munk Nielsen
912e117e9e Bluetooth: Controller: Test for user extensions
With pull request #16208 and #16404 hooks for calling user defined
code was implemented. These user extensions are gated by a number of
Kconfigs. The test in this pull request tests that code compiles when
these Kconfigs are enabled.

Signed-off-by: Asger Munk Nielsen <asmk@oticon.com>
2019-06-06 12:38:13 +02:00
Luiz Augusto von Dentz
aec04a02ed Bluetooth: GATT: Fix using invalid handle
When reading attributes from static services their handles will not be
set and must be resolved at runtime.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-06-06 13:32:17 +03:00
Jukka Rissanen
1cbda7d4ac tests: net: socket: register: Close socket after test
The file descriptor was not closed after the test which caused
Coverity to complain about resource leak.

Coverity-CID: 198640
Fixes #16493

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-06-06 17:49:01 +08:00
Loic Poulain
3653e688f3 net: ethernet: Fix build issue with C++
When compiling with CPP, compiler complains about implicit type
conversions. Fix them.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2019-06-06 17:15:10 +08:00
Vinayak Kariappa Chettimada
79cb615770 Bluetooth: controller: split: Port Enc setup to be queueable
Port the fix for the controller implementation to make start
encryption queueable if there is any control procedure in
progress.

Refer to #15335.
Relates to #15335, #15186, #15958 and #14636.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2019-06-06 10:34:13 +02:00
Anas Nashif
69fc29de4d tests: mesh: fix function prototype and match declaration
Match function declaration of board_output_number. Use u32_t instead of
uint32_t.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-05 23:31:26 -04:00
David B. Kinder
9bcf629828 doc: fix typo in gpmrb doc
Fix typo missed during regular review

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-06-05 21:13:33 -04:00
David B. Kinder
b9ce0e70f0 doc: fix malformed label in shields doc
Doc label at the top was malformed and couldn't be referenced.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-06-05 19:46:36 -04:00
Andy Ross
a12f2d6666 kernel/smp: Rename smp_init()
This name collides with one in the bt subsystem, and wasn't named in
proper zephyrese anyway.

Fixes #16604

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-06-05 17:15:55 -04:00
Vinayak Kariappa Chettimada
d244ee878f Bluetooth: shell: Fix disconnect command argument count
Fix disconnect command optional argument count to permit the
supply of Bluetooth Address so as to be able to cancel a
pending central initiated connection creation.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2019-06-05 16:29:06 +02:00
Joakim Andersson
e182d75ef7 Bluetooth: host: Fix gatt indicate when conn is NULL
Fix gatt indicate when conn is NULL and called with characteristic
declaration as the attribute argument. In this case the handle was not
advanced to the characteristic value. This is inconsistent with the rest
of the notify and indicate API

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2019-06-05 17:24:36 +03:00
Johan Hedberg
82497eca2b Bluetooth: Mesh: Fix missing implementation of Proxy SAR timeout
Mesh Profile 1.0 Section 6.6:
"The timeout for the SAR transfer is 20 seconds. When the timeout
expires, the Proxy Server shall disconnect."

This will let qualification test case MESH/SR/PROX/BV-05-C pass
without requiring an explicit disconnect.

Fixes #16600

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-06-05 17:13:56 +03:00
Luiz Augusto von Dentz
2699d05e45 Bluetooth: Fix BT_ATT_ENFORCE_FLOW
This moves the processing packets of upper layers from RX thread to the
system workqueue so they have the same priority as the TX callbacks
which has the added benefit of making any protocol on top of L2CAP to
be executed using system wq stack.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-06-05 16:45:57 +03:00
Johann Fischer
2204193bdb drivers: apds9960: allow additional LED current configuration
Allow additional proximity LED current configuration.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-06-05 07:48:58 -05:00
Johann Fischer
df3796a724 drivers: apds9960: make proximity pulse length configurable
Make proximity pulse length and pulse count configurable.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-06-05 07:48:58 -05:00
Johann Fischer
67ae508459 drivers: apds9960: make ALS and proximity gain configurable
Make ALS and proximity gain configurable.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-06-05 07:48:58 -05:00
Johann Fischer
3bbd102844 drivers: apds9960: allow to disable Ambient Light Sense
Allow to disable Ambient Light Sense (ALS) if measurement is
not necessary.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-06-05 07:48:58 -05:00
Paul Sokolovsky
0fb8a917e6 net: sockets: Make NET_SOCKETS_POSIX_NAMES depend on !POSIX_API
These options are mutually exclusive, or more specifically,
CONFIG_POSIX_API has wider scope and supersedes
CONFIG_NET_SOCKETS_POSIX_NAMES. Implementation-wise, the two
options should not be defined at the same time, as that may
lead to declaration conflicts.

Fixes: #16141

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-06-05 07:51:01 -04:00
Nicolas Pitre
4323d381e7 json: make it 64-bit compatible
The struct json_obj_descr definition allocates only 2 bits for type
alignment. Instead of using them literally minus 1 to encode 1, 2, or 4,
let's store the alignment's shift value instead so that 1, 2, 4 or 8 can
be encoded with the same 2 bits to accommodate 64-bit builds.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-06-05 07:47:41 -04:00
Benjamin Valentin
def743efda tests: drivers: uart: depend on SERIAL_SUPPORT_ASYNC for ASYNC test
Only build the async testcase for platforms
that support async operation.

Signed-off-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2019-06-05 07:45:27 -04:00
Benjamin Valentin
4d89ff1232 drivers/uart: introduce SERIAL_SUPPORT_ASYNC option
Not all serial drivers support ASYNC operation and if they do,
they might not support it on every SoC.

Add the SERIAL_SUPPORT_ASYNC option to indicate ASYNC operation
is availiable.

Signed-off-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2019-06-05 07:45:27 -04:00
Andrzej Puzdrowski
f74cebba34 doc/reference/storage/settings: storage behavior description
Elaborated on storage mechanism usage and key-value version
garbage collection.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-06-05 13:43:00 +02:00
Paul Sokolovsky
f7810d4a3c include: arch: arc: Minor punctuation fix
Add missing space after comma.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-06-05 07:39:56 -04:00
Andrei Emeltchenko
26b514dec4 usb: usb_descriptor: Trivial syntax correct
Trivial function name fix.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-06-05 11:44:17 +02:00
Andrei Emeltchenko
df2bb46497 usb: console: Initialize USB console after USB Device stack
It does make sense to initialize USB console after USB Device stack.
Note that the value is selected only if we specify USB_UART_CONSOLE
in prj.conf, not in menuconfig afterwards.

Fixes #16518

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-06-05 11:44:17 +02:00
Geoffroy Van Cutsem
57728ffb27 boards/x86: scripts: build_grub.sh to use grub-2.04-rc1-17-g8e8723a6b
Newer versions of GCC (e.g. gcc 9.1.1) fail to compile the version of
Grub that is used by the Zephyr build_grub.sh script. This patch updates
the version of Grub to the latest (as of June 4 2019) which includes a
number of fixes that solve the problem.

Fixes: #16624
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2019-06-04 19:32:44 -04:00
Christian Tavares
543de09357 lib: updatehub: add support ipv6
This extends the UpdateHub library code to allow the
use of IPV6 for communication.

Signed-off-by: Christian Tavares <christian.tavares@ossystems.com.br>
2019-06-05 00:20:37 +02:00
Christian Tavares
c5d74eccda lib: updatehub: add suport a CoAPS/DTLS
This extends the UpdateHub library code to allow the
use of CoAPS/DTLS for communication.

Refs: #13039.

Signed-off-by: Christian Tavares <christian.tavares@ossystems.com.br>
2019-06-05 00:20:37 +02:00
Christian Tavares
297ac3765f lib: updatehub: Add UpdateHub.io support
UpdateHub is an enterprise-grade solution which makes simple to
remotely update all your embedded devices in the field. It
handles all aspects related to sending Firmware Over-the-Air(FOTA)
updates with maximum security and efficiency, while you focus in
adding value to your product.

Signed-off-by: Christian Tavares <christian.tavares@ossystems.com.br>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2019-06-05 00:20:37 +02:00