Commit graph

41120 commits

Author SHA1 Message Date
Kumar Gala
6833ea718f kconfig: Remove dead references to CONFIG_PCI_DEBUG
CONFIG_PCI_DEBUG isn't a Kconfig option we support anymore so remove
some dead references to it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-03-07 13:04:29 -06:00
Tedd Ho-Jeong An
32caf24cb4 samples: sockets: echo_async: Add more error checking
This patch adds more error checking and handling for socket APIs.

Fixes: #13885
Coverity-CID: 190928

Signed-off-by: Tedd Ho-Jeong An <tedd.an@intel.com>
2019-03-07 10:15:59 -05:00
Kumar Gala
eba74fa809 samples: net: nets: Remove references to CONFIG_NET_DHCPV6
CONFIG_NET_DHCPV6 doesn't exist so remove references to it in the
sample, leave comments about TODO if/when this might exist.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-03-07 10:13:27 -05:00
Kumar Gala
9740078d6c samples: net: wpan_serial: Remove dead code related to CONFIG_DCD_DSR
CONFIG_DCD_DSR does not exist so the code block associated with it would
never be built, so remove it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-03-07 10:13:10 -05:00
Krzysztof Chruscinski
f563ca338f drivers: counter: Fix handling of relative alarms on nrf platform
In case of relative alarm, nrf counter driver for TIMER peripheral
was not handling correctly case when new value exceeded top value.
Additionally, RTC implementation has been refactored to use similar
code for calculating alarm ticks.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-03-07 15:50:10 +01:00
Daniel Leung
bb1c900e28 adc: return EBUSY when requesting new sampling while one in progress
Inside adc_context_request_next_sampling(), it tries to signal an I/O
error if there is a new request while a sampling is in progress.
However, it is not exactly an I/O error. The system is simply busy.
So signal EBUSY instead.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-03-07 09:41:19 -05:00
Tedd Ho-Jeong An
2df4652077 samples: sockets: echo_async_select: Add error check
This patch adds error checking routine for socket APIs.

Fixes: #13852
Coverity-CID: 190966

Signed-off-by: Tedd Ho-Jeong An <tedd.an@intel.com>
2019-03-07 09:40:13 -05:00
Varun Sharma
145d8f06e0 tests: subsys: fs : Fix coverity issue
Fix Unchecked return value in func: nffs_test_util_create_file_blocks

Coverity-CID: 190955
Fixes: #13860

Signed-off-by: Varun Sharma <varun.sharma@intel.com>
2019-03-07 09:39:39 -05:00
Ulf Magnusson
7089ec76b9 kconfig: pinmux: Remove lots of redundant PINMUX dependencies
Most of these are from source'ing a file within an 'if PINMUX', and then
adding another 'depends on PINMUX' within it.

'if FOO' is just shorthand for adding 'depends on FOO' to each item
within the 'if'. There are no "conditional includes" in Kconfig, so
'if FOO' has no special meaning around a 'source'. Conditional includes
wouldn't be possible, because an 'if' condition could include (directly
or indirectly) forward references to symbols not defined yet.

Tip: When adding a symbol, check its dependencies in the menuconfig
('ninja menuconfig', then / to jump to the symbol). The menuconfig also
shows how the file with the symbol got included, so if you see
duplicated dependencies, it's easy to hunt down where they come from.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-03-07 08:47:31 -05:00
Ulf Magnusson
61bcd766f7 kconfig: drivers: entropy: Remove duplicated ENTROPY_GENERATOR deps.
Also remove some duplicated dependencies for the related symbol
ENTROPY_NRF5_RNG.

The redundant ENTROPY_GENERATOR deps. are in files sourced within a

  if ENTROPY_GENERATOR
  ...
  endif

block in drivers/entropy/Kconfig.

The redundant ENTROPY_NRF5_RNG deps. are due to redundant 'depends on'
within an 'if' in the same file.

Tip: Jump to symbols with '/' in the menuconfig and press '?' to check
their dependencies. If there are duplicated dependencies, the
'included via ...' path can be handy to discover where they are added.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-03-07 13:38:35 +01:00
Jiri Kubias
b71b9c688c serial: u(s)art_sam: Fixed return value of usart_sam_irq_is_pending
The function usart_sam_irq_is_pending (uart_sam_irq_is_pending) return
only the masked value of US_CSR register but it doesn't respect if the
IRQ is enabled or not. For proper function it must check if the IRQ is
enabled for the event.

Signed-off-by: Jiri Kubias <jiri.kubias@leapslabs.com>
2019-03-07 06:24:48 -06:00
Filip Brozovic
fb3d9744cc lvgl: lvgl_color_1: add support for horizontally tiled displays
Enable displays which do not have SCREEN_INFO_MONO_VTILED set to work
with LittlevGL

Signed-off-by: Filip Brozovic <fbrozovic@gmail.com>
2019-03-07 07:18:50 -05:00
Benjamin Valentin
4dc672fc19 power: don't switch to power modes not enabled in Kconfig
Disable low power/deep sleep modes when they are not enabled in Kconfig.
Otherwise if only low power modes are enabled (but no deep sleep),
Zephyr will try to swich to the lowest power mode (deep sleep) anyway,
only to discover that it's not availiable, resulting in no low power
mode at all being used.

By disabling the modes here if they are not enabled in Kconfig,
policy_residency will switch to the lowest low power mode instead.

Signed-off-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2019-03-07 07:18:10 -05:00
Ravi kumar Veeramally
746618460b net: tests: Migrate UDP tests
Migrate UDP tests to new net_pkt API.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2019-03-07 07:17:36 -05:00
Krzysztof Chruscinski
cae3c28a96 logging: Fix RTT log backend lagging if no host
In case it was detected that RTT host was not present
backend was still performing single sleep or busy wait
round before dropping data. That was degrading log
processing performance.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-03-07 13:06:52 +01:00
Michael Scott
d5d35d06d1 drivers: modem: wncm14a2a: cleanup wncm14a2a_rx() handler block
Coverity doesn't like that we're storing the return value of
net_buf_findcrlf() near the end of the handler block as "len".
Only to overwrite "len" again once we exit and look for the next
match.

Let's ignore the return value there and also remove the redundant
check for !frag.  Either way, we've found a handler, and need to
break the search loop.

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

Signed-off-by: Michael Scott <mike@foundries.io>
2019-03-07 04:58:45 -06:00
Michael Scott
693827d09b drivers: modem: wncm14a2a: Fix illegal mem access in on_cmd_sockread()
We can't let i == value_size during the loop which gathers characters
for the length.  If we do, the next check of "value[i] != ','" would
access memory beyond the value boundary.

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

Signed-off-by: Michael Scott <mike@foundries.io>
2019-03-07 04:58:45 -06:00
Andrew Boie
90132d3543 tests: jwt: lower heap size
The heap, plus a few globals relevant to mbedtls get put in
their own memory partition.

With systems that have power-of-two region size/alignment
constraints, this results in a 64K partition being created,
even though we are using just a whisker above 32K.

Lower the heap size a little so everything fits in 32K.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-03-07 04:27:32 -06:00
Ulf Magnusson
bc0a0ed246 kconfig: arm: cortex_m: Remove duplicated CPU_CORTEX_M dependencies
The "ARM Cortex-M options" menu is already within a 'if CPU_CORTEX_M',
so no need to put 'depends on CPU_CORTEX_M' on it.

Tip: Jump to symbols with '/' in the menuconfig and press '?' to check
their dependencies. If there are duplicated dependencies, the
'included via ...' path can be handy to discover where they are added.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-03-07 04:21:17 -06:00
Sebastian Bøe
f96c9bc75a kconfig: Have ninja Re-run CMake when Kconfig sources change
Users often get confused when they change Kconfig sources and then
rebuild only to discover that nothing happens. To fix this we add a
dependency between re-running cmake, and all Kconfig sources, similair
to how touching CMakeLists.txt files cause CMake to re-run.

This fixes #5634

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2019-03-07 10:40:00 +01:00
Sebastian Bøe
cabb35fcc9 cmake: Kconfig: Minor refactorings in preparation for solving #5634
Minor refactoring of the build scripts in preparation for the patch
that resolves #5634.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2019-03-07 10:40:00 +01:00
Flavio Ceolin
48c6548d6a x86: core: Remove extra parenthesis
Extra parenthis was raising a warning when building using Clang/llvm

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2019-03-06 22:40:25 -05:00
Flavio Ceolin
18d96436a0 compiler: clang: Include missing target
Adding baremetal target when using clang/llvm.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2019-03-06 22:40:25 -05:00
Maureen Helm
5ebf6104a2 soc: nxp_kinetis: Add HAS_MCUX_FTFX to conditionalize mcux flash driver
Adds a new config HAS_MCUX_FTFX to conditionalize the mcux flash driver
on socs that support it. Selects HAS_MCUX_FTFX on all kinetis socs
except kw40z, because even though this soc has the relevant hardware,
its CMSIS header file is not compatible with the mcux flash driver in
ext/.

This change also prevents enabling the mcux flash driver on lpc and imx
rt boards.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-03-06 21:19:25 -06:00
Marc Herbert
f78288be20 gen_kobject_list.py: OrderedDict for < 3.6 determinism
Dictionaries are iterated in a random order by Python 3.5 and before.
This could have caused "Unstable" CI in PR #13921 and maybe others.
Anyway we want builds to be determimistic by default. Explicit
randomness can be added for better coverage but not by default.

1. When running "make kobj_types_h_target" repeatedly one can observe
that the following .h files keep changing in
build/zephyr/include/generated/:

- kobj-types-enum.h
- otype-to-str.h
- otype-to-size.h

Switching kobjects to OrderedDict makes these 3 .h files deterministic.

2. When running this test repeatedly with CONFIG_USERSPACE=y:

  rm build/zephyr/*.gperf && make -C build obj_list

... the dict used for --gperf-output seems to be deterministic, probably
because its keys are all integers (memory addresses). However we can't
take that for granted with Python < 3.6 so out of caution also switch
the output of find_objects() in elf_helper.py to a sorted OrderedDict.

PS: I would normally prefer official Python documentation to
StackOverflow however this one is a good summary and has all the
multiple pointers to the... official Python documentation.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2019-03-06 20:58:58 -05:00
Marc Herbert
73cb0bf306 extract_dts_includes.py: deterministic flash table with Python < 3.6
To reproduce the issue this addresses, run "cmake -B96b_nitrogen"
twice with Python 3.5. Observe the order of the flash partition table
changing in:
"build{1,2}/zephyr/include/generated/generated_dts_board.conf" and
"generated_dts_board_unfixed.h"

Dictionaries are iterated in a random order by Python 3.5 and before.
This could have caused "Unstable" CI in PR #13921 and maybe others.
Anyway we want builds to be determimistic by default. Explicit
randomness can be added for better coverage but not by default.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2019-03-06 20:58:58 -05:00
Arnaud Pouliquen
97f4265c12 tests: fix compilation error for printk
Fix multiple definitions of `ram_console'. The ram_console
array is already defined in drivers/console/ram_console.c.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
2019-03-06 18:15:06 -05:00
Tomasz Bursztyka
7b2d33f432 usb/net: Switch RNDIS netusb driver to new net_pkt API
Using new allocator and pkt writer instead.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-03-06 17:46:18 -05:00
Tomasz Bursztyka
28f499ee15 usb/net: Fix MTU size
Commit 766101c was a wrong fix as NETUSB_MTU is the actual network MTU.
Instead of using this value in EEM/ECM drivers, a relevant value should
be set for each there.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-03-06 17:46:18 -05:00
Tomasz Bursztyka
846f84a20f usb/net: Switch ECM netusb driver to new net_pkt API
Using new allocator and pkt writer instead.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-03-06 17:46:18 -05:00
Tomasz Bursztyka
b8b63e06db usb/net: Switch EEM netusb driver to new net_pkt API
Using new allocator and pkt writer instead.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-03-06 17:46:18 -05:00
Tomasz Bursztyka
e911f3821b usb/net: Extend netusb API to get the actual network interface pointer
This will be needed from receiver implementation (eem or ecm).

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-03-06 17:46:18 -05:00
Patrik Flykt
e8f6ea2c8c lib/os: Remove case ranges from printk
Remove case ranges from printk in order to clean up GNUisms
and make the code standards compliant.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2019-03-06 17:44:04 -05:00
Patrik Flykt
dfc2cd038d drivers/led: Remove case ranges from the LP3943 LED driver
Remove case ranges from the LP3943 LED driver in order to clean
up GNUisms and make the code standards compliant.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2019-03-06 17:44:04 -05:00
Anas Nashif
4fcbb6bdf2 Revert "net: sockets: recv_stream: Check that the underlying net_context active"
This reverts commit 8cb5d083cb53627964ed72fb9fa3fb7a5219739f.

This was breaking tests on master due to missing dependency that is
still being reviewed.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-03-06 17:40:52 -05:00
Paul Sokolovsky
1b837d64de tests: socket: tcp: Test handling of EOF condition on socket
If peer socket closed, the other side should get 0 from recv(), and
should get in stable manner (no matter how much time went from the
closure and/or how many times recv() is called).

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-03-06 15:57:40 -05:00
Paul Sokolovsky
41864915c2 net: sockets: recv_stream: Check that the underlying net_context active
It may be closed by the stack behind our back (something which needs
to be fixed).

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-03-06 15:56:57 -05:00
Tomasz Gorochowik
35b7fde8a6 drivers: eth: gmac: fix screening registers limit check
The j iterator is used for priorities, and the i iterator is used for
choosing the actual screening register. Therefore the screening register
availability needs to be checked with i.

This commit also improves the readability by doing two things:
* by moving the screening register index check to a place where the
  index is going to be actually used
* by using the ARRAY_SIZE macro instead of a hard-coded number as the
  upper limit

Signed-off-by: Tomasz Gorochowik <tgorochowik@antmicro.com>
2019-03-06 11:43:17 -06:00
Andrzej Głąbek
ca11c0cec4 ext: nordic: Unify NRFX_RTC* options handling in nrfx_config*.h
This patch unifies the way NRFX_RTC* Kconfig options are handled in
nrfx_config*.h files for particular Nordic SoCs, so that these files
are easier in maintenance. For nRF52810 and nRF9160, this means adding
of support for these options, since it was missing.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-03-06 11:37:51 -06:00
Andrzej Głąbek
b1701a2a47 ext: nordic: Unify NRFX_UART[E]* options handling in nrfx_config*.h
The NRFX_UARTE* Kconfig options were handled only in the nrfx_config
for nRF9160. This commit updates remaining nrfx_configs, so that these
options are handled uniformly for all Nordic SoCs.
The NRFX_UART option, although defined in ext/hal/nordic/Kconfig,
were not supported in any of nrfx_config files, effectively making
it impossible to use nrfx_uart.c driver. This commit corrects this.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-03-06 11:37:51 -06:00
Andrzej Głąbek
311cb182a8 ext: nordic: Update nrfx_config_nrf52810.h entries
This is a follow up to commit f0cf126015a073a5417e6fcfd06b2d41f0f18d87.
Entries in nrfx_config_nrf52810.h are synchronized with the template
from nrfx v1.6.2. In particular, the entries for SPI0, TWI0, and UART0
peripherals are added, so that these peripherals can be actually used
by nrfx drivers in Zephyr.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-03-06 11:37:51 -06:00
Maureen Helm
7e720a6052 boards: mimxrt1064_evk: Default to internal flash and external sdram
JLink V6.44 (2019-03-01) added support for the imx rt1064 soc, including
programming the internal flash on flexspi2. Updates the mimxrt1064_evk
board to use the internal flash and external sdram memories by default,
now that the debug tools support them.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-03-06 11:18:45 -06:00
Erwan Gouriou
809bca4585 soc/arm/st_stm32: Add comments on Kconfig.defconfig organization
There are some implicit rules in STM32 family Kconfig.defconfig
fragments organizations.
Add comments to explicit these rules.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-03-06 09:38:02 -06:00
Erwan Gouriou
859b630c51 soc/arm/st_stm32/stm32l4: Factorize definition of GPIO_STM32_PORTH
GPIO port H is available on all SoCs of L4 series.
Move Kconfig GPIO_STM32_PORTH symbol deifnition to series Kconfig
fragment Kconfig.defconfig.series.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-03-06 09:38:02 -06:00
Krzysztof Chruscinski
fb4f5e727b logging: Use k_uptime_get_32 for high frequency system clock
If system clock runs fast k_cycle_get_32(), which is the timestamp
source, wraps often (few minutes). This patch changes default
timestamp function to use k_uptime_get_32() if system clock
frequency is higher than 1 MHz and k_cycle_get_32() otherwise.

If system clock runs at 1 MHz, counter will wrap every 71.5 minutes.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-03-06 16:11:23 +01:00
Andrzej Głąbek
2d91e5cc11 boards: nrf: Correct I2C and SPI instances enabled by default in dts
Do not enable by default both I2C and SPI nodes for the peripherals
with the same instance number, since they use the same MMIO base
address and DTC will issue a warning in such situation.
This patch corrects dts files for the following boards:
- nrf51_pca10028
- nrf52_pca10040
- nrf52840_blip
- nrf52840_pca10056
- nrf52840_pca10059

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-03-06 07:17:21 -06:00
Andrzej Głąbek
da917bc569 boards: 96b_nitrogen: Enable by default SPI_1 instead of SPI_0
SPI_0 cannot be used simultaneously with I2C_0, since in nRF52832 SoC
these instances share certain hardware resources.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-03-06 07:17:21 -06:00
Michael Scott
cb874235fd boards: arm: particle_*: add code-partition fix for mcuboot apps
To build apps for mcuboot, a zephyr,code-partition needs to be
identified in the DTS chosen block.  Without this entry, the
following configs will always be 0:
CONFIG_FLASH_LOAD_OFFSET
CONFIG_FLASH_LOAD_SIZE

Signed-off-by: Michael Scott <mike@foundries.io>
2019-03-06 05:54:46 -06:00
Ulf Magnusson
ac059db362 kconfiglib: Give more helpful hints for missing files
Sigvart pointed out that the error message for missing Kconfig files
(which rambles on a lot about $srctree) can easily kick people off in
the wrong direction.

Update Kconfiglib to upstream revision 9f26eb3ae3 to add the following
commit, which makes the error message point to stuff that's more likely
to be the problem:

    Give more helpful error messages when files are missing

    The current error message talks a lot about $srctree, but $srctree
    is seldom the culprit in practice. More common is 'source
    "$(SOME_ENV_VAR)/foo"`, where SOME_ENV_VAR hasn't been set.

    Include the complete 'source ...' line for missing Kconfig files,
    and mention unset environment variables as a hint. Only mention
    $srctree briefly.

    Also shorten the message when a .config can't be a found a bit. This
    message would usually only be seen when working directly with the
    library.

Example error:

    Kconfig:7: '/Kconfig' not found (in 'source
    "$(SOME_ENV_VAR)/Kconfig"'). Check that environment variables are
    set correctly (e.g. $srctree, which is unset or blank). Also note
    that unset environment variables expand to the empty string.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-03-06 12:07:50 +01:00
Flavio Ceolin
d9876be30c kernel: Make statements evaluate boolean expressions
MISRA-C requires that the if statement has essentially Boolean type.

MISRA-C rule 14.4

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2019-03-05 14:58:58 -08:00