Commit graph

41176 commits

Author SHA1 Message Date
Ulf Magnusson
7c26c17be6 scripts: edtlib: Add easy redirection of warnings
Add a 'warn_file' parameter to EDT.__init__() that gives a 'file' object
to write warnings to. Use it to capture and verify warnings generated
for deprecated features in testedtlib.py. This indirectly gets rid of
possibly broken-looking output when running it.

Because any function that writes warnings now needs to use EDT._warn()
(as self._warn()), some functions were moved into the EDT class.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-10-02 11:49:58 -07:00
Ulf Magnusson
567c348167 scripts: dts: Generalize '#cells' to allow multiple sources
Implement a nice generalization suggested by Bobby Noelte.

Instead of having a generic #cells key in bindings, have source-specific
*-cells keys. Some examples:

    interrupt-cells:
        - irq
        - priority
        - flags

    gpio-cells:
        - pin
        - flags

    pwm-cells:
        - channel
        - period

This makes bindings a bit easier to read, and allows a node to be a
controller for many different 'phandle-array' properties.

The prefix before *-cells is derived from the property name, meaning
there's no fixed set of *-cells keys. This is possible because of the
earlier 'phandle-array' generalization.

The older #cells key is supported for backwards compatibility, but
generates a deprecation warning.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-10-02 11:49:58 -07:00
Johan Hedberg
4f3b0cb28c Bluetooth: Mesh: Remove unused macro
The FRIEND_BUF_SIZE macro has no users.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-10-02 10:36:12 -07:00
Wentong Wu
ad28c2d67a logging: wake up log process thread only when log message happen
Periodically wake up log process thread consume more power if system
already in sleep or deep sleep state. With the help of added logging
timer and semaphore, log process thread is woken up only when there
is logging message.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
2019-10-02 10:28:05 -07:00
Charles E. Youse
6e89842d3d drivers/i2c/i2c_dw: really, really make 64-bit clean
The base_address in the device configuration is used as a handle
to access an entity in memory. In C, we call that a 'pointer'.
Also in C, (versus, say, PL/M) we name these pointer things after
what they point not ('regs') not what they are ('base address').

Thus, we change the member to a pointer type and change its name.
This makes it compile cleanly regardless of machine pointer size,
while also cutting down on a bunch of casting noise.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-10-02 10:24:56 -07:00
Ulf Magnusson
e5192f8e9a doc: cmake: kconfig: Remove assignments to unused env. vars.
These are never referenced by the Kconfig files or
scripts/kconfig/kconfigfunctions.py.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-10-02 08:18:46 -04:00
Jan Van Winkel
631a90cd42 tests: gui: Pass image pointer to fs_write
Pass image pointer to fs_write in function setup_fs of lvgl tests.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2019-10-02 08:18:16 -04:00
Wolfgang Puffitsch
799b46e35e Bluetooth: controller: Use entropy driver directly in bt_rand
Use entropy driver directly in bt_rand instead of stitching together
calls to sys_rand32_get to improve efficiency. The use of
sys_rand32_get could also leak timestamps into keys.

Signed-off-by: Wolfgang Puffitsch <wopu@demant.com>
2019-10-02 13:21:24 +02:00
Morten Priess
70cbf342ff bluetooth: controller: RX PDU meta data support in LLL
Added support for vendor specific meta data in LLL node_rx_hdr. This
enables vendors to add "footer" data to the RX PDU, for supporting
specialized BLE features.

Signed-off-by: Morten Priess <mtpr@oticon.com>
2019-10-02 13:20:50 +02:00
Jan Van Winkel
9468cb6eb1 tests: net: hostname: Corrected unique hostname conversion
Replaced net_bytes_from_str in hostname_get test by a new function that
converts the unique part of the hostname in a byte array.

net_bytes_from_str can not be used as it assumes that the string input
is of the format "xx:xx:xx:xx:xx:xx" where as the unique part of the
hostname is a MAC address string without colons. If net_bytes_from_str
is used this could result in buffer overrun on the input string.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2019-10-02 12:52:16 +03:00
Jan Van Winkel
391076c73e samples: net: echo-server: Init tcp6_handler_in_use for IPv6
Initialize tcp6_handler_in_use instead of tcp4_handler_in_use for IPv6
in start_tcp.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2019-10-02 10:07:03 +03:00
Peter Bigot
49d6837bec samples: move board overlay files into boards directory
Application board.overlay files tend to be paired with
boards/board.conf files that extend the functionality of a board.
Move the overlay files to the same location as the config files that
they work with.

A few overlay files that are paired with a prj_board.conf file in the
application root directory are left in place.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-10-01 20:38:24 -07:00
Peter Bigot
0582a0c1bf cmake: add app boards subdir as search location for board overlay files
Putting overlay files in the test/sample root clutters the file
system.  Allow them to be in the boards subdirectory alongside
board.conf files.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-10-01 20:38:24 -07:00
Charles E. Youse
89a984e644 drivers/i2c/i2c_dw.c: make 64-bit clean
Use UINT_TO_POINTER() macros to silence warnings about casts.

Fixes: #19219

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-10-01 18:12:28 -04:00
Krzysztof Chruscinski
de057ba284 logging: Add log_output flushing to synchronous processing
Even though interrupts are locked before processing in synchronous
call, it is still possible that they will be interrupted by NMI.
In that case log_output module may assert because of buffer
overwritting.

Added flushing of log_output buffer before starting the process to
ensure that output buffer is always in reset state at the beginning.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-10-01 18:11:39 -04:00
Andrei Emeltchenko
e0fbac01a3 samples: usb: webusb: Update README and sample link
Update instructions and webusb sample link.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-10-01 18:11:13 -04:00
Sebastian Bøe
e169818b68 cmake: Cleanup ethernet include directory handling
The zephyr/subsys/net/l2 include directory has been added through the
'zephyr_library_' API to modify the 'zephyr' library, when the
'zephyr_' API should have been used.

This patch fixes this problem. Using 'zephyr_library_' in this context
works by accident when 'zephyr' is the current library but has no
guarantees of working in the future.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2019-10-01 18:05:58 -04:00
Jan Van Winkel
7c07093f66 kernel: tests: Increased TX/RX buf size in pipe test
Increased TX/RX buffer size by one in pipe test to prevent buffer
overrun.

Some test will transfer one byte more then the number of bytes
supported by the pipe, in case the buffer size is the same as the
size of the pipe this will result in a buffer overrun.
Tools such as address sanitizer would detect this overrun and fail the
test.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2019-10-01 17:56:02 -04:00
Andrew Boie
13433fcc4b x86: fix EXCEPTION_DEBUG dependency
This requires logging, not printk.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-10-01 16:15:55 -05:00
Andrew Boie
cb1dd7465b kernel: remove vestigal printk references
Logging is now used for these situations.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-10-01 16:15:06 -05:00
Anas Nashif
9d70a87f20 drivers: espi: move header to include/drivers
Driver APIs need to go into include/drivers/.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-10-01 16:18:36 -04:00
Erwin Rol
1af66a9cc5 include/tc_util.h: Rename __str to fix C++ compile error
Several C++ std library headers use __str as internal
variable names. If those headers are included after
tc_util.h is included those headers fail to compile
because tc_util.h defined __str to be a macro.

Fixed by renaming the __str macro to TC_STR.

Signed-off-by: Erwin Rol <erwin@erwinrol.com>
2019-10-01 13:08:58 -07:00
Anas Nashif
6add267377 tests: tinycrypt: build only on native_posix
Move tinycrypt related header into test and make those tests only build
on native_posix. The tests are unit tests, ie. testing tinycrypt
functionality only without any dependency on the underlying system.

Long term we should move those to be true unit tests and create
functional and integration tests that use tinycrypt in the context of
Zephyr and for real use-cases.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-10-01 10:42:19 -07:00
Sebastian Bøe
ba287d2b27 cmake: Fix bug where DTS_BINDINGS_DIRS could only have one entry
Fix a bug where DTS_BINDINGS_DIRS could only have one entry. When
there were more than one entry the command for invoking menuconfig
became corrupted.

This changes the separator of DTS_BINDINGS_DIR from a space to ? so
that the shell does not interpret the space as an argument separator.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2019-10-01 10:35:23 -07:00
Andrew Boie
99b3f8617e kernel: use logging for userspace errors
We want to use a single API for this in kernel code.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-10-01 10:23:03 -07:00
Nicolas Pitre
dc246fb1ca SYS_MEM_POOL_DEFINE(): move BUILD_ASSERT() at the end
Similarly to commit 223a2b950f ("mempool: move BUILD_ASSERT to the
end of K_MEM_POOL_DEFINE"), move BUILD_ASSERT() at the end for
consistency.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-10-01 10:22:18 -07:00
Sebastian Bøe
9d0e2cb325 cmake: Fix usb include directory organization
There are two problems with how zephyr/subsys/usb is being added to
the include path. Firstly it is using the zephyr_library_ API to
modify the zephyr library, when the zephyr_ API should have been used.

Secondly the code is located in the class directory even though it
affects the more general usb directory.

This patch fixes these issues. Using zephyr_library_ in this instance
works by accident when 'zephyr' is the current library but has not
guarantees of working in the future.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2019-10-01 19:22:02 +02:00
Ulf Magnusson
c15705f180 doc: genrest: Separate turbo mode logic from rest of code
KCONFIG_TURBO_MODE being twisted up in the normal logic made the code
hard to follow and change.

Use a separate write_dummy_index() function for KCONFIG_TURBO_MODE
instead, and add more documentation for it. Also get rid of options.rst
and just write all the symbol link targets directly to the dummy index
file, which is a bit simpler.

As a small piggybacked improvement for default values, make the heading
'default' instead of 'defaults' when there's only one. The menuconfigs
do this too.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-10-01 19:21:02 +02:00
Carles Cufi
cd9b940756 Bluetooth: common: Statically check for immediate logging
Immediate logging is not compatible with the software-based controller
due to the additional ISR latency that it introduces. Ensure that
deferred logging is in use whenever using the software-based LL.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-10-01 19:11:16 +02:00
Carles Cufi
f8da57a93e tests: bluetooth: shell: Revert back to default logging settings
Disable the CONFIG_TEST_LOGGING_DEFAULTS Kconfig option which forces
immedate logging, since that is not compatible with Bluetooth and its
tests.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-10-01 19:11:16 +02:00
Carles Cufi
6c5fc1b532 doc: bluetooth: Add 1.14 qualification listings
Add the 3 new listings obtained in the 1.14.x LTS release.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-10-01 10:42:41 -04:00
Jose Alberto Meza
953952adbd samples: drivers: espi: Remove delay from eSPI handshake
Make sure eSPI handshake is performed with eSPI master
once eSPI master power is up

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2019-10-01 09:24:42 -04:00
Andrew Boie
7e29c9da0b logging: add minimal implementation
The log mechanism, even in immediate mode, adds somewhere
between 1K-2K of footprint to applications that use it.

We want to standardize the logging APIs for all logging
within the kernel, but need to not let platforms with
very constrained RAM/ROM in the dust.

This patch introduces CONFIG_LOG_MINIMAL, which is a very
thin wrapper to printk(). It supports the APIs expressed
in logging/log.h.

This will be the new default for test cases.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-10-01 09:24:02 -04:00
Andrew Boie
1b900bf546 bluetooth: monitor: don't build backend if minimal
Log backends don't exist with minimal logging enabled,
don't compile this code.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-10-01 09:24:02 -04:00
Andrew Boie
a7787c8519 shell: fix configuration issue
These checks should be against CONFIG_SHELL_LOG_BACKEND,
and not against CONFIG_LOG, since it's possible to enable
logging without building this particular backend.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-10-01 09:24:02 -04:00
Andrew Boie
d6d3f152b3 logging: remove return value from log_printk()
printk() doesn't return a value, this doesn't need to
either.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-10-01 09:24:02 -04:00
Andrew Boie
638f480b35 log: remove duplicate log_printk() definition
The same function should not be defined in two different
headers.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-10-01 09:24:02 -04:00
Andrew Boie
144f2cb2b3 logging: abstract log_core_init()
Similar to how LOG_INIT(), LOG_PANIC(), etc are
wrapped.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-10-01 09:24:02 -04:00
Wayne Ren
56650aff7e arch: arc: fix the bug in prologue of sys call handling
* the old codes may not save the caller saved regs correctly,
  e.g. r7- r12. Because the sys call entry is called in the form
  of static inline function. The compiler optimizations may not save
  all the caller saved regs.

* new codes use the irq stack frame as the sys call frame and gurantee
  all the called saved regs are pushed and popped correctly.

* the side effect of new codes are more stack operations and a little
  overhead.

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2019-10-01 09:22:30 -04:00
Andrei Emeltchenko
67795b79a2 usb: Remove extra logs
usb_handle_bos() and usb_handle_os_desc() are got invoked from
usb_handle_standard_request(), remove those unneeded logs.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-10-01 09:16:42 -04:00
Jan Van Winkel
b3ce7cb1c8 kernel: tests: Added header with common declarations
Added header file containing common declarations for tstack,
tstack_size and tdata.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2019-10-01 09:16:01 -04:00
Sebastian Bøe
bb6a6e8fcc cmake: Move the invocation of 'project' earlier
The CMake documentation for 'project' states "Call the project()
command near the top of the top-level CMakeLists.txt". Meaning, it
should be run as early as possible.

An obscure internal error was observed when 'project' was located in
zephyr/CMakeLists.txt and was observed to be fixed after moving
'project' earlier, hence this patch that moves it earlier.

Invoking project depends on knowing information about the toolchain so
it is placed after target_toolchain.cmake.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2019-10-01 06:26:03 -05:00
Jukka Rissanen
7e0d8bcf7a samples: net: echo-server: Add support for multiple listeners
By default only one listener is enabled, but if user specifies
CONFIG_NET_SAMPLE_NUM_HANDLERS with value larger than 1, then
multiple threads are created, and each will be able to accept
connections.

Fixes #19374

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-10-01 14:21:38 +03:00
Laczen JMS
b9dc69b38e subsys/settings: Remove optional from Kconfig
Kconfig does not set SETTINGS_NONE as default backend (meaning no
backend) because SETTINGS_NONE is optional. There is no difference
between SETTINGS_NONE and SETTINGS_CUSTOM. By removing the optional line
SETTINGS_NONE is selected as default, to use a custom backend
SETTINGS_CUSTOM=y must be set.

Signed-off-by: Laczen JMS <laczenjms@gmail.com>
2019-10-01 06:20:36 -05:00
Andrew Boie
89d4c6928e kernel: add arch abstraction for irq_offload()
This makes it clearer that this is an API that is expected
to be implemented at the architecture level.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-10-01 11:11:42 +02:00
Erwin Rol
0f5d2d323f arch/x86: add Z_ARCH_THREAD_STACK_MEMBER() macro
Implement standard Z_ARCH_THREAD_STACK_MEMBER() arch interface macro.

Signed-off-by: Erwin Rol <erwin@erwinrol.com>
2019-09-30 15:34:45 -07:00
Anas Nashif
cb5e6b234d tests: rtc: rename test.yaml to testcase.yaml
testcase file wrongly named test.yaml.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-09-30 17:20:22 -04:00
Anas Nashif
965aac39b6 tests: board_shell: rename test.yaml to testcase.yaml
testcase file wrongly named test.yaml.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-09-30 17:20:22 -04:00
Anas Nashif
2d4837061a tests: fix identifiers
Fix identifier and rename plain 'test' to something more appropriate.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-09-30 17:20:22 -04:00
Jose Alberto Meza
4c095b5cbc drivers: gpio: xec: Ensure GPIO input is enabled
All GPIOs except VCI pins come in default GPIO mode and  input disabled
Need to explicitly enable input apart from setting direction.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2019-09-30 13:42:58 -07:00