Commit graph

41120 commits

Author SHA1 Message Date
Ulf Magnusson
32e6565fd7 scripts/dts: Merge Bindings.binding() into load_bindings()
load_bindings() is trivial, and it allows some stuff to simplified, like
the check for no bindings being found, and the assignments to the
extract.globals.{bindings,bus_bindings,bindings_compat}.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-02-14 10:49:44 -06:00
Ulf Magnusson
706809e9b0 scripts/dts: Turn Bindings._included into a global
This is (probably) a temporary change just to be able to move some stuff
out of the Bindings class.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-02-14 10:49:44 -06:00
Ulf Magnusson
a1f1969331 scripts/dts: Separate out finding binding (.yaml) files
As a step in moving some functions out of the Bindings class.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-02-14 10:49:44 -06:00
Ulf Magnusson
d859f4f937 scripts/dts: Move initialization logic into load_bindings()
Makes main() more readable.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-02-14 10:49:44 -06:00
Ulf Magnusson
e17af82190 scripts/dts: Rename load_yaml_descriptions() to load_bindings()
More explicit, and consistent with other code.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-02-14 10:49:44 -06:00
Kumar Gala
1f1282afa4 scripts/dts/extract_dts_includes: Limit conf file to DT prefix defines
Only write out to the .conf file if the define starts with "DT_".  The
the conf file should only be used by sanitycheck, west, and
kconfigfunctions at this time.  In the future we should remove it, so
lets limit what's it exposing at this time.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-14 10:45:25 -06:00
Kumar Gala
1f68831197 samples: Use DT_ prefix define for DT filters
Update the filters that are extracting info from DT to use a define that
has a DT_ prefix so its clear that its coming from DT_.  Also this lets
us remove any non-DT prefixed defines in the conf db.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-14 10:45:25 -06:00
François Delawarde
74f9901b8d debug: Place Kconfig tracing options in debug submenu
Fix Kconfig options placed incorrectly in top level menu.

Signed-off-by: François Delawarde <fnde@oticon.com>
2019-02-14 10:29:06 -05:00
Jakub Rzeszutko
46a02322ec shell: allow commands to suspend shell thread
It was possible to deadlock the shell when command
suspended shell's thread and next another thread wanted
to print something on the shell.

To avoid that shell releases mutex before entering command
handler. Due to this change some  adapations to shell
internal print functions have been applied.

This change addresses following usecase:
1. A command handler needs to call a (system) function which
communicate results via a callback, and this callback is expected
to print these results. The callback is called by the system from
another thread.
2. To achieve that, the handler needs to pass `struct shell *`
to callbacks, but also some other data specific to callback.
Thus, handles allocates some structure will those fields on
the stack.
3. The handler schedules this callback to be called.
4. As a reference to stack structure is passed to the callback,
the handler can't return immediately (or stack data will go out
of scope and will be overwritten).
5. So, the handler blocks waiting for callback to finish.

Previously, this scenario led to deadlock when the callback
trying or print to shell. With these changes, it just works,
as long as main handler and callback serialize there access
to the shell structure (i.e. when callback prints, the main
handler is blocked waiting for its completion).

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2019-02-14 13:40:28 +01:00
Tomasz Gorochowik
0604c30a1b net: gptp: Fix pkt allocation with debugs enabled
Commit 44964c735e ("net/gptp: Switch GPTP to new net_pkt API") changed
the callback used for allocation (from net_pkt_get_reserve_tx to
net_pkt_alloc_with_buffer), but for compilation with
CONFIG_NET_DEBUG_NET_PKT_ALLOC enabled, both callbacks are used
(the first pointer was just overwritten, causing MPU FAULT).

This commit removes the extra callback and fixes the fault.

Signed-off-by: Tomasz Gorochowik <tgorochowik@antmicro.com>
2019-02-14 05:15:25 -06:00
Kumar Gala
b814af827d scripts/dts/extract: Fix how we determine DT_FLASH_AREA_<X>_DEV
DT_FLASH_AREA_<X>_DEV should be the label of the flash controller.  For
flashes that are "jedec,spi-nor" the flash itself is considered the
controller.  For "soc-nv-flash" the parent of the flash is assumed to be
the controller.

Rework the logic in how we determined DT_FLASH_AREA_<X>_DEV to handle
both cases.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-14 05:13:35 -06:00
Johann Fischer
70776028f5 drivers: apds9960: fix ALS in non-trigger mode
Generate interrupt on every ALS cycle in non-trigger mode
and enable ALS saturation interrupt.

resolves: #11989

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-02-13 22:10:21 -06:00
Erwan Gouriou
516899c82b boards: nucleo_l4r5zi: Add flash & debug support
Following introduction of zephyr sdk0.10 and openocd branch
from from 20190130, stm32l4+ SoC support is now available and
flash and debug operations are available on nucleo_l4r5zi board.

Fixes 12094

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-02-13 22:05:49 -06:00
Michael Scott
844c2ad716 net: lwm2m: fix NULL deref in plain_text_read_number()
Per Coverity report, we are assigning the value1 and value2
s64_t pointers a value of 0.  Later when we go to use value1
and value2, they are of course ... NULL.

Fix the typos in the initial assignment of 0 to the
references of value1 and value2.

Fixes: https://github.com/zephyrproject-rtos/zephyr/issues/12300
Fixes: https://github.com/zephyrproject-rtos/zephyr/issues/12296

Signed-off-by: Michael Scott <mike@foundries.io>
2019-02-13 21:02:53 -05:00
Michael Scott
f6b221699c net: lwm2m: fix out-of-bounds access in put_s8()
Per Coverity report, oma_tlv_put() does pointer arithmetic accessing
the data as an array of u8_t.  In put_bool() we get a singleton
pointer from the evaluation of: "value != 0 ? 1 : 0" which is
passed to put_s8() which in turn passes it to oma_tlv_put().

To avoid misinterpretation, let's create a temporary s8_t variable
to pass into oma_tlv_put instead.

Fixes: https://github.com/zephyrproject-rtos/zephyr/issues/12312

Signed-off-by: Michael Scott <mike@foundries.io>
2019-02-13 21:02:53 -05:00
Michael Scott
95f21d59b7 net: lwm2m: remove checks for long int > MAX_INT
Per Coverity report, the evaluation of long int v > MAX_INT is
always false and considered a CONSTANT_EXPRESS_RESULT issue.

Removed these checks from:
atof32()
lwm2m_write_attr_handler()

Fixes: https://github.com/zephyrproject-rtos/zephyr/issues/12317
Fixes: https://github.com/zephyrproject-rtos/zephyr/issues/12320

Signed-off-by: Michael Scott <mike@foundries.io>
2019-02-13 21:02:53 -05:00
Krzysztof Chruscinski
c73dc42a82 tests: drivers: counter: Test cleanup
Minor cleanup in counter test.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-02-13 18:15:56 -05:00
Krzysztof Chruscinski
849726b3e4 tests: drivers: counter: Fix single_shot_alarm_top and multiple_alarms
Tests were failing because:

1. `alarm_cnt` was not reset before the test.
2. one test was failing because it was expecting that setting
`top_value` for channel_alarm is too high value but in fact
it is accepted and `top_value+1` is too much.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-02-13 18:15:56 -05:00
Maureen Helm
0540b1a699 soc: nxp_imx: Move code/data location configs to soc level
The imx rt family of socs has several options for linking code and data
into internal or external memories, and up until now we have handled
these options at the board level. This has resulted in several Kconfig
symbols being defined in multiple places and triggering warnings in
documentation builds:

warning: the default selection CODE_ITCM (defined at boards/arm/mimxrt1050_evk/Kconfig:13, boards/arm/mimxrt1060_evk/Kconfig:13) of <choice> (defined at boards/arm/mimxrt1050_evk/Kconfig:9) is not contained in the choice
warning: the choice symbol CODE_ITCM (defined at boards/arm/mimxrt1050_evk/Kconfig:13, boards/arm/mimxrt1060_evk/Kconfig:13) is defined with a prompt outside the choice
warning: the choice symbol CODE_HYPERFLASH (defined at boards/arm/mimxrt1050_evk/Kconfig:16, boards/arm/mimxrt1060_evk/Kconfig:16) is defined with a prompt outside the choice
warning: the choice symbol CODE_QSPI (defined at boards/arm/mimxrt1050_evk/Kconfig:19, boards/arm/mimxrt1060_evk/Kconfig:19) is defined with a prompt outside the choice
warning: the choice symbol CODE_ITCM (defined at boards/arm/mimxrt1050_evk/Kconfig:13, boards/arm/mimxrt1060_evk/Kconfig:13) is defined with a prompt outside the choice
warning: the choice symbol CODE_HYPERFLASH (defined at boards/arm/mimxrt1050_evk/Kconfig:16, boards/arm/mimxrt1060_evk/Kconfig:16) is defined with a prompt outside the choice
warning: the choice symbol CODE_QSPI (defined at boards/arm/mimxrt1050_evk/Kconfig:19, boards/arm/mimxrt1060_evk/Kconfig:19) is defined with a prompt outside the choice

The number of warnings increased as we added more imx rt boards. Fix the
warnings by moving code and data location configs from the board level
to the soc level.

The default memories for all imx rt boards are unchanged. The
mimxrt10{20,50,60}_evk boards still default to hyperflash/qspi for code
and sdram for data. The mimxrt1064_evk board still defaults to ITCM for
code and DTCM for data because jlink does not yet support programming
internal flash.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-02-13 17:52:20 -05:00
Krzysztof Chruscinski
4fac1f4204 shell: Add support to log_panic in RTT backend
Shell RTT backend was using RTT call which was using
lock (mutex). In case of panic, that lead to failure
if panic occured in the interrupt context where mutex
is not permitted.

Implementation changed to use write without log in
blocking mode.

Additionally, added static assert to check if raw RTT
log backend is not enabled on channel 0 which is used
by shell RTT backend.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-02-13 17:25:59 -05:00
Kumar Gala
02670ed2d7 spi: spi_mcux_lpspi: Convert to use DT_ prefixed defines
The spi mcux_lpspi driver has been using non DT_ prefixed defines for
DT generated defines.  Switch to use DT_ prefixed ones as we want to
deprecated the non DT_ prefixed defines.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-13 16:59:02 -05:00
Andrew Boie
d2886ab8bc x86: clear EFLAGS on double fault
In the event of a double fault, we do a HW task switch to
a special _df_tss hardware task which resets the stack
pointer to the interrupt stack and otherwise restores
the main hardware task to a runnable state so that
_df_handler_bottom() can run.

However, we need to make sure that _df_handler_bottom()
runs with interrupts locked, otherwise another IRQ could
corrupt the interrupt stack resulting in undefined
behavior.

We have very little stack space to work with in this
context, just zero it. It's a fatal error for the thread
in any event.

Fixes: #7291

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-02-13 10:58:42 -08:00
Erwan Gouriou
1227b2feda samples/bluetooth: Add note about Long term key clearance
It could happen that bluetooth samples fail because of stored LTK
on device used to test the sample (eg smartphone).

Add a note in bluetooth sample doc to inform users of this trick.

Fixes #13034

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-02-13 19:51:39 +02:00
Andy Gross
89fb37b76a uart: pl011: Use correct masking for ICR
This patch changes the ICR masking to use a fixed mask instead of
a buggy read/write of the current ICR to itself.  The ICR is write
only and reading this for information is unpredictable and should
be avoided.

Signed-off-by: Andy Gross <andy.gross@linaro.org>
2019-02-13 11:08:22 -06:00
Krzysztof Chruscinski
be06327d39 kernel: Reworking _K_TIMER_INITIALIZER and _K_PIPE_INITIALIZER for C++
Modify macros for struct initialization to compile in C++.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-02-13 11:06:56 -06:00
Andrzej Głąbek
7e3d5142a6 settings: Fix default value of flash area ID in Kconfig
Use the value extracted from DT instead of a hardcoded 4, as it is done
in commit 977b292d8072e4024664cf7293d42e532de64cd4 for tests.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-02-13 11:03:51 -06:00
Ryan Erickson
cb516b4bc9 tests: drivers: adc: adc_api: Add BL654 board support
Add case to support the BL654 DVK board.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdtech.com>
2019-02-13 11:02:56 -06:00
Ryan Erickson
847500dd43 boards: bl654_dvk: Add BL654 DVK board
Add the Laird Connectivity BL654 DVK board to zephyr.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdtech.com>
2019-02-13 11:02:56 -06:00
Kumar Gala
10acd623c9 soc: arm: atmel: sam3x: Add missing SoC Kconfig symbols
soc.h references Kconfig symbols which aren't defined.  Define the
specific SoC versions that are referenced in soc.h

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-13 11:02:33 -06:00
Kumar Gala
20838b493b soc: arm: atmel: sam4s: Fix Kconfig typo
In soc.h reference to CONFIG_SOC_PART_NUMBER_SAM4S18B should have been
CONFIG_SOC_PART_NUMBER_SAM4S8.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-13 11:02:33 -06:00
Jukka Rissanen
dbf7af7f43 net: context: can: Fix typo in Kconfig option name
The option CONFIG_NET_SOCKETS_RAW name was changed to
CONFIG_NET_SOCKETS_PACKET but two checks using the old name
was left to net_context.c

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-02-13 09:18:36 -06:00
Ulf Magnusson
4e02590231 scripts/dts: Change 'Error::' to 'Error:'
Typo.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-02-13 08:53:07 -06:00
Ulf Magnusson
b29a5b0e83 scripts/dts: Add a check_binding_properties() function
Removes some logic from merge_included_bindings() and makes it easier to
follow.

Also remove an outdated comment ('id' no longer exists) and some
comments that might not be helpful.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-02-13 08:53:07 -06:00
Ulf Magnusson
2b8766db53 scripts/dts: Improve documentation for merge_included_bindings()
Use a plain-English description.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-02-13 08:53:07 -06:00
Ulf Magnusson
3f8616add9 scripts/dts: Get rid of yaml_list in Bindings.bindings()
The yaml_list dictionary is three regular variables in disguise, as keys
are never added. Use regular variables instead, which is less confusing.

Hopefully the naming makes sense.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-02-13 08:53:07 -06:00
Ulf Magnusson
9e8c3fdf16 scripts/dts: Fix recursion in merge_included_bindings()
The consistency checks at the beginning of the function were not done
for "leaf" .yaml files.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-02-13 08:53:07 -06:00
Ulf Magnusson
6a15130b9a scripts/dts: Rename yaml_traverse_inherited()
...to merge_included_bindings().

This gives a better hint to what it does (merges properties from
!include'd files).

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-02-13 08:53:07 -06:00
Ulf Magnusson
00b2ec05e5 scripts/dts: Document Bindings._include()
Explain that it implements !include.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-02-13 08:53:07 -06:00
Ulf Magnusson
b98cdc10f6 scripts/dts: Have Bindings._include() always return a list
Makes yaml_traverse_inherited() more straightforward.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-02-13 08:53:07 -06:00
Ulf Magnusson
105c5b426b scripts/dts: Remove support for !import
Implemented as an undocumented and unused synonym for !include.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-02-13 08:53:07 -06:00
Ulf Magnusson
339db385ef scripts/dts: Simplify Bindings._include()
Use a list comprehension for the '!include [foo.yaml, bar.yaml]' case.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-02-13 08:53:07 -06:00
Ulf Magnusson
377a794378 scripts/dts: Remove dead '!include <dict>' implementation
Remove the '!include {foo: bar}' support from Bindings._include(). Only
'!include foo.yaml' and '!include [foo.yaml, bar.yaml]' are documented,
and yaml_traverse_inherited() doesn't implement the dict case either.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-02-13 08:53:07 -06:00
Mieszko Mierunski
bf855c621b api: uart: Revert to using bitmasks for errors.
Revert to using bitmasks for errors.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2019-02-13 09:21:53 -05:00
Vinayak Kariappa Chettimada
85d92923e2 Bluetooth: controller: Rename non-Kconfig option macros
Remove CONFIG_ prefix from non-Kconfig macro definitions.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2019-02-13 09:20:26 -05:00
Kumar Gala
a6eab1be4b tests: spi_loopback: reduce footprint by tweaking logging
Using CONFIG_LOG_IMMEDIATE gives us some flash back.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-13 08:15:37 -06:00
Paul Sokolovsky
3b73511153 net: sockets: Add dummy shutdown() implementation.
shutdown() itself is described as just marking RX or TX path of a
socket as not available. For the first approximation, we implement
it just as a dummy function, to allow build existing POSIX
applications which use it.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-02-13 07:00:51 -06:00
Michael Scott
91ef79539a net: lwm2m: fix rendering of zero value float32/64
Zero is a special value in the binary32/64 format.  It has all zero
bits (sign=0, exponent=0 and fraction=0).

Handle this special case explicitly instead of trying to encode
in binary format which results in an incorrect value of 0.5.

Signed-off-by: Michael Scott <mike@foundries.io>
2019-02-13 07:00:33 -06:00
Marc Herbert
5284231750 doc: fix incremental build by fixing doxygen output mtime
Doxygen doesn't support incremental builds.  It could be ok because it
doesn't take much time in this codebase.  However it's not because it
makes old output look new which has a cascade effect on sphinx:
https://sourceforge.net/p/doxygen/mailman/message/36580807/

Make doxygen artificially smarter by saving and restoring modify
timestamps on the filesystem for doxygen output files that haven't
changed.

On my system this brings down the time to run an incremental "make
htmldocs" from 75s down to 8s (cmake -DKCONFIG_TURBO_MODE=1 used in both
cases)

This optimization speeds-up non-doxygen documentation work only.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2019-02-13 06:58:52 -06:00
Aurelien Jarno
8236f3d72c arch: arm: mpu: get the region sizes from the linker
The linker file defines the __gcov_bss_size and _nocache_ram_size
symbols to get the size of the __gcov_bss and _nocache_ram section. Use
that instead of computing the value at runtime from the start and end
symbols.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2019-02-13 06:58:01 -06:00
Tomasz Bursztyka
dad4b297f3 net/context: No need to set pkt family as the allocator did already
net_context uses net_pkt_alloc_with_buffer(), which sets the family and
protocol (according to parameters) so no need to set the family again.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-02-13 06:56:15 -06:00