Commit graph

99049 commits

Author SHA1 Message Date
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
Flavio Ceolin
f18e632566 logging: 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
Flavio Ceolin
051a7057a9 boards: galileo: Fix switch usage
According with MISRA-C every switch-clause must terminate with an
unconditional break.

MISRA-C rules 16.1 and 16.3

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2019-03-05 14:58:58 -08:00
Flavio Ceolin
b07fe48027 power: Fix switch usage
According with MISRA-C every switch-clause must terminate with an
unconditional break.

MISRA-C rules 16.1 and 16.3

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2019-03-05 14:58:58 -08:00
Johann Fischer
45c6ead099 drivers: eth_enc28j60: fix typo and build for half duplex
Fix typo and build for half duplex configuration.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-03-05 13:38:43 -05:00
Andrzej Głąbek
fe06e4276f drivers: spi: nrfx: Improve a few Kconfig option prompts
Rephrase prompts for a few options in drivers/spi/Kconfig.nrfx
so that their purpose is presented a bit better.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-03-05 13:38:18 -05:00
Andrzej Głąbek
257c28a200 drivers: nrfx: Add Kconfig checks for mutually exclusive peripherals
In Nordic SoCs, SPI and TWI peripherals with the same instance number
share certain resources and therefore cannot be used at the same time
(in nRF91 Series this limitation concerns UART peripherals as well).
This patch adds Kconfig checks ensuring that only one of such mutually
exclusive peripherals can be enabled.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-03-05 13:38:18 -05:00
Andrzej Głąbek
cc185bc02b ext: nordic: Add missing NRFX_UARTE[2,3] Kconfig options
Definitions of these two options were missing, altought the symbols
that would be created for them were already referenced from
`ext/hal/nordic/nrfx_config_nrf9160.h`.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-03-05 13:38:18 -05:00
Andrzej Głąbek
d2735edf65 ext: nordic: Add NRF_SPIS[0-3] definitions to nrfx_config_nrf9160.h
These entries should have been added in the initial version of
this file (in commit 99bab3f478)
but their absence was overlooked.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-03-05 13:38:18 -05:00
Andrzej Głąbek
b6a31a80d0 drivers: spi: nrfx: Add support for SPIS3
This patch adds missing SPI_3_NRF_SPIS Kconfig option (referenced by
`ext/hal/nordic/nrfx_config_nrf9160.h`, although not defined anywhere)
and adds support for SPIS3 instance in the nrfx_spis driver shim.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-03-05 13:38:18 -05:00
Krzysztof Chruscinski
244aecf2d2 tests: drivers: counter: Fix coverity issue (190952)
Fix issue reported by coverity regarding using volatile
variables in zassert_equal macro.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-03-05 12:37:18 -06:00
Krzysztof Chruscinski
e318401426 tests: drivers: counter: Fix coverity issues 190937, 190967, 190983
Fix issue reported by coverity regarding using volatile variable
in zassert_equal macro.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-03-05 12:37:18 -06:00
Andrew Boie
f084c38d44 userspace: properly namespace linker vars
App shared memory defines a bunch of symbols in the
linker script. Namespace them properly as private
zephyr variables.

The variables which indicate the bounds of the entire
partition now end with "_part_start", "_part_size",
and "_part_end" to make them easy for scripts to
distinguish them from other generated symbols for
data/bss sizes.

Finally, the bss size is not rounded up, this was
causing unnecessary memory to be zeroed.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-03-05 10:02:27 -08:00
Song Qiang
c8a811bc58 drivers: gpio: sifive: cleanup irq initialzation code
Clean up irq initialization code with macro definitions.

Signed-off-by: Song Qiang <songqiang1304521@gmail.com>
2019-03-05 12:42:54 -05:00
Vincent Wan
341c2308d2 ext: simplelink: Remove build warnings
This commit removes build warnings in the SimpleLink SDK's driver.c file
by updating CMakeLists.txt

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-03-05 11:37:10 -05:00
Vincent Wan
794c18932e CODEOWNERS: Update code ownership for TI SimpleLink code
Updated for SimpleLink-related code in ext, board and soc.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-03-05 11:37:10 -05:00
Vincent Wan
c051d97bc1 ext: simplelink: Run dos2unix on files imported from TI SimpleLink SDK
Getting rid of DOS line termination characters to be more
Linux-friendly.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-03-05 11:37:10 -05:00
Vincent Wan
067a5f76e0 ext: simplelink: Update the README
The README is updated for the new version of the TI SimpleLink SDK.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-03-05 11:37:10 -05:00
Vincent Wan
30c9c2954d ext: simplelink: Add a workaround for #13444 in cc_pal.h
We are undefining timeval to avoid a symbol redefinition build error.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-03-05 11:37:10 -05:00
Vincent Wan
5bce9cb1d4 ext: simplelink: Add posix api and pthread support to Kconfig
When using the wifi driver, we should automatically select
CONFIG_POSIX_API and CONFIG_PTHREAD_IPC. This is necessary given the
code in the new SimpleLink host driver from the SimpleLink SDK uses
pthread and sem.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-03-05 11:37:10 -05:00
Vincent Wan
28cfb09010 ext: simplelink: Use Zephyr posix headers in cc_pal.h
We should use the headers from Zephyr, not the ones provided by TI for
their posix implementations.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-03-05 11:37:10 -05:00
Vincent Wan
2e15b0f611 drivers: wifi: simplelink: Use TI SimpleLink SDK 2.40
This commit updates the wifi driver to use the new TI SimpleLink SDK.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-03-05 11:37:10 -05:00