Commit graph

3289 commits

Author SHA1 Message Date
Florian Vaussard 5491c29314 i2c: stm32_ll: Fix spurious error while reading using IRQ
We can have a spurious error while performing a transfer using IRQ. This
happens when the last message of the transfer is a read with a STOP
condition. We must disable the RX interrupt while waiting for the STOP
interrupt, otherwise we will get a spurious RX interrupt which will lead
to an error.

Signed-off-by: Florian Vaussard <florian.vaussard@gmail.com>
2018-01-11 19:00:19 -05:00
Daniel Wagenknecht 1f66015f73 drivers: serial: use the right clock busses for STM32F0 series UARTs
STM32F0 Series uses different clock busses for UARTs than other
STM32FX Series.

fixes #5406

Signed-off-by: Daniel Wagenknecht <wagenknecht@clage.de>
2018-01-11 19:00:19 -05:00
Daniel Wagenknecht 47c747e954 drivers: serial: simplify STM32 UART clock initialization
STM32 UART driver uses a macro for clock initialization, that
is difficult to read and incompatible with needed changes to
fix STM32F0 series UART problems.
This change switches to using the full clock bus names in UART
init functions removing the macro-magic and increasing
readability.

Signed-off-by: Daniel Wagenknecht <wagenknecht@clage.de>
2018-01-11 19:00:19 -05:00
Daniel Wagenknecht 39bb93d402 drivers: stm32 clock control: fix HSI PLLSOURCE with PREDIV1 support
The combination of
CONFIG_CLOCK_STM32_SYSCLK_SRC_PLL and
CONFIG_CLOCK_STM32_PLL_SRC_HSI
on SOCs with PREDIV1 support made use of the LL define
LL_RCC_PLLSOURCE_HSI_DIV_2, which is not defined for SOCs with
PREDIV1 support.

This exchanges LL_RCC_PLLSOURCE_HSI_DIV_2 with LL_RCC_PLLSOURCE_HSI
which is the appropiate source according to stm32f0xx_ll_rcc.h
line 473 and stm32f3xx_ll_rcc.h line 795.

Tested by compiling hello world for nucleo_f091rc board with HSI as
PLLSOURCE.

Signed-off-by: Daniel Wagenknecht <wagenknecht@clage.de>
2018-01-11 19:00:19 -05:00
Neil Armstrong 9dfb73c12a pinmux: stm32f0: Add B3/4/5 SPI1 B13/14/15 SPI2 pinmux
Add STM32F0 Pinmuxes for SPI1 and SPI2 controllers to be used on
the nucleo_f091rc board.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2018-01-11 19:00:19 -05:00
Neil Armstrong 7caa56f608 spi: spi_ll_stm32: Add support for STM32F0
Add support for STM32F0 similar to STM32F3 and STM32L4

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2018-01-11 19:00:19 -05:00
Yannis Damigos ef0d77b74e drivers: gpio_stm32: Add defines for ports I, J, K
This patch adds defines for ports I, J, K and
refactors gpio_stm32.h file.

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2018-01-11 14:35:45 -06:00
Carles Cufi 7d764b35f3 cmake: Use path-corrected version of ZEPHYR_BASE
Instead of accessing the environment variable ZEPHYR_BASE every time we
require accessing the source code root, use an intermediate variable
that has OS path separators correctly set to '/' to avoid issues on
Windows.

Note: This removes the ZEPHYR_SOURCE_DIR CMake variable. External
applications using that will need to change to use the new ZEPHYR_BASE
variable.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-01-11 14:59:03 -05:00
Tomasz Bursztyka f4664f1d9a drivers/ieee802154: Cleaning up CMakeLists.txt
Old reference on driver's specific raw mode was still lurking around.
Removing those.

Fixes #5270

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-01-10 21:53:01 -05:00
Tomasz Bursztyka 5195ddf472 drivers/ieee802154: Cleanup Kconfig
A very old reference to former net stack was still lurking around.
Removing it.

Taking the opportunity to clear up dependencies.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-01-10 21:53:01 -05:00
Michael Hope 17fcbc3f9b serial: sam0: add support for interrupt based transmit.
Signed-off-by: Michael Hope <mlhx@google.com>
2018-01-10 21:49:18 -05:00
Jukka Rissanen e63a781612 drivers: eth: mcux: Use correct Kconfig option for RX bufs
The mcux ethernet driver was using TX buf count when allocating
RX buffers.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-01-10 10:32:16 -06:00
Anas Nashif f6aefe5f17 drivers: ti_adc108s102: remove newline from syslog messages
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-09 10:59:41 -05:00
Erwan Gouriou 89eb2d2057 drivers: ethernet: stm32: various small changes
Amend stm32 ethernet driver with small changes:
*Provide HAL_ETH_Init return value in error message,
return on error and move it before thread creation
*Provide computed MAC address in debug message

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-01-09 08:44:03 -06:00
Gil Pitney e5cef70abd drivers: i2c: Add support for cc32xx I2C bus
This was validated on the cc3220sf_launchxl board
using the Zephyr thermometer sample program
adapted to call the i2c driver directly, and fetching
samples from the on-board TMP006 temperature sensor.

Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2018-01-09 08:39:59 -06:00
Anas Nashif 7ae749828f kconfig: fix help text indentation
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-08 08:08:45 -05:00
Johann Fischer 476f05d2f8 drivers: sensors: add driver for amg88xx sensor
This patch adds the driver for Panasonic AMG88xx
infrared array sensor.

The driver was developed within the framework of a student
internship in the development department. The task of the
student was to implement the trigger part of the driver,
transfer and visualization of the measured data.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-01-07 16:04:45 -05:00
Michael Hope b85b676ba9 serial: add a serial driver for the SAM0 family.
Signed-off-by: Michael Hope <mlhx@google.com>
2018-01-04 13:18:25 -05:00
Michael Hope 54c6fbdca7 gpio: add a GPIO driver for the SAM0 family.
Signed-off-by: Michael Hope <mlhx@google.com>
2018-01-04 13:18:25 -05:00
Michael Hope be8cba4bad watchdog: add a watchdog driver for the SAM0 family.
Signed-off-by: Michael Hope <mlhx@google.com>
2018-01-04 13:18:25 -05:00
Paul Sokolovsky e25df54eae various: Update/fix some textual material and code comments.
Of these, only struct net_ipv6_nbr_data::send_ns is a descriptive
change:

send_ns is used for timing Neighbor Solicitations in general, not
just for DAD.

The rest are typo/grammar fixes.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-12-29 09:45:39 -05:00
Anas Nashif 6b55598ad4 board: posix: add native_posix board definition
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-27 14:16:08 -05:00
Ramakrishna Pallala 12d614d0b8 drivers: gpio: add support for Altera Nios-II PIO controller
The PIO cores on Altera Nios-II processors can be used
for GPIOs and each PIO core can be configured as Input only,
Output only or as Bidirectional port from the Qsys tool.

The present Nios-II softcpu image on the Zephyr only has the
support for Output only port and the PIOs[0:3] are wired to
LED[0:3] on the Altera MAX10 board.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2017-12-21 12:02:24 -08:00
Anas Nashif e2122cbf89 lib: move ring_buffer from misc/ to lib/
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-15 20:02:01 -05:00
Anas Nashif 6daf046e8f lib: move crc from drivers to lib/
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-15 20:02:01 -05:00
Savinay Dharmappa 21c2cf78f2 driver: serial: Get interrupt number from dts
Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>
2017-12-15 11:22:55 -06:00
Savinay Dharmappa 54239d50a4 dts: x86: Add interrupt controller node
patch adds interrupt controller node and interrupt
property for device nodes.

Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>
2017-12-15 11:22:55 -06:00
Erwan Gouriou 65747e8702 dts: add sensors dts support for some sensors
Provide HAS_DTS_I2C_DEVICE flag to enable dts based generation for
these sensors.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-12-14 11:30:44 -06:00
Anas Nashif 429c2a4d9d kconfig: fix help syntax and add spaces
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-13 17:43:28 -06:00
Maureen Helm 112800d6c1 drivers: slip: Remove stale CMakeLists.txt
The slip driver was moved to drivers/net around the same time as the
conversion to CMake,

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-12-13 18:25:11 -05:00
Wayne Ren 528c960ae7 arch: arc: Add the support of secure mode for em
In ARC's SecureShield, a new secure mode (currently only em) is added.
The secure/normal mode is orthogonal to kernel/user mode. The
differences between secure mode and normal mode are following:

* different irq stack frame. so need to change the definition of
  _irq_stack_frame, assembly code.

* new aux regs, e.g, secure status(SEC_STAT), secure vector base
  (VECT_BASE_S)

* interrupts and exceptions, secure mode has its own vector base;
  interrupt can be configured as secure or normal through the
  interrupt priority aux reg.

* secure timers. Two secure timers (secure timer 0 and timer 1) are
  added.Here, for simplicity and backwards compatibility original
  internal timers (timer 0 and timer1) are used as sys clock of zephyr

* on reset, the processor is in secure mode and secure vector base is
  used.

Note: the mix of secure and normal mode is not supported, i.e. it's
assumed that the processor is always in secure mode.

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2017-12-13 12:05:33 -05:00
Andrzej Puzdrowski d095963e73 drivers: flash: Assert implementation of Flash Page Layout
Some drivers doesn't implement flash API page layout extension
which is causing the application crash once the API was calling.
This patch introduce system termination for this in those drivers
which doesn't implement extension. This will help to discover this
problem early.

It is not done by preprocessor check because it is possible to have
enabled a driver which support and a driver which doesn't support
this API simultaneously.

Now FLASH_PAGE_LAYOUT configuration option is accessible only in case
that at last one driver which implements mentioned API is enabled.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2017-12-12 14:23:50 -06:00
Yannis Damigos c2a0789d5f boards: stm32f3_disco: Use pins PA9/PA10 for I2C_2
On stm32f3_disco pins PF0/PF1 are used for OSC_IN/OSC_OUT
signals. Use pins PA9/PA10 for I2C_2 port

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2017-12-12 12:36:08 -06:00
Neil Armstrong 41cfa37b8c pinmux: stm32f0: add I2C1 and I2C2 pinmux
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2017-12-12 12:36:08 -06:00
Neil Armstrong 59d33b5f27 i2c: stm32_ll: add support for STM32F0 with combined irq
The STM32F0 has only a single IRQ line, add a combined IRQ handler.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2017-12-12 12:36:08 -06:00
Neil Armstrong 32cb3f0220 flash: stm32: add support for STM32F0 flash controller
Add the STM32F0 Embedded Flash support in the flash_stm32 driver
interface.
The STM32F0 has a particularity or use the HSI as clock source
for the flash controller interface, so this clock must be
enabled directly in the case HSE or another clock is used by
the system clock.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2017-12-12 12:36:08 -06:00
Paul Sokolovsky 2a795a19ff drivers: eth_mcux: Implement IPv6 multicast group joining/leaving
IPv6 mcast addr to MAC mcast conversion was factored out to
subsys/net/ip/l2/ethernet.c for reuse by other drivers.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-12-12 09:24:51 -05:00
Vitor Massaru Iha c969ddbdd8 drivers: gpio: esp32: Check return value of pinmux_pin_input_enable()
Some gpio pins are only input, and this assert is for check if
they were set as output.

Signed-off-by: Vitor Massaru Iha <vitor@massaru.org>
2017-12-11 09:21:53 -05:00
Paul Sokolovsky 81ecfc3506 drivers: eth_mcux: Disable promiscuous mode by default
Now that proper solicited-node multicast group joing is implemented,
promiscuous mode's purpose is reduced to just debugging needs.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-12-11 09:09:48 -05:00
Sebastian Bøe 1bb47676a9 kconfig: 802154: nrf: Fix kconfig
This fixes a regression from
https://github.com/zephyrproject-rtos/zephyr/pull/5018

The ieee802154 driver wouldn't build because nrf drivers/ieee802154
depends on the nordic ext drivers to build.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2017-12-06 11:11:59 -06:00
Erwan Gouriou 222bc6096b drivers: serial: stm32: report only unmasked irq
Fix #5298
irq_is_pending function returned TXE/RXNE flag status
even if IRQ was masked, which led to enless loop
in uart_pipe when no TX was performed. Fix by reporting status only when
IRQ is unmasked.

Signed-Off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-12-06 09:42:51 -06:00
Neil Armstrong 958acd1b4e flash: stm32l4x: fix build
Fix build since current file directly is no more in the include path.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2017-12-04 10:53:12 -06:00
Ioannis Glaropoulos ffbc28a465 drivers: serial: Fix nRF5x UART IRQ Mask values
In uart_nrf5.c the IRQ masks for the TX READY and ERROR events are
incorrect. This pull request fixes the mask values so they are
according to the nRF51/nRF52832/nRF52840 product specification.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2017-12-04 12:26:14 +01:00
Piotr Mienkowski dafdfadfbe drivers: Add Atmel SAM I2S (SSC) driver
Added Inter-IC Sound driver (based on SSC module) for Atmel
SAM MCU family.

Tested on Atmel SMART SAM E70 Xplained board

Origin: Original

Jira: ZEP-2509
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2017-11-30 10:30:33 -05:00
Piotr Mienkowski fce40c4795 drivers: add missing i2s directory to CMakeLists.txt
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2017-11-30 10:30:33 -05:00
Piotr Mienkowski dbcc7429e6 drivers: Add Atmel SAM DMA (XDMAC) driver
Added DMA (XDMAC) driver for Atmel SAM MCU family. The driver provides
private DMA API to be used by the SAM family device drivers. Public
DMA API to be used by user space programs is currently missing.

Tested on Atmel SMART SAM E70 Xplained board

Origin: Original

Jira: ZEP-1609
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2017-11-30 10:30:33 -05:00
Michael Hope 21b94bacd9 flash: minor documentation improvements.
This patch makes minor improvements to the flash documentation:

* spi -> SPI
* Capitialise the first word in a sentance
* Adding the, and, all, etc where appropriate.

Signed-off-by: Michael Hope <mlhx@google.com>
2017-11-28 12:25:19 -05:00
Daniel Wagenknecht 02a46e7197 drivers: i2c_ll_stm32_v2: don't use while loops in interrupt mode
Waiting for transfer complete and stop condition uses while loops
even when interrupt mode is enabled.
Implement use of TC, TCR and STOP interrupt for interrupt mode.
msg_done is not needed in interrupt mode anymore, so move it
to non-interrupt section
Tested with stm32f3_disco board.

Signed-off-by: Daniel Wagenknecht <wagenknecht@clage.de>
2017-11-28 11:21:06 -06:00
Daniel Wagenknecht 5380bc597f drivers: i2c_ll_stm32_v2: reorder to remove duplication
Disabling of Interrupts is duplicated. Move it to a position
that is common to messages that end with and without errors.

Signed-off-by: Daniel Wagenknecht <wagenknecht@clage.de>
2017-11-28 11:21:06 -06:00
Yongfa Zhou ce6f6f4985 drivers: sensor: Fix some code style issues
Signed-off-by: Yongfa Zhou <yongfa.zhou@intel.com>
2017-11-27 22:17:38 -05:00
Yongfa Zhou 85c6b060b0 drivers: sensor: Add plantower PMS7003 Driver
Tested on STM32F103 board

Origin: Original

Signed-off-by: Yongfa Zhou <yongfa.zhou@intel.com>
2017-11-27 22:17:38 -05:00
Anas Nashif 938a8aadaa kconfig: fix type of config for nrf5 15.4
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-11-23 07:29:13 -05:00
Leandro Pereira 07e1a64e77 drivers: i2c_gpio: Use quoted #include directive for i2c_bitbang
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-11-22 18:49:17 -05:00
Vinayak Kariappa Chettimada c983f670f6 drivers: pwm: nRF5x: Use TIMER2 and PPI indices 14-19
As the nRF5x BLE controller uses TIMER1, TIMER2 and PPI
indices 0-13 (and 14-15, if PA/LNA feature is enabled),
the software based PWM driver needing 6 PPI channels has
to use PPI indices outside the BLE controller used range.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2017-11-22 18:46:20 -05:00
Tomasz Bursztyka b52c0f24a6 net/ieee802154: Make RAW mode generic
- Renaming NET_L2_RAW_CHANNEL to NET_RAW_MODE
- Create a generic IEEE 802.15.4 raw mode for drivers
- Modify the IEEE 802.15.4 drivers so it passes the packet unmodified,
up to code using that mode to apply the necessary changes on the
received net_pkt according to their needs
- Modify wpanusb/wpan_serial relevantly

Fixes #5004

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-11-22 10:10:09 -05:00
Vitor Massaru Iha bed7698ac0 pinmux: esp32: Unnecessary iteration in "for" loop
In this case: "pin == ARRAY_SIZE(pin_mux_off)" is invalid and it
isn't necessary to iterate.

Signed-off-by: Vitor Massaru Iha <vitor@massaru.org>
2017-11-20 16:39:58 -05:00
Vitor Massaru Iha 6a513ef65d drivers: gpio: Fix typo on esp32
esp32 has 40 gpio ports but some ranges are wrote 32_63 instead of
32_39.

Signed-off-by: Vitor Massaru Iha <vitor@massaru.org>
2017-11-18 07:43:29 -05:00
Ramakrishna Pallala 37ee913908 drivers: serial: Add Altera shim driver for JTAG UART soft IP
Delete the native UART JTAG driver as we will be reusing
the Altera's HAL driver.

Add the shim driver support for Altera HAL's JTAG UART soft IP.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2017-11-17 07:46:40 -05:00
Ramakrishna Pallala eb51886d8c drivers: timer: Add Altera shim driver for timer soft IP
Delete the native timer soft IP driver as we will be reusing
the Altera's HAL drivers for most of the soft IP's.

Add shim driver support for Altera timer system clock soft IP.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2017-11-17 07:46:40 -05:00
Anas Nashif 84ea59f00e drivers: crypto: add missing CMakeLists.txt file
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-11-16 05:48:16 -05:00
Piotr Mienkowski 8bfcfe5545 drivers: i2c: Add DTS support for i2c_sam_twihs driver
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2017-11-15 11:13:08 -06:00
Piotr Mienkowski 1f47ed75b7 drivers: i2c: rename twihs_sam to i2c_sam_twihs
Rename the Atmel SAM I2C driver based on TWIHS module to match the
convention:
<driver class>_<SoC family>_<hardware module used by the driver>

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2017-11-15 11:13:08 -06:00
Piotr Mienkowski e7dd844c6a drivers: i2c: Refactor Atmel SAM (TWIHS) driver
Various minor changes to the Atmel SAM (TWIHS) driver
- clean up variable names, comments
- refactor i2c_clk_set function
- do not save configuration in dev_data
- improve ISR NACK handling
- print "Device initialized" string

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2017-11-15 11:13:08 -06:00
Maureen Helm 6043c74fd3 gpio: Introduce mcux igpio shim driver
Adds a new gpio driver for the NXP i.MX family of SoCs. Read, write,
configure, and callback API functions are all implemented.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-11-15 09:09:58 -06:00
Maureen Helm 0f3b490905 clock_control: Introduce mcux ccm driver
Adds a new clock control driver for i.MX SoCs that have the clock
control module (CCM).

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-11-15 09:09:58 -06:00
Maureen Helm 175e4f4953 serial: Add another instance to the mcux lpuart driver
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-11-15 09:09:58 -06:00
Yannis Damigos cf2eb7d1fa drivers: i2c_ll_stm32_v2: Use the correct flags in event ISR
Event ISR checks if the TX/RX interrupts is enabled instead
of the TXIS/RXNE interrupt status flags. Use the TXIS/RXNE
interrupt status flags to check which interrupt event
happened.

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
Signed-off-by: Daniel Wagenknecht <wagenknecht@clage.de>
2017-11-15 09:09:58 -06:00
Yannis Damigos b80da2b710 drivers: i2c_ll_stm32: Use I2C API flags
STM32 I2C driver doesn't use the I2C API flags STOP/RESTART,
instead it uses its own RESTART flag. As a result, I2C API's
i2c_burst_write* funtions doesn't work. This patch makes
STM32 I2C driver to use I2C API flags.

Tested on: 96b_carbon, olimexino_stm32 (i2c_ll_stm32_v1)
Tested on: stm32f3_disco, disco_l475_iot1 (i2c_ll_stm32_v2)

Fixes: #4459

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
Signed-off-by: Daniel Wagenknecht <wagenknecht@clage.de>
2017-11-15 09:09:58 -06:00
Kumar Gala 4b2348c9e7 drivers/ieee802154_kw41z: Fix interrupt priority
The interrupt priority on KW41Z is from 0..3.  The value of 0x80 is
invalid, so lets set it to 0 for now as all the other interrupt
priorities default to 0 right now.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-11-15 08:30:16 -06:00
Kumar Gala 7cd27be39a drivers/ieee802154_kw41z: Update kw41z to support event trace buffer
Added conditionally enabled event state tracing support.
Needed for enhanced debug visibility of tight timed events where
normal print debug messages affect the timing of things. This is a
simple buffer that allows post analysis via gdb of what sequencer
events occurred.

Signed-off-by: David Leach <david.leach@nxp.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-11-15 08:30:16 -06:00
David Leach fcffac92b7 drivers/ieee802154_kw41z: Reduce debug logging due to false positives
- Removed some debug output and changed the level of others to reduce
  the amount of information logged. The reason is that some of this is
  causing false positive distractions.
- Removed enabling of FILTER error IRQ events. It isn't needed and is
  only informational.
- Changed frame control AR bit inspection to use native retrieval
  routine.
- Addressed some coding style issues.

Signed-off-by: David Leach <david.leach@nxp.com>
2017-11-15 08:30:16 -06:00
David Leach 280ccbaffb drivers/ieee802154_kw41z: Modified RX handling of filter failures
Changed the logic to reset the sequencer when a RX filter
failure has been detected. This also disables the RX timer
until the next watermark detection.

Signed-off-by: David Leach <david.leach@nxp.com>
2017-11-15 08:30:16 -06:00
David Leach e8431daac0 drivers/ieee802154_kw41z: Stabilize the KW41Z IEEE802.15.4 driver
- Reworked the driver logic around TX/RX to correctly handle the
  expectations of the underlying 802.15.4 hardware IP.
- Fixed a problem with TX always reporting an error to the stack
  which resulted in constant retries.
- Fixed bug in RX to TX transition which would occasionally cause the
  driver to error the TX.
- Changed RX logic to ensure that invalid RX frames were not passed up
  the stack.
- Simplified hardware timer usage to only use TMR3.
- Added RX watermark and TMR3 support to fix a hardware problem where
  the hw IP can get stuck on a receive in noisy environments.
- Modified samples/net/echo_client and echo_server kw41z project config
  files to provide enanced debug visibility into stacks and threads.

Signed-off-by: David Leach <david.leach@nxp.com>
2017-11-15 08:30:16 -06:00
Vincent Veron aff88a2249 drivers: spi: add 16 bits word size support for stm32
Add 16 bits support when using SPI in master mode.

Signed-off-by: Vincent Veron <vincent.veron@st.com>
2017-11-15 07:19:34 -06:00
Sebastian Bøe 780d9facbe cmake: s/CONFIG_I2C_STM32_V1x/CONFIG_I2C_STM32_V1/
Fix typo in build scripts for STM's I2C driver. The typo was
introduced in the cmake migration.

Discovered by Dmitry:
https://lists.zephyrproject.org/pipermail/zephyr-devel/2017-November/008383.html

Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-15 07:06:26 -06:00
Jukka Rissanen 0436ad9e78 drivers: net: loopback: Simulate real hw device
Instead of passing net_pkt as is to the receiving side of the
interface, clone the sent packet and drop the sent one.
This is needed mainly in TCP where passing the same packet from
sending to receiving side is causing havoc.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-15 12:27:14 +02:00
Sebastian Bøe f2a3977261 cmake: Added missing zephyr_sources() calls for esp32 drivers
Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-14 10:47:15 -05:00
Piotr Mienkowski bf74e5409b drivers: serial: fix CMakeLists for Atmel SoCs
- added missing usart_sam.c entry
- removed outdated uart_atmel_sam3.c entry

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2017-11-14 08:10:34 -05:00
Ding Tao 8fbbc13d20 CMake: Fix wrong file name of entropy_stm32.c
Signed-off-by: Ding Tao <miyatsu@qq.com>
2017-11-14 08:10:22 -05:00
Thiago Silveira 912a51957e drivers: entropy: Add nRF5 entropy generator driver
Origin: Original

Signed-off-by: Thiago Silveira <thiago@exati.com.br>
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2017-11-14 07:02:12 -05:00
David Leach 513ce10da8 cmake: Fix build of entropy driver for MCUX TRNG
Signed-off-by: David Leach <david.leach@nxp.com>
2017-11-13 16:32:08 -05:00
Johann Fischer a14dd6309e cmake: fix build of the entropy drivers
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-11-11 19:01:42 -05:00
Sebastian Bøe 2224e22a6f drivers: sensor: Fixed include paths s/</"/
CMake no longer adds the source directory to the system include path.

Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-10 11:21:41 -05:00
Sebastian Bøe 29bb2a8fbf cmake: Fixed drivers/sensor/CMakeLists.txt
Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-10 11:21:41 -05:00
Gil Pitney dec93834d9 cmake: Fix drivers/serial/CMakeLists.txt to build uart_cc32xx.c
Previously, a typo prevented UART from working for any program
built for BOARD=cc3220sf_launchxl.

Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2017-11-09 22:01:34 -05:00
Loic Poulain eb83cda770 usb: dc_dw: Improve TX perf and reliability
During large USB transfer it's pretty common to call ep_write whereas
the previous TX transfer is not achieved and so the TX FIFO space is
not available. Sleeping 20ms in this case introduce a relatively high
latency and reduce the throughput.

This can be observed when pinging the board with CDC-ECM net class.
ping reply is split into 2 USB TX transfer, the second one is only
triggered after 20ms, making ping latency > 20ms.

To fix this, just continuously read the FIFO availabilty and fire TX
as soon as possible.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2017-11-09 09:15:55 -06:00
Loic Poulain fa2da6713b usb: stm32: Fix null dereference in ep_write
ret_bytes param is optional and then can be NULL.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2017-11-09 09:13:14 -05:00
Loic Poulain 4a2e967a87 usb: stm32: Fix TX FIFO overwrite
In the same way as dw driver, check that FIFO is empty before
writing any new data. This patch introduces a boolean semaphore
which is requested before any new TX transfer and released on
transfer completion.

This fixes usb-ecm support on 96b_carbon board.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2017-11-09 09:13:14 -05:00
Sebastian Bøe 0829ddfe9a kbuild: Removed KBuild
Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
Sebastian Bøe 12f8f76165 Introduce cmake-based rewrite of KBuild
Introducing CMake is an important step in a larger effort to make
Zephyr easy to use for application developers working on different
platforms with different development environment needs.

Simplified, this change retains Kconfig as-is, and replaces all
Makefiles with CMakeLists.txt. The DSL-like Make language that KBuild
offers is replaced by a set of CMake extentions. These extentions have
either provided simple one-to-one translations of KBuild features or
introduced new concepts that replace KBuild concepts.

This is a breaking change for existing test infrastructure and build
scripts that are maintained out-of-tree. But for FW itself, no porting
should be necessary.

For users that just want to continue their work with minimal
disruption the following should suffice:

Install CMake 3.8.2+

Port any out-of-tree Makefiles to CMake.

Learn the absolute minimum about the new command line interface:

$ cd samples/hello_world
$ mkdir build && cd build
$ cmake -DBOARD=nrf52_pca10040 ..

$ cd build
$ make

PR: zephyrproject-rtos#4692
docs: http://docs.zephyrproject.org/getting_started/getting_started.html

Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
David B. Kinder 7e3ed1465f doc: fix Kconfig misspellings
Kconfig files are processed to create configuration
option documentation.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-11-08 13:50:35 -05:00
Gustavo Lima Chaves 9bb07ff69a jailhouse: add support for x2APIC mode for all LOAPIC accesses
Besides the fact that we did not have that for the current supported
boards, that makes sense for this new, virtualized mode, that is meant
to be run on top of full-fledged x86 64 CPUs.

By having xAPIC mode access only, Jailhouse has to intercept those MMIO
reads and writes, in order to examine what they do and arbitrate if it's
safe or not (e.g. not all values are accepted to ICR register). This
means that we can't run away from having a VM-exit event for each and
every access to APIC memory region and this impacts the latency the
guest OS observes over bare metal a lot.

When in x2APIC mode, Jailhouse does not require VM-exits for MSR
accesses other that writes to the ICR register, so the latency the guest
observes is reduced to almost zero.

Here are some outputs of the the command line

  $ sudo ./tools/jailhouse cell stats tiny-demo

on a Jailhouse's root cell console, for one of the Zephyr demos using
LOAPIC timers, left for a couple of seconds:

Statistics for tiny-demo cell (x2APIC root, x2APIC inmate)

COUNTER                              SUM   PER SEC
vmexits_total                          7         0
vmexits_management                     3         0
vmexits_cr                             2         0
vmexits_cpuid                          1         0
vmexits_msr                            1         0
vmexits_exception                      0         0
vmexits_hypercall                      0         0
vmexits_mmio                           0         0
vmexits_pio                            0         0
vmexits_xapic                          0         0
vmexits_xsetbv                         0         0

Statistics for tiny-demo cell (xAPIC root, xAPIC inmate)

COUNTER                              SUM   PER SEC
vmexits_total                       4087        40
vmexits_xapic                       4080        40
vmexits_management                     3         0
vmexits_cr                             2         0
vmexits_cpuid                          1         0
vmexits_msr                            1         0
vmexits_exception                      0         0
vmexits_hypercall                      0         0
vmexits_mmio                           0         0
vmexits_pio                            0         0
vmexits_xsetbv                         0         0

Statistics for tiny-demo cell (xAPIC root, x2APIC inmate)

COUNTER                              SUM   PER SEC
vmexits_total                       4087        40
vmexits_msr                         4080        40
vmexits_management                     3         0
vmexits_cr                             2         0
vmexits_cpuid                          1         0
vmexits_exception                      0         0
vmexits_hypercall                      0         0
vmexits_mmio                           0         0
vmexits_pio                            0         0
vmexits_xapic                          0         0
vmexits_xsetbv                         0         0

See that under x2APIC mode on both Jailhouse/root-cell and guest, the
interruptions from the hypervisor are minimal. That is not the case when
Jailhouse is on xAPIC mode, though. Note also that, as a plus, x2APIC
accesses on the guest will map to xAPIC MMIO on the hypervisor just
fine.

Signed-off-by: Gustavo Lima Chaves <gustavo.lima.chaves@intel.com>
2017-11-07 08:58:49 -05:00
Gustavo Lima Chaves 97a8716a4f x86: Jailhouse port, tested for UART (# 0, polling) and LOAPIC timer
This is an introductory port for Zephyr to be run as a Jailhouse
hypervisor[1]'s "inmate cell", on x86 64-bit CPUs (running on 32-bit
mode). This was tested with their "tiny-demo" inmate demo cell
configuration, which takes one of the CPUs of the QEMU-VM root cell
config, along with some RAM and serial controller access (it will even
do nice things like reserving some L3 cache for it via Intel CAT) and
Zephyr samples:

   - hello_world
   - philosophers
   - synchronization

The final binary receives an additional boot sequence preamble that
conforms to Jailhouse's expectations (starts at 0x0 in real mode). It
will put the processor in 32-bit protected mode and then proceed to
Zephyr's __start function.

Testing it is just a matter of:
  $ mmake -C samples/<sample_dir> BOARD=x86_jailhouse JAILHOUSE_QEMU_IMG_FILE=<path_to_image.qcow2> run
  $ sudo insmod <path to jailhouse.ko>
  $ sudo jailhouse enable <path to configs/qemu-x86.cell>
  $ sudo jailhouse cell create <path to configs/tiny-demo.cell>
  $ sudo mount -t 9p -o trans/virtio host /mnt
  $ sudo jailhouse cell load tiny-demo /mnt/zephyr.bin
  $ sudo jailhouse cell start tiny-demo
  $ sudo jailhouse cell destroy tiny-demo
  $ sudo jailhouse disable
  $ sudo rmmod jailhouse

For the hello_world demo case, one should then get QEMU's serial port
output similar to:

"""
Created cell "tiny-demo"
Page pool usage after cell creation: mem 275/1480, remap 65607/131072
Cell "tiny-demo" can be loaded
CPU 3 received SIPI, vector 100
Started cell "tiny-demo"
***** BOOTING ZEPHYR OS v1.9.0 - BUILD: Sep 12 2017 20:03:22 *****
Hello World! x86
"""

Note that the Jailhouse's root cell *has to be started in xAPIC
mode* (kernel command line argument 'nox2apic') in order for this to
work. x2APIC support and its reasoning will come on a separate commit.

As a reminder, the make run target introduced for x86_jailhouse board
involves a root cell image with Jailhouse in it, to be launched and then
partitioned (with >= 2 64-bit CPUs in it).

Inmate cell configs with no JAILHOUSE_CELL_PASSIVE_COMMREG flag
set (e.g. apic-demo one) would need extra code in Zephyr to deal with
cell shutdown command responses from the hypervisor.

You may want to fine tune CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC for your
specific CPU—there is no detection from Zephyr with regard to that.

Other config differences from pristine QEMU defaults worth of mention
are:

   - there is no HPET when running as Jailhouse guest. We use the LOAPIC
     timer, instead
   - there is no PIC_DISABLE, because there is no 8259A PIC when running
     as a Jailhouse guest
   - XIP makes no sense also when running as Jailhouse guest, and both
     PHYS_RAM_ADDR/PHYS_LOAD_ADD are set to zero, what tiny-demo cell
     config is set to

This opens up new possibilities for Zephyr, so that usages beyond just
MCUs come to the table. I see special demand coming from
functional-safety related use cases on industry, automotive, etc.

[1] https://github.com/siemens/jailhouse

Reference to Jailhouse's booting preamble code:

Origin: Jailhouse
License: BSD 2-Clause
URL: https://github.com/siemens/jailhouse
commit: 607251b44397666a3cbbf859d784dccf20aba016
Purpose: Dual-licensing of inmate lib code
Maintained-by: Zephyr

Signed-off-by: Gustavo Lima Chaves <gustavo.lima.chaves@intel.com>
2017-11-07 08:58:49 -05:00
Gustavo Lima Chaves 1a8e72c913 loapic_intr: factor (out) APIC accesses in static functions
This will accomodate newer access models later, with variations of those
functions' contents.

Signed-off-by: Gustavo Lima Chaves <gustavo.lima.chaves@intel.com>
2017-11-07 08:58:49 -05:00
Youvedeep Singh 833025dd94 timer: xtensa_sys_timer: Tickless Kernel Implementation for Xtensa
Implement Tickless Kernel support for Xtensa Architecture.

Signed-off-by: Youvedeep Singh <youvedeep.singh@intel.com>
2017-11-07 08:17:40 -05:00
Bobby Noelte 2ce56e0100 drivers: serial: provide support for stm32f091
Support the USARTs of the ST STM32F091xx SoC.

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
2017-11-06 11:39:16 -06:00
Youvedeep Singh 26de2ec1cb gpio: Add APIs for enabling/Disabling GPIOTE interrupts for nrf52 SOC.
Signed-off-by: Youvedeep Singh <youvedeep.singh@intel.com>
2017-11-06 09:29:10 -05:00
Youvedeep Singh affbea7caf gpio: Add support for SENSE configuration for nrf SOC GPIO.
nrf SOCs are capable of waking from Low power state or
Deep Sleep state using sense configuration.
So adding support for this in nrf GPIO driver.

Jira: ZEP-2623

Signed-off-by: Youvedeep Singh <youvedeep.singh@intel.com>
2017-11-06 09:29:10 -05:00
Michael Hope 82118c712f net: fix the build rules for drivers/net.
The Makefile was using the obj-$FOO = form instead of the ob-$FOO +=
form, so if both slip and loopback are enabled then only loopback will
get built.

Signed-off-by: Michael Hope <mlhx@google.com>
2017-11-06 10:24:05 +02:00
Erwan Gouriou 2a7efb7419 sensors: hts221: provide name to Kconfig choice
In order to be able to default Kconfig "Trigger mode" choice
in a board Kconfig.defconfig, this commit provides it with a name.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-11-03 13:52:57 -05:00
Erwan Gouriou 2e20f49167 sensors: lis3mdl: provide name to Kconfig choice
In order to be able to default Kconfig "Trigger mode" choice
in a board Kconfig.defconfig, this commit provides it with a name.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-11-03 13:52:57 -05:00
Daniel Wagenknecht c404c3b241 i2c: fix issue of stm32-i2c-v2 (F0/F3/F7) driver hanging in endless loop
Fixes #4429
Driver didn't work properly when a transfer consisted of multiple
messages.
Fix doesn't use auto end mode anymore. msg_done function waits for
transfer to complete and issues stop condition if necessary.

Tested with stm32f3_disco board and samples/drivers/i2c_fujitsu_fram
example adapted to use I2C_1 as I2C_DEV

Signed-off-by: Daniel Wagenknecht <wagenknecht@clage.de>
2017-11-03 13:52:57 -05:00
Ramakrishna Pallala 56cab64d70 drivers: crypto: Fix the scope of ataes132a crypto_driver_api functions
Limit the scope of crypto_driver_api functions to driver file only.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2017-11-03 14:27:41 -04:00
Ramakrishna Pallala bb5a2985d1 drivers: crypto: Fix mbedtls Kconfig dependencies
Fix mbedtls shim driver Kconfig dependencies.

Limit the scope of crypto_driver_api functions to driver file only.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2017-11-03 14:27:41 -04:00
Ramakrishna Pallala 4742f8e010 drivers: crypto: Fix TinyCrypt Kconfig dependencies
Fix TinyCrypt shim driver Kconfig dependencies.

Limit the scope of crypto_driver_api functions to driver file only.

Remove dead code from crypto_tc_shim_priv.h

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2017-11-03 14:27:41 -04:00
Piotr Mienkowski 4487c935fe drivers: gpio: deprecate GPIO_PIN_ENABLE, GPIO_PIN_DISABLE
GPIO_PIN_ENABLE, GPIO_PIN_DISABLE configuration constants overlap
functionality provided by pinmux driver. They usage makes the API
inconsistent. They are almost uniformly ignored by the existing device
drivers. Only few of them take these constants into account.

This commit deprecates usage of the two configuration constants.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2017-11-02 18:46:30 -04:00
Leandro Pereira 1eed91f024 drivers: entropy: Only show STM32 entropy driver on if applicable
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-11-01 08:26:29 -04:00
Leandro Pereira 8b883a61a3 subsys/random: sys_rand32_get() implementation that uses entropy API
Instead of every hardware number generator driver providing an
implementation of this function, use the random device API to
centralize the implementation of this function.

This is a very simplistic function that can be seen as a stepping stone
to refactor the random number generation in Zephyr.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-11-01 08:26:29 -04:00
Leandro Pereira da9b0ddf5b drivers: Rename random to entropy
This should clear up some of the confusion with random number
generators and drivers that obtain entropy from the hardware.  Also,
many hardware number generators have limited bandwidth, so it's natural
for their output to be only used for seeding a random number generator.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-11-01 08:26:29 -04:00
Leandro Pereira adce1d1888 subsys: Add random subsystem
Some "random" drivers are not drivers at all: they just implement the
function `sys_rand32_get()`.  Move those to a random subsystem in
preparation for a reorganization.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-11-01 08:26:29 -04:00
Leandro Pereira 0dfee8f254 drivers: eth_enc28j60: Check return value of spi_transceive()
Coverity-ID: 178240
Coverity-ID: 178241
Coverity-ID: 178243

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-10-31 18:52:09 -04:00
Andrew Boie b7442a0a6b drivers: fix handler filenames
Fixes: #4654

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-31 12:51:22 -07:00
Anas Nashif 035814efc6 boards: move pinmux driver to board/soc dir
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-31 12:32:34 -04:00
Anas Nashif 4fb789701b drivers: pinmux: PINMUX_CC2650 depends on GPIO
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-31 12:32:34 -04:00
Anas Nashif 780324b8ed cleanup: rename fiber/task -> thread
We still have many places talking about tasks and threads, replace those
with thread terminology.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-30 18:41:15 -04:00
Andrew Boie b93f59e15c drivers: uart: add system call handlers
Certain interrupt-driven APIs were excluded as they are intended
only to be called from ISRs, or involve registering a callback
which runs in interrupt context.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-30 13:20:19 -07:00
Andrew Boie 0cb0447493 drivers: spi: add system call handlers
spi_transceive_async() omitted as we don't support k_poll objects
in user mode (yet).

The checking for spi_transceive() is fairly complex as we have to
validate the config struct passed in along with device instances
contained within it.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-30 13:20:19 -07:00
Andrew Boie 9a3f3aa218 drivers: random: add random_get_entropy sys call
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-30 13:20:19 -07:00
Andrew Boie d3ec6654f5 drivers: gpio: add system call handlers
Many APIs had two versions, by port and by pin, which called the same
API with different parameters. This has been reorganized to reduce
the number of system calls.

Callback registration API skipped.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-30 13:20:19 -07:00
Andrew Boie 4d91f5abe9 drivers: pinmux: add system call handlers
pinmux_pin_get() needs memory validated for the func parameter since
it's a pointer that gets written to.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-30 13:20:19 -07:00
Andrew Boie 9ca42fb033 drivers: rtc: add system calls
rtc_set_config() omitted since it registers a callback.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-30 13:20:19 -07:00
Andrew Boie 2e60b24a80 drivers: ipm: add system calls
ipm_register_callback() omitted since it registers a callback.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-30 13:20:19 -07:00
Andrew Boie 66aefcfcf4 drivers: flash: add system calls
The page_layout API returns pointers to kernel memory and is not
exposed to user mode. This is fine for flash_get_page_count()
and flash_get_page_info APIs since these copy the values, but some
redesign work will be needed to get flash_page_foreach() working in
user mode since we do not want the callback running in a privileged
state.

Due to the way that (even unimplemented) system call prototypes are
generated, the definition of struct flash_pages_info needed to be
moved outside of the #ifdef.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-30 13:20:19 -07:00
Andrew Boie 678314b7b2 drivers: counter: add syscall handlers
counter_set_alarm() registers a callback and has been skipped.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-30 13:20:19 -07:00
Andrew Boie 9c37af10ec drivers: aio_comparator: add system calls
aio_cmp_configure() registers a callback and is skipped.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-30 13:20:19 -07:00
Andrew Boie 0f66b9f7d8 drivers: pwm: add system call handlers
pwm_pin_set_usec now defined in terms of the other two APIs.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-30 13:20:19 -07:00
Andrew Boie c93a4789cb drivers: adc: add system call handlers
Straightforward conversion for adc_enable/disable.

adc_read() uses a sequence table, which points to an array
of struct adc_seq_entry, each element pointing
to memory buffers. Need to validate all of these as being readable
by the caller, and the buffers writable.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-30 13:20:19 -07:00
Andrew Boie 2a2a855aa8 drivers: i2c: add system call handlers
i2c actually only has two entry points into the driver,
i2c_configure and i2c_transfer. All the other APIs are derived
from these.

All derived APIs now just call i2c_transfer() with appropriate args.

The handler for i2c_transfer() needs to examine the message array
and validate all the buffers involved depending on whether we are
reading or writing to them.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-30 13:20:19 -07:00
Andrew Boie 74446381d1 sensors: move userspace handlers location
Place driver handlers with the drivers, not somewhere separate under
subsys/

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-30 13:20:19 -07:00
KaSroka bea5ccf7ea drivers: 15.4: nrf5: Add timeout when waiting for tx to complete
Waiting for tx to complete should timeout after 10ms
instead of blocking forever in case ack is not received.

Signed-off-by: Kamil Sroka <kamil.sroka@nordicsemi.no>
2017-10-30 12:03:03 +02:00
Andrei Emeltchenko fe9dee0107 usb: dw: Add sleep before FIFO flash
Adding sleep before TX FIFO flash fixes splitting networking packets
sent over USB endpoints making ECM broken since there is no flow
control other then frame sizes.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-10-28 14:38:19 -04:00
Andrei Emeltchenko b722dc589e usb: dw: Fix debug log specifier for FIFO not empty
The situation when FIFO is not empty is not a bug and it is spamming
console when only bugs are enabled.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-10-28 14:38:19 -04:00
Andy Ross 5aee94e4cf usb_dw_dc: Cleanup: write DIEPCTL register just once
The enable and clear NAK bit can be legally written together, do it in
just one write.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2017-10-28 14:38:19 -04:00
Andy Ross eebb17ca52 usb_dc_dw: Correctness: use bytewise I/O in FIFO fill
The Designware FIFO is filled in units of 32 bit words, but the buffer
we are passed is not guaranteed to be a multiple of 4 bytes long, nor
aligned on a 4-byte boundary.  So in theory we are reading 0-3 bytes
of unused garbage from the end of the array.

That's currently benign on supported platforms with this hardware,
which all support misaligned reads.  But not all do.  And the incoming
arrival of memory protection opens the possibility that those extra
bytes would cross a protection boundary and cause a crash or security
bug.

Do this right.

(Note that this is fixed to little endian byte order.  The Designware
databook is frustratingly silent on the endianness it expects, but
existing hardware I can see is definitely LE and I see a few spots in
the Linux dwc2 driver that likewise assume LE).

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2017-10-28 14:38:19 -04:00
Andy Ross f591e58211 usb_dc_dw: Correctly assign endpoint FIFOs
The designware hardware in dedicated FIFO mode (which is all we
support right now for lack of shared-FIFO hardware) has one hardware
FIFO per IN (i.e. transmit) endpoint.  But it doesn't assign them on
its own, it's the drivers responsibility to populate the TxFNum field
of the DIEPCTL registers with integer indices corresponding to the
desired FIFO.

We weren't doing that, which meant that all IN endpoints were sharing
the same FIFO zero which is supposed to be dedicated to EP0 control
transfers.  The net effect is that sometimes outbound transfers would
be corrupted, showing data from the wrong endpoint.  More often that
not this would leak from control transfers over to the
higher-bandwidth bulk endpoints of the application, but occasionally
you'd see a control transfer itself get borked and the USB device
would glitch.

Get this right and set the FIFOs properly.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2017-10-28 14:38:19 -04:00
Andy Ross e6874a0c61 usb_dw_dc: Fix locking correctness
There is no particular reason this spot in usb_dw_tx() cannot be
reached by racing threads on the same endpoint, though existing API
usage in the tree is all unithreaded.  The FIFO state read at the top
of the function must still be true at the bottom or else the packet
byte count will be corrupt.

Also, as described in an existing comment, the databook has some
scary-sounding warnings about access to the registers during FIFO
operations, even if they "should" be on separate endpoints and
unrelated.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2017-10-28 14:38:19 -04:00
Johann Fischer d81b332b0d drivers: mcr20a: check AR bit and use appropriate TX sequence
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-10-28 14:22:46 -04:00
Johann Fischer 5db10d072f drivers: mcr20a: small improvements
Issue a error message, if the _mcr20a_read_reg fails.

Do not execute SPI burst read/write if the buffer is too small.

Unlock mutex if set_pan_id, set_short_addr or set_ieee_addr
fail.

Force abort of the sequence when the higher level changes the channel
even though a T or TR sequence is in progress.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-10-28 14:22:46 -04:00
Loic Poulain 85d916caa9 pinmux: stm32: Fix coding-style errors
checkpatch returns the following errors:
"ERROR:COMPLEX_MACRO: Macros with complex values
 should be enclosed in parentheses"

Let's fix all of them.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2017-10-28 13:34:02 -04:00
Marti Bolivar 669327137b drivers: led_strip: add WS2812-ish driver
The WS2812 LED driver IC has a one-wire interface which encodes bit
values as pulse widths.

The ICs themselves are basically shift registers. Roughly speaking, a
"short" pulse shifts in a zero bit, a "long" pulse shifts in a one
bit, and an inter-pulse gap exceeding a reset time threshold causes a
pixel to latch the shifted-in color values. Each chip has an output
pin for daisy chaining. Refer to the chip datsheets and comments in
Kconfig.ws2812 for more details.

To meet timing without hogging the core, this driver generates pulses
using SPI. To work, this requires the MOSI line to stay low between
SPI frames, and for inter-frame delays to be less than the reset pulse
time.

There are other ways do it (PWM + DMA on some SoCs, GPIO bit-banging
if no other tasks need the core), but this is a reasonably
general-purpose implementation.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-10-28 13:23:30 -04:00
Marti Bolivar 658b673a83 drivers: led_strip: add LPD880x driver
LPD880x (e.g. LPD8803, LPD8806) devices are LED driver ICs which can
be controlled via a reduced SPI interface (clock and data only), and
support daisy chaining.

Add an led_strip driver for these devices.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-10-28 13:23:30 -04:00
Marti Bolivar b533841bf0 drivers: led_strip: add public API for addressable LED strips
This API covers drivers for strips, or strings, of individually
addressable LEDs. Both RGB and grayscale LED strip drivers can be
implemented within these APIs.

The API only provides for updating the entire strip, since not all
strips support updating individual LEDs without affecting the others.

Subsequent patches will add individual driver support.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-10-28 13:23:30 -04:00
Rajavardhan Gundi c24b77f84f i2c/i2c_dw: configure ic_tar based on ic_10bitaddr_master
This ensures DW_apb_i2c correctly transmits the slave address (7 or
10 bit) based on ic_10bitaddr_master when configured in master mode.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2017-10-28 07:22:28 -04:00
Rajavardhan Gundi 51e7fc7cf8 i2c/i2c_dw: correct the bitfield for ic_tar and ic_sar
The ic_tar and ic_sar were earlier set to 9 bits but now its
corrected to consider 10 bits.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2017-10-28 07:22:28 -04:00
Sebastian Bøe b7eaeb9f0a cleanup: Use quote include instead of system include
When the header file is located in the same directory as the source
file it is better to use a relative quote-include, e.g.

than a system include like

Avoiding the use of system includes in these cases is beneficial
because;

* The source code will be easier to build because there will be fewer
system include paths.

* It is easier for a user to determine where a quote-include header
  file is located than where a system include is located.

* You are less likely to encounter aliasing issues if the list of
  system include paths is minimized.

Authors:
Anas Nashif
Sebastian Bøe

Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-28 07:11:53 -04:00
Jukka Rissanen dc3f2455d7 drivers: ieee802154: uart: Do not send FCS bytes to peer
No need to send FCS bytes as the monitor_15_4 is configured to not
expect them. If we change the monitor_15_4 to use them, then we would
need to put correct values into these two FCS bytes.
So cleanest solution is not to send FCS bytes at all.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-10-26 14:51:56 +03:00
Kumar Gala ace47887bd serial: atmel_sam3: remove driver as it was deprecated
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-10-26 06:10:21 +02:00
Kamil Sroka 652fbe6756 drivers: 15.4: nrf5: Fix warning during compilation
Fixes #4466

Signed-off-by: Kamil Sroka <kamil.sroka@nordicsemi.no>
2017-10-24 11:00:08 +03:00
Leandro Pereira fa92bfe3c1 drivers: gpio: gecko: GPIO driver ignores pull-up/pull-down settings
Fixes #4395.

Coverity-ID: 178059
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-10-24 08:49:41 +02:00
Leandro Pereira 5e2303d54e drivers: flash: stm32f4x: rc should be declared as int
`rc` gets assigned values from function returning `int` and not
`u32_t`.

Fixes #4051.

Coverity-ID: 177219
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-10-24 00:15:11 +02:00
Paul Sokolovsky 15c64b2c84 drivers: net: loopback: Network loopback interface driver
Loopback is a networking interface which doesn't actually transfer
any data via link layer externally, and instead just mirrors back
(i.e. any packet send to the loopback interface will be received from
it). This interface very useful for testing.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-10-23 15:10:00 +03:00
Paul Sokolovsky 0612651deb drivers: slip: Consolidate under drivers/net/
Make drivers/net/ be the place for misc networking-related drivers
(otherwise, we'd need to have a new dir per driver).

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-10-23 15:10:00 +03:00
Maciej Debski eaff37e21f drivers: serial: provide support for stm32f0.
Fixes #3923

Signed-off-by: Maciej Debski <maciej.debski@rndity.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2017-10-23 12:31:47 +02:00
Maciej Debski f93e0bed4b drivers: pinmux: provide support for stm32f0 and nucleo f030r8 board.
Fixes #3923

Signed-off-by: Maciej Debski <maciej.debski@rndity.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2017-10-23 12:31:47 +02:00
Maciej Debski 0d80a3b574 drivers: interrupt_controller: provide support for stm32f0.
Fixes #3923

Signed-off-by: Maciej Debski <maciej.debski@rndity.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2017-10-23 12:31:47 +02:00
Maciej Debski 38b5d3c17e drivers: gpio: provide support for stm32f0.
Fixes #3923

Signed-off-by: Maciej Debski <maciej.debski@rndity.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2017-10-23 12:31:47 +02:00
Maciej Debski d0678201c3 drivers: clock_control: provide support for stm32f0.
Fixes #3923

Signed-off-by: Maciej Debski <maciej.debski@rndity.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2017-10-23 12:31:47 +02:00
Piotr Mienkowski 5bb0172839 drivers: i2c: deprecate usage of i2c_atmel_sam3 driver
Atmel SAM3X series has been recently converted to use ASF and
should now use common SAM family drivers. The i2c_atmel_sam3
I2C driver will be removed in the future.

This commit also changes the default I2C driver for Arduino Due
board from i2c_atmel_sam3 to i2c_sam_twi.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2017-10-23 10:18:08 +02:00
Piotr Mienkowski 26ba99e972 drivers: Add Atmel SAM family I2C (TWI) driver
Added I2C bus (TWI) driver for Atmel SAM MCU family. Only
I2C Master Mode with 7 bit addressing is currently supported.

Tested on Arduino Due board.

Origin: Original

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2017-10-23 10:18:08 +02:00
Adam Podogrocki 6d4da19602 iwdg: make independent watchdog driver compliant with STM32Cube LL API
Appropriate inclusion done for F1/F3/F4/L4 families in SoC tree.

JIRA: ZEP-2347

Signed-off-by: Adam Podogrocki <adam.podogrocki@rndity.com>
2017-10-23 09:51:16 +02:00
Erwan Gouriou da210ba0ba driver: serial: Move STM32 UART driver to LL API
STM32 UART driver was using a mix of LL/HAL APIs.  This commit removes
calls to HAL API and replaces them with LL APIs.  No functional change
have been seen during non regression testing.

But we could note a direct gain of 1Kb of ROM

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-10-20 12:28:11 -05:00
Yannis Damigos a172f72d84 boards: stm32f3_disco: Add I2C support
Add I2C support to STM32F3DISCOVERY board

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2017-10-20 12:28:11 -05:00
Yannis Damigos 1a85a80200 drivers: i2c_ll_stm32: STM32F0/3 set I2C clock source
STM32F0/3 I2C's independent clock source supports only
HSI and SYSCLK, not APB1. We force I2C clock source to SYSCLK.

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2017-10-20 12:28:11 -05:00
Maureen Helm e0954d3118 serial: Refactor mcux lpsci shim driver to use clock control interface
Refactors the mcux lpsci shim driver to use the clock control interface
instead of calling CLOCK_GetFreq() directly. This will allow SoCs with
different clock architectures to reuse this driver.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-10-20 12:28:11 -05:00
Maureen Helm 17a6d29f67 serial: Refactor mcux lpuart shim driver to use clock control interface
Refactors the mcux lpuart shim driver to use the clock control interface
instead of calling CLOCK_GetFreq() directly. This will allow SoCs with
different clock architectures to reuse this driver.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-10-20 12:28:11 -05:00
Maureen Helm e042e249b1 serial: Refactor mcux uart shim driver to use clock control interface
Use the clock control interface instead of calling CLOCK_GetFreq()
directly. This will allow SoCs with different clock architectures to
reuse this driver.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-10-20 12:28:11 -05:00
Maureen Helm 7a60782f67 clock_control: Introduce mcux sim driver
Adds a new clock control driver for Kinetis SoCs that have the system
integration (SIM) module. This will allow mcux shim drivers, such as
uart and i2c, to abstract the call to CLOCK_GetFreq() behind the
clock_control interface and thus be reused for SoCs with different clock
architectures.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-10-20 12:28:11 -05:00
Ravi kumar Veeramally b2d3656c1d i2c: twihs_sam: fix mode config variable usage
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-20 13:22:25 -04:00
Leandro Pereira 803984837f drivers: i2c: esp32: Fix crash when enabling second I2C device
IRQ_CONNECT() was being expanded with the IRQ line for the first device
twice, causing spurious IRQs.

Should fix #4398.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-10-19 20:09:23 -04:00
Manivannan Sadhasivam 90d288be29 drivers: serial: Add MSP-EXP432P401R UART
This patch adds support for on board UART_0 on MSP-EXP432P401R-LAUNCHXL.
Driver makes use of driverlib available in ROM by default, thus saving
code space.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
2017-10-19 12:16:11 -05:00
David B. Kinder 4600c37ff1 doc: Fix misspellings in header/doxygen comments
Occasional scan for misspellings missed during PR reviews

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-10-17 19:40:29 -04:00
Loic Poulain 8a11f91252 usb: Add support for STM32 family USB driver
This is a USB controller driver for STM32F4xx devices using
the STM32 Cube HAL_PCD framework. This has been tested with
the cdc_acm driver on a 96b_carbon board (STM32F401RE).

This is a refactoring of:
usb: usb_dc_stm: Add support for STM32Cube HAL_PCD USB driver
Signed-off-by: Christer Weinigel <christer@weinigel.se>
[daniel.thompson@linaro.org: Removed STM32F40(157) defconfig changes
together with STM32F4Discovery pinmux and defconfig changes, updated
clock settings and pad configuration to match latest mainline]
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
[giannis.damigos@gmail.com: Change uint*_t types to u*_t types,
change SYS_LOG_USB_DC_STM_LEVEL to SYS_LOG_USB_DRIVER_LEVEL and
update pinmux to match latest arm branch]
Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2017-10-17 09:14:47 -04:00
Loic Poulain e9d9463ebc pinmux: stm32: stm32f4: Add USB FS pinmux
Add pinmux configuration for USB OTG Full Speed.
Ports 11 and 12 use alternate function 10 for DM/DP.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2017-10-17 09:14:47 -04:00
Kamil Sroka 22d02db46e drivers: ieee802154: nrf5: Fix typo
Signed-off-by: Kamil Sroka <kamil.sroka@nordicsemi.no>
2017-10-17 10:23:34 +03:00
Paul Sokolovsky a39ec5f72c drivers: slip: Rework logging to follow conventions
Previously, there was boolean CONFIG_SLIP_DEBUG, which effectively
switched between "logging off" and "debug-level logging". Instead,
switch to CONFIG_SYS_LOG_SLIP_LEVEL (the naming of the option follows
existing conventions) which allows to select any of the standard 5
logging levels.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-10-16 12:31:17 -04:00
Marti Bolivar 1f244a7b1e drivers: spi: fix SPI_QMSI_SS typo
Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-10-16 11:58:50 -04:00
Marti Bolivar 5cb9578942 spi: stm32: fix clock prescaler calculation
The current prescaler calculation incorrectly fails to configure the
desired frequency when it is possible to match it exactly. Fix this.

Without this patch, if the user requests frequency N Hz, and there is
a SPI prescaler that can match this frequency exactly, the actual
frequency chosen by spi_stm32_configure() will be N/2 Hz.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-10-16 08:56:29 -07:00
Paul Sokolovsky 1ca4f1aa1d drivers: slip: Consistently log pkt/buf allocation failures
There are 3 cases of possible allocation failures, only 1 of them
was logged. Now, all the cases are logged: 1) failure to allocate
net_pkt; 2) failure to allocate very first net_buf for it; 3)
failure to allocate additional net_buf for it (this latter was
the only one logged previously).

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-10-16 10:58:12 +03:00
Tomasz Bursztyka ea0aee2bb3 drivers/ieee802154: Stop exposing old radio API functions
set_ieee_addr, set_short_addr and set_pan_id are now unused by L2, so
removing their exposure through the radio API.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-10-13 13:48:32 +03:00
Tomasz Bursztyka 54b3d6b130 drivers/ieee802154: Implement radio API's set_filter() relevantly
Currently, all drivers seem to support hardware filtering.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-10-13 13:48:32 +03:00
Tomasz Bursztyka b2726e14a6 drivers/ieee802154: Implement get_capabilities in existing drivers
Further support will need work per-driver basis, as soon as the L2 will
be able to make usage of such support.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-10-13 13:48:32 +03:00
Tomasz Bursztyka 164cbec9d0 drivers/ieee802154: Set lqi/rssi to net_pkt, stop exposing get_lqi
Both values are now embedded into net_pkt, get_lqi will be removed.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-10-13 13:48:32 +03:00
Andrzej Puzdrowski 296a355af5 drivers: flash: Add write-block-size values for SoCs
Write-block-size values were filled for nRF5, STM32, QMSI, MCUX and
w25qxxdv devices.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2017-10-11 11:19:15 -05:00
Kumar Gala 0bfd810d13 i2c: deprecate use of union dev_config
There are several issues with the dev_config union used as a
convenience when calling the i2c_configure api.  One, the union is well
name spaced protected and doesn't convey use with just i2c.  Second
there are assumptions of how the bits might get packed by the union
which can't be guaranteed.  Since the API takes a u32_t lets change in
tree uses to using the macros to setup a u32_t and make the union as
deprecated.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-10-11 10:45:12 -04:00
Jonas Pfaff b62a353551 drivers: adc: Add SAM ADC driver
Tested on Atmel SMART SAM E70 Xplained board

Origin: Original

Jira: ZEP-2507

Signed-off-by: Jonas Pfaff <jonas.pfaff@gmail.com>
2017-10-10 11:56:47 -05:00
Christian Taedcke 4b586157d6 drivers: serial: Add uart driver for Silabs EXX32 MCUs
Signed-off-by: Christian Taedcke <hacking@taedcke.com>
2017-10-10 11:56:47 -05:00
Christian Taedcke 158b635b57 drivers: gpio_gecko: Add gpio driver for Silabs EXX32 MCUs
Signed-off-by: Christian Taedcke <hacking@taedcke.com>
2017-10-10 11:56:47 -05:00
Tomasz Bursztyka 53ca9a3f9b drivers/spi: Run CS/GPIO logic only when relevant
If given gpio dev pointer is NULL, it will silently ignore the CS
control.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-10-10 09:42:45 -04:00
Tomasz Bursztyka 5f1360e27d drivers/bluetooth/spi: Do not initialize vendor attribute
As commit introducing it will be reverted.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-10-10 09:42:45 -04:00
Tomasz Bursztyka 24199b234c drivers/spi/stm32_ll: Configure NSS behavior according to cs pointer
If CS (Chip Select, known also as Slave Select...) is managed externaly
of the stm32_ll SPI controller, just config NSS line management
accordingly.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-10-10 09:42:45 -04:00
Leandro Pereira e1effa0e73 drivers: esp32: I2C driver implementation
Supports both master and slave mode, standard and fast modes,
configurable timeouts, and a few other tunable settings.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-10-09 20:53:22 -04:00
Leandro Pereira 5f22dab17a esp32: Prefix ROM routines with esp32_rom_
Also provide their prototypes in `soc.h`.  This should help
readability, since some ROM functions, with their names as provided by
Espressif, have sometimes the same prefix as Zephyr APIs.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-10-09 20:53:22 -04:00
Leandro Pereira 095424c416 drivers: gpio: esp32: Configure GPIO drive strength
Configuring an open drain driver is required by the I2C driver,
but the GPIO driver didn't support setting the drive strength.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-10-09 20:53:22 -04:00
Leandro Pereira fd25931228 drivers: gpio: esp32: Use PIN_FUNC_GPIO definition from ESP-IDF
PINMUX_FUNC_A is set to 0, which coincides with the GPIO function in
many of the ESP32 pins.  Use PIN_FUNC_GPIO by default inside the
GPIO driver, however, so the correct function is always selected.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-10-09 20:53:22 -04:00
Thiago Silveira 1d8c8ac3af clock_control: nrf5_power: Let the LF clock be configured at least once
If the LF clock was already started, but wasn't initialized with
_k32src_start yet, allow it to run once. This is needed because if a
soft reset is triggered while watchdog is active, the LF clock will
already be running, but won't be configured yet (watchdog forces LF
clock to be running).

If the LF clock isn't configured with _k32src_start, the nRF5 RTC
won't count and the whole system will malfunction, as the kernel
depends on the clock source being working properly.

Signed-off-by: Thiago Silveira <thiago@exati.com.br>
2017-10-08 23:05:34 -04:00
Marti Bolivar 4f8081b5e4 drivers: flash: add flash_page_foreach()
This patch adds a routine which can be used to iterate over all flash
pages on the device.

This can be also done by using flash_get_page_info_by_idx(), but that
would add an unnecessary loop over the layout array for each page.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-10-06 22:12:23 -04:00
Paul Sokolovsky 808b315cf6 arm: nxp: kw41z: Select IEEE802154_KW41Z driver for networking
802.15.4 is the networking hardware available in KW41Z SoC (and
supported by Zephyr). So, if networking in enabled, automatically
select the corresponding driver. This is similar to how frdm_k64f
automatically selects Ethernet driver, 96b_carbon selects BLE/IPSP
drivers, etc. (But we apply it on SoC level to reuse across the
boards.)

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-10-06 14:39:17 -05:00
Savinay Dharmappa 58d54c0f2d dts: x86: qemu_x86: Add device support for uart ns16550
Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>
2017-10-06 08:35:42 -04:00
Tomasz Bursztyka eb7b29e5cf drivers/ieee802154: Fix regression in uart pipe driver
A wrong name replacement was applied during commit
db11fcd174

Fixes issue #4165

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-10-04 10:47:08 +03:00
David B. Kinder f00f58517b doc: replace UTF-8 chars
Some our Zephyr tools don't like seeing UTF-8 characters, as reported in
issue #4131) so a quick scan and replace for UTF-8 characters in .rst,
.h, and Kconfig files using "file --mime-encoding" (excluding the /ext
folders) finds these files to tweak.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-10-03 20:03:57 -04:00