Commit graph

99049 commits

Author SHA1 Message Date
Kumar Gala
7b0d27313e boards: hexiwear_k64: Remove PWM defines
Now that the samples use DT generated defines we can remove the
hexiwear_k64 specific ones in board.h

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-05 14:01:21 -06:00
Kumar Gala
937f45dc86 samples: baisc: Update to use DT generated pwm defines
We update 'blink_led', 'fade_led' and 'rgb_led' to support dt generated
defines for the PWM info needed for each.  Since hexiwear_k64 supports
generating the info, moved the support for hexiwear_k64 to just use the
dt generated defines.

For 'blink_led' and 'fade_led' we use an alias in dt called 'pwm-led0'.
For 'rgb_led' we use aliases 'red-pwm-led', 'green-pwm-led' and
'blue-pwm-led'

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-05 14:01:21 -06:00
Kumar Gala
cfbde52a2c dts/bindings: Add binding for pwm-leds
Add a binding file to descript an LED connected via a PWM.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-05 14:01:21 -06:00
Kumar Gala
780605aac0 boards: hexiwear_k64: Add PWM LED to device tree
Add the Red, Green, & Blue PWM LED info to the device tree.  We will use
this in the future for any samples that utilize PWM on these LEDs.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-05 14:01:21 -06:00
Kumar Gala
d857d2fac2 arm: soc: kinetis: Update PWM dts support
Add #pwm-cells properties to kinetis dts files and update the yaml
binding to spec the two cells as pin and period (in nanosecond to match
Linux Kernel binding spec).

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-05 14:01:21 -06:00
Kumar Gala
30960e61bf scripts/dts: extract_dts_includes: Add support for client pwms
Add support to the extract script to handle 'pwms' client properties.
This is pretty much identical to how we hand 'gpios'.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-05 14:01:21 -06:00
Anas Nashif
c3d75488d4 boards: dts: remove CONFIG_BT checking
No need to check for BT being enabled. The UART entries will be
available for use if BT is enabled and will do nothing if not.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-05 12:07:30 -06:00
Anas Nashif
bb313d1e71 boards: frdm_k64f: move modem configurtion to overlay
The wncm14a2a modem is an add-on/shield and not part of the frdm_k64f
board and should be maintained and configured outside of the board.

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

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-05 12:07:30 -06:00
Anas Nashif
d8a8012758 tests: make ethernet build test depend on netif
Test for ethernet should depend on the HW having ethernet support.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-05 12:07:30 -06:00
Anas Nashif
8d138ede02 boards: dts: define default console only
When using USB CDC, set that via an overlay instead of in the board DTS.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-05 12:07:30 -06:00
Vinayak Kariappa Chettimada
ebaabba834 clock_control: nrf5: Ensure HF & LF running before calibration
Fix RCOSC calibration initiation to ensure LF clock is
running; and the HF clock is running with crystal before
triggering the actual calibration in ISR.

Fixes #10811.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2018-11-05 19:07:12 +01:00
Kumar Gala
2d7825976a boards: cc3220sf_launchxl: Add dts support for led/buttons
Move LED/Button info from board.h to dts.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-05 11:08:35 -06:00
Kumar Gala
ac7da0b65c gpio: ti cc32xx: Add device tree support for GPIO
Convert gpio_cc32xx driver over to using device tree. Added binding
files, updates to dts for various SoCs that use cc32xx.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-05 11:08:35 -06:00
Kumar Gala
98dff36250 dts/bindings: Fix warning in ti,cc32xx-i2c.yaml
A missing version field was causing a warning, add the version field to
fix the issue.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-05 10:51:54 -06:00
Dennis Wildmark
e60a6e9256 drivers: lsm303dlhc_accel: support for sensor_attr_set
Driver for LSM303DLHC accelerometer now supports API function
sensor_attr_set for attribute SENSOR_ATTR_SAMPLING_FREQUENCY.

Signed-off-by: Dennis Wildmark <d.wildmark@gmail.com>
2018-11-05 10:41:51 -06:00
Anas Nashif
8ee4b0f378 sanitycheck: make mps2_an385 default qemu for ARM
mps2_an385 does support MPU and Userspace.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-05 11:00:38 -05:00
Anas Nashif
0819684703 doc: update docs with latest SDK
Changed documentation to point to SDK 0.9.4.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-05 11:00:38 -05:00
Anas Nashif
91401aa7f4 sdk: require Zephyr SDK 0.9.4
Due to changes to Qemu and DTC, we do require at least SDK version 0.9.4
now.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-05 11:00:38 -05:00
Anas Nashif
a4c368ef07 sanitycheck: only log printable chars
New Qemu is emitting binary charachters which is disturbing generation
of XML, so make sure we only log printable charachters.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-05 11:00:38 -05:00
Anas Nashif
c2c6a6a245 qemu_riscv32: use hifive1 configuration
Use hifive1 configuration for this qemu and set
SYS_CLOCK_HW_CYCLES_PER_SEC to 10000000

Fixes #10043

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-05 11:00:38 -05:00
Anas Nashif
b38fba35a3 boards: qemu_nios2: switch to ns16550 UART
Needed to support latest version of Qemu (3.0.0).

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-05 11:00:38 -05:00
Anas Nashif
5ffc1b8542 riscv32: hifive1: make board run in qemu
This board can run in recent qemu versions (>3.0.0), so enable it
instead of a dedicated qemu board.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-05 11:00:38 -05:00
Anas Nashif
1c3cbc5eba ci: use sdk 0.9.5
Use new SDK version 0.9.5.
- new qemu
- new dtc
- new openocd

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-05 11:00:38 -05:00
Aurelien Jarno
fdfa975b9d usb: device: fix wrong direction in usb_transfer_ep_callback
In case no transfer is ongoing, the usb_transfer_ep_callback consumes
the received data. This is however associated with the wrong test. USB
is host centric, so data reception on the device is signaled by
USB_DC_EP_DATA_OUT and not USB_DC_EP_DATA_IN.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2018-11-05 16:33:01 +01:00
Kumar Gala
ddc2a3d9df drivers: spi_sam0: move sercom pad info to dts
Move the setting of the SERCOM PAD for dipo/dopo for the spi driver
into device tree out of board.h

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-05 10:05:47 -05:00
Kumar Gala
6d08958ad5 drivers: uart_sam0: move sercom pad info to dts
Move the setting of the SERCOM PAD for rxpo/txpo for the uart driver
into device tree out of board.h

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-05 10:05:47 -05:00
Kumar Gala
365dc19bc4 dts: bindings: remove setting use-prop-label in st,stm32-ccm
We set 'use-prop-label' incorrectly in the st,stm32-ccm binding file.
This property is meant to generate names based on there being a label
property set in the node.  For st,stm32-ccm nodes we don't ever set
labels and the binding file doesn't specify a label.  So remove setting
'use-prop-label'.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-05 10:05:11 -05:00
Anas Nashif
aed52d7058 tests: add board_shell test app
Group various shell modules for kernel, peripherals and other
subsystems. This will be used to test board functionality interactively
using commands implemented in the individual shell modules.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-05 09:32:38 -05:00
Anas Nashif
cd9103826b tests: add Kconfig for testing via shell
One Kconfig to select shell modules based on configured featues.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-05 09:32:38 -05:00
Anas Nashif
c41b236a14 shell: add PCI shell
Add basic 'lspci' command to list PCI devices. This command can be
enabled with the new Kconfig PCI_SHELL.

Example:

uart:~$ lspci
0:1 8086:7010 class: 0x1, 1, 4, I/O, addrs: 0xC000-0xC00F, IRQ -1

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-05 09:32:38 -05:00
Kiril Zyapkov
7a602fc615 drivers: uart_stm32: fix ORE hogging the CPU
If data is received before an IRQ handler was set and enabled,
hardware sets the ORE flag. Once set, the IRQ routine starts
hogging the CPU until ORE is cleared. This change will clear
the flag when user code attempts to drain incoming data.

Signed-off-by: Kiril Zyapkov <k.zyapkov@allterco.com>
2018-11-05 09:01:30 -05:00
Sathish Kuttan
7e3a457308 drivers: i2s_cavs: Add bidirectional I2S support
Added bidirectional I2S support for Intel S1000

- Added implementation for I2S receive mode
- Extended driver instances to support 3 I2S ports
- Added DMA channel mappings for upto 4 I2S ports
- Utilized k_msgq to track buffers through the driver
    - Allocate buffers for audio reception in the driver
    - Free buffers after audio transmission in the driver
- Perform buffer reload for DMA after every reception/transmission
- Removed unused Kconfig variables
    - I2S_CAVS_TX_BLOCK_COUNT
    - I2S_CAVS_RX_BLOCK_COUNT

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2018-11-05 08:48:36 -05:00
Sathish Kuttan
9c52171750 drivers: dma_cavs: add buffer refresh/reload
Added a mechanism to refresh DMA buffers without the
need to call the "configure" API every time.
The reload is done after every DMA completion.

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2018-11-05 08:48:36 -05:00
Sathish Kuttan
4ed63ee39d drivers: dma: Add buffer reload API for DMA driver
Config API is meant for initial configuration.

Using config API to reload DMA buffers is inefficient and hence
a reload API is added

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2018-11-05 08:48:36 -05:00
Andrei Emeltchenko
767b4ec6b7 usb: usb_dc_nrfx: Remove dead code
Fix deadcode warning.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-11-05 08:46:55 -05:00
Aurelien Vouaillat
6282320427 drivers: i2c: i2c_nrfx_twi and twim: Return -EBUSY when I2C bus is busy
Return -EBUSY instead of -EIO

Signed-off-by: Aurelien Vouaillat <aurelien.vouaillat@proglove.de>
2018-11-05 14:23:17 +01:00
Armando Visconti
7a18efefbc drivers: dma: stm32f4: Fix typo introduced when removing board.h
Following commit removed board.h but forgot to add soc.h:

  "drivers: Remove board.h include"

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2018-11-05 07:49:19 -05:00
Paul Sokolovsky
6203020bfd subsys: console: Switch to POSIX-like read/write interface
Tty device gets only read/write calls, but console retains
getchar/putchar for convenience.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-11-04 17:31:39 -05:00
Paul Sokolovsky
9d3b48fd48 subsys: console: tty: Allow to specify transmit timeout
Previously, transmit was effectively non-blocking - a character either
went into buffer, or -1 was returned. Now it's possible to block if
buffer is full. Timeout is K_FOREVER by default, can be adjusted
with tty_set_tx_timeout() (similar to receive timeout).

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-11-04 17:31:39 -05:00
Paul Sokolovsky
680085b3e2 subsys: console: tty: Allow to specify receive timeout
This allows to specify receive timeout, instead of previously
hardcoded K_FOREVER value. K_FOREVER is still the default, and can
be changes after tty initialization using tty_set_rx_timeout() call,
and timeout is stored as a property of tty. (Instead of e.g. being
a param of each receive call. Handling like that is required for
POSIX-like behavior of tty).

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-11-04 17:31:39 -05:00
Paul Sokolovsky
79ea613a32 lib/fdtable: Can call zephyr_write() only for CONFIG_NEWLIB_LIBC
If we don't have Newlib, the more or less POSIX library, it's unclear
how to deal with POSIX stdin/stdout/stderr at all.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-11-04 22:04:11 +01:00
Paul Sokolovsky
65a33bd0c0 lib: fdtable: Define standard I/O file descriptors if CONFIG_POSIX_API
This is simplistic implementation which just redirects to (likewise
simplistic) implementation in lib/libc/newlib/libc-hooks.c. This
should be replaced with bindings to "real console", but what should
be a "real console" is so far discussed, at the RFC stage.

This implementation goes into the fdtable.c itself to keep all those
things nicely static. (This is again likely will change when we have
"real console", but again, it's so far not clear where it would
belong, so at least avoid creating random files to be deleted later).

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-11-04 22:04:11 +01:00
Paul Sokolovsky
9aafe38828 tests: socket: Bump number of available fd's
These tests require much bigger number than default 4.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-11-04 22:04:11 +01:00
Paul Sokolovsky
f750ce56ce net: lib: sockets: Switch to use fdtable
Previously the "socket file descriptors" were just net_context
pointers cast to int. For full POSIX compatibility and support
of generic operations line read/write/close/fcntl/ioctl, the
real file descriptors should be supported, as implemented by
fdtable mini-subsys.

Socket implementation already has userspace vs flatspace dichotomy,
and adding to that ptr-fds vs real-fds dichotomy (4 possible cases)
is just too cumbersome. So, switch sockets to real fd's regardless
if full POSIX subsystem is enabled or not.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-11-04 22:04:11 +01:00
Paul Sokolovsky
c2702ba76e include: socket: Define ZSOCK_POLLHUP, ZSOCK_POLLNVAL
So that client apps can refer to them, and then can be implemented on
Zephyr side as needed.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-11-04 22:04:11 +01:00
Paul Sokolovsky
b2fd1a27ac libc: newlib: libc-hooks: s/CONFIG_POSIX_FS/CONFIG_POSIX_API/
read/write/etc. are defined in case CONFIG_POSIX_API is defined, and
we shouldn't provide duplicates.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-11-04 22:04:11 +01:00
Paul Sokolovsky
b6e58d54c9 lib: posix: fs: Convert to use generic fdtable
All the handling of POSIX file descriptors is now done by fdtable.c.
fs.c still manages its own table of file structures of the underlying
fs lib.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-11-04 22:04:11 +01:00
Paul Sokolovsky
f484bbaa26 lib: posix: Implement generic file descriptor table
The table allows to wrap read/write (i.e. POSIX-compatible) semantics
of any I/O object in POSIX-compatible fd (file descriptor) handling.
Intended I/O objects include files, sockets, special devices, etc.

The table table itself consists of (underlying obj*, function table*)
pairs, where function table provides entries for read(), write, and
generalized ioctl(), where generalized ioctl handles all other
operations, up to and including closing of the underlying I/O object.

Fixes: #7405

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-11-04 22:04:11 +01:00
Sebastian Bøe
3215dd862f cmake: nrf51: Don't #define NRF51822
The define NRF51822 has no in-tree users and is believed to have been
added by accident. The define NRF51 should be referenced in it's
place.

To avoid users accidentally referencing NRF51822 instead of NRF51, and
to avoid confusing users into believing that NRF51822 has semantics we
remove it.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-11-04 22:03:01 +01:00
Sebastian Bøe
c4266a8cd2 cmake: Move MDK-defines from 'soc' to the MDK build script
The build script ext/hal/nordic/CMakeLists.txt manages the MDK
dependency. The MDK is not aware of Zephyr and uses it's own defines
to indicate what HW we are building for.

This commit moves these MDK-specific defines out of the 'soc' build
scripts and into the MDK build script where they belong.

This is expected to be a pure refactoring without side-effects.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-11-04 22:03:01 +01:00