Commit graph

99049 commits

Author SHA1 Message Date
Carles Cufi
8ba60342cf cmake: Set PYTHON_EXECUTABLE env var with kconfig
In order to be able to invoke Python from Kconfig files,
set the path to the Python executable (which can be python,
python3, py -3, etc) as an environment variable so that
Kconfig shell invocations can use it like:

config MY_OPTION
       string "My option string"
       default "$(shell,$(PYTHON_EXECUTABLE) \
	          $(ZEPHYR_BASE)\scripts\script.py)"

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-11-16 13:26:24 -05:00
Paul Sokolovsky
325954de8f samples: console: echo: Test output-only mode too
We have cases with UART drivers where TX interrupt handling is not
bootstrapped properly on enabling them. To make such cases more
obvious, start this sample with console_write(), the output of which
wouldn't appear if that's the case. (Of course, the sample starts
with printk() exlaining what may happpen.)

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-11-16 11:48:06 -06:00
Paul Sokolovsky
49bb163756 drivers: serial: uart_cmsdk_apb: Fix interrupt-driven operation
1. There's an expectations that TX ready (i.e. TX buffer space
available) interrupt is a level interrupt, i.e. always active
while there's TX buffer space available. In particular, there's
an expectation that after uart_irq_tx_enable(), the TX interrupt
will immediately fire (assuming free TX buffer space is available).
But CMSDK UART interrupt appears to be edge interrupt, firing only
on buffer state change. So, after irq_tx_enable(), we need to
"bootstrap" interrupt processing by calling user-defined ISR
manually (the ISR will see that TX ready to accept a new char,
will write it there, then we'll get interrupt once TX buffer is
ready again).

2. Interrupts should be acknowledges only after user ISR is called,
because the ISR will check the status of interrupts.

3. Update stale comments.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-11-16 11:48:06 -06:00
Kumar Gala
ee9b08d7da drivers: watchdog: Convert Atmel SAM driver to DTS
The majority of bits where already in place, but some minor support
get the driver name from DTS was needed.  Now we select HAS_DTS_WDT
for the driver.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-16 11:19:36 -06:00
Sebastian Bøe
5e6f220713 kernel: Fix type of Z_EXC_HANDLE
The type of Z_EXC_HANDLE was incorrectly declared, this was causing
the compiler to make incorrect inferences about what could be in
exc_handle and caused a bug in fault.c.

To get more specific ...

An exception handler consists of three void pointers, or function
pointers. The function pointers point to functions. An example of one
such function is 'z_arch_user_string_nlen_fault_start' From
userspace.S.

The correct way of initalizing a function pointer from a function
declared in another source file looks like this:

void external_defined_function(void);

{
   void * internal_initialized_function_ptr = external_defined_function;
}

But EXC_HANDLER is not doing this. Instead it does this:

extern void (*external_defined_function)(void);

{
  void * internal_initialized_function_ptr = &external_defined_function;
}

The declaration here is wrong. It declares that externally, there is
stored a function pointer somewhere. Which is not true. There does not
exist a function pointer anywhere. But this doesn't matter, because we
don't actually de-reference the function pointer to find the address
of the function, but instead we take the address of the function
pointer.

Taking the address of the function pointer to find the address of a
function is wrong, one should de-reference function pointers to find
function addresses. Luckily, these two bugs have been cancelling each
other out, until recently.

This patch corrects the type used.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-11-16 09:18:27 -08:00
Tomasz Bursztyka
8c4b551be4 drivers/spi: Set CS inactive when releasing unconditionally
In order to avoid changing the signature of spi_context_cs_control
function, which is used in every driver, let's just make it an alias to
a new version.

Fixes #10344

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-11-16 10:22:30 -05:00
Marek Pieta
39551cfbb8 drivers: pwm: Add power management to pwm_nrfx
Change adds power management to pwm_nrfx.

Signed-off-by: Marek Pieta <Marek.Pieta@nordicsemi.no>
2018-11-16 15:01:16 +01:00
Klaus Petersen
18f9bb04f7 Build: Offsets lib as OBJECT not STATIC
Use cmake to get generated path of lib instead of predefined absolute
path.  This is needed to eventually be able to have an
architecture-out-of-tree build.  The path "OFFSETS_O_PATH" is not
generated for sources out-of-tree and therefore must be replaced by the
cmake generator $<TARGET_OBJECTS:offsets>.

The following lines are needed while we are using a Cmake version <
3.12.3:

target_include_directories(.....
target_compile_options(...
target_compile_definitions(....

This is due to the cmake feature "Linking Object Libraries" not
supported until 3.12:
https://cmake.org/cmake/help/v3.12/command/target_link_libraries.html#linking-object-libraries

Signed-off-by: Klaus Petersen <kape@oticon.com>
2018-11-16 08:34:30 -05:00
Krzysztof Chruscinski
5af45bd392 shell: uart: Handle RX ring buffer full case
Scenario where RX ring buffer is full and cannot accept
more data was not handled. In that case byte should be
dropped. Such situation may occur when long command is
pasted (exceeding ring buffer size).

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-11-16 08:31:01 -05:00
Johan Hedberg
296dab3fe2 Bluetooth: Mesh: Increase scan window from 10ms to 30ms
Experiments have shown that the probability of missing advertising
packets is significantly lower with 30ms scan window compared to 10ms
scan window. This is especially the case with advertisers using a 20ms
advertising interval, which in turn is perhaps the most common one
since it's the smallest allowed by the Bluetooth 5.0 specification.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-11-16 09:36:20 +02:00
Robert Lubos
824d0bd854 sockets: tls: Use FD table to reach net_context
With FD table introduction, net_context can no longer be reached by
typecasting socket descriptor. Instead, file descriptor API have to be
used.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-11-15 17:54:40 -05:00
Robert Lubos
72958f2e1c sockets: tls: Fix getsockopt/setsockop return value
ztls_setsockopt and ztls_getsockopt returned error codes instead of
setting errno in particular cases. This commit fixes it.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-11-15 17:54:40 -05:00
Aiden Park
16dca3773f boards/x86: up_squared: add support for SBL(Slim Bootloader)
This adds a primitive board configuration for the UP Squared board to
work properly with SBL(Slim Bootloader).
- https://github.com/slimbootloader/slimbootloader
- https://slimbootloader.github.io/

BOARD shall be 'up_squared_sbl'
  cmake -GNinja -DBOARD=up_squared_sbl ..
  ninja

Signed-off-by: Aiden Park <aiden.park@intel.com>
2018-11-15 17:51:51 -05:00
Patrik Flykt
f8cbf7f92a arch/arm: Avoid C++ comments inside C comments
Avoid nested C++ comments inside the C comment block due to MISRA-C
rule 3.1. Keep the variables documenting possible caller saved
registers.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2018-11-15 17:38:25 -05:00
Patrik Flykt
07697dd004 subsys/mgmt: Avoid C++ comments inside C comments
MISRA-C rule 3.1 wants to avoid mixing C/C++ comments. An ellipsis
works fine here.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2018-11-15 17:38:25 -05:00
Patrik Flykt
72378a40f5 drivers/pci: Avoid nested C/C++ comments
Avoid nested C++ comments inside the C comment block due to MISRA-C
rule 3.1. Add ellipsis around the explanatory text instead.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2018-11-15 17:38:25 -05:00
Patrik Flykt
66a4a11836 arch/xtensa: Use C style comments
Update comments to follow C style.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2018-11-15 17:38:25 -05:00
Patrik Flykt
8d769d5533 arch/xtensa: Remove identifier looking as mixed C/C++ comments
The identifier looks like a mixed C/C++ comment, which is against
MISRA-C rule 3.1. As the identifier is not used, remove it altogether.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2018-11-15 17:38:25 -05:00
Kumar Gala
90823520e2 dts: Remove ifdef CONFIG_FS_FLASH_STORAGE_PARTITION from dts files
Remove the ifdef related to CONFIG_FS_FLASH_STORAGE_PARTITION.  There
shouldn't be any harm in always having the partition around as we'll
just generate the defines related to and most applications will ignore
them.

Helps get one step closer to have DTS not depend on Kconfig.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-15 17:37:59 -05:00
Kumar Gala
edefd7dc7d boards: nrf52840_pca10056: move modem configurtion to overlay
The wncm14a2a modem is an add-on/shield and not part of the
nrf52840_pca10056 board and should be maintained and configured
outside of the board.

This needs to be moved to a shield, see #10965.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-15 16:31:35 -05:00
Kumar Gala
94bf29561e boards: nrf52840_mdk: move modem configurtion to overlay
The wncm14a2a modem is an add-on/shield and not part of the nrf52840_mdk
board and should be maintained and configured outside of the board.

This needs to be moved to a shield, see #10965.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-15 16:31:35 -05:00
Krzysztof Chruscinski
6a960e7d17 logging: Fix LOG_LEVEL dependency on log.h include
Refactoring of LOG_MODULE_REGISTER (commit 88648699) introduced
regression: fixed ordering of LOG_LEVEL definition and log.h
include.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-11-15 16:31:08 -05:00
Andrew Boie
d945d32a1e i2s_sam_ssc: fix compiler warning
First argument to a DMA callback is a void pointer.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-11-15 16:20:36 -05:00
Andrew Boie
ad4df685f1 i2s: add i2s_configure() as a system call
Now that k_mem_slabs are tracked as kernel objects,
even though they have no user facing API, we can now
accept a pointer to one in the configure API.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-11-15 16:20:36 -05:00
Andrew Boie
76a160ba38 i2s_handlers: fix incorrect k_mem_slab_free arg
The API wants a pointer to the memory block pointer for
some reason (even though it's unnecessary to the
implementation).

Compiler won't warn if a void * is passed instead of a
void **.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-11-15 16:20:36 -05:00
Andrew Boie
42cfd4ff26 kernel: expose k_busy_wait() to user mode
If we just had the kernel's implementation, we could
just move this to lib/, but possible arch-specific
implementations dictate that we just make this a
syscall.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-11-15 16:20:36 -05:00
Andrew Boie
f253d0779d k_mem_slab: track as a kernel object
We aren't going to allow any user mode access to the
k_mem_slab APIs, but in some cases (specifically in the
case of the I2S subsystem) we need to allow user mode
to assign a memory slab to a particular driver.

This will let us verfiy (in supervisor mode) that a provided
k_mem_slab pointer is really a k_mem_slab, and know its
initialization state, and have permissions assigned to it.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-11-15 16:20:36 -05:00
Vikrant More
8da14d79fd samples: mesh: nrf52: improvement in transition type reassignment
Simplifies message handler for Servers & transition type reassignment.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-11-15 22:43:41 +02:00
Vikrant More
931eeee070 samples: mesh: nrf52: merged timer in transtion structure
In this commit, struct k_timer timer_lightness & struct k_timer
timer_temp picked & merged into struct transition lightness_transition
& struct transition temp_transition resp.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-11-15 22:43:41 +02:00
Anas Nashif
065903f3c7 usb: netusb: fix log level macro
Using the wrong Kconfig for log level.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-15 15:24:32 -05:00
Robert Lubos
f60b580710 samples: sockets: Configure correct number of FDs for echo_server
echo_server can use up to 6 sockets therefore it needs more file
descriptors than the maximum default value specified.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-11-15 10:02:49 -05:00
Rajavardhan Gundi
50c0ff6e8c lib/cmsis_rtos_v1: Use k_is_in_isr instead of _is_in_isr
Use the kernel API k_is_in_isr() instead of the internal
_is_in_isr() function.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2018-11-15 09:20:57 -05:00
Kamil Gawor
446b751609 drivers: gpio: Add reading port/pin in both direction
These changes modify the function of reading port/pin,
function return logical sum of input pin value and
output pin values for a given port. It is now possible
to read the status of pins set as output.

Signed-off-by: Kamil Gawor <Kamil.Gawor@nordicsemi.no>
2018-11-15 09:17:15 -05:00
Tomasz Bursztyka
2a0669e501 net/ieee802154: Remove unnecessary __packed keyword on API struct
It is useless first, and for some reason now generate a bug on kw41z.

Fixes #11301

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-11-15 09:14:56 -05:00
Kumar Gala
a0b660730f samples: Add explicit zephyr_include_directories to get <board.h>
There are a small handful of samples that still utilize <board.h>
include, to minimize the use of <board.h> to these specific cases and
allow us to remove adding the board dir to the top level include search
path, we explicitly in each sample add the specific board dir it needs.

For the microbit cases these could be replaced by DTS support in the
future when the pwm_nrf5_sw supports DTS.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-15 09:14:07 -05:00
Andrei Emeltchenko
13b02d620c ieee802154: Allow to set debug for RAW_CHANNEL
Allow to set debug also for RAW_CHANNEL and set general debug template
instead of networking one.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-11-15 08:42:52 -05:00
Andrei Emeltchenko
1cd95969e3 ieee802154: Remove dead code
Remove unused ieee802154_shell_init()

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-11-15 08:42:52 -05:00
Anas Nashif
3cbffefb26 sanitycheck: use overlays to enable coverage
Set COVERAGE option using an overlay instead of piping it through CMAKE
which breaks dependecies, i.e. if someone wants to disable that option
on the application level.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-15 08:31:34 -05:00
Anas Nashif
8d72bb909f sanitycheck: remove dependency of coverage on native_posix
Make it more generic and depend on Kconfig taking care of dependencies.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-15 08:31:34 -05:00
Anas Nashif
4df6c565d2 sanitycheck: ignore generated headers in outdir
With this, we will get results for the same file for every build (tests
and samples).

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-15 08:31:34 -05:00
Kumar Gala
71c3dd11c5 spi: sam: Specify pinmux for chipselect via Kconfig
Move to using Kconfig (like other Atmel SAM drivers do) to specify the
pinmux setting for SAMe70 SoCs.  Updated the sam_e70_xplained board to
set the default in Kconfig.defconfig instead of via board.h

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-15 07:29:44 -06:00
Yannis Damigos
954a943854 drivers: usb_dc_stm32: Use DT to check if USBPHYC exists
Use DT to check if SoC has a USBPHYC controller.

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2018-11-15 07:27:23 -06:00
Yannis Damigos
542e6ac823 dts: st: Add USB PHY nodes
Add USB phy nodes and phys property in USB nodes.

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2018-11-15 07:27:23 -06:00
Yannis Damigos
31ae43d024 dts/bindings/usb: Add phys property to STM32 USB yaml
Add phys property, which specifies USB PHY provider,
to STM32 USB yaml files.

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2018-11-15 07:27:23 -06:00
Yannis Damigos
68dc1125dc dts: bindings: Add yaml files for PHY subsystem
Add yaml file for initial support of USB PHYs.
It adds also yaml files for STM32 USBPHYC and
USB controllers with embedded PHY.

PHY refers to the physical layer which is used
to connect a device to the physical medium e.g.
USB controller.

Origin: original

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2018-11-15 07:27:23 -06:00
Ioannis Glaropoulos
d8b51ea9cd kernel: mem_domain: optimize sane partition checking
This commit optimizes the process of checking that the
added partitions in a mem_domain are sane. It places the
sane_partition checking inside the loop of adding the
partitions in the mem_domain, so that the checkings are
not performed twice, and no partition is checked against
itself.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2018-11-15 08:18:59 -05:00
Ioannis Glaropoulos
3e390ed42d kernel: mem_domain: fix partition end address calculations
This commit fixes the calculations of the partition ending
addresses in two places in the code, according to:
<last> = <start> + <size> - 1. We also rename 'end' to 'last'
to stress that we calculate the last address in the partition.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2018-11-15 08:18:59 -05:00
Mieszko Mierunski
a5b7500bef api: uart: Add configure functions for UART.
Allow UART configuration to be altered during runtime.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2018-11-15 07:50:47 -05:00
Rajavardhan Gundi
31351734e2 kconfig: intel_s1000: Clean up App level prj.conf
USB is desired to be configured by default and hence the Kconfigs
are addressed in _defconfig for intel_s1000_crb. Cleaned it up
from the app level prj.conf which was anyway redundant.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2018-11-15 07:44:04 -05:00
Rajavardhan Gundi
f75b5f6c55 intel_s1000: DTS: fix dts_fixup.h with new DT_ prefix for SPI driver
This fixes the SPI driver references in dts_fixup.h with DT_ prefixes.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2018-11-15 07:43:38 -05:00