Commit graph

41120 commits

Author SHA1 Message Date
Kumar Gala
e053a474ee dts: riscv: pulpino: Fix warning for itim unit address
dtc produces the following warning:

Warning (simple_bus_reg): /soc/itim@8000000: simple-bus unit address
format error, expected "0"

We had the wrong unit address in the dtsi file, should be 0.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-16 19:09:47 -05:00
Kumar Gala
5ac0fd35d3 dts: atmel: samd: Fix reg address for NVM flash controller
dtc was producing this warning when we build on SAMD SoCs:
	Warning (simple_bus_reg): /soc/nvmctrl@41004000:
	simple-bus unit address format error, expected "40022000"

The reg addr isn't used by the flash_sam0.c driver so we wouldn't notice
this issue.  Looking at the atmel HAL we see:

	#define NVMCTRL           ((Nvmctrl  *)0x41004000UL)

So that provides confirmation of what the reg addr should be.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-16 17:49:17 -06:00
Andrei Gansari
db7d1da896 dts: added nxp.kinetis-ptp interrupts
Kinetis device K64F's PTP interrupt crashed the system becase it was not
generated from dts. Device interrupt correctly set now.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2018-11-17 00:44:28 +01:00
Andrew Boie
2d8b86d2c2 tests: i2s_api: run in user mode
Now all tests are additionally run in user mode.

Test now all use the i2s_buf_read/write APIs, which
are themselves implemented in terms of i2s_read/write.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-11-16 18:26:03 -05:00
Andrew Boie
9dc6c77bb0 ztest: wait for all suites to finish
The ending report needs to be emitted after all test
suites have run, not after each one.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-11-16 18:26:03 -05:00
Andrew Boie
7f1f2385d2 tests: i2s_api: disable log subsystem
Enabling this throws off the timing of the test case, resulting
in failures.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-11-16 18:26:03 -05:00
Andrew Boie
696d9a72be tests: pci_enum: don't use STDOUT_CONSOLE
Fixes a stack overflow on qemu_x86.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-11-16 18:26:03 -05:00
Andrew Boie
9f597d898f i2s: fix bad argument to k_mem_slab_free()
Takes a double pointer. Compiler doesn't catch this.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-11-16 18:26:03 -05:00
Andrew Boie
d5f464c62b i2s: fix slab leak in i2s_buf_write()
A failed return value from i2s_write() requires that the
slab we allocated earlier be freed.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-11-16 18:26:03 -05:00
Tomasz Bursztyka
eae05d928e drivers/spi: Adding async mode to SAM and SAM0 drivers
This mode was missing for some reason.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-11-17 00:25:36 +01:00
Tomasz Bursztyka
27195895b1 drivers/spi: Do not reconfigure at every transaction
If the configuration is already installed, there will no need to
reconfigure the controller all over again.

This was missing for mcux_dspi, mcux_lspi, sam and sam0.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-11-17 00:25:36 +01:00
Alexander Polleti
fb4cb3a878 c++: convert implicit conversion to explicit ones in header files
c++ does not allow implicit conversions and setting -fpermissive just
causes a huge load of warnings to appear and hides real errors.

This commit converts those implicit conversions to c-style explicit
conversions.

Signed-off-by: Alexander Polleti <metapsycholo@gmail.com>
2018-11-16 15:18:36 -05:00
Kumar Gala
25d17db96b ieee802154: cc2520: quark_se_c1000_devboard: Move all GPIOs to DTS
Added support to the ti,cc2520 binding for optional GPIO signals and
moved the quark_se_c1000_devboard to define those signals in the DTS.
This lets us remove board.h and some #defines & fake Kconfig symbols
from the quark_se_c1000_devboard board.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-16 14:02:00 -05:00
Kumar Gala
27469810ac board: quark_se_c1000_devboard: Move the CC2520 DTS node to the board
The CC2520 device is specific to the quark_se_c1000_devboard not the
intel curie SoC.  Move the device node where it belongs.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-16 14:02:00 -05:00
Kumar Gala
f249a0f4f2 ieee802154: cc2520: Move to DT only config support
Now that the in tree user of cc2520 uses device tree to configure SPI
and GPIO params, we can remove and convert the driver to utilize DT
only.  This means removing the Kconfig options that come from DT and
rename CONFIG_ to DT_ for those options.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-16 14:02:00 -05:00
Kumar Gala
1634cf2248 drivers/spi: Always selecet HAS_DTS_SPI once SPI is enabled
All drivers require DTS for their primary SPI settings.

Removing SPI_[0-9]_NAME config option added some more samples changes.
Usage of these options there was anyway not relevant.

Fixes #11064

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-16 14:02:00 -05:00
Kumar Gala
ea198e3e4b ieee802154: mcr20a: Cleanup Kconfig and DT support
Now that all SPI controllers support DTS we can remove the Kconfig
support for non-DTS options.  We also cleanup some defines that should
have be DT_MCR20A_ instead of CONFIG_MCR20A_.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-16 14:02:00 -05:00
Tomasz Bursztyka
1b3b0153a6 boards/x86: Use dts for configuring the cc2520 device
Only the SPI bus for now.
Make cc2520's Kconfig aware of DTS on these settings.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-11-16 14:02:00 -05:00
Tomasz Bursztyka
f95c3d1a00 dts/boards: Add a dedicated cc2520 config for quark_se_c1000_devboard
Using DTS to setup cc2520 SPI settings on quark_se_c1000_devboard.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-11-16 14:02:00 -05:00
Kumar Gala
e743104ad4 dts: Fix warning related to invalid alias name
Aliases are not suppose to use '_', so replace with '-'.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-16 13:57:45 -05:00
Kumar Gala
fd6e9c6f58 dts: i2c: cleanup CONFIG_I2C_x_IRQ_PRI
The majority of cases of CONFIG_I2C_x_IRQ_PRI should be
DT_I2C_x_IRQ_PRI.  So go ahead and fix them up.  Only the i2c_nios
driver still uses Kconfig for getting priority.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-16 13:57:02 -05:00
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