Commit graph

95513 commits

Author SHA1 Message Date
Ulf Magnusson 7727d1a48e kernel: Kconfig: Remove redundant 'default n' properties
Bool symbols implicitly default to 'n'.

A 'default n' can make sense e.g. in a Kconfig.defconfig file, if you
want to override a 'default y' on the base definition of the symbol. It
isn't used like that on any of these symbols though.

Also simplify the definitions of COOP_ENABLED, PREEMPT_ENABLED, and
SYS_CLOCK_EXISTS. 'default' (and def_bool) can take any expression, not
just a fixed value.

(It would work without the parentheses around the comparisons too.)

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-06-22 15:21:14 -04:00
Ulf Magnusson 0785b79ebe lib: kconfig: Remove redundant 'default n' properties
Bool symbols implicitly default to 'n'.

A 'default n' can make sense e.g. in a Kconfig.defconfig file, if you
want to override a 'default y' on the base definition of the symbol. It
isn't used like that on any of these symbols though.

Also simplify the default on STDOUT_CONSOLE. Defaults can be arbitrary
expressions, not just fixed values.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-06-22 15:12:48 -04:00
Ulf Magnusson 34e11f0c45 tests: kconfig: Remove redundant 'default n' properties
Bool symbols implicitly default to 'n'.

A 'default n' can make sense e.g. in a Kconfig.defconfig file, if you
want to override a 'default y' on the base definition of the symbol. It
isn't used like that on any of these symbols though.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-06-22 15:11:58 -04:00
Ulf Magnusson b63a5928bc dts: kconfig: Remove redundant 'default n' properties
Bool symbols implicitly default to 'n'.

A 'default n' can make sense e.g. in a Kconfig.defconfig file, if you
want to override a 'default y' on the base definition of the symbol. It
isn't used like that on any of these symbols though.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-06-22 15:11:21 -04:00
Johan Hedberg b26ca13672 shell: Fix command completion logic
The original code (introduced by commit d5db35204a) looked like this
before the last rewrite/cleanup:

       if (default_module != -1) {
               return (str == NULL) ? dest : -1;
       }

However with the cleanup the logic seems to have gotten reversed.

Fixes #8501

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-06-22 15:09:18 -04:00
Jukka Rissanen c63363711d tests: net: Add unit test for network pkt timestamping
Test that Tx timestamp callback code is called properly if network
packet timestamping is enabled.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-06-22 12:31:32 -04:00
Jukka Rissanen 580596c30a net: if: Add TX timestamp callback support
Allow creation of TX timestamp thread which will collect TX timestamp
information from device drivers. If the callback is registered, then
it will pass that timestamp information to the relevant party for
further processing. This support will be used by gPTP code in
subsequent commits.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Signed-off-by: Julien Chevrier <julien.chevrier@intel.com>
2018-06-22 12:31:32 -04:00
Johann Fischer c36e800e8e usb: remove all CONFIG_*_EP_ADDR options
Remove all CONFIG_*_EP_ADDR options but keep the default
values for it, as they are necessary to find ep_addr in
usb_ep_cfg_data associated with bEndpointAddress in
interface descriptor.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-06-22 12:30:55 -04:00
Erwan Gouriou 37028baf38 dts/bindings: Remove redundant clock properties in st,stm32-i2c...
Clock property is is provided in i2c.yaml binding,
remove it from st,stm32-i2c-vX.yaml

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-06-22 12:30:33 -04:00
David Brown 00ef6b5e3c doc: Enumerate threats in model
Certain external requirements require justification that threats in a
threat model have been satisfied.  In order to do this, the threats must
be enumerated, and given labels.

Add labels to the threats.  Use rts's citation model to allow the
threats to be grouped and listed at the end of the document to help with
cross referencing.

Signed-off-by: David Brown <david.brown@linaro.org>
2018-06-22 12:30:06 -04:00
Andrei Emeltchenko 48ff11752c usb: webusb: Strip CDC ACM function from the code
CDC ACM is not needed in webusb, communication is going through Bulk
endpoints. Endpoint numbers stay the same only Interface number
changed, so basically only this change is needed:

-        .then(() => this.device_.claimInterface(2))
+        .then(() => this.device_.claimInterface(0))

this.device_.claimInterface({2,0}) apart from removing serial port
commands.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-06-22 12:29:45 -04:00
Alberto Escolar Piedras 5ea637d23b drivers: entropy: native: implement standard ISR-specific call
For the native_posix board, implement the new get_entropy_isr call.
The old native get_entropy was already safe for ISRs, so we just
add a wrapper to it.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-06-22 12:29:02 -04:00
Sebastian Bøe 1b6007067d cmake: Invoke 'python' instead of py scripts directly
Python scripts should be executed indirectly by the python
interpreter, not directly in a CMake COMMAND. This is for portability
reasons.

Directly executing a python script depends on non-portable shebang
logic and/or "default application" behaviour.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-06-22 12:28:31 -04:00
Sebastian Bøe c1c25dea1a cmake: Remove stray CMakeLists.txt file
Remove the CMakeLists.txt file that is in the 'common' directory of
nffs_fs_api. It has likely been added by mistake as it does not make
any sense as it is written.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-06-22 12:28:01 -04:00
Jamie McCrae 23ce6f44b5 drivers: flash: w25qxxdv: Add options for delay and device ID
Adds support for configuring the CS toggling delay and using a
different device ID so that compatible flash chips can also be
used by this driver.

Signed-off-by: Jamie McCrae <jamie.mccrae@lairdtech.com>
2018-06-22 12:27:40 -04:00
Vinayak Kariappa Chettimada b35ed7e79c Bluetooth: Fix central from failing to start encryption
This fixes a regression introduced in commit 6af5d1cd1f
("Bluetooth: Compress bt_keys struct").

Instead of passing a value zero as the random number, the
value at the RAM address zero was being used by the start
encryption function call. It is now fixed by consistently
using byte-array to store EDiv and Rand values.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2018-06-22 18:03:43 +02:00
Andrzej Głąbek 13eba3970d ext: nordic: Correct CMakeLists.txt
This corrects two things:
- moves addition of the proper "system_*.c" file to sources, so that it
  is done only when CONFIG_HAS_NRFX is active (related CONFIG_SOC_* may
  be activated also for simulated targets which do not want to compile
  code with system initialization for the real SoC)
- removes redundant check of HAS_NRFX when adding "nrfx_glue.c"

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2018-06-22 12:34:10 +02:00
Justin DeMartino cfc18f2102 drivers: pwm: Add shim for nrfx PWM HW driver
Adds a translation layer to make the nrfx driver for nrf52 PWM
peripheral accessible via the Zephyr's API.

Signed-off-by: Justin DeMartino <jdemarti@gmail.com>
2018-06-22 11:56:01 +02:00
Ulf Magnusson 7a7e4f5832 misc: kconfig: Remove redundant 'default n' properties
Bool symbols implicitly default to 'n'.

A 'default n' can make sense e.g. in a Kconfig.defconfig file, if you
want to override a 'default y' on the base definition of the symbol. It
isn't used like that on any of these symbols though.

Piggyback removal of some 'default ""' properties on string symbols. The
empty string is the default.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-06-22 09:06:29 +02:00
Ioannis Glaropoulos aee97be710 arch: arm: soc: remove core zephyr header inclusions from soc.h
This commit removes the direct inclusions of device.h or gpio.h
from soc.h header files in ARM SOCs, to avoid soc.h include
kernel.h.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2018-06-21 22:28:00 +02:00
Ioannis Glaropoulos 92b8a41f20 include: create kernel_includes.h header to hold kernel includes
This commit creates a new header file (kernel_include.h) that
contains all header files to be included by kernel_init.h.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2018-06-21 22:28:00 +02:00
Ioannis Glaropoulos 071f5153ac arch: arm: mpu: include CMSIS header in arm_mpu.h
This commit includes the arch/arm/cortex_m/cmsis.h directly
in arm_mpu.h. This is requires as arm_mpu.h uses CMSIS macro
defines directly.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2018-06-21 22:28:00 +02:00
Bartosz Sokolski 92778e4438 arch: soc: nrf52: add UART1 to dts fixup
Current fixup supports only UART0 while there is also UART1

Signed-off-by: Bartosz Sokolski <bartosz.sokolski@nordicsemi.no>
2018-06-21 13:49:13 +02:00
Mandar Chandrakant Thorat f5ddc99c4f boards: nrf52_blenano2: Add i2c's to nrf52_blenano2 board dts.
Fixes #8391

Enables the i2c drivers for these boards.
Required to enable i2c with these boards.
Tested samples/sensor/tmp112 for nrf52_blenano2
with i2c enabled.

Signed-off-by: Mandar Chandrakant Thorat <mandar.chandrakant.thorat@intel.com>
2018-06-21 07:15:07 -04:00
Sathish Kuttan c738834854 doc: intel_s1000: Procedure to obtain toolchain
Added procedure to obtain the Cadence toolchain
Cleaned up the documentation a bit

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2018-06-20 16:00:23 -04:00
Paul Sokolovsky 5acb7fc9a9 subsys: console: Make CONSOLE_GETCHAR and *_GETLINE optional
It should be possible to make both these options off, and that
should be default, otherwise targets not supporting them yet, e.g.
native_posix, have build issues.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-06-20 15:59:12 -04:00
Paul Sokolovsky f6d8ab8289 subsys: console: Factor out fifo-based console input abstraction
Console subsystem is intended to be a layer between console drivers
and console clients, like e.g. shell. This change factors out code
from shell which dealed with individial console drivers and moves it
to console subsystem, under the name console_register_line_input().

To accommodate for this change, older console subsys Kconfig symbol
is changed from CONFIG_CONSOLE_PULL to CONFIG_CONSOLE_SUBSYS
(CONFIG_CONSOLE is already used by console drivers). This signifies
that console subsystem is intended to deal with all of console
aspects in Zephyr (existing and new), not just provide some "new"
functionality on top of raw console drivers, like it initially
started.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-06-20 15:59:12 -04:00
Ulf Magnusson 54a5997f5c kconfiglib: Add dependency loop detection
Update Kconfiglib to get upstream commit ca89ca0c0c420 ("Add dependency
loop detection") in.

Upstream commit message
=======================

Pretty long overdue.

Until now, dependency loops have raised a hard-to-debug Python
RecursionError during evaluation. A Kconfiglib exception is raised now
instead, with a message that lists all the items in the loop.

See the comment at the start of _check_dep_loop_sym() for an overview of
the algorithm. At a high level, it's loop detection in a directed graph
by keeping track of unvisited/visited nodes during depth-first search.
(A third "visited, known to not be in a dependency loop" state is used
as well.)

Choices complicate things, as they're inherently loopy: The choice
depends on the choice symbols and vice versa, and the choice symbols in
a sense all depend on each other.

Add the choice-to-choice-symbol dependencies separately after dependency
loop detection, so that there's just the choice-symbol-to-choice
dependencies to deal with. It simplifies things, as it makes it possible
to tell dependencies from 'prompt' and 'default' conditions on the
choice from choice symbol dependencies.

Do some flag shenanigans to prevent the choice from being "re-entered"
while looping through the choice symbols. Maybe this could be cleaned up
a bit somehow...

Example exception message:

Dependency loop
===============

A (defined at tests/Kdeploop10:1), with definition...

config A
        bool
        depends on B

...depends on B (defined at tests/Kdeploop10:5), with definition...

config B
        bool
        depends on C = 7

...depends on C (defined at tests/Kdeploop10:9), with definition...

config C
        int
        range D 8

...depends on D (defined at tests/Kdeploop10:13), with definition...

config D
        int
        default 3 if E
        default 8

...depends on E (defined at tests/Kdeploop10:18), with definition...

config E
        bool

(select-related dependencies: F && G)

...depends on G (defined at tests/Kdeploop10:25), with definition...

config G
        bool
        depends on H

...depends on the choice symbol H (defined at tests/Kdeploop10:32), with
definition...

config H
        bool
        prompt "H" if I && <choice>
        depends on I && <choice>

...depends on the choice symbol I (defined at tests/Kdeploop10:41), with
definition...

config I
        bool
        prompt "I" if <choice>
        depends on <choice>

...depends on <choice> (defined at tests/Kdeploop10:38), with
definition...

choice
        bool
        prompt "choice" if J

...depends on J (defined at tests/Kdeploop10:46), with definition...

config J
        bool
        depends on A

...depends again on A (defined at tests/Kdeploop10:1)

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-06-20 15:53:38 -04:00
Ulf Magnusson d930c21e12 drivers: spi: Fix SPI_2_NRF_SPIS-related dependency loop
The following dependency loop existed:

  config SPI_SLAVE
  	bool

  (Defined at drivers/spi/Kconfig:27)

  ...is selected by...

  config SPI_2_NRF_SPIS
  	bool
  	select SPI_SLAVE

  (Defined at drivers/spi/Kconfig.nrfx:210)

  ...is in the choice...

  choice
  	bool
  	depends on SPI_2

  (Defined at drivers/spi/Kconfig.nrfx:192)

  ...that depends on...

  config SPI_2
  	bool
  	depends on SPI_SLAVE

  (Defined at
  arch/x86/soc/intel_quark/quark_se/Kconfig.defconfig.series)

  ...that again depends on SPI_SLAVE

(This might not be a problem in practice, but it'd be difficult to
detect.)

I think the underlying issue is that SPI_2_NRF_SPIS 'select's SPI_SLAVE,
while SPI_2 'depends on' it.

Fix it by having SPI_2_NRF_SPIS 'depend on' SPI_SLAVE as well. This will
require SPI_SLAVE to be explicitly enabled before SPI_2_NRF_SPIS can be
enabled.

No configuration files in Zephyr itself seem to currently enable
SPI_2_NRF_SPIS (and it defaults to n), so no tweaks should be needed
there.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-06-20 15:53:38 -04:00
Andrei Emeltchenko 0d895c8aa3 usb: webusb: Refactor WebUSB using BOS API
Refactor USB sample WebUSB using new BOS API.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-06-20 15:47:00 -04:00
Andrei Emeltchenko b9c82121c6 usb: bos: unit: Add unit test for BOS testing
Add testing USB Binary Device Object Store descriptors and macros.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-06-20 15:47:00 -04:00
Andrei Emeltchenko c6b38a2a86 usb: tests: Add usb_bos_desc to sanitycheck table
Fix check warnings

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-06-20 15:47:00 -04:00
Andrei Emeltchenko c1724f65bf usb: bos: Add USB BOS descriptors API
Add API for USB BOS Descriptors.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-06-20 15:47:00 -04:00
Andrei Emeltchenko f07275e6e6 usb: trivial: Remove unneeded braces
Clean up the code

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-06-20 15:47:00 -04:00
Andrei Emeltchenko 2be6594d3f usb: bos: Add linker sections for USB BOS descriptor
Since USB Binary Device Object Store (BOS) descriptor might be defined
in several places create usb_bos_desc section.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-06-20 15:47:00 -04:00
Andrei Emeltchenko 7eb05cd113 usb: webusb: Correct total length
Calculate correct length

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-06-20 15:47:00 -04:00
Andrei Emeltchenko b25567eab8 usb: Allow to enable stack on native_posix arch
At the moment USB Device stack is not possible to enable for
native_posix architecture since there is not USB controller.
The patch allows to enable stack making possible to use it in unit
tests.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-06-20 15:47:00 -04:00
Olivier Martin 2b10dd8a0b drivers: rtc: Fix build
_impl_rtc_(enable|disable) does not return a value while
Z_SYSCALL_HANDLER(rtc_(enable|disable)) expects to return a value.

Signed-off-by: Olivier Martin <olivier.martin@proglove.de>
2018-06-20 15:46:09 -04:00
Sebastian Bøe 608778a4de cmake: Support specifying Kconfig options on the CLI
This resolves #5723 by adding support for assigning to Kconfig options
from the CMake CLI.

CMake CLI Kconfig options can be specified like so:

'cmake -DCONFIG_ASSERT=y'

The lifetime of such an option is the same as the lifetime of a CMake
cache variable, and in principle any method of populating the
CMakeCache could be used, such as cmake-gui.

This has been implemented by scanning the CMakeCache variables before
Kconfig is executed and writing any that are prefixed with 'CONFIG_'
to a new Kconfig fragment in the build directory that is merged in
with a high precedence.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-06-20 15:40:24 -04:00
Sebastian Bøe aed0b6c4bd isr_tables: Simplify how the sw_irq_handler function is used
This is a migration from using code generation to using the C language
which we in the general case we should aways strive towards.

It is equivalent to the simplification that was done with
_irq_spurious here:
https://github.com/zephyrproject-rtos/zephyr/pull/7574

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-06-20 15:39:29 -04:00
David B. Kinder a9e0d14bee doc: fix misspelling in vlan document
fix misspellings missed during regular review

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-06-20 12:37:15 -04:00
David B. Kinder ca16b6f8ee doc: fix misspelling in hci API docs
fix misspellings missed during regular reviews

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-06-20 12:37:01 -04:00
David B. Kinder 90380730b3 doc: fix misspelling in watchdog Kconfig
fix misspellings missed during regular review

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-06-20 12:36:48 -04:00
Bartosz Sokolski 06f4daf847 dts: add parentheses around argument in macro __SIZE_K
to allow expressions

Signed-off-by: Bartosz Sokolski <bartosz.sokolski@nordicsemi.no>
2018-06-20 12:14:58 -04:00
Yasushi SHOJI 064608b429 include: remove unused macros from include/arch/*/arch.h
All architecture defines OCTET_TO_SIZEOFUNIT and SIZEOFUNIT_TO_OCTET
as identity functions. But the only user is tests/benchmarks/app_kernel.
It's effectively a no-op.  Remove them.

Signed-off-by: Yasushi SHOJI <y-shoji@ispace-inc.com>
2018-06-20 12:07:59 -04:00
Jukka Rissanen cf9bfb20f1 doc: net: Add information about websocket server API
Websocket server side support was not mentioned in network
overview.rst document.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-06-20 12:06:58 -04:00
Joakim Andersson 5204fd7061 arch: arm: Set Zero Latency IRQ to priority level zero:
Set Zero Latency IRQ to priority level zero and SVCs to priority level
one when Zero Latency IRQ is enabled.
This makes Zero Zatency truly zero latency when the kernel has been
configured with userspace enabled, or when IRQ offloading is used.

Exceptions can still delay Zero Latency IRQ, but this is considered
ok since exceptions indicate a serious error, and the system needs to
recover.

Fixes: #7869

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2018-06-20 18:05:02 +02:00
Karol Gugala 1765d75ff4 riscv32: riscv-privilege: Microsemi Mi-V support
This commit adds support for Microsemi Mi-V RISC-V softcore CPU
running on the M2GL025 IGLOO2 FPGA development board.

signed-off-by: Karol Gugala <kgugala@antmicro.com>
2018-06-20 11:57:07 -04:00
Karol Gugala 23a5b5d171 riscv32: riscv-privilege: integrate common code
This commit moves code from fe310 platform into RISC-V privilege common
folder. This way the code can be reused by other platforms in future.

signed-off-by: Karol Gugala <kgugala@antmicro.com>
2018-06-20 11:57:07 -04:00
Karol Gugala 5417f29def drivers: plic: do not compile plic for qemu target
RISC-V qemu does not use PLIC controller, so plic.c file fails to
compile with qemu target. This change disables plic if qemu is
chosen.

signed-off-by: Karol Gugala <kgugala@antmicro.com>
2018-06-20 11:57:07 -04:00