Commit graph

7653 commits

Author SHA1 Message Date
Andrew Boie
efc5fe07a2 kernel: overhaul unused stack measurement
The existing stack_analyze APIs had some problems:

1. Not properly namespaced
2. Accepted the stack object as a parameter, yet the stack object
   does not contain the necessary information to get the associated
   buffer region, the thread object is needed for this
3. Caused a crash on certain platforms that do not allow inspection
   of unused stack space for the currently running thread
4. No user mode access
5. Separately passed in thread name

We deprecate these functions and add a new API
k_thread_stack_space_get() which addresses all of these issues.

A helper API log_stack_usage() also added which resembles
STACK_ANALYZE() in functionality.

Fixes: #17852

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-02-08 10:02:35 +02:00
Ulf Magnusson
b9270c388d kconfig: Remove redundant SPI_DW dep on SPI_DW_ACCESS_WORD_ONLY
This symbol is already defined within an 'if SPI_DW'.

Flagged by https://github.com/zephyrproject-rtos/ci-tools/pull/128.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-02-08 09:58:33 +02:00
Alexander Wachter
f590d4fadb drivers: lora: build with newlib
The loramac-node library uses math functions from math.h that
are not included in the minimal lib.
This commit changes the samples project config to always build
with newlib and adds a dependency to newlib.

Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
2020-02-07 16:00:47 -06:00
Anas Nashif
fad8701748 tracing: cleanup and split segger/rtt configuration options
Move rtt configuration options to drivers/debug and split the
systemview configuration.

drivers/debug will service for this class of drivers that are enabled in
debug mode only and provide a hardware interface to the system.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-02-07 15:58:05 -05:00
Markus Fuchs
b0fcb0777c drivers: crypto: Add STM32 CRYP crypto driver
This patch adds crypto driver support for all STM32F4 devices providing
a CRYP peripheral.
This driver implements the AES ECB, CBC and CTR modes of operation.

It has been tested on a STM32F437 SoC running the Zephyr crypto driver
sample.

Signed-off-by: Markus Fuchs <markus.fuchs@de.sauter-bc.com>
2020-02-07 10:45:51 -06:00
Yannis Damigos
a4b448ea59 uart_stm32: Fix flow misspelling
Fix flow misspelling.

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2020-02-07 08:08:25 -06:00
Kumar Gala
6115346174 drivers: serial: stm32: Fix possible issue with mixed enum
When building with LLVM we get the following error:

uart_stm32.c:272:9: error: implicit conversion from enumeration type
'enum uart_config_parity' to different enumeration type
'enum uart_config_flow_control' [-Werror,-Wenum-conversion]
        return UART_CFG_PARITY_NONE;
        ~~~~~~ ^~~~~~~~~~~~~~~~~~~~

We shouldn't be mixing parity and flow control enum's.  Use
UART_CFG_FLOW_CTRL_NONE instead or UART_CFG_PARITY_NONE.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-07 11:50:38 +01:00
Alberto Escolar Piedras
90d9eb2f50 native_posix: timer: Improve arch_busy_wait() doc
Expand a bit the native_posix arch_busy_wait()
documentation so it is clearer

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2020-02-07 11:48:41 +01:00
Andrew Boie
846034f678 drivers: loapic_timer: simplify TSC read
We have an inline function for this in x86's arch.h
that works for both 64 and 32-bit.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-02-06 23:07:37 -05:00
Kumar Gala
0e42d4838e flash: sam: Limit flash driver to SAME70 SoCs
The SAM flash driver was developed for the SAME70 SoCs and hasn't ever
been validated on the other SAM families (SAM3X, SAM4S).  If we try and
build on one of the other SoC families we get build errors.  So limit it
to just SAME70 for now.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-06 19:18:51 -05:00
Kumar Gala
afc449ec79 flash: sam0: Fix build issue.
Fix stale DT define that causes driver not to build.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-06 19:18:51 -05:00
Jukka Rissanen
6009045902 drivers: modem: Fix gpio compile errors with modem shell
Compile errors because of missing include file and typos
when accessing variables in the modem_pin struct.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-02-06 12:33:20 +02:00
Jukka Rissanen
cb4bf32f2c drivers: modem: gsm: Add support for getting modem info
Add callbacks to get the modem information which can then be
shown by modem shell.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-02-06 10:19:25 +02:00
Steven Slupsky
d93fadc099 drivers: i2c_slave: eeprom: fixes incorrect declaration
This commit fixes an incorrect declaration of the buffer_size member
of the i2c_eeprom_slave_config struct.

Signed-off-by: Steven Slupsky <sslupsky@gmail.com>
2020-02-05 18:46:35 -05:00
Tobias Svehagen
8a9c9d43bf drivers: modem: Add support for different line endings
This makes it possible to handle devices that use different line
endings.

Signed-off-by: Tobias Svehagen <tobias.svehagen@gmail.com>
2020-02-05 23:31:56 +02:00
Henrik Brix Andersen
e5f3279abb adc: common: handle gain of 128 in adc_gain_invert()
Add missing entry for ADC_GAIN_128 in the adc_gain_invert() function.

This fixes 4420c5ed40.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-02-05 14:28:09 -06:00
Erwan Gouriou
609f78b75c drivers/adc: stm32: Don't enable ADC instance by default in driver
ADC_1 peripheral instance was enabled by default in driver.
This is not the usual way to enable peripheral instances, as it
makes board configuration unclear.
Move activation in boards that are declaring ADC support.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-02-05 13:56:26 -06:00
Krzysztof Chruscinski
ce766305b7 drivers: clock_control: Add subsys argument to the callback
Added subsys argument to the callback, updated one driver which
used it and test cases.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-02-05 17:07:01 +01:00
Gerson Fernando Budke
738f76736e drivers: spi: sam: Add sam4e chip select config
Add depends on SOC_SERIES_SAM4E to enable spi driver for sam4e soc.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-02-05 10:14:51 -05:00
Gerson Fernando Budke
e3d35713f6 drivers: gpio: Add sam4e defines
Enable sam4e MCU gpio specifics.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-02-05 08:18:02 -06:00
Peter Bigot
7c95d503b0 gpio: clean up internal API function prototypes
Use gpio_pin_t uniformly when passing pin indexes to the driver.  Use
gpio_flags_t uniformly when passing flags to the driver.  Change name
of pin configuration function in API function table to be consistent
with other API functions.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot
37239dbcbf gpio: rename typedef for devicetree flags
gpio_dt_flags_t is shorter and consistent with DT_ prefix.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot
f017209821 gpio: use reduced-size role typedef for public API pin indexes
There is a typedef used to store pin indexes in configuration
structures.  For consistency it should also be used to identify pin
indexes in function prototypes.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot
c7d526be04 gpio: remove port access op support
The only remaining port operations have dedicated API function table
entries.  Remove the defines for access op (mode), and remove support
for access op from all implementations.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot
1f9beb193f gpio: remove legacy read/write API functions
The last external reference to these was removed when the pin
write/read functions were deprecated.  Remove the syscall support, API
function table entries, and implementation from all drivers.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot
1947481cce gpio: deprecate gpio pin callback enable and disable API
These have been replaced by the appropriate call to
gpio_pin_interrupt_configure().  While the disable function could be
implemented using the new functionality, the enable function cannot
because the interrupt mode is not available.  Consequently we cannot
replace these with equivalent functionality using the legacy API.

Clean up the internal implementation by removing the inaccessible
port-based enable/disable feature, leaving the pin-based capability in
place.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot
4b25e75c8f drivers: sensor: lis3mdl: replace deprecated gpio_pin callback API
gpio_pin_disable_callback is to be replaced by
gpio_pin_interrupt_configure.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot
bcf4d1249e drivers: led: ht16k33: reorder pin interrupt configuration
Replace the enable callback API with the enable interrupt API, and do
it after the callback is installed.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot
f591f3e0bf drivers: bluetooth: hci: replace deprecated gpio_pin callback API
gpio_pin_en/disable_callback are to be replaced by
gpio_pin_interrupt_configure.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot
e63c6cc325 gpio: replace GPIO_INT_LEVEL flag
This will be deprecated, use the generalized mode flag or absence of
GPIO_INT_EDGE.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot
d7c461b0da drivers: gpio_cc13xx_cc26xx: replace GPIO_PUD_PULL macros
GPIO_PUD_PULL_foo is now spelled GPIO_PULL_foo.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot
099614b30a gpio: replace GPIO_DIR flags
GPIO_DIR_OUT is now GPIO_OUTPUT, similarly for GPIO_DIR_IN.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot
2befa6a251 gpio: deprecate legacy gpio pin read/write functions
These have been replaced by get/set functions in both raw and
active-sensitive variants.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot
ddc3f0699f gpio: replace gpio pin write/read with set/get
This API will be deprecated in favor of the new API that clearly
specifies whether it works on logical or physical levels.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Johann Fischer
8f09c42b2c drivers: gd7965: convert to new GPIO API
Convert GD7965 controller driver to new GPIO API.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2020-02-05 12:00:36 +01:00
Tomasz Bursztyka
62b2cae2ae drivers/ieee802154: Adapt cc1200 driver to new GPIO API
Update to use new API for GPIO pin configuration and operation.  Fix
invalid arithmetic on void pointer.  Convert to support devicetree.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Tomasz Bursztyka
3587fe2fe3 drivers/ieee802154: Adapt cc2520 driver to new GPIO API
Update to use new API for GPIO pin configuration and operation.  Fix
invalid arithmetic on void pointer.  Mark all CC2520 GPIOs as required
in binding.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Tomasz Bursztyka
a40e9d3762 drivers/wifi: Switch WINC1500 to new GPIO API
Use new API to configure and interact with GPIOs.  Move GPIO
initialization from sample into driver.  The existing physical/line
level control has been kept rather than converting to logical level
signals.

Also improve error messages.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot
97106bf95e drivers: modem: clean up pin configuration
After startup ublox-sara-r4 code sets the MDM_POWER signal to input
using a deprecated configuration macro.  This was the only use of the
modem context API to configure a pin.

Refactor the API to not take the flags as an input but instead select
between the flags to be used when the pin is active and a disconnected
state.  Use this API instead of a separate direct configure call when
initializing the modem pins.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot
9b0859566d drivers: sensor: bma280: convert to new GPIO API
Use the new pin and interrupt configuration API.

NOTE: Because hardware is not available this has been build-tested
only.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Henrik Brix Andersen
8553f421ca drivers: adc: lmp90xxx: update to use new GPIO API
Update the DRDYB pin interrupt handling code of the TI LMP90xxx ADC
driver to use the new GPIO API.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-02-05 12:00:36 +01:00
Henrik Brix Andersen
82ecb89dae drivers: gpio: lmp90xxx: update to use new GPIO API
Update the TI LMP90xxx GPIO driver to the new GPIO API.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-02-05 12:00:36 +01:00
Piotr Mienkowski
e1c10f6454 drivers: ieee802154_rf2xx: convert to the new GPIO API
Use new GPIO configuration API, set pin active level in devicetree
source.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2020-02-05 12:00:36 +01:00
Peter Bigot
78f8f84517 drivers: lora: update for new GPIO API
Update the lora/sx1276 driver to the new GPIO API, using configured
active level and the replacement interrupt and active-sensitive set
APIs.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot
ce6ffd21dc drivers: eeprom_at2x: update for new GPIO API
Document and assign write-protect signal as active low, and use the
active-sensitive API to control it.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Carles Cufi
132bf05561 drivers: audio: tlv320dac310x: Convert to the new GPIO API
Convert to the new GPIO API using logical access, including setting the
GPIO line as active low in the Device Tree source.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot
a748e577bd drivers: sensor: mpu6050: convert to new GPIO API
Use new configuration API, replace callback enable/disable with
interrupt enable/disable, and set active level in devicetree source.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Johann Fischer
2748a23c61 drivers: ssd16xx: convert to new GPIO API
Convert SSD16XX sensor driver to new GPIO API.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2020-02-05 12:00:36 +01:00
Carles Cufi
8399224271 drivers: modem: wncm14a2a: Convert to the new GPIO API
Conver to the new GPIO API using raw access, since the driver
has its own macros to define signal levels.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Carles Cufi
d7afd55a45 drivers: modem: ublox-sara-r4: Convert to the new GPIO API
Convert to the new API using raw access, since it's a common access
layer shared by multiple (right now only ublox-sara-r4) modems.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Johann Fischer
3eecab88e6 drivers: ieee802154_mcr20a: convert to new GPIO API
Convert MCR20A 802154 controller driver to new GPIO API.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2020-02-05 12:00:36 +01:00
Carles Cufi
594ec75547 drivers: display: mb_display: Convert to the new GPIO API
Convert to the new GPIO API, use raw access since this is a low-level
GPIO-based driver.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot
6ccaef981c drivers: sensor: lsm9ds0_gyro: convert to new GPIO API
Use the new pin and interrupt configuration API.

NOTE: Because hardware is not available this has been build-tested
only.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Johann Fischer
64f5e23b47 drivers: ili9340: convert to new GPIO API
Convert ILI9340 display driver to new GPIO API.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2020-02-05 12:00:36 +01:00
Johann Fischer
c671b75e13 drivers: st7789v: convert to new GPIO API
Convert ST7789V display driver to new GPIO API.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2020-02-05 12:00:36 +01:00
Peter Bigot
2c9425fe77 drivers: sensor: tmp007: convert to new GPIO API
Use the new pin and interrupt configuration API.

NOTE: Because hardware is not available this has been build-tested only.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Johann Fischer
91fad730a6 drivers: enc28j60: convert to new GPIO API
Convert ENC28J60 controller driver to new GPIO API.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2020-02-05 12:00:36 +01:00
Johann Fischer
d3da608535 drivers: enc424j600: convert to new GPIO API
Convert ENC424J600 controller driver to new GPIO API.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2020-02-05 12:00:36 +01:00
Peter Bigot
6980a04e8c drivers: sensor: sx9500: convert to new GPIO API
Use the new pin and interrupt configuration API.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot
f5c8291c56 drivers: sensor: bmc150_magn: convert to new GPIO API
Use the new pin and interrupt configuration API.

NOTE: Because hardware is not available this has been build-tested
only.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot
cb37ed7830 drivers: sensor: bmg160: convert to new GPIO API
Use the new pin and interrupt configuration API.

NOTE: Because hardware is not available this has been build-tested
only.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot
acb43b66da sensors: ccs811: update to new API
Update devicetree sources and bindings, switch to new GPIO API.  Use
devicetree property name to identify interrupt signal.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Johann Fischer
988a681a16 drivers: ssd1306: convert to new GPIO API
Convert SSD1306 sensor driver to new GPIO API.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2020-02-05 12:00:36 +01:00
Peter Bigot
3154627a97 drivers: sensor: lis2dh: convert to new GPIO API
Use the new pin and interrupt configuration API.  Update all
devicetree bindings to add INT signal active level.  Document active
level.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot
50d1bb16e3 sensor: adt7420: update for new GPIO API
Update sample overlays.  Add GPIO flags to configuration state.
Refactor to split out setup/handle/process phases.  Switch to new API
replacing callback dis/enable with interrupt dis/enable.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Yannis Damigos
ee351328a4 usb_dc_stm32: Convert usb disconnect gpio to new gpio api
Convert usb disconnect gpio to new gpio api.
Updates device tree for the olimexino_stm32.

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2020-02-05 12:00:36 +01:00
Erwan Gouriou
9222a4f9a3 drivers/gpio: stm32: Align arguments types on few api functions
Somehow, types used in some api functions where not in line with
api.
Fix this.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-02-05 12:00:36 +01:00
Peter Bigot
32ff5f1d1f drivers: gpio_stm32: add support for pin validation
Add the common config structure as a prefix of the driver-specific
config structure.  This driver uses fixups to define a common name
based on the SOC series; until aliases for the new properties are
added the code assumes all pins are supported.

Since pin ordinal validation is now done directly in gpio API,
remove checks inside the driver itself.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-02-05 12:00:36 +01:00
Peter Bigot
9d6127606a drivers: gpio_stellaris: add support for pin validation
Add the common config structure as a prefix of the driver-specific
config structure and use the devicetree GPIO pin counts to initialize
it.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot
6ef8dbbae2 drivers: gpio_sifive: add support for pin validation
Add the common config structure as a prefix of the driver-specific
config structure and use the devicetree GPIO pin counts to initialize
it.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot
b943f71e19 drivers: gpio_sam0: add support for pin validation
Add the common config structure as a prefix of the driver-specific
config structure and use the devicetree GPIO pin counts to initialize
it.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot
02676d1b3c drivers: gpio_sam: add support for pin validation
Add the common config structure as a prefix of the driver-specific
config structure and use the devicetree GPIO pin counts to initialize
it.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot
afd987fe9f drivers: gpio_rv32m1: add support for pin validation
Add the common config structure as a prefix of the driver-specific
config structure and use the devicetree GPIO pin counts to initialize
it.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot
71873c8a16 drivers: gpio_pca95xx: add support for pin validation
Add the common config structure as a prefix of the driver-specific
config structure and use the devicetree GPIO pin counts to initialize
it.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot
7c175c5197 drivers: gpio_mcux_lpc: add support for pin validation
Add the common config structure as a prefix of the driver-specific
config structure and use the devicetree GPIO pin counts to initialize
it.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot
c446588523 drivers: gpio_mcux_igpio: add support for pin validation
Add the common config structure as a prefix of the driver-specific
config structure and use the devicetree GPIO pin counts to initialize
it.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot
56f975fbb4 drivers: gpio_mcux: add support for pin validation
Add the common config structure as a prefix of the driver-specific
config structure and use the devicetree GPIO pin counts to initialize
it.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot
5eebc35d8b drivers: gpio_mchp_xec: add support for pin validation
Add the common config structure as a prefix of the driver-specific
config structure and use the devicetree GPIO pin counts to initialize
it.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot
8236d8209a drivers: gpio_intel_apl: add support for pin validation
Add the common config structure as a prefix of the driver-specific
config structure and use the hard-coded device-specific pin count to
initialize it.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot
d869a6c766 drivers: gpio_imx: add support for pin validation
Add the common config structure as a prefix of the driver-specific
config structure and use the devicetree GPIO pin counts to initialize
it.  Not all aliases appear to be present, but using instances breaks
because the ports used by different boards do not always start with
the first.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot
84ee7341fe drivers: gpio_ht16k33: add hard-coded support for pin validation
Add the common config structure as a prefix of the driver-specific
config structure.  The devicetree binding does not inherit from
gpio-controller, so the required property is not available there.  A
hard-coded value of 32 pins has been implemented to make the driver
function.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot
a908db8d20 drivers: gpio_gecko: add hard-coded support for pin validation
Add the common config structure as a prefix of the driver-specific
config structure.  This driver uses fixups to define a common name
based on the SOC; until aliases for the new properties are added the
code assumes all pins are supported.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot
10075991cc drivers: gpio_esp32: add support for pin validation
Add a config structure for each port and use the devicetree GPIO pin
count to initialize it.  Simplify device initialization by using
instance number as only variation point.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot
cbe207377e drivers: gpio_dw: add support for pin validation
Add the common config structure as a prefix of the driver-specific
config structure and use the devicetree GPIO pin counts to initialize
it.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot
432b33d3fe drivers: gpio_cmsdk_ahb: add support for pin validation
Replace the common data structure with the common config structure as
a prefix of the driver-specific config structure and use the
devicetree GPIO pin counts to initialize it.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot
13c6cac876 drivers: gpio_cc32xx: add support for pin validation
Add the common config structure as a prefix of the driver-specific
config structure and use the devicetree GPIO pin counts to initialize
it.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot
47eb2fa27a drivers: gpio_cc13xx_cc26xx: add support for pin validation
Add a config structure and use the devicetree GPIO pin count to
initialize it.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot
a8ba5fb1a5 drivers: gpio_sx1509b: add support for pin validation
Add the common config structure as a prefix of the driver-specific
config structure and use the devicetree GPIO pin counts to initialize
it.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot
63141c1a31 drivers: gpio_nrfx: add support for pin validation
Add the common config structure as a prefix of the driver-specific
config structure and use the devicetree GPIO pin counts to initialize
it.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot
9022d33fec drivers: gpio: add support for device-specific pin validation
Extend the driver data structure with a field that identifies the pins
supported by the device.  Document the fields and who is responsible
for maintaining them.

Update all configuration functions for specific pins to return an
error if the pin is not supported.

Update all set/get functions for specific pins to assert if the pin is
not supported.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot
c273b5d885 drivers: sensor: mcp9808: update to new GPIO API
Since this was converted to the setup/handle/process idiom in master
the conversion is straightforward.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Armando Visconti
3fdcbe5a79 driver/sensor: lis2ds12: update to use new GPIO API
Get rid of all the deprecated functions and definitions
replacing them with the new ones.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2020-02-05 12:00:36 +01:00
Peter Bigot
6afbd053e4 drivers: sensor: isl29035: update to new GPIO API
Document alert pin behavior, switch to new API.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Johann Fischer
664a1cf0db drivers: amg88xx: convert to new GPIO API
Convert AMG88XX sensor driver to new GPIO API.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2020-02-05 12:00:36 +01:00
Johann Fischer
afe53230b3 drivers: ti_hdc: convert to new GPIO API
Convert TI HDC sensor driver to new GPIO API.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2020-02-05 12:00:36 +01:00
Kevin Townsend
f800c7266e drivers: hmc5883l: update to new GPIO API
This commit updates the HMC5883L driver to use the new GPIO API.

Also add a note explicitly describing the active state of the DRDY
pin in the binding file.

Tested on frdm_k64f.

Signed-off-by: Kevin Townsend <kevin@ktownsend.com>
2020-02-05 12:00:36 +01:00
Armando Visconti
7fa48d4d6e driver/sensor: lis2mdl: update to use new GPIO API
Get rid of all the deprecated functions and definitions
replacing them with the new ones.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2020-02-05 12:00:36 +01:00
Peter Bigot
4b5393c228 sensor: adxl372: update for new GPIO API
Update sample overlay for missing chip select and to deconflict with
UART TXD.  Add GPIO flags to configuration state.  Replace callback
enable with interrupt enable.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot
de7e3e7693 sensor: adxl362: update for new GPIO API
Add a sample overlay.  Add GPIO flags to configuration state.  Replace
callback enable with interrupt enable.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot
0d1d06ea79 drivers: sensor: hts221: cleanup related to devicetree and trigger idiom
Put all the devicetree configuration data into a config structure in
flash, which removes some ultra-long identifiers from the code and
makes it more readable, and prepares for multiple instance support.

Consistently use the interrupt signal datasheet name for all objects
that are specific to that signal, including configuration structure
tags and function names.

Update the trigger idiom for setup/handle/process stages.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Armando Visconti
a08aec9999 driver/sensor: stts751: update to use new GPIO API
Get rid of all the deprecated functions and definitions
replacing them with the new ones.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2020-02-05 12:00:36 +01:00
Peter Bigot
c44290f75d drivers: sensor: dht: update to new GPIO API
Document IO signal behavior, switch to new API.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Maureen Helm
0f38786889 drivers: sensor: Convert fxas21002 to new gpio api
Converts the fxas21002 sensor driver to the new gpio api. Updates device
trees for all boards with this sensor to active low gpio interrupts by
default.

Tested on the hexiwear_k64 board.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-02-05 12:00:36 +01:00
Armando Visconti
b0ad7bb594 driver/sensor: lis3mdl: update to use new GPIO API
Get rid of all the deprecated functions and definitions
replacing them with the new ones.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2020-02-05 12:00:36 +01:00
Peter Bigot
6dd1f66a3c drivers: sensor: bmi160: convert to new GPIO API
Document interrupt signal and replace legacy calls with new API.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Daniel Leung
07cb01b079 x86: apollo_lake: changes GPIO definition in DTS
This breaks down the GPIO controller definition in DTS into
multiple entries. This allows these controllers to be
referenced by other DTS, and test board overlay files.
And also we can remove the entries in the dts fixup file.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-02-05 12:00:36 +01:00
Daniel Leung
4e05433790 gpio: intel_apl: convert to new GPIO API
Update driver code to use new GPIO configuration flags such as
GPIO_ACTIVE_LOW. Also add implementation of new port_* driver
API as well as gpio_pin_interrupt_configure function.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-02-05 12:00:36 +01:00
Peter Bigot
1cf43985e9 drivers: sensor: lsm6dsl: update to new GPIO API
Correct IRQ active level to default active-high, switch to new
interrupt configuration.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Erwan Gouriou
bfc1a50eb9 drivers: hci: spi: update to new GPIO API
Update bluetooth hcp spi driver to new GPIO API.
Following changes have been done:
- Use new gpio api functions
- Get reset, irq and cs flags from dt defines
- Define reset pin as active low and invert set/unset logic.

Tested on disco_l475_iot1 and 96b_carbon.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-02-05 12:00:36 +01:00
Johann Fischer
2a117748f6 drivers: apds9960: convert to new GPIO API
Convert APDS9960 sensor driver to new GPIO API.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2020-02-05 12:00:36 +01:00
Maureen Helm
cadbc96d66 drivers: sensor: Convert fxos8700 to new gpio api
Converts the fxos8700 sensor driver to the new gpio api. Updates device
trees for all boards with this sensor to active low gpio interrupts by
default.

Tested on frdm_k64f and rv32m1_vega_ri5cy boards. The latter verifies
that the reset output works correctly.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-02-05 12:00:36 +01:00
Armando Visconti
0ae55c7ce9 driver/sensor: iis3dhhc: update to use new GPIO API
Get rid of all the deprecated functions and definitions
replacing them with the new ones.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2020-02-05 12:00:36 +01:00
Armando Visconti
f5dc6580a0 driver/sensor: lsm6dso: update to use new GPIO API
Get rid of all the deprecated functions and definitions
replacing them with the new ones.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2020-02-05 12:00:36 +01:00
Armando Visconti
cde71b4f75 driver/sensor: lps22hh: update to use new GPIO API
Get rid of all the deprecated functions and definitions
replacing them with the new ones.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2020-02-05 12:00:36 +01:00
Armando Visconti
e690fab6b1 driver/sensor: lis2dw12: update to use new GPIO API
Get rid of all the deprecated functions and definitions
replacing them with the new ones.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2020-02-05 12:00:36 +01:00
Peter Bigot
2016cc64aa drivers: gpio: provide typedefs for flags and devicetree properties
The public API for GPIO flags should use unsigned values, and for
MISRA compliance the size should not be platform-dependent.  Add a
typedef for generic flags.

Also add typedefs for pin indexes and devicetree flags so these can
be safely recorded from devicetree property values without risking
loss of information if more flags are added in the future.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Robert Winkler
e8d0eb1db1 drivers: gpio: Add LiteX GPIO driver
This commits adds GPIO driver for LiteX SoC builder.

Due to the fact that GPIO in LiteX is unidirectional and can be
configured with different pins amount per port, additional entries
were added to the dts file.

Signed-off-by: Robert Winkler <rwinkler@internships.antmicro.com>
Signed-off-by: Mateusz Holenko <mholenko@antmicro.com>
Signed-off-by: Piotr Zierhoffer <pzierhoffer@antmicro.com>
2020-02-05 12:00:36 +01:00
Peter Bigot
7821104ee9 drivers: gpio_sx1509b: add support for pin configuration on device init
IO extenders may provide input signals to LEDs or sensors where
leaving the signal undriven may result in increased power consumption
or misbehavior.  The SX1509B powers up with all signals configured as
inputs.  Provide a way to indicate which pins should be set as output,
and their initial signal level, when the device is configured.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot
a49b364244 drivers: sensor: sht3xd: convert to new GPIO APIO
Update ALERT active level in all devicetree files.  Capture GPIO flags
in static configuration.  Add internal API to enable and disable
interrupt, to release the handlers when an alert occurs, and to
re-enable the signal when the handler completes.  Check for alerts
received during periods when the interrupt was disabled.

Extend the example to handle both above and below range triggers and
alerts that are present on startup.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Erwan Gouriou
e2721fee6f drivers/wifi: eswifi: Update to new GPIO API
Update to new GPIO API.
Tested on disco_l475_iot1


Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-02-05 12:00:36 +01:00
Peter Bigot
22be9ddc79 drivers: gpio_sx1509b: fix consistency issue in toggle implementation
The cached state of the output must be managed under mutex, but the
original toggle implementation read the current state outside the
mutex and used it to update the state.  Rework the internal API so
that toggle is done within the mutex, distinct from masked set.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Martí Bolívar
1d2a551c65 drivers: led_strip: modernize and fix up ws2812 drivers/sample
Convert the GPIO based driver to the new GPIO API. (Only the
gpio_configure() call is affected).

Move configuration to DT where appropriate for both SPI and GPIO
drivers, only leaving the SPI vs. GPIO decision in Kconfig (in
addition to the basic enable for the driver.) Move some files around
to clean up as a result of this change.

led_ws2812 sample changes:

- make the pattern easier to look at by emitting less light

- use led_strip alias from DT to get strip device, allocate
  appropriate struct led_rgb buffer, etc.

- move the pins around and remove 96b_carbon support (I have no board
  to test with)

GPIO driver specific changes:

- str is required to write OUTSET/OUTCLR, not strb. The registers
  are word-sized.

- the str[b] registers must all be in r0-r7, so "l" is the correct GCC
  inline assembly constraint for both "base" and "pin"

SPI driver specific changes:

- match the GPIO driver in not supporting the update_channels API
  method, which never made sense for this type of strip

- return -ENOMEM when the user tries to send more pixel data
  than we have buffer space for instead of -EINVAL

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Erwan Gouriou
b0ced41b69 drivers: sensors: vl53l0x: update to new GPIO API
Update to the new GPIO API.
Tested on disco_l475_iot1.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-02-05 12:00:36 +01:00
Erwan Gouriou
361b55d4cb drivers/spi: spi_context.h: Update to new GPIO API
Update to new GPIO API.


Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-02-05 12:00:36 +01:00
Karsten Koenig
4897c95462 drivers: can: mcp2515: Switch to new GPIO API
Mark the INT signal to be active low and use the new functions to get
gpio state and configure the gpio interrupt flanks.

Signed-off-by: Karsten Koenig <karsten.koenig.030@gmail.com>
2020-02-05 12:00:36 +01:00
Daniel Leung
2de126e40d drivers: gpio_pca95xx: factor device declaration into macros
This factors the common bits of device declaration into macros
so it would be easier to add new instances.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-02-05 12:00:36 +01:00
Daniel Leung
e6bbc49a7a gpio: pca95xx: convert kconfig to DTS
This converts configuration of the driver to DTS.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-02-05 12:00:36 +01:00
Daniel Leung
5e678c2e6a drivers: gpio_pca95xx: no longer support config by port
Remove support for GPIO_ACCESS_BY_PORT in the config function
as configuration by port is going away.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-02-05 12:00:36 +01:00
Daniel Leung
b2e1058ca3 drivers: gpio_pca95xx: guard read/write with semaphore
Since the GPIO expander is a I2C device, any read/write to
the registers has high latency. Therefore, semaphore is
introduced to prevent multiple threads to manipulate
the GPIOs at the same time.

Also make sure that we are not doing I2C transactions
within ISRs.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-02-05 12:00:36 +01:00
Daniel Leung
04db241fb7 drivers: gpio_pca95xx: update cache after successful write
Only update the internal register cache after successful write,
or else it would get out of sync with hardware.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-02-05 12:00:36 +01:00
Daniel Leung
1c474e5364 drivers: gpio_pca95xx: endianness awareness
The register pair for each port in the GPIO expander are
port 0 first then port 1. This would not work for big
endian systems with the u16_t port value. So need to
swap the byte ordering on such system.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-02-05 12:00:36 +01:00
Daniel Leung
698f587e3a drivers: gpio_pca95xx: roll header file into source file
The structures defined in the header file are only used by
the driver source file, and should not be used by others.
So roll the header file into the source file so it won't
get #include.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-02-05 12:00:36 +01:00
Daniel Leung
74e6795f6a drivers: gpio_pca95xx: use I2C burst write
Use I2C burst write to write 2 bytes to each pair of registers
instead of 2 separate transactions of writing 1 byte.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-02-05 12:00:36 +01:00
Daniel Leung
eafd0d9d21 drivers: gpio: rename PCAL9535A to PCA95XX
PCA95XX is a series of compatible I2C-based GPIO expanders,
with common registers on input/output, polarity and configuration.
This renames the original PCAL9535A driver to PCA95XX to indicate
that it can support this series. Additional features on variants
are guarded by kconfigs.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-02-05 12:00:36 +01:00
Daniel Leung
dfce0617f4 drivers: gpio_pcal9535a: update to use new GPIO API
Update driver code and board files to use new GPIO configuration flags
such as GPIO_ACTIVE_LOW. Also add implementation of new port_* driver
API as well as gpio_pin_interrupt_configure function.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-02-05 12:00:36 +01:00
Nathaniel Graff
3c986e970d drivers: gpio_sifive: Disable interrupts
The interrupt functionality of this driver is incomplete,
but for the sake of not slowing down the GPIO API refactor,
I'm just returning -ENOTSUP until we can track down the issue.

Signed-off-by: Nathaniel Graff <nathaniel.graff@sifive.com>
2020-02-05 12:00:36 +01:00
Nathaniel Graff
be1cbd4aa7 drivers: gpio_sifive: Update for new GPIO API
Update the Sifive GPIO driver for new API

Signed-off-by: Nathaniel Graff <nathaniel.graff@sifive.com>
2020-02-05 12:00:36 +01:00
Peter Bigot
3f04133e58 drivers: gpio: sx1509b: relax conditions on pin specification
The 1pin test fails to pass because it expects to be able to
manipulate more than 16 pins.  Since the intent is to filter invalid
pins at the wrapper level remove the validation performed within the
driver.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot
2f3c43251f drivers: gpio: utils: filter pin notifications based on callback
Some drivers masked the set of signaled pins based on enabled
interrupts, some did not.  For those that did not the 2-pin test could
fail.  The documentation does not imply that pins unrelated to the
callback participate in the notification process, so do the filtering
in the generic callback loop.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot
4feff71aab drivers: gpio: gecko: fix interrupt clear
In order to reliably detect interrupts the interrupt must be
acknowledged before the callback is invoked.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot
5d30d5cb03 drivers: gpio: sam: fix pull reconfiguration
In the fine print of the manual it's stated that attempts to enable a
pull in one direction while the pull in the other direction is enabled
are ignored.  This has been confirmed.  Change logic to disable both
pulls, then enable the one that's configured, if any.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot
8c8f8bbb48 drivers: gpio: rv32m1: fix interrupt clear
In order to reliably detect interrupts the interrupt must be
acknowledged before the callback is invoked.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot
ff4294a7fe drivers: sensor: hts221: update to new GPIO API
Correct DRDY active level to default active-high, switch to new
interrupt configuration.

Also fix a common bug where an already-active DRDY signal is not
properly handled.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Kumar Gala
ab859fabc1 drivers: stellaris: update to use new GPIO API
Update driver code and board files to use new GPIO configuration flags
such as GPIO_ACTIVE_LOW. Also add implementation of new port_* driver
API as well as gpio_pin_interrupt_configure function.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-05 12:00:36 +01:00
Mohamed ElShahawi
fef3ebaa69 drivers: gpio_esp32: update to use new GPIO API
- Updates gpio driver and device tree files to the new GPIO Config flags
- Implements the new port_* APIs
- Update I2C and PWM Drivers to use new GPIO config
- Add esp32.overlay to gpio_basic_api test
- refactor convert_int_type, regs struct
- remove config_polarity
- add kConfig notes

Tests:
- samples/basic/blinky
- samples/basic/button
- tests/drivers/gpio/gpio_basic_api
- tests/drivers/gpio/gpio_api_1pin

Board:
- esp32 DevKitC V4

Note about interrupts:
The ESP32 requires specifying a CPU interrupt to be used for GPIO
interrupt signals.  CPU interrupts can be either level or edge (or
special) triggered, but not both.
Please check gpio/Kconfig.esp32 for more info.

Signed-off-by: Mohamed ElShahawi <ExtremeGTX@hotmail.com>
2020-02-05 12:00:36 +01:00
Kumar Gala
8f4da10356 drivers: mmio32: update to use new GPIO API
As the mmio32 is more of a library than a proper driver, just implement
the new port functions and have pin_interrupt_configure marked pretty
much as not supported.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-05 12:00:36 +01:00
Maureen Helm
03c3b4bed5 gpio: Update rv32m1 gpio driver to use new gpio api
Updates the rv32m1 gpio driver and all associated boards to use new
device tree compatible gpio configuration flags. Implements new port
get/set/clear/toggle and pin_interrupt_configure functions recently
added to the gpio api.

Assumes the gpio api layer handles translating logical flags to physical
flags.

Stops quietly reconfiguring pinmuxes to gpio mode. The pinmux must now
be configured explicitly in the board's pinmux.c or in the application.

Tested with:
- samples/basic/blinky
- samples/basic/button
- tests/drivers/gpio/gpio_api_1pin

On boards:
- rv32m1_vega_ri5cy

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-02-05 12:00:36 +01:00
Piotr Mienkowski
73fcc07281 drivers: gpio_mcux: clean up interrupt code
Remove redundant interrupt code from gpio_mcux_configure, move the rest
to gpio_mcux_pin_interrupt_configure.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2020-02-05 12:00:36 +01:00
Peter Bigot
746f7e37e7 drivers: gpio_sam0: update to new GPIO API
Drop the port access, rework to separate interrupt and pin
configuration, add new API.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Kumar Gala
9aa1dc11ce drivers: gpio_cmsdk_ahb: update to use new GPIO API
Update driver code and board files to use new GPIO configuration flags
such as GPIO_ACTIVE_LOW. Also add implementation of new port_* driver
API as well as gpio_pin_interrupt_configure function.

We treat GPIO_INT_MODE_LEVEL as not supported as the hardware doesn't
seem to handle level interrupts as one would expect.  Looking into this
further to determine if its a HW bug or some misconfiguration in the
software.

We don't support dynamic setting of PULL_UP/PULL_DOWN config as this is
handled by pinctrl for the current boards we support the CMSDK AHB
driver on.

Tested on musca-a board.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-05 12:00:36 +01:00
Andrei Gansari
9b0931e54a drivers: gpio_mcux_lpc GPIO interrupts
LPC GPIO architecture uses multiple devices.
GPIO input is routed via INPUTMUX to the PINT
device which roots the interrupt to NVIC.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2020-02-05 12:00:36 +01:00
Andrei Gansari
abfc81541a gpio: Update mcux lpc driver to use new gpio api
Updates the mcux lpc driver and all associated boards to use new
device tree compatible gpio configuration flags. Implements new port
get/set/clear/toggle functions recently added to the gpio api.
ISR functions to be added later.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2020-02-05 12:00:36 +01:00
Erwan Gouriou
78d7b2106a drivers/interrup_controller: stm32: stm32_exti_enable could be void
stm32_exti_enable was returning errors on line > 32 or line pointing
to non implemented line. Both conditions are hard-coded, hence there
is no use to detect them dynamically in the code.
Check them with assert. As a consequence, function could now be void.

Additionally, enable exti irq line only if both checks are passed.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-02-05 12:00:36 +01:00
Erwan Gouriou
29e9780ad1 drivers/interrupt_controller: stm32: Clean set api from unused arg
Argument 'port' in stm32_exti_set_callback function is not
used, remove it.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-02-05 12:00:36 +01:00
Erwan Gouriou
e88cdffcd6 drivers/gpio: stm32: exti: Clear triggers when not requested
Since it is now possible to disable/re-enable interrupts and
also to reconfigure an already configured interrupt, it is
now required to clear non requested triggers.
While it is not strictly requested, triggers are also cleared
when interrupt is disabled (assuming trigger should be configured
when interrupt is enabled).

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>

fixup exti
2020-02-05 12:00:36 +01:00
Erwan Gouriou
eecc384b22 drivers/gpio: stm32: various clean up
Perform few clean up in stm32 gpio driver:
*Clean up uint32_t occurrences left over.
*Move function gpio_stm32_flags_to_conf from const to static
and remove useless parameter check
*Rework error handling in functoin gpio_stm32_config
*Remove gpio_stm32_int_enabled_port function and have direct call
to gpio_stm32_get_exti_source

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-02-05 12:00:36 +01:00
Erwan Gouriou
a6801f7ff4 drivers/gpio: stm32: Update to new GPIO api
Update STM32 GPIO driver to support new GPIO API.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-02-05 12:00:36 +01:00
Stanislav Poboril
6422e1a36b gpio: Update imx gpio driver to use new gpio api
Updates the imx gpio driver and all associated boards to use new
device tree compatible gpio configuration flags. Implements new port
get/set/clear/toggle and pin_interrupt_configure functions recently
added to the gpio api.

Assumes the gpio api layer handles translating logical flags to physical
flags.

Tested with:
- samples/basic/blinky
- samples/basic/button
- tests/drivers/gpio/gpio_api_1pin
- tests/drivers/gpio/gpio_basic_api

On boards:
- udoo_neo_full_m4

Signed-off-by: Stanislav Poboril <stanislav.poboril@nxp.com>
2020-02-05 12:00:36 +01:00
Maureen Helm
5f09966380 gpio: Update mcux igpio driver to use new gpio api
Updates the mcux igpio driver and all associated boards to use new
device tree compatible gpio configuration flags. Implements new port
get/set/clear/toggle and pin_interrupt_configure functions recently
added to the gpio api.

Assumes the gpio api layer handles translating logical flags to physical
flags.

Removes port configuration support since that feature is deprecated in
the new gpio api.

Tested with:
- samples/basic/blinky
- samples/basic/button
- tests/drivers/gpio/gpio_api_1pin

On boards:
- mimxrt1015_evk
- mimxrt1020_evk
- mimxrt1050_evk
- mimxrt1060_evk
- mimxrt1064_evk

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-02-05 12:00:36 +01:00
Henrik Brix Andersen
ba18a7d6d0 drivers: led: ht16k33: update to use new GPIO API
Update the IRQ GPIO handling code of the HT16K33 LED driver to use the
new GPIO API.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-02-05 12:00:36 +01:00
Henrik Brix Andersen
c7382c80a0 drivers: gpio_ht16k33: update to use new GPIO API
Implement the new GPIO driver APIs for the HT16K33 and update the
driver to use the new GPIO flags.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-02-05 12:00:36 +01:00
Vincent Wan
5edb7288ad drivers: gpio: cc32xx: add assertions to check number of pins
On the TI CC32xx, the GPIO peripheral supports only 8 pins per port.
We should add assertions where appropriate to verify this.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2020-02-05 12:00:36 +01:00
Vincent Wan
4fce4749a2 gpio: Update cc13x2/cc26x2 gpio driver to use new gpio api
Updates the cc13x2/cc26x2 gpio driver and all associated boards to use
new device tree compatible gpio configuration flags. Implements new port
get/set/clear/toggle and pin_interrupt_configure functions recently
added to the gpio api.

Tested with:

samples/basic/blinky
samples/basic/button
tests/drivers/gpio/gpio_api_1pin
tests/drivers/gpio/gpio_basic_api

On board:

cc1352r1_launchxl

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2020-02-05 12:00:36 +01:00
Vincent Wan
d5850ac686 gpio: Update cc32xx gpio driver to use new gpio api
Updates the cc32xx gpio driver and all associated boards to use new
device tree compatible gpio configuration flags. Implements new port
get/set/clear/toggle and pin_interrupt_configure functions recently
added to the gpio api.

Tested with:

samples/basic/blinky
samples/basic/button
tests/drivers/gpio/gpio_api_1pin
tests/drivers/gpio/gpio_basic_api

On boards:

cc3220sf_launchxl
cc3235sf_launchxl

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2020-02-05 12:00:36 +01:00
Peter Bigot
dfa7ef2c4d drivers: gpio_sx1509b: update to use new GPIO API
Update driver code and board files to use new GPIO configuration flags
such as GPIO_ACTIVE_LOW. Also add implementation of new port_* driver
API.

Tested on external SX1509B breakout board and Thingy:52.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Daniel Leung
f8f1a91cf7 drivers: gpio_dw: update to use new GPIO API
Update driver code and board files to use new GPIO configuration flags
such as GPIO_ACTIVE_LOW. Also add implementation of new port_* driver
API as well as gpio_pin_interrupt_configure function.

The interrupt triggering on both edges is a remnant from the old
Quark SE which has a customized DesignWare GPIO block. So remove
the support for both edges as the board is no longer supported.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-02-05 12:00:36 +01:00
Peter Bigot
79c04b4ea6 drivers: gpio_mcux: fix handling of unsupported configurations
The MCUX GPIO peripheral must be configured as either input or output.
Reject attempts to configure disconnected or bidirectional.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Daniel Leung
4307a86243 drivers: gpio_mchp_xec: update to use new GPIO API
Update driver code and board files to use new GPIO configuration flags
such as GPIO_ACTIVE_LOW. Also add implementation of new port_* driver
API as well as gpio_pin_interrupt_configure function.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-02-05 12:00:36 +01:00
Kumar Gala
9736d8dee2 drivers: gpio_sx1509b: Add gpio_driver_data to driver data
Add gpio_driver_data as the first element in the driver data as the gpio
core expects this.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-05 12:00:36 +01:00
Kumar Gala
01d74c6393 drivers: gpio_stm32: Add gpio_driver_data to driver data
Add gpio_driver_data as the first element in the driver data as the gpio
core expects this.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-05 12:00:36 +01:00
Kumar Gala
049dd625db drivers: gpio_stellaris: Add gpio_driver_data to driver data
Add gpio_driver_data as the first element in the driver data as the gpio
core expects this.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-05 12:00:36 +01:00
Kumar Gala
d33ba46751 drivers: gpio_sifive: Add gpio_driver_data to driver data
Add gpio_driver_data as the first element in the driver data as the gpio
core expects this.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-05 12:00:36 +01:00
Kumar Gala
dce2251043 drivers: gpio_sam0: Add gpio_driver_data to driver data
Add gpio_driver_data as the first element in the driver data as the gpio
core expects this.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-05 12:00:36 +01:00
Kumar Gala
88c23b9f9d drivers: gpio_rv32m1: Add gpio_driver_data to driver data
Add gpio_driver_data as the first element in the driver data as the gpio
core expects this.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-05 12:00:36 +01:00
Kumar Gala
d408fa0411 drivers: gpio_pcal9535a: Add gpio_driver_data to driver data
Add gpio_driver_data as the first element in the driver data as the gpio
core expects this.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-05 12:00:36 +01:00
Kumar Gala
cc4723ca5d drivers: gpio_mcux_lpc: Add gpio_driver_data to driver data
Add gpio_driver_data as the first element in the driver data as the gpio
core expects this.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-05 12:00:36 +01:00
Kumar Gala
d91cb6ec7c drivers: gpio_mchp_xec: Add gpio_driver_data to driver data
Add gpio_driver_data as the first element in the driver data as the gpio
core expects this.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-05 12:00:36 +01:00
Kumar Gala
af66e1dccd drivers: gpio_intel_apl: Add gpio_driver_data to driver data
Add gpio_driver_data as the first element in the driver data as the gpio
core expects this.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-05 12:00:36 +01:00
Kumar Gala
dfbb8fa5f1 drivers: gpio_imx: Add gpio_driver_data to driver data
Add gpio_driver_data as the first element in the driver data as the gpio
core expects this.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-05 12:00:36 +01:00
Kumar Gala
bd06f0835a drivers: gpio_ht16k33: Add gpio_driver_data to driver data
Add gpio_driver_data as the first element in the driver data as the gpio
core expects this.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-05 12:00:36 +01:00
Kumar Gala
22042ad75c drivers: gpio_esp32: Add gpio_driver_data to driver data
Add gpio_driver_data as the first element in the driver data as the gpio
core expects this.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-05 12:00:36 +01:00
Kumar Gala
bcdc057503 drivers: gpio_dw: Add gpio_driver_data to driver data
Add gpio_driver_data as the first element in the driver data as the gpio
core expects this.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-05 12:00:36 +01:00
Kumar Gala
5a34407daa drivers: gpio_cmsdk_ahb: Add gpio_driver_data to driver data
Add gpio_driver_data as the first element in the driver data as the gpio
core expects this.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-05 12:00:36 +01:00
Kumar Gala
be17245419 drivers: gpio_cc32xx: Add gpio_driver_data to driver data
Add gpio_driver_data as the first element in the driver data as the gpio
core expects this.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-05 12:00:36 +01:00
Kumar Gala
f30e4efd7a drivers: gpio_cc13xx_cc26xx: Add gpio_driver_data to driver data
Add gpio_driver_data as the first element in the driver data as the gpio
core expects this.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-05 12:00:36 +01:00
Kumar Gala
3231b22767 drivers: gpio_nrfx: Update for handling local layer in core
Remove handling for GPIO_INT_LEVELS_LOGICAL in driver now that we do
that in gpio_pin_interrupt_configure and gpio_pin_configure.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-05 12:00:36 +01:00
Kumar Gala
7e6d9ffb31 drivers: gpio_sam: Update for handling local layer in core
Remove handling for GPIO_INT_LEVELS_LOGICAL in driver now that we do
that in gpio_pin_interrupt_configure and gpio_pin_configure.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-05 12:00:36 +01:00
Kumar Gala
31139f834a drivers: gpio_gecko: Update for handling local layer in core
Remove handling for GPIO_INT_LEVELS_LOGICAL in driver now that we do
that in gpio_pin_interrupt_configure and gpio_pin_configure.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-05 12:00:36 +01:00
Kumar Gala
bd8141832e drivers: gpio_mcux: Update for handling local layer in core
Remove handling for GPIO_INT_LEVELS_LOGICAL in driver now that we do
that in gpio_pin_interrupt_configure and gpio_pin_configure.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-05 12:00:36 +01:00
Kumar Gala
7989f5cd6b drivers: gpio_mcux: Fix interrupt handling
Change when we clear interrupt status to happen before we handle the
callbacks.  As the callbacks might manipluate the GPIO state and cause
a GPIO interrupt.  If we clear interrupt status after than we might
miss an interrupt.

Also only clear interrupts for interrupts that are we have enabled and
that were reported when we read from the interrupt status.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-05 12:00:36 +01:00
Piotr Mienkowski
30a97ce28e drivers: gpio_mcux: update to use new GPIO API
Update driver code and board files to use new GPIO configuration flags
such as GPIO_ACTIVE_LOW. Also add implementation of new port_* driver
API as well as gpio_pin_interrupt_configure function.

Tested on frdm_k64f board.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2020-02-05 12:00:36 +01:00
Piotr Mienkowski
ff90b2c1d6 drivers: gpio_nrfx: update to use new GPIO API
Update driver code and board files to use new GPIO configuration flags
such as GPIO_ACTIVE_LOW. Also add implementation of new port_* driver
API as well as gpio_pin_interrupt_configure function.

Tested on nrf52840_pca10056 board.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Piotr Mienkowski
39effb4397 drivers: gpio_sam: update to use new GPIO API
Update driver code and board files to use new GPIO configuration flags
such as GPIO_ACTIVE_LOW. Also add implementation of new port_* driver
API as well as gpio_pin_interrupt_configure function.

Tested on sam_e70_xplained board.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2020-02-05 12:00:36 +01:00
Piotr Mienkowski
1fdc3bed14 drivers: gpio_gecko: update to use new GPIO API
Update driver code and board files to use new GPIO configuration flags
such as GPIO_ACTIVE_LOW. Also add implementation of new port_* driver
API as well as gpio_pin_interrupt_configure function.

Tested on efr32_slwstk6061a board.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2020-02-05 12:00:36 +01:00
Peter Bigot
48b674b570 gpio: use named types to distinguish pin sets from pin values
Both pin sets and values encoding pin values are ultimately represented
by 32-bit unsigned integers. Provide typedefs that make the role of a
parameter explicit.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2020-02-05 12:00:36 +01:00
Piotr Mienkowski
33193a57eb gpio: add gpio_pin_interrupt_configure function
This commit moves interrupt configuration for a single pin from
gpio_pin_configure to gpio_pin_interrupt_configure function.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2020-02-05 12:00:36 +01:00
Piotr Mienkowski
d6191b5781 gpio: add new functions to set/get pin/port values
This commit adds following functions which work with pin logical levels
(take into account GPIO_ACTIVE_LOW flag):
- gpio_port_get, gpio_port_set_masked, gpio_port_set_bits,
  gpio_port_clear_bits, gpio_port_set_clr_bits
- gpio_pin_get, gpio_pin_set
Functions which work with pin physical levels:
- gpio_port_get_raw, gpio_port_set_masked_raw, gpio_port_set_bits_raw,
  gpio_port_clear_bits_raw, gpio_port_set_clr_bits_raw
- gpio_pin_get_raw, gpio_pin_set_raw
As well as functions:
- gpio_port_toggle_bits, gpio_pin_toggle_bits

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2020-02-05 12:00:36 +01:00
Jukka Rissanen
1474b4ea14 drivers: modem: gsm: Use modem log level instead of ppp
Use the same log level as the other modems.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-02-05 10:19:15 +02:00
Kumar Gala
6d1a32a60d drivers: dma: stm32: Fix compiler warning
When building the i2s tests on 96b_argonkey we get the following
warnings:

drivers/dma/dma_stm32.c: In function 'dma_stm32_configure':
drivers/dma/dma_stm32.c:181:2: error: 'periph_addr_adj' may be used
  uninitialized in this function [-Werror=maybe-uninitialized]
  181 |  switch (increment) {
      |  ^~~~~~
drivers/dma/dma_stm32.c:161:2: error: 'memory_addr_adj' may be used
   uninitialized in this function [-Werror=maybe-uninitialized]
  161 |  switch (increment) {
      |  ^~~~~~

Fix by initialzing periph_addr_adj and memory_addr_adj to 0.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-04 15:49:48 -06:00
Carles Cufi
1a37baf24a drivers: ieee802154: rf2xx: Enable sub-GHz L2 conditionally
Enable the sub-GHz L2 only if the main L2 is enabled too.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-02-04 15:49:35 -06:00
Gerson Fernando Budke
b1b60ac1d8 drivers: spi: sam: Add support to samv71 soc
Add depends on SOC_SERIES_SAMV71 to enable spi driver for samv71 soc.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-02-04 14:55:45 -05:00
Gerson Fernando Budke
7422cff736 drivers: spi: sam: Enable generic config
The current sam spi driver uses soc dependent name which duplicate
configuration to enable other platforms. This refactor current
definitions to a generic way to reuse symbols by multi soc definitions.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-02-04 14:55:45 -05:00
Gerson Fernando Budke
17ccd9ee1b drivers: usb: sam: Add support to samv71 soc
Add depends on SOC_SERIES_SAMV71 to enable usb driver for samv71 soc.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-02-04 14:02:59 -05:00
Ismael Fillonneau
84a0b32210 drivers: spi: nrfx: factorise spi_context_lock()
spi_context_lock() & spi_context_release() are called in transceive()
function for a better readability.

Signed-off-by: Ismael Fillonneau <ismael.fillonneau@stimio.fr>
2020-02-04 20:58:05 +02:00
Gerson Fernando Budke
4a1bb71694 drivers: gpio: Add samv71 defines
Enable samv71 MCU gpio specifics.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-02-04 13:56:42 -05:00
Jim Shu
baa72d8c32 riscv_machine_timer: optimize MTIME/MTIMECMP registers access in riscv64
riscv64 CPUs can access full 64-bit memory-mapped register by a single
instruction, so we can directly access these registers.

Signed-off-by: Jim Shu <cwshu@andestech.com>
2020-02-04 17:42:48 +02:00
Oane Kingma
dc5c242223 drivers/watchdog: Add support for SiLabs Gecko Watchdog
Watchdog type is found on e.g. Pearl/Jade Gecko, often
more than 1 is present.

Driver supports timeout and (minimum) window configuration
and reset or timeout interrupt support for now.

Signed-off-by: Oane Kingma <o.kingma@interay.com>
2020-02-03 11:25:40 -08:00
Peter A. Bigot
4420c5ed40 adc: provide API to help with conversions
Gain values are specified with enumeration values that can't be used
to reverse the effects of scaling the input signal.  Provide a
function that reverses the effect of the gain by scaling a measured
value.

Also provide a function that converts a raw measurement captured with
a reference voltage and specific gain and resolution to the
corresponding voltage in millivolts.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-02-03 16:26:51 +01:00
Maureen Helm
6382f06aa0 drivers: kscan: Introduce ft5336 touch panel driver
Introduces a new ft5336 touch panel driver for the keyboard scan (kscan)
interface. The driver currently uses a timer to periodically poll touch
data in the system work queue, but later it can be enhanced to use a
gpio interrupt instead of a timer.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-02-01 08:50:16 -05:00
Carlo Caione
6f36300219 drivers: timer: Add per-core ARM architected timer
ARM cores may have a per-core architected timer, which provides per-cpu
timers, attached to a GIC to deliver its per-processor interrupts via
PPIs. This is the most common case supported by QEMU in the virt
platform.

This patch introduces support for this timer abstracting the way the
timer registers are actually accessed. This is needed because different
architectures (for example ARMv7-R vs ARMv8-A) use different registers
and even the same architecture (ARMv8-A) can actually use different
timers (ELx physical timers vs ELx virtual timers).

So we introduce the common driver here but the actual SoC / architecture
/ board must provide the three helpers (arm_arch_timer_set_compare(),
arm_arch_timer_toggle(), arm_arch_timer_count()) using an header file
imported through the arch/cpu.h header file.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2020-02-01 08:08:43 -05:00
Anas Nashif
aa14022c8a intel_s1000: various fixes for build errors
Lot of misdefined variables that went in undetected due to lack of CI on
this board. Fix them and test build with new SDK.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-01-31 14:51:37 -05:00
Anas Nashif
0358d707b0 usb: dw: fix undefined callback variable
Add missing declaration of variables for callbacks.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-01-31 14:51:37 -05:00
Johann Fischer
c68ac431cc drivers: display: add support for GD7965 display controller
Add support for GD7965 display controller.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2020-01-31 11:37:35 -05:00
Robert Lubos
aa17850455 drivers: wifi: eswifi: Rework offloading mechanism
Switch to `NET_SOCKET_REGISTER` mechanism over the offloaded API
registration.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-01-31 11:36:02 -05:00
Robert Lubos
e434725bdf drivers: modem: ublox-sara-r4: Rework offloading mechanism
Switch to `NET_SOCKET_REGISTER` mechanism over the offloaded API
registration.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-01-31 11:36:02 -05:00
Robert Lubos
ece552c644 drivers: wifi: simplelink: Rework offloading mechanism
Switch to `NET_SOCKET_REGISTER` mechanism over the offloaded API
registration.

Including the following fixes from the review:

* The fd returned by the socket accept call needs to be finalized,
  similar to how it is done for socket creation.

* sl_RecvFrom() in TI SimpleLink Host driver does not support NULL
  pointers for 'from' address and address length, and sl_SendTo() does
  not ignore the destination address when in connection mode, so passing
  NULL would cause a failure. These issues have been reported to TI
  (CC3X20SDK-1970, CC3X20SDK-1971).

  Let's use sl_Recv and sl_Send to implement recvfrom/sendto in the case
  of NULL addresses.

* simplelink_poll() should not process negative file descriptors in the
  fds array after sl_Selecti() returns. A negative fd value indicates
  that the entry is invalid and should be ignored.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-01-31 11:36:02 -05:00
Ivo Clarysse
fe9025aafb drivers: can: stm32: Support CAN_2 interface
Add support for the CAN_2 interface.

Simultaneous use of CAN_1 and CAN_2 is not supported yet.

Signed-off-by: Ivo Clarysse <ivo@bcdevices.com>
2020-01-30 14:27:28 -05:00
Ivo Clarysse
29d2a438ab drivers: pinmux: stm32f4: add CAN_2 pins
Add pinmux definitions for CAN_2 RX/TX pins on PB5/PB6 and PB12/PB13.

Signed-off-by: Ivo Clarysse <ivo@bcdevices.com>
2020-01-30 14:27:28 -05:00
Peter van der Perk
11ef49b65c drivers: can: Add SocketCAN support to mcux flexcan driver
Used the SocketCAN initalization code from the can_stm32.c driver which
successfully initializes SocketCAN for the Flexcan driver

Signed-off-by: Peter van der Perk <peter.vanderperk@nxp.com>
2020-01-30 16:03:34 +02:00
Jukka Rissanen
92481765a2 drivers: ethernet: Set the context iface ptr to main interface
If the Ethernet driver has VLAN enabled (only native_posix, mcux
or gmac has VLAN supported), then the iface pointer in ethernet
context should contain the main network interface. This is needed
so that the interface will get link address set to it properly.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-01-30 09:42:07 +02:00
Erwan Gouriou
dbd054fbd3 drivers/flash: stm32: Fix faulty register access
Merge of conflicting PRs lead to compilation issue.
Fix this.

Fixes #22297

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-01-29 15:14:22 -06:00
Mieszko Mierunski
971c27af0d drivers: sam: UART async API change timeout to signed value.
Change timeout to signed value.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2020-01-29 19:37:31 +01:00
Mieszko Mierunski
20444869e3 drivers: nrf: Fix forever timeout handling in UART async API.
Current implementation directly passes timeout value to workqueue/timer
which results in assertion or instant timeout in case when K_FOREVER is
passed. This fix ensures that no timer or workqueue is called with
K_FOREVER.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2020-01-29 19:37:31 +01:00
Mieszko Mierunski
dc3c906d12 drivers: uart: Switch timeout values to s32_t in UART async API
Use signed values for timeout in UART asynchronous API, to be consistent
with timeout type in timer and workqueue values.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2020-01-29 19:37:31 +01:00
Krzysztof Chruscinski
dcdc61cfdb drivers: serial: nrf_uarte: Allow TX only instance
Extended nrf_uarte driver to support TX only UARTE instances.
When RX pin is not provided then RX is not started at all. This
allows to achieve low power with logging/console enabled.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-01-29 12:03:05 -06:00
Krzysztof Chruscinski
510102dd71 soc: arm: nordic_nrf: nrf52: Add workaround for anomaly 132
Added delay before starting low frequency clock for the first time to
ensure that anomaly conditions are not met. Delay is configurable and
might be disabled.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-01-29 15:38:55 +01:00
Kamil Lazowski
5b4f4253c1 drivers: flash: add Nordic JEDEC QSPI NOR flash driver
Most JEDEC NOR flash devices uses not only typical SPI mode
(MISO,MOSI,SCK and CS), but also QSPI mode (IO0,IO1,IO2,IO3,SCK and CS).
QSPI mode uses more data lines and as a result provide higher
throughput. If this were not enough, Nordic chips provide
hardware acceleration for read/write/erase functions, what
gives significant performance boost.
It does a lot of things "behind the scene", i.e when user has written
some data to the flash and would like to read them back, it has to wait
until the flash is ready by reading WIP bit in Status Register.
This driver does it automatically.

Signed-off-by: Kamil Lazowski <Kamil.Lazowski@nordicsemi.no>
2020-01-29 15:15:49 +01:00
Andrzej Głąbek
7899b1f5b6 modules: hal_nordic: Update nrfx to version 2.1.0
Update the hal_nordic module revision, to switch to nrfx 2.1.0.

Because the list of peripherals for nRF5340 has changed as follows:
- SPIM2 has been renamed to SPIM4
- SPIM2-3, SPIS2-3, TWIM2-3, TWIS2-3, and UARTE2-3 have been added
a couple of related corrections needed to be applied in dts and Kconfig
files, plus the spi_nrfx_spim driver has been extended with the support
for SPIM4.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2020-01-29 15:00:45 +01:00
Henrik Brix Andersen
0b15a836a5 drivers: pinmux: stm32f3: add CAN_1 pins
Add pinmux definitions for CAN_1 RX/TX pins on PD0/PD1.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-01-29 09:47:27 +01:00
Gerson Fernando Budke
268f65d221 drivers: ieee802154: rf2xx: Add missing handle_ack call
The rf2xx driver is doing automatic retransmissions in hardware based
on whether ACKs are received or not. Currently the driver is not
invoking ieee802154_radio_handle_ack() as other drivers are doing and
required by OpenThread since 4fe1da9. This add rf2xx_handle_ack method
to ensures required ACK processing when driver performs TX.

Fixes: #21763

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-01-29 09:01:53 +02:00
Tomasz Bursztyka
b8e14b5b9d drivers/usb: Switching to DTS based configuration for DW driver
And applying the changes to intel_s1000_crb board as well.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-01-28 18:18:18 -05:00
Tomasz Bursztyka
2161c91f0b drivers/usb: Fixing style issues in DW driver
Lots of style mess in this driver:
- 80 chars limit not followed
- variable allocation and if condition on it should be coalesced
- etc...

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-01-28 18:18:18 -05:00
Tomasz Bursztyka
8d10e66371 drivers/interrupt-controller: Make irqs DT configured in DW
DesignWare driver can manage different amount of irqs so let's make it
configurable via DTS.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-01-28 18:18:18 -05:00
Tomasz Bursztyka
251141567f drivers/interrupt_controller: No need for runtime base address in DW
Base address does not change at runtime, thus storing it directly into
device's config.

Also keeping it consistent in naming: s/port/dev

And no need to store irq_num as it is unused.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-01-28 18:18:18 -05:00
Tomasz Bursztyka
4b94668f5b drivers/interrupt_controller: Normalize DT aliases consitently for DW
DT_<domain>_DW_<num>_<option> as for SPI, GPIO, DMA etc...

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-01-28 18:18:18 -05:00
Tomasz Bursztyka
82ecefc11c drivers/gpio: Fix indentation in DW driver
Commit ID c490219d1e introduced wrong indentation there.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-01-28 18:18:18 -05:00
Tomasz Bursztyka
f5a9d5d1a5 driver/spi: Make DT aliases consistent for the DW drivers
And apply it on all existing fixups.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-01-28 18:18:18 -05:00
Tomasz Bursztyka
ab72e3478f drivers/dma: Add support for 3 instances instead of only one.
If more is needed, it will be added.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-01-28 18:18:18 -05:00
Tomasz Bursztyka
dff4857349 drivers/dma: Make initialization function generic in DW driver
There will be more instance of that driver, and the initialization
function will the same all the time. That was done wrong as it was not
following the device driver rules.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-01-28 18:18:18 -05:00
Tomasz Bursztyka
defa1bce5f drivers/dma: Use DTS generated option when configuring DW driver
This driver is going to be used by other SoCs and as such should be
easily configurable through DTS.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-01-28 18:18:18 -05:00
Tomasz Bursztyka
414f8b037d driver/dma: No need to store IRQ number in DW driver
irq_enable() can be directly called from relevant irq config function
and thus voids the necessity to store the IRQ number, saving some
memory.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-01-28 18:18:18 -05:00
Tomasz Bursztyka
e33432fd44 drivers/dma: Rename CAVS driver to DesignWare
There is no such thing as CAVS DMA IP block, the DMA IP block found on
CAVS based chips is made with DesignWare one.

This will help to centralize DW based DMA device into one driver.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-01-28 18:18:18 -05:00
Kwon Tae-young
c86d7ff320 drivers: lora: sx1276: Added support for RSSI and SNR in recv
The sx1276_rx_done() function supports RSSI and SNR.
Change to support RSSI and SNR through sx1276_lora_recv() function.

Signed-off-by: Kwon Tae-young <tykwon@m2i.co.kr>
2020-01-28 17:28:26 -05:00
Gerson Fernando Budke
dbc1e717aa drivers: ieee802154: rf2xx: Fix missing auto ACKs
The RF2XX driver not always sent ACK when a RX frame requests. This
happen because RF2XX transceiver asserts TRX_END interrupt after
confirm that the FCS is valid. The driver can now decode the frame
but in parallel the radio still processing the ACK frame. This will
sync the radio FSM state to ensure that ACK will be send.

Fixes #21659

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-01-28 17:27:10 -05:00
Sarvesh Patkar
4f2c107389 drivers: flash: stm32: Update flash driver implementation
Remove soc/arm/st_stm32/stm32YY/flash_registers.h files.
Change register accesses in stm32 flash drivers to use FLASH_TypeDef
from modules/hal/stm32/stm32cube/stm32YYxx/soc/stm32xxxxxx.h.

Fixes #16235

Signed-off-by: Sarvesh Patkar <psarvesh314@gmail.com>
2020-01-28 15:30:12 -06:00
Flavio Ceolin
d507574864 console: uart: Ifdef an include
usb-device.h must be included only if CONFIG_USB_UART_CONSOLE is
defined, otherwise it is not used and will pull a lot of usb code.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2020-01-28 14:02:54 -05:00
Francois Ramu
25700ace0a soc: arm: stm32: define the heap size when enabling dma feature
when DMA IP is enabled on stm32 series,
the heap size must be configured to large value
because of dma channels configuration.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-01-28 12:58:44 -06:00
Francois Ramu
3553d4fa69 driver: dma: split header file differently
This patches just changes the header file organisation

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-01-28 12:58:44 -06:00
Francois Ramu
53dec09037 driver: dma: update for different dma channels
This patches defines constants from dma registers
depending on the dma configuration of the stm32 soc
Some devices have 6 or 7 or 8 dma channels per dma instance

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-01-28 12:58:44 -06:00
Francois Ramu
a569303f70 drivers: dma: wrong return type of dma_stm32_width_config function
The dma_stm32_width_config must return a int type
as -EINVAL is a possible return value

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-01-28 12:58:44 -06:00
Francois Ramu
82799d2ae4 dts: bindings: dma controller supports mem2mem transfer
This checks if the DMA controller supports or not
the memory-to-memory transfers. For DMA Version1,
in the stm32f2xx, stm32f4xx, stm32f7xx series,
only DMA instance 2 is able to transfer mem-to-mem.
For other series, with DMA Version2, there is no such a limitation.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-01-28 12:58:44 -06:00
Jose Alberto Meza
77b7b42f1d drivers: espi: xec: Allow to intercept eSPI host suspend/reset warnings
Fix #22188
Introduce config option to disable automatic acknowledge via
virtual wires on response to eSPI host suspend and reset warnings.
This will give the opportunity for eSPI slave systems that need to
perform preparations before reset or suspend.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2020-01-28 20:13:36 +02:00
Jose Alberto Meza
35c28a3dbf drivers: espi: xec: Use DT IRQ priority values
Use  DT define IRQ priorities instead KConfig.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2020-01-28 20:13:36 +02:00
Henrik Brix Andersen
c894a6db4d drivers: counter: add counter_get_value(), deprecate counter_read()
Introduce a new counter API function for reading the current counter
value (counter_get_value()) and deprecate the former counter_read() in
favor of this.

Update all drivers and calling code to match the new counter API.

The previous counter driver API function for reading the current value
of the counter (counter_read()) did not support indicating whether the
read suceeded. This is fine for counters internal to the SoC where the
read always succeeds but insufficient for external counters (e.g. I2C
or SPI slaves).

Fixes #21846.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-01-28 12:52:46 -05:00
Jukka Rissanen
66cc8e9c3a drivers: modem: gsm: Fix uart_pipe.h location
The uart_pipe.h was moved to drivers/console/uart_pipe.h and that
was missed by sanity.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-01-28 19:11:13 +02:00
Robert Lubos
7e7f05546d modules: nordic: Allow separate nRF 802.15.4 radio driver build
So far, nRF 802.15.4 radio driver build was dependent on the 802.15.4
subsystem in Zephyr. While this was a reasonable approach for samples,
it prevented the radio driver from being built as a standalone entity,
which could be useful in some applications (e. g. running core nRF
802.15.4 radio driver tests with Zephyr).

Resolve this, by providing a separate set of Kconfigs for the radio
driver, therefore allowing to build it as a separate entity. The 802154
subsystem simply enables the radio driver module in this case.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-01-28 15:18:42 +01:00
Patrik Flykt
3fe8707bc0 drivers: modem: Implement uart_pipe interface for GSM modem
Implement uart_pipe functionality for the modem so that it
integrates with the PPP implementation.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2020-01-28 12:44:17 +02:00
Patrik Flykt
2308293d89 drivers: modem: Support GSM modems and PPP
Create a driver for GSM modems that use a standard AT command set
and enable Zephyr's own PPP stack for IP traffic.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2020-01-28 12:44:17 +02:00
Ulf Magnusson
cf89ba33ea global: Fix up leading/trailing blank lines in files
To make the updated test in
https://github.com/zephyrproject-rtos/ci-tools/pull/121 clean, though it
only checks modified files.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-27 17:41:55 -06:00
Ivo Clarysse
a290d30c9a drivers: can: stm32: Fix bit timing conversion
Fix CAN TS1, TS2 and SJW bit timing conversion to properly
handle upper limits.

Signed-off-by: Ivo Clarysse <ivo@bcdevices.com>
2020-01-27 15:07:32 -06:00
Alexander Wachter
2f44990e9b can: Introduce can-primary alias
This commit introduces the can-primary alias to identify
the primary CAN interface.
This alias is used for all samples and tests, so they don't
need to probe the right interface.

Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
2020-01-27 10:25:00 -06:00
Peter Bigot
344c109f02 treewide: use full path to wifi/winc1500.h header
The build infrastructure should not be adding the drivers subdirectory
to the include path.  Fix the legacy uses that depended on that
addition.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-26 17:52:12 +01:00
Peter Bigot
9689868f7b treewide: use full path to watchdog.h header
The build infrastructure should not be adding the drivers subdirectory
to the include path.  Fix the legacy uses that depended on that
addition.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-26 17:52:12 +01:00
Peter Bigot
84497d0e49 treewide: use full path to usb/usb_dc.h header
The build infrastructure should not be adding the drivers subdirectory
to the include path.  Fix the legacy uses that depended on that
addition.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-26 17:52:12 +01:00
Peter Bigot
02ae343100 treewide: use full path to uart.h header
The build infrastructure should not be adding the drivers subdirectory
to the include path.  Fix the legacy uses that depended on that
addition.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-26 17:52:12 +01:00
Peter Bigot
5ceb612738 treewide: use full path to spi.h header
The build infrastructure should not be adding the drivers subdirectory
to the include path.  Fix the legacy uses that depended on that
addition.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-26 17:52:12 +01:00
Peter Bigot
165fe48229 treewide: use full path to sensor.h header
The build infrastructure should not be adding the drivers subdirectory
to the include path.  Fix the legacy uses that depended on that
addition.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-26 17:52:12 +01:00
Peter Bigot
12e30f16c9 treewide: use full path to pwm.h header
The build infrastructure should not be adding the drivers subdirectory
to the include path.  Fix the legacy uses that depended on that
addition.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-26 17:52:12 +01:00
Peter Bigot
5e2b24a5e4 treewide: use full path to led/ht16k33.h header
The build infrastructure should not be adding the drivers subdirectory
to the include path.  Fix the legacy uses that depended on that
addition.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-26 17:52:12 +01:00
Peter Bigot
5e486b98b1 treewide: use full path to ipm.h header
The build infrastructure should not be adding the drivers subdirectory
to the include path.  Fix the legacy uses that depended on that
addition.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-26 17:52:12 +01:00
Peter Bigot
e0aa1b1e1d treewide: use full path to ieee802154/cc2520.h header
The build infrastructure should not be adding the drivers subdirectory
to the include path.  Fix the legacy uses that depended on that
addition.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-26 17:52:12 +01:00
Peter Bigot
faa4bf34bd treewide: use full path to ieee802154/cc1200.h header
The build infrastructure should not be adding the drivers subdirectory
to the include path.  Fix the legacy uses that depended on that
addition.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-26 17:52:12 +01:00
Peter Bigot
8e2c230cbc treewide: use full path to i2c.h header
The build infrastructure should not be adding the drivers subdirectory
to the include path.  Fix the legacy uses that depended on that
addition.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-26 17:52:12 +01:00
Peter Bigot
5e470ec3bf treewide: use full path to gpio/gpio_mmio32.h header
The build infrastructure should not be adding the drivers subdirectory
to the include path.  Fix the legacy uses that depended on that
addition.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-26 17:52:12 +01:00
Peter Bigot
22bc403c17 treewide: use full path to gpio/gpio_esp32.h header
The build infrastructure should not be adding the drivers subdirectory
to the include path.  Fix the legacy uses that depended on that
addition.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-26 17:52:12 +01:00
Peter Bigot
a539fc6b73 treewide: use full path to flash.h header
The build infrastructure should not be adding the drivers subdirectory
to the include path.  Fix the legacy uses that depended on that
addition.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-26 17:52:12 +01:00
Peter Bigot
e35c896278 treewide: use full path to entropy.h header
The build infrastructure should not be adding the drivers subdirectory
to the include path.  Fix the legacy uses that depended on that
addition.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-26 17:52:12 +01:00
Peter Bigot
ee35fab6f7 treewide: use full path to counter.h header
The build infrastructure should not be adding the drivers subdirectory
to the include path.  Fix the legacy uses that depended on that
addition.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-26 17:52:12 +01:00
Peter Bigot
6a964663b1 treewide: use full path to console/uart_pipe.h header
The build infrastructure should not be adding the drivers subdirectory
to the include path.  Fix the legacy uses that depended on that
addition.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-26 17:52:12 +01:00
Peter Bigot
f780247d8a treewide: use full path to console/uart_mcumgr.h header
The build infrastructure should not be adding the drivers subdirectory
to the include path.  Fix the legacy uses that depended on that
addition.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-26 17:52:12 +01:00
Peter Bigot
47e62276ff treewide: use full path to console/ipm_console.h header
The build infrastructure should not be adding the drivers subdirectory
to the include path.  Fix the legacy uses that depended on that
addition.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-26 17:52:12 +01:00
Peter Bigot
0b0d2e640b treewide: use full path to clock_control/stm32_clock_control.h header
The build infrastructure should not be adding the drivers subdirectory
to the include path.  Fix the legacy uses that depended on that
addition.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-26 17:52:12 +01:00
Peter Bigot
4147188bbb treewide: use full path to clock_control/arm_clock_control.h header
The build infrastructure should not be adding the drivers subdirectory
to the include path.  Fix the legacy uses that depended on that
addition.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-26 17:52:12 +01:00
Peter Bigot
bbb00d0eb7 treewide: use full path to clock_control.h header
The build infrastructure should not be adding the drivers subdirectory
to the include path.  Fix the legacy uses that depended on that
addition.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-26 17:52:12 +01:00
Peter Bigot
19381a7e12 treewide: use full path to adc/lmp90xxx.h header
The build infrastructure should not be adding the drivers subdirectory
to the include path.  Fix the legacy uses that depended on that
addition.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-26 17:52:12 +01:00
Peter Bigot
dfd293a5c3 treewide: use full path to adc.h header
The build infrastructure should not be adding the drivers subdirectory
to the include path.  Fix the legacy uses that depended on that
addition.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-26 17:52:12 +01:00
Ulf Magnusson
92529da116 kernel: kconfig: Fix broken references to TICKLESS_KERNEL
The CONFIG_ prefixes were missing on these.

Found with a work-in-progress scripts/kconfig/lint.py check.

This symbol is defined in kernel/Kconfig.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-25 08:14:55 -05:00
Armando Visconti
8dbe9806ff drivers/i2c: Kconfig.stm32: Enable interrupts usage by default
I2C interrupts usage should be the preferred way. This commit
enables them by default in the STM32 I2C driver itself.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2020-01-24 21:34:45 -05:00
Ulf Magnusson
d28e1f6bcb kconfig: Turn pointless 'menuconfig's into 'config's
Same deal as in commit 677f1e6 ("config: Turn pointless/confusing
'menuconfig's into 'config's"), for a newly-introduced stuff.

Also clean up headers to be consistent with recent cleanups.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-24 21:30:17 -05:00
Ulf Magnusson
72a350c3dc console: kconfig: Have CONSOLE_HANDLER dep. on SERIAL_SUPPORT_INTERRUPT
CONSOLE_HANDLER was unconditionally selecting UART_INTERRUPT_DRIVEN (and
depends on it in the code), but UART_INTERRUPT_DRIVEN depends on
SERIAL && SERIAL_SUPPORT_INTERRUPT.

Add a SERIAL_SUPPORT_INTERRUPT dependency to CONSOLE_HANDLER.
CONSOLE_HANDLER already depends on UART_CONSOLE, which depends on
SERIAL, so a SERIAL dependency does not need to be added.

This avoids some selects with unsatisfied dependencies in CI.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-24 22:48:40 +01:00
Oane Kingma
ea9140e652 drivers/serial: Add more USART ports for Silabs EFM32GG11B
Silicon Labs EFM32GG11B SoCs have more USART ports than
currently supported by the driver. Driver expanded with
support for USART4 and USART5.

Signed-off-by: Oane Kingma <o.kingma@interay.com>
2020-01-24 10:28:33 -06:00
Oane Kingma
437587af20 drivers/ethernet: Add support for SiLabs Giant Gecko GG11
Ethernet MAC present in Silicon Labs EFM32GG11B4xx and
EFM32GG11B8xx SoCs.

DMA based driver with support for link up/down detection.

Signed-off-by: Oane Kingma <o.kingma@interay.com>
2020-01-24 10:28:33 -06:00
Peter Bigot
1a5368a07b drivers: sensor: bma280: convert from Kconfig to devicetree
Define a binding for the Bosch BMA280 sensor.  Remove the Kconfig
settings and update the driver to use the devicetree information.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-24 15:52:09 +01:00
Jose Alberto Meza
d1f0fbfec5 drivers: espi: xec: Add support for eSPI OOB channel operations
Implement send/receive out-of-band packet APIs

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2020-01-23 12:17:48 -05:00
Andrzej Puzdrowski
997be3d04d drivers/flash/flash_simulator: erase posix flash in initialization
After startup the native_posix flash was filed by 0x00 instead
of 0xff, which is not coherent with erased byte value which
is 0xff for the native_posix target.

Such inconsistent behavior makes for instance running
a storage system designed(or configured) for a flash device
with 0xff as erased byte values problematic.

This patch makes flash erased after new flash device file creation.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-01-23 10:51:42 -05:00
Benjamin Valentin
633d57508f drivers: entropy: sam: Add support for sam0
SAM0 uses the same TRNG as SAM, so it's trivial to add support
for this line of MCUs.

Signed-off-by: Benjamin Valentin <benpicco@googlemail.com>
2020-01-23 12:40:59 +01:00
Carlo Caione
b9fc192779 drivers: uart_pl011: Enable shared interrupts support
The PrimeCell UART (PL011) IP can use one single combined/shared
interrupt line instead than different IRQ lines for TX/RX/Err/... This
is the most common configuration supported in the Linux world but not
currently supported in Zephyr. QEMU emulates a PL011 UART with a single
interrupt line as well.

To support this configuration we have to hookup the PL011 driver with a
shared IRQ driver and add two new configuration options when the shared
IRQ line is used.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2020-01-23 02:04:52 -08:00
Flavio Ceolin
2abfccb352 driver: uart: ns16550: Simplify drv_cmd function
There is only one possible command, so just use if instead of switch
to avoid several MISRA-C violations and also avoid set dev_data wrongly
unused when UART_NS16550_DLF_ENABLED is defined.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2020-01-22 21:21:49 -05:00
Flavio Ceolin
e1589c2278 driver: uart: ns16550: Setting default options
Commit 68a235932f changed this driver to
not use hard-coded options. The problem was that these options were
never being set. This commit just set an initial value that can be
changed later.

Fix 68a235932f

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2020-01-22 01:52:51 -05:00
Jennifer Williams
68a235932f drivers: uart: ns16550: move from hard-coded to configurable
The NS16550 UART driver is currently hard-coded as 8-n-1
with no flow control. The baud rate is set by what is in DTS.
This commit moves away from hard-coded and strictly DTS to
configurable using the UART configure API. Requires commit #bcb807.

Signed-off-by: Jennifer Williams <jennifer.m.williams@intel.com>
2020-01-21 18:50:27 -05:00
Jennifer Williams
3a34db8501 driver: uart: ns16550: implement configure API
The UART configure API was added to uart.h and this commit
implements the initial framework for the configure API for
the ns16550 uart. This includes the configure() and config_get()
functions and uart device configuration structures of the uart
configure API for the ns16550.

Note this commit does not resolve the pre-existing hard-coded
8-n-1 implementation.

Signed-off-by: Jennifer Williams <jennifer.m.williams@intel.com>
2020-01-21 18:50:27 -05:00
Henrik Brix Andersen
0f60477667 drivers: counter: add missing syscalls
Add missing syscalls and fix already present syscalls for the counter
API.

Fixes #14650.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-01-21 11:36:55 -05:00
Andrzej Puzdrowski
68f51f66c6 doc: cleanup after NFFS removal
Patch introduce references to LittleFS instead of NFFS where it
was suitable. In other places NFFS mentions were removed

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-01-21 15:32:47 +01:00
Adam Kondraciuk
2ff0105954 drivers: flash: nrfx: Change write_block_size parameter to 32-bits
According to NRF product specifications the smallest write unit is
32-bits. Added parameter 'CONFIG_EMULATE_ONE_BYTE_WRITE_ACCESS'
which allows one byte flash write using more complex operation.

Signed-off-by: Adam Kondraciuk <adam.kondraciuk@nordicsemi.no>
2020-01-21 15:26:23 +01:00
Christian Hirsch
5fcb5d0b75 drivers: counter: fix nRF prescaler overflow
use u32_t in init_rtc to be able to use the full 12 bit prescaler values
fixes #22014

Signed-off-by: Christian Hirsch <christian.hirsch@tuwien.ac.at>
2020-01-21 08:24:11 +01:00
David D
b96525c82c drivers: spi: Fixing null-pointer dereference in stm32
Fixes #21935

Signed-off-by: David D <a8961713@gmail.com>
2020-01-20 18:38:39 -05:00
Andrzej Puzdrowski
32109512f2 drivers/flash: group nRF sub-option under menuconfig
Grouped all nRF driver sub-option under SOC_FLASH_NRF
menuconfig.

This makes menuconfig cleaner.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-01-20 18:37:47 -05:00
Marcin Niestroj
bbe8e63c46 spi: stm32: deduplicate code creating SPI instances
Create new instances of SPI using single STM32_SPI_INIT() macro
invocation, similar as it is done for STM32 UART driver. Add also
implicit '#ifdef CONFIG_SPI_id' check, so it further reduces required
lines of code for each SPI instance definition.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-01-20 18:36:24 -05:00
Henrik Brix Andersen
66e109cab7 drivers: can: flexcan: use initialization from MCUX v2.7.0
Update the NXP Kinetis FlexCAN driver to use the initialization
parameters for disabling self-reception and enabling listen-only mode
added in MCUXpresso v2.7.0.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-01-20 09:25:02 -06:00
Jan Van Winkel
b153f0b914 drivers: display: Add support for RGB565 to SDL display
Added support for RGB565 and BGR565 to SDL display driver

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2020-01-20 09:21:04 -06:00
Jan Van Winkel
9041b0f119 drivers: display: Set mcux elcdif pixel format to BGR565
Return BGR565 as supported mcux elcdif pixel format for RK043FN02H
display panel.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2020-01-20 09:21:04 -06:00
Daniel Leung
549fdb9ec9 i2c: mchp_xec: define driver instaces based on device tree...
...instead of kconfig.

This provides a bit more flexibility in defining driver
instances. Also, since the DTS defines 5 I2C controllers,
the driver code is extended to cover all 5 if the controllers
are enabled.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-01-18 13:33:20 -05:00
Kumar Gala
b1602c8e39 arm: Removed support for CC2650
The SoC, driver, and board support for the CC2650 and CC2650 Sensortag
aren't currently supported and we are removing them as such.  If anyone
is interesting in supporting this platform we can easily recovery it
from git.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-01-18 09:27:55 -06:00
Andrew Boie
a51b125aba drivers: serial: add async API system calls
These were unintentionally omitted. We don't expose callback
registration or callback response APIs for security reasons.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-01-17 16:15:02 -05:00
Pushpal Sidhu
74f9c23ac6 pinmux: stm32: l4: Make SPI SCK and MOSI pins Very High Speed
Ensure that the SPI SCK and MOSI pins are set to very high as slower
SPI speeds will cause device hangs when used. This is due to the state
changing too fast for hardware, causing RXE to never fire and thus
hang.

Signed-off-by: Pushpal Sidhu <psidhu.devel@gmail.com>
2020-01-17 06:47:20 -06:00
Ruslan Mstoi
c2542eacbd drivers: eth: native_posix: Yield to avoid deadlocks in RX
TCP segment with several EOL TCP options causes echo server to block and
use 100% of CPU. This patch fixes that issue by using k_yield to let
also other threads to run.

Fixes #21949

Signed-off-by: Ruslan Mstoi <ruslan.mstoi@intel.com>
2020-01-17 10:02:18 +02:00
Carles Cufi
6cf7ac77bf Bluetooth: Always use full path to hci_driver.h
The path to include/drivers should not be in the compiler include path
list, only include/. In order to make this possible, always explictly
refer to hci_driver.h via the drivers/bluetooth/ path and not only
bluetooth/.

Fixes #21974.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-01-16 19:20:39 -05:00
Henrik Brix Andersen
fdbb76ff55 drivers: sensor: add driver for the nxp kinetis temperature sensor
Add sensor driver for the internal temperature sensor present in the
NXP Kinetis SoC series.

The driver allows reading the die temperature and the voltage of the
external voltage reference used for calculating the temperature.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-01-16 17:30:42 -06:00
Siddharth Chandrasekaran
1ab39e7c52 drivers/crypto: mbedTLS_shim add support for CAP_NO_IV_PREFIX
Add support for `CAP_NO_IV_PREFIX` in mbedTLS_shim and advertise this as
one of its capabilities. When this flag is active, the IV passed is
preserved to allow applications to reuse the IV buffer.

Signed-off-by: Siddharth Chandrasekaran <siddharth@embedjournal.com>
2020-01-16 18:34:20 +01:00
Erwan Gouriou
136d92de33 drivers/usb/device: stm32: Update due to API change on F0/F3/L0
Following update of STM32Cube packages for series F0/L0/F3,
a new file ll_usb.h is now available for these series.
As a consequence, specific hanlding is no more requested for this
series is stm32 usb_device driver.

Fixes #21962

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-01-16 10:09:58 -05:00
Andrei Gansari
b72db6b02e drivers: soc_flash_mcux enabled for LPC
soc_flash_mcux added support for IAP Flash device specific to LPC SoC
families.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2020-01-16 08:19:46 -06:00
Thomas Schmid
03e992a6b5 drivers: sensor: ms5607: fix potential integer overlow
Fix potential integer overflow by making operands to multiplication
wider.

Fixes #21673

Signed-off-by: Thomas Schmid <tom@lfence.de>
2020-01-16 07:47:59 -06:00
Lyle Zhu
b3df27afcf driver: interrupt_controller: Filter invalid channel for RV32M1 SOC
Invalid channel should be filtered in intmux isr, please refer to
page 1243~1244 of chapter 36 INTMUX of RV32M1 RM.

Note: Unlike the NVIC, the INTMUX does not latch pending source
interrupts. This means that the INTMUX output channel ISRs must
check for and handle a 0 value of the CHn_VEC register to account
for spurious interrupts.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2020-01-16 07:10:23 -06:00
Audun Korneliussen
a68ef65bc4 drivers: uart: Enable rx byte counting timer only in active power state
Nrfx_uarte uses a hardware timer/counter to count received bytes.
Keeping this timer enabled increases power consumption for some SoCs.

This change disables the timer when an inactive power state is set.

Signed-off-by: Audun Korneliussen <audun.korneliussen@nordicsemi.no>
2020-01-16 11:55:56 +01:00
Maureen Helm
ee65932c96 drivers: watchdog: Refactor mcux wdog driver to use generated dts macros
Refactors the mcux wdog driver to use generated device tree macros
directly. Removes now unused dts fixup macros from kinetis socs.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-01-15 18:02:19 -05:00
Maureen Helm
9329c0db27 drivers: counter: Refactor mcux rtc driver to use generated dts macros
Refactors the mcux rtc driver to use generated device tree macros
directly. Removes now unused dts fixup macros from kinetis socs.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-01-15 18:02:19 -05:00
Maureen Helm
94c5a75998 drivers: spi: Refactor mcux dspi driver to use generated dts macros
Refactors the mcux dspi driver to use generated device tree macros
directly. Removes now unused dts fixup macros from kinetis socs.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-01-15 18:02:19 -05:00
Maureen Helm
93b457f4da drivers: serial: Refactor mcux lpsci driver to use generated dts macros
Refactors the mcux lpsci driver to use generated device tree macros
directly. Removes now unused dts fixup macros from i.mx rt and kinetis
socs.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-01-15 18:02:19 -05:00
Maureen Helm
5df8b5d63e drivers: serial: Refactor mcux uart driver to use generated dts macros
Refactors the mcux uart driver to use generated device tree macros
directly. Removes now unused dts fixup macros from kinetis socs.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-01-15 18:02:19 -05:00
Maureen Helm
806813bb6a drivers: i2c: Refactor mcux i2c driver to use generated dts macros
Refactors the mcux lpi2c driver to use generated device tree macros
directly. Removes now unused dts fixup macros from kinetis socs.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-01-15 18:02:19 -05:00
Dominik Ermel
8cb200309b drivers: sensors: qdec_nrfx: Fix compilation after HAL update
hal_nordic update 1e8103ae require changes to sensor code,
to make it compile.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2020-01-15 16:16:09 +01:00
Erwan Gouriou
fc85361cfe drivers: flash: stm32: Update SR define
Following update of stm32wb package, FLASH_FLAG_SR_ERROR
has been renamed to FLASH_FLAG_SR_ERRORS.
Update driver to fix compilation issue.


Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-01-15 08:39:05 -06:00
Peter Bigot
f041570188 drivers: sensor: ccs811: accommodate old firmware
The firmware version on the CCS811 on nrf52_pca20020 is generally
version 1.1, which does not set the data ready bit in the status
register.  Assume that a non-zero CO2 measurement on that version is
fresh for the purposes of determining the fetch status.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-14 15:44:09 -06:00
Peter A. Bigot
ac5acb9530 drivers: sensor: ccs811: provide API to fetch configuration and versions
The application may want to know the configured mode without inspecting
Kconfig macros; this is important for proper management of BASELINE
which is mode-dependent.

It also may need to know the version of the hardware and firmware, as
the behavior of application firmware 2.0 is significantly better than
version 1.1.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-01-14 15:44:09 -06:00
Peter A. Bigot
2dd990ad55 drivers: sensor: ccs811: enable drive mode 4
This mode is documented as producing a raw result every 250 ms that the
application must convert to eCO2 and eTVOC readings.  In practice
application firmware 2.0 appears to convert the readings as with all
other rates.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-01-14 15:44:09 -06:00
Peter A. Bigot
cb84836745 drivers: sensor: ccs811: provide access to sensor results
Expose the entire content of the ALG_RESULT_DATA block to the
application, primarily so the status and error flags can be seen.  With
those available the application has the ability to detect that a stale
result has been provided so sensor_fetch_sample() can return -EAGAIN in
this case instead of -EIO, and it doesn't need to block which is
annoying.

This should also make the sensor usable on older Nordic Thingy:52
devices with outdated CCS811 application firmware that doesn't properly
implement the DATA_READY bit.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-01-14 15:44:09 -06:00
Peter A. Bigot
c90a738d8c drivers: sensor: ccs811: support update of environmental conditions
Accurate estimate of gas presence requires temperature and humidity
data.  Add API to update these values.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-01-14 15:44:09 -06:00
Peter A. Bigot
316c6e3aeb drivers: sensor: ccs811: cleanup of raw reading processing
Use CMSIS-standard bit mask and offset macros.  Rename the field to more
closely match the data sheet.  Use slightly less magic numbers for the
scale multipliers.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-01-14 15:44:09 -06:00
Peter A. Bigot
af0c69fb9f drivers: sensor: ccs811: add interface for BASELINE management
Proper use of the CCS811 requires maintenance of the BASELINE
register value measured in clean air at various points in the sensor
life cycle.  The sensor driver abstraction has no facility to support
this, so add an application header with functions to fetch and update
the register value.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-01-14 15:44:09 -06:00
Peter A. Bigot
403a7ab2c5 drivers: sensor: ccs811: support triggers
Add the standard suite of trigger configuration options.  Add driver
support for the DATA_READY and THRESHOLD triggers.  Note cross-module
dependency as configuring the trigger requires a controlled modification
of the sensor registers and the sensor driver API doesn't support this.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-01-14 15:44:09 -06:00
Peter A. Bigot
29c5f30ed2 drivers: sensor: ccs811: rework data fetch to prepare for non-polled use
The original implementation relied on the DATA_READY bit of the STATUS
register to indicate when a reading was available.  This bit remains
clear for the first several readings produced by the CCS811.

When INT_DATARDY is set in MEAS_MODE the nINT signal will remain
asserted until ALG_RESULT_DATA is read.  If this is treated as a LEVEL
signal, which is the common case in Zephyr, gating the read of
ALG_RESULT_DATA on DATA_READY means the signal will never be cleared,
and the interrupt callback will be repeated immediately.

Since the STATUS register value is part of the ALG_RESULT_DATA block
just read the whole thing, and provide its content to the user only if
the DATA_READY bit is set.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-01-14 15:44:09 -06:00
Peter A. Bigot
21e68d4b81 drivers: sensor: ccs811: reset sensor when driver is initialized
The CCS811 has a measurement lifecycle that includes certain timing
constraints, including that calibration constants should not be applied
until the conditioning period has completed.  If a device resets but the
CCS811 remains the process of inspecting current state and initializing
the device properly can be complicated.

Simplify this by forcing a reset of the device when the driver is
initialized.  Should this cause hardship the necessary logic and
infrastructure to record time-of-last-reset across reboots and verify
measurement mode/baseline consistency can be added at that point.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-01-14 15:44:09 -06:00
Peter A. Bigot
ff5ef271ee drivers: sensor: ccs811: abstract read of status/error
Read the status and error in one function that provides its own
diagnostics.

Also change name of register to match datasheet.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-01-14 15:44:09 -06:00
Peter A. Bigot
463bec1749 drivers: sensor: ccs811: bypass APP_START when not in boot mode
The CCS811 can be in either boot mode (after powerup) or application
mode, and these modes have distinct register maps that share only some
content.  The register written to switch from boot mode to application
mode is not available in application mode, so don't write to it in that
case.

Also respect the required timeout between APP_START and next I2C
operation.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-01-14 15:44:09 -06:00
Peter A. Bigot
59d41669b9 drivers: sensor: ccs811: make measurement drive mode configurable
Allow application to choose the measurement rate.

Measurement mode 4 (250 ms rate) is not supported because it we have no
support for processing the raw data it produces.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-01-14 15:44:09 -06:00
Peter A. Bigot
cc3020ea49 drivers: sensor: ccs811: deassert WAKEn when not active
Asserting the WAKEn increases current draw.  Turn it off when I2C is
not being used.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-01-14 15:44:09 -06:00
Peter A. Bigot
11dd504f2a drivers: sensor: ccs811: use device tree for control GPIOs
Replace Kconfig GPIO pin configuration with device tree gpios.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-01-14 15:44:09 -06:00
Peter A. Bigot
6c15968322 drivers: sensor: ccs811: uncrustify
Run the code formatter over the source files for the CCS811.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-01-14 15:44:09 -06:00
Kwon Tae-young
4a4a979dca drivers/eeprom: stm32: Added support for L0 Series
Enable EEPROM support in the L0 Series.

Signed-off-by: Kwon Tae-young <tykwon@m2i.co.kr>
2020-01-14 11:13:42 -05:00
Benjamin Valentin
fc7f458ab3 flash: sam0: Define LOCK_REGIONS in dts
The amount of lock regions differs between different sam0 MCUs.

	saml10:  2
	saml11:  4
	samd2x:	16
	saml2x: 16
	samd5x: 32

ASF does not provide a definition for this, so create a new one
in dts.

Signed-off-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2020-01-14 11:12:33 -05:00
Benjamin Valentin
cafc074d06 flash: sam0: Add support for SAME54
This adds support for the flash peripheral found in the SAME5x/SAMD5x
line of MCUs.
The peripheral is very simmilar to the one found on SAMD2x with only
a few register names changed.

Signed-off-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2020-01-14 11:12:33 -05:00
Maureen Helm
b8ad9969ef drivers: counter: Refactor mcux gpt driver to use generated dts macros
Refactors the mcux gpt driver to use generated device tree macros
directly. Removes now unused dts fixup macros from i.mx rt socs.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-01-14 11:10:27 -05:00
Maureen Helm
9e14543c19 drivers: gpio: Refactor mcux igpio driver to use generated dts macros
Refactors the mcux igpio driver to use generated device tree macros
directly. Removes now unused dts fixup macros from i.mx rt socs.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-01-14 11:10:27 -05:00
Maureen Helm
a2082303b8 drivers: serial: Refactor mcux lpuart driver to use generated dts macros
Refactors the mcux lpuart driver to use generated device tree macros
directly. Removes now unused dts fixup macros from i.mx rt and kinetis
socs.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-01-14 11:10:27 -05:00
Maureen Helm
7242660399 drivers: i2c: Refactor mcux lpi2c driver to use generated dts macros
Refactors the mcux lpi2c driver to use generated device tree macros
directly. Removes now unused dts fixup macros from i.mx rt and kinetis
socs.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-01-14 11:10:27 -05:00
Johann Fischer
93ff0defc3 drivers: ssd1306: fix partial buffer write for SH1106 controller
Fix partial buffer write for SH1106 controller.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2020-01-14 11:06:57 -05:00
Johann Fischer
8918e48072 drivers: ssd1306: add choice symbol to controller type choice
Add choice symbol to controller type choice.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2020-01-14 11:06:57 -05:00
Jan Tore Guggedal
a536c14132 drivers: sensor: bme280: Add CS control when using SPI
Adds BME280 SPI chip select pin control if chip select is
configured for the device in the device tree.

Signed-off-by: Jan Tore Guggedal <jantore.guggedal@nordicsemi.no>
2020-01-14 08:49:19 -06:00
Anas Nashif
ebaed210c7 sensor: tmp007: fix read and use i2c_burst_read
- Fix reading of temp. sensor
- Use i2c_burst_read instead of i2c_transfer

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-01-13 16:09:27 -06:00
Maksim Masalski
33336e78f6 drivers: spi: Support PM busy state where relevant in DW
Need to set device busy when enter into transceive function
in SPI DW driver.
In current SPI DW driver the transceive function don't set busy state,
but that is important for PM busy state.
This will lead to unexpected behaviors when system calls this
function and enter into idle state.

Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-01-13 11:33:12 -05:00
Henrik Brix Andersen
3e7ca8f2ad drivers: pwm: add driver for the RV32M1 Timer/PWM module
Add driver for the OpenISA Timer/PWM (TPM) module present in the
RV32M1 SoC.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-01-13 09:12:34 -06:00
Håkon Øye Amundsen
311b31d9f4 Bluetooth: select BT_RPMSG_NRF53 for non-secure variant of nrf5340
Prior to this you would get compilation error when building
samples for the nrf5340_dk_nrf5340_cpuappns board.

Signed-off-by: Håkon Øye Amundsen <haakon.amundsen@nordicsemi.no>
2020-01-10 16:33:00 +01:00
Anas Nashif
89005438bc i2c: add i2c shell with scan cmd
Add a shell to interact with I2C devices. Currently scanning for devices
is supported. Example output:

uart:~$ i2c scan I2C_1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:             -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- 18 -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: 40 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
2 devices found on I2C_1
uart:~$ i2c scan I2C_3
i2c - I2C commands
Subcommands:
  I2C_1  :I2C_1
  I2C_2  :I2C_2
uart:~$ i2c scan I2C_2
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:             -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- 1e --
20: -- -- -- -- -- -- -- -- -- 29 -- -- -- 2d -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- 56 -- -- -- -- -- -- 5d -- 5f
60: -- -- -- -- -- -- -- -- -- -- 6a -- -- -- -- --
70: -- -- -- -- -- -- -- --
7 devices found on I2C_2

This shell is based on the a sample that did the same thing and was
limited in support. The sample is now removed in favour of this generic
shell module.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-01-10 08:55:47 -05:00
Christian Taedcke
6da94af847 drivers: spi: Add Gecko SPI driver
This commit adds SPI driver and its bindings using the USART peripheral
for Silicon Labs EFM32 and EFR32 MCUs.

Signed-off-by: Christian Taedcke <hacking@taedcke.com>
2020-01-10 07:14:35 -06:00
Ismael Fillonneau
0c3fbaa882 drivers: nrf: avoid UARTE pm infinite loop
calling UARTE power management with DEVICE_PM_SUSPEND_STATE
then DEVICE_PM_OFF_STATE causes a deadlock in while loop.
It waits for an event witch never comes

Signed-off-by: Ismael Fillonneau <ismael.fillonneau@stimio.fr>
2020-01-10 10:42:23 +01:00
Ryan QIAN
df12b9ee7f driver: gpio: gpio_mcux_igpio: check presence of IRQ macro first
- Check presence of GPIO IRQ related macros before enabling IRQ

Signed-off-by: Ryan QIAN <jianghao.qian@nxp.com>
2020-01-09 16:29:22 -06:00
Laczen JMS
ab3ed439c8 drivers: eeprom: Unified simulator and native_posix
EEPROM simulator and native_posix have been unified to one solution,
the old eeprom,native_posix is removed.

Signed-off-by: Laczen JMS <laczenjms@gmail.com>
2020-01-09 20:28:19 +01:00
Laczen JMS
20623dfa4c drivers: eeprom: Add support for eeprom simulator
Add support for a eeprom simulator. The PR limits the addition to
qemu_x86 but it can easily be added to other devices by defining the
eeprom simulator in the dts and setting 'CONFIG_EEPROM_SIMULATOR=y'

Signed-off-by: Laczen JMS <laczenjms@gmail.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-01-09 20:28:19 +01:00
Benoit Leforestier
f256625ad4 Driver: Flash STM32: Don't use semaphore if multithreading isn't defined
In STM32 flash driver, don't use semaphore if multithreading
isn't defined.
If multithreading isn't defined, a call to sem_give function
generates a hardware fault exception.

Signed-off-by: Benoit Leforestier <benoit.leforestier@gmail.com>
2020-01-09 19:14:32 +01:00
Henrik Brix Andersen
bc2113bd46 drivers: adc: add LMP90xxx ADC driver with GPIO
Add driver for the Texas Instruments LMP90xxx series of multi-channel,
low-power 16-/24-bit sensor analog frontends (AFEs).

The functionality is split into two drivers; an ADC driver and a GPIO
driver.

Tested with LMP90080 and LMP90100.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-01-09 17:27:52 +01:00
Christian Taedcke
5e94ac9aa9 net: ppp: Enable connection setup for windows
Before establishing the ppp connection, windows sends the string CLIENT
and expects the reply CLIENTSERVER from the modem.
This functionality is implemented in the new function
ppp_handle_client().
This feature must be enabled via Kconfig.

Signed-off-by: Christian Taedcke <christian.taedcke@lemonbeat.com>
2020-01-09 15:16:05 +02:00
Peter A. Bigot
f05cbb421d drivers: sensor: mcp9808: fix various problems and improve test
Correct handling of device encoded temperature values, which combine a
12-bit 2s complement signed value with a separate sign bit.  Rework
conversion between device and sensor temperature representations to
support negative temperatures in both domains.

Use a much simpler trigger configuration where the alert is driven by
comparator output, rather than as an interrupt that requires a pair of
I2C transactions to read and clear the flag.

Refactor the trigger infrastructure to use the setup/handle/process
idiom, which reduces duplicated code and to correctly detect alerts
present when the triggers are set.

Completely replace the sample with something that demonstrates
updating upper and lower threshold values to track moving
temperatures.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-01-08 20:33:51 -05:00
Henrik Brix Andersen
835c118636 drivers: adc: mcux_adc12: fix DT_INST_2_* usage
Fix the usage of DT_INST_2_* defines in the NXP MCUX ADC12 ADC driver.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-01-08 17:32:13 -06:00
Krzysztof Chruscinski
95b4d37230 drivers: sensor: shell: Improved shell support for sensors
Added autocompletion to 'sensor get' command. After this change
device and channels are autocompleted. It is possible to provide
multiple channels for reading.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-01-08 12:59:46 -05:00
Krzysztof Chruscinski
efeb7fa771 drivers: sensor: hts221: Return error on not supported channel
When asserts were disabled then sensor accepted any channel in
hts221_channel_get(). Changed to return -ENOTSUP when invalid
channel is provided.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-01-08 12:59:46 -05:00
Peter Bigot
19a0f354ae drivers: sensor: ak8975: remove legacy reference to MPU6050
MPU6050 no longer using Kconfig to specify I2C addresses.  Reference
to the removed symbol causes QA diagnostics.  Remove the reference;
when AK8975 is converted to devicetree it may be possible to restore
the link between the sensors.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-08 16:40:04 +01:00
Peter Bigot
fe018f51a2 drivers: sensor: mpu6050: convert to devicetree
Add a binding for the sensor and replace all Kconfig selection of
hardware parameters with devicetree property values.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-08 16:40:04 +01:00
Oleg Zhurakivskyy
5e54a8f1c4 drivers: eth: e1000: Include sys/types.h for ssize_t
echo_server app doesn't compile (it uses minimal libc which lacks
unistd.h), let's switch to a more fine-grained include here.

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2020-01-08 15:42:16 +02:00
Robert Winkler
56db098a55 drivers: pwm: Add driver for LiteX PWM peripherial
PWM driver for LiteX SoC builder was created.
Because LiteX supports only one channel for each PWM device,
an appropriate restriction was made.

Signed-off-by: Robert Winkler <rwinkler@internships.antmicro.com>
Signed-off-by: Mateusz Holenko <mholenko@antmicro.com>
2020-01-08 11:04:36 +01:00
Robert Winkler
7f8a70a74b drivers: i2c: Add driver for LiteX I2C controller
This adds I2C bitbang driver for LiteX SoC builder with its bindings.

Signed-off-by: Robert Winkler <rwinkler@internships.antmicro.com>
Signed-off-by: Mateusz Holenko <mholenko@antmicro.com>
2020-01-07 20:55:43 +01:00
Erwan Gouriou
ca61847af2 Revert "spi: stm32: Enable sending 16bits at a time in 8bit mode if possible"
This reverts commit 2ce8fa1e42.

Fixes #21546
Fixes #21679

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-01-07 19:08:36 +01:00
Henrik Brix Andersen
e2346cf6a2 drivers: pwm: mcux_ftm: add support for inverted polarity pwm signals
Add support for specifying the PWM signal polarity through flags to
the NXP Kinetis FlexTimer (FTM) PWM driver.

Prior to this change the FTM PWM driver always produced inverted
polarity (active-low) PWM signals.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-01-07 18:13:18 +01:00
Henrik Brix Andersen
eafb9b17b6 drivers: pwm: shell: add PWM flags support
Add support for specifying flags in the PWM shell commands.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-01-07 18:13:18 +01:00
Henrik Brix Andersen
db611e6781 drivers: pwm: add support for inverted PWM signals
Add support for requesting an inverted PWM pulse (active-low) when
setting up the period and pulse width of a PWM pin. This is useful
when driving external, active-low circuitry (e.g. an LED) with a PWM
signal.

All in-tree PWM drivers is updated to match the new API signature, but
no driver support for inverted PWM signals is added yet.

All in-tree PWM consumers are updated to pass a flags value of 0
(0 meaning default, which is normal PWM polarity).

Fixes #21384.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-01-07 18:13:18 +01:00
Marciano C. Preciado
d3abb0b9ca drivers: nrf: Catch for nRF53 serial interference
UARTE, SPI, & TWI with the same ID# share resources on nRF53

Signed-off-by: Marciano C. Preciado <marciano@passive-logic.com>
2020-01-07 17:14:25 +01:00
Gerson Fernando Budke
bd0d8a35c3 drivers: ieee802154: rf2xx: Add GPIO dependency
The rf2xx driver needs GPIO driver to works. The RST, SLPTR and INT
are mandatory signals and driver uses DT to configure them. This add
the GPIO dependency on Kconfig.rf2xx file.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-01-07 13:51:46 +02:00
Jukka Rissanen
2a1eabecc6 drivers: eth: mcux: Disable HW accel checksum calc
Do not enable hardware accelerated checksum calculation by
default. It does not work for frdm-k64f and is causing
confusion among users.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-01-07 12:29:49 +02:00
Andrew Boie
8617af383d drivers: watchdog: fix system call handlers build
A directive to compile the system call handlers for the
watchdog subsystem was omitted from CMakeLists.txt, causing
the handlers not to be compiled and some issues in the C
file undetected.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-01-06 21:36:54 -08:00
Jan Van Winkel
2e713dc34b drivers: display_st7789v: Name pixel format choice
Made the unnamed choice for ST7789V pixel formats named so that the
default value can be set in defconfig files.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2020-01-06 14:25:00 -05:00
Pawel Czarnecki
894b488b06 drivers: entropy: Add driver for LiteX PRBS module
This adds PRBS ranom number generator driver for
LiteX SoC builder with its bindings.

Signed-off-by: Pawel Czarnecki <pczarnecki@internships.antmicro.com>
Signed-off-by: Mateusz Holenko <mholenko@antmicro.com>
2020-01-06 13:33:25 -05:00
Olof Johansson
3b733b5282 interrupt_controller: plic: use shared symbol for DT_*
miv already had it defined, but let's shorten the names and use
them in the driver. This also adds it for sifive-freedom.

Signed-off-by: Olof Johansson <olof@lixom.net>
2020-01-06 13:28:21 -05:00
Olof Johansson
a6b3b616f5 riscv: use standard MSTATUS
This is no longer needed, since all in-tree platforms are only using
the standard mstatus formats. Remove it to avoid the complexity.

Signed-off-by: Olof Johansson <olof@lixom.net>
2020-01-06 13:27:45 -05:00
Henrik Brix Andersen
9efc58961c drivers: pwm: mcux_ftm: use DT_INST_* defines instead of dts fixups
Convert the NXP MCUX FTM driver to use the DT_INST_* defines instead
of a mix of CONFIG_PWM_* and dts fixups. This simplifies adding new
device tree properties to the ftm nodes.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-01-06 10:03:20 -06:00
Henrik Brix Andersen
7694ebb694 drivers: pwm: mcux_ftm: only emit warning on period change from zero
Only emit a warning about changing PWM period for all channels of a
given FTM instance when changing the period from zero to
non-zero. This silences the useless warning issued at first FTM PWM
channel configuration.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-01-06 10:03:20 -06:00
Jonas Norling
d7d3462d91 drivers: eth: native_posix: Don't sleep when there is data to read
Don't sleep 50ms after each received packet, sleep only when there
wasn't anything to receive. Otherwise data could get stuck for a long
time if there was more than 20 packets coming in per second. The
read() call on a TUN/TAP device returns only a single packet per call.

Also remove the call to eth_stats_update_errors_rx() because this else
clause isn't actually a receive error, we're just waiting for more
packets.

Signed-off-by: Jonas Norling <jonas.norling@greeneggs.se>
2020-01-06 17:03:13 +02:00
Marco Peter
1ee99d2568 drivers: flash: Build STM32 flash support only when selected
The current configuration causes the STM32 flash support always to be
built, even if an unrelated flash driver, by example the SPI_NOR driver
is selected.
This behaviour gets especially problematic (build failure) if the flash
hardware of the given MCU is not supported (e.g. STM32F2).
The suggested change should ensure that STM32 flash support only is
built when it actually is selected.

Signed-off-by: Marco Peter <marco@peter-net.ch>
2020-01-06 08:51:18 -05:00
Ulf Magnusson
0fb370b257 drivers: spi: kconfig: Turn pointless 'menuconfig' into 'config'
Same deal as in commit 677f1e6 ("config: Turn pointless/confusing
'menuconfig's into 'config's"), for a newly-introduced SPI_MCUX_FLEXCOMM
symbol.

Also clean up the header to be consistent with recent cleanups.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-03 07:32:32 -06:00
Ulf Magnusson
bd9962d8d9 kconfig: Remove '# hidden' comments on promptless symbols
Same deal as in commit 41713244b3 ("kconfig: Remove '# Hidden' comments
on promptless symbols"). I forgot to do a case-insensitive search.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-03 11:38:40 +01:00
Johann Fischer
0fcd421973 drivers: display_st7789v: remove obsolete display_st7789v_tl019fqv01.c
Remove obsolete display_st7789v_tl019fqv01.c

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2020-01-02 17:00:06 -05:00
Johann Fischer
0512c3e7d0 drivers: display_st7789v: remove obsolete Kconfig options
Remove obsolete Kconfig options.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2020-01-02 17:00:06 -05:00
Johann Fischer
f6807df469 drivers: display_st7789v: obtain panel settings and parameters from DT
Obtain panel settings and parameters from DT.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2020-01-02 17:00:06 -05:00
Johann Fischer
885d80f2f2 drivers: display_st7789v: make functions static, cleanup
Make privat functions static, remove unused st7789v_cmd_read8().

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2020-01-02 17:00:06 -05:00
Johann Fischer
b5d43d24d8 drivers: display_st7789v: obtain resolution and offsets from DT
Obtain resolution and offsets from DT.
Fix style.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2020-01-02 17:00:06 -05:00
Johann Fischer
9023f3ac34 drivers: display_st7789v: fix style, move init function to the bottom
Fix style, move init function to the bottom.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2020-01-02 17:00:06 -05:00
Oleg Zhurakivskyy
fdd29717f5 drivers: eth: e1000: Add a hexdump of the received/sent data
In case ETH_E1000_VERBOSE_DEBUG is enabled, hexdump
the received/sent data.

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2020-01-02 16:58:27 -05:00
Oleg Zhurakivskyy
2552400533 drivers: eth: e1000: Sanitize the RX descriptor length
Add an error handling of the invalid RX descriptor length (<= 4).

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2020-01-02 16:58:27 -05:00
Oleg Zhurakivskyy
1453b316cb drivers: eth: e1000: Minor cleanup of the naming in e1000_rx()
Use buf and len for consistency.

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2020-01-02 16:58:27 -05:00
Oleg Zhurakivskyy
4b74f69eb3 drivers: eth: e1000: Minor cleanup of the naming in e1000_tx()
Use buf and len for consistency.

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2020-01-02 16:58:27 -05:00
Benjamin Valentin
cd0873015a timer: sam0_rtc_timer: Add support for SAME54
The RTC peripheral found in the SAMD5x/SAME5x MCUs is very
simmilar to the one found in existing sam0 devices with only
a few changes to register names and the clock source selection.

Signed-off-by: Benjamin Valentin <benpicco@googlemail.com>
2019-12-21 11:15:52 -05:00
Ulf Magnusson
41713244b3 kconfig: Remove '# Hidden' comments on promptless symbols
How prompts work is better documented nowadays, and these comments might
not be that helpful if you don't know.

There are lots promptless symbols that don't have a comment.

Also fix up some comments in arch/Kconfig that seem misplaced/redundant,
and clean up some whitespace (no blank line after a comment makes it
look like it only applies to the symbol directly after it to me).

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-21 10:30:33 -05:00
Ulf Magnusson
9c9eb3452b kconfig: Fix some formatting nits
Same deal as in commit bd6e04411e ("kconfig: Clean up header comments
and make them consistent") and commit 1f38ea77ba ("kconfig: Clean up
'config  FOO' (two spaces) definitions"), for some newly-introduced
stuff.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-21 10:30:02 -05:00
Ulf Magnusson
6ef29c0250 kconfig: Remove some redundant single-item menus and ifs
A single menu within an if like

    if FOO

    menu "blah"

    ...

    endmenu

    endif

can be replaced with

    menu "blah"
            depends on FOO

    ...

    endmenu

Fix up all existing instances.

Also remove redundant extra menus underneath 'menuconfig' symbols.
'menuconfig' already creates a menu.

Also remove the menu in arch/arm/core/aarch32/Kconfig around the
"Floating point ABI" choice. The choice depends on FLOAT, which depends
on CPU_HAS_CPU, so remove the 'depends on CPU_HAS_FPU' too.

Piggyback removing a redundant 'default n' for BME280.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-21 10:26:54 -05:00
Manivannan Sadhasivam
e47b5f7a65 drivers: lora: Add SX1276 LoRa Modem support
Add support for Semtech SX1276 LoRa Modem.

Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
2019-12-21 12:20:24 +01:00
Manivannan Sadhasivam
5cb5cc0e66 drivers: Add basic LoRa driver support
Add basic driver support for LoRa.

Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
2019-12-21 12:20:24 +01:00
Hans Wilmers
5b1a524348 sensor: tmp116: Add support for tmp117, fix calculation issues
- Added support for TMP117 in existing driver for TMP116
  The Texas Instruments TMP117 is a higher precision upgrade
   from TMP116. It shares most functionality, but has a
   differing device ID.
   This patch will run with the hardware IDs of both devices.

- Fixed an int promote issue in tmp116_channel_get
  Negative temperature values in drv_data->sample were not
  processed correctly.
  The error occured during integer promotion from u16_t to s32_t
  in this code line:
     tmp = (s32_t)drv_data->sample * TMP116_RESOLUTION;

  By first promoting to s16_t, the correct result is obtained:
     tmp = (s16_t)drv_data->sample * (s32_t)TMP116_RESOLUTION;

- Made temperature resolution compatible to sensor API
  The fractional part of the temperature was returned as a
  multiple of 10^-7 deg.Celsius.
  This differs from the resolution sugegsted by the sensor API,
  which is 10^-6.

  The driver is now returning temperature readings with
  a resolution of 10^-6 deg. Celsius.

- The changed driver was tested using following hardware:
  TMP117 attached to disco_l475_iot1 via i2c1

Signed-off-by: Hans Wilmers <hans@wilmers.no>
2019-12-20 20:18:25 -05:00
Carlo Caione
aec9a8c4be arch: arm: Move ARM code to AArch32 sub-directory
Before introducing the code for ARM64 (AArch64) we need to relocate the
current ARM code to a new AArch32 sub-directory. For now we can assume
that no code is shared between ARM and ARM64.

There are no functional changes. The code is moved to the new location
and the file paths are fixed to reflect this change.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2019-12-20 11:40:59 -05:00
Thomas Schmid
91e39d5ee7 drivers: adc: adc_stm32: fix clock setup
Fix clock setup for stm32 f3, l4, wb and g4 series.

The macro __LL_ADC_COMMON_INSTANCE() is called without argument, which
leads to a compile error. Fix by passing adc parameter.

Signed-off-by: Thomas Schmid <tom@lfence.de>
2019-12-20 08:04:09 -05:00
Andrei Gansari
6adde8c137 drivers: eth_mcux enable checksum and autonegotiation
Enable ETHERNET_HW_TX_CHKSUM_OFFLOAD, ETHERNET_HW_RX_CHKSUM_OFFLOAD,
ETHERNET_AUTO_NEGOTIATION_SET and the equivalent driver configuration
in eth_mcux driver.
Autonegoitiation was done at driver initialization.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2019-12-20 12:35:21 +02:00
Johann Fischer
5c48c2132d drivers: ssd16xx: derive buffer length from width and height attributes
Derive buffer length from width and height attributes and
do not use buf_size direct.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-12-19 22:17:36 +01:00
Johann Fischer
f54b106f60 drivers: ssd1306: cleanup and make functions static
Cleanup and make functions static.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-12-19 22:17:36 +01:00
Johann Fischer
d50ec79757 drivers: ssd1306: derive buffer length from width and height attributes
Derive buffer length from width and height attributes and
do not use buf_size direct.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-12-19 22:17:36 +01:00
Diego Sueiro
93e1560faa subsys/shell: Introduce the Sensor Shell Module
Adds a Shell Module for retrieving Sensor data. The following commands
were added:

sensor - Device commands
Options:
  -h, --help  :Show command help.
Subcommands:
  get            :<device_name> [chanel_idx]
  list           :List configured sensors
  list_channels  :<device_name>

Signed-off-by: Diego Sueiro <diego.sueiro@gmail.com>
2019-12-19 15:54:04 -05:00
Laczen JMS
a91df4a077 drivers/flash: nios2_qspi byte read access
Correct nios2_qspi to allow byte size read access

Signed-off-by: Laczen JMS <laczenjms@gmail.com>
2019-12-19 12:53:22 -05:00
Mateusz Holenko
49da1b877e drivers: i2c_bitbang: read SDA on high clock
According to the I2C spec, the SDA signal must be
stable as long as the SCL signal is high (which
means it can change only when clock is low).

This commit reworks clock signal handling
in such a way that all reads are done
when SCL is high and SDA is stable.

Signed-off-by: Mateusz Holenko <mholenko@antmicro.com>
2019-12-19 11:08:55 -05:00
Stephanos Ioannidis
382e6fbccf drivers: watchdog: Make WDT_DISABLE_AT_BOOT default to y
This commit consolidates the meaning of WDT_DISABLE_AT_BOOT option as
"disabling watchdog at Zephyr system startup for the SoCs that enable
the watchdog by default after reset", and makes this default to y in
order to prevent unintentional processor reset by the watchdog when
not explicitly configured and fed by the application.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2019-12-19 11:07:42 -05:00
Stephanos Ioannidis
2b441732ff interrupt_controller: gic: Support multiple GIC versions
The current GIC driver implementation only supports the GIC-400, which
implements the GICv2 interface.

This commit refactors the GIC driver to support multiple GIC versions
and adds GICv1 interface support (GICv1 and GICv2 interfaces are very
similar).

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2019-12-19 11:05:27 -05:00
Stephanos Ioannidis
11d0f0a294 drivers: interrupt_controller: Refactor GIC configurations
The current GIC configuration scheme is designed to support only one
specific type and version of GIC (i.e. GIC-400 that implements the
GICv2 interface).

This commit adds a set of GIC version configuration symbols that can
be selected by the SoC configuration to specify which version of GIC
interface is implemented in the SoC.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2019-12-19 11:05:27 -05:00
Peter Bigot
0cfac519cc sensor: dht: convert from Kconfig to devicetree
Define a binding for the Aosong DHT family of temperature/humidity
sensors.  Remove the Kconfig settings, and update the driver to use
devicetree information.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-12-19 06:43:37 -06:00
Ulf Magnusson
967b89a752 sensors: lps2hh: Fix misspelled GPIOS_CONTROLLER references
DT_INST_0_ST_LPS22HH_CS_GPIO_CONTROLLER should be
DT_INST_0_ST_LPS22HH_CS_GPIOS_CONTROLLER, which is the name generated by
gen_defines.py.

Discovered while working on unrelated removing of special-casing for
clocks.

Co-authored-by: Armando Visconti <armando.visconti@st.com>
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-19 06:41:25 -06:00
Emil Obalski
2128750138 usb: api: Add user device status callback
By this commit user gets possibility to register USB
device satutus callback. This callback represents device state
and is added so user could know what happend to USB device.

Callback is registered by providing it to usb_enable()
USB api is extended by this callback handler.

Samples using using USB are by default provide no callback
and the usb_enable() is called with NULL parameter.

Status callback registered by hid class is deleted as now
USB device has global callback for all classes within device.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2019-12-19 13:08:55 +01:00
Emil Obalski
d65027d8c0 usb: samples: Application calling usb_enable by itself
User app is reponsible for issuing usb_enable and
making USB hardware operative.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2019-12-19 13:08:55 +01:00
Benjamin Valentin
74f95c499e spi: sam0: Add support for SAME54
The SPI SERCOM peripheral found on the SAMD5x/SAME5x is very much alike
the one found in previous SAM0 MCUs.

Only the clock setup is different.

Signed-off-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2019-12-18 22:12:15 +01:00
Siddharth Chandrasekaran
850f355be1 drivers/crypto: Add macro to simplify access to ctx->drv_sessn_state
The conversion of struct cipher_ctx * to mtls_aes_context * happens in
a bunch of places. Add a macro MTLS_GET_CTX() to simplify this.

Signed-off-by: Siddharth Chandrasekaran <siddharth@embedjournal.com>
2019-12-18 22:10:29 +01:00
Siddharth Chandrasekaran
5fbaf9f0e5 drivers/crypto: Add support for AES ECB mode in mbedTLS shim
Add support for AES ECB mode of operation in mbedTLS shim driver.

Signed-off-by: Siddharth Chandrasekaran <siddharth@embedjournal.com>
2019-12-18 22:10:29 +01:00
Siddharth Chandrasekaran
30f0b3a37c drivers/crypto: Add support for AES CBC mode in mbedTLS shim
Add support for AES CBC mode of operation in mbedTLS shim driver.
Refactor mtls_session_setup() to allow multiple cipher modes to
co-exist.

Signed-off-by: Siddharth Chandrasekaran <siddharth@embedjournal.com>
2019-12-18 22:10:29 +01:00
Filip Brozovic
19d1ea2646 boards: stm32g0316-disco: add support for the ST STM32G0316-DISCO board
Add support for the ST STM32G0316-DISCO development board. This board
features an ST STM32G031J6 MCU on a breakable SO8 to DIL8 module, a user
LED and a button.

Signed-off-by: Filip Brozovic <fbrozovic@gmail.com>
2019-12-18 22:06:39 +01:00
Filip Brozovic
9e92babca2 stm32: clock_control: fix APB2 peripheral clock control on stm32g0
The STM32G0 series of MCUs only has one APB, but two reset and clock
enable registers. Fix enabling/disabling the clock and getting the rate
for peripherals in the second register.

Signed-off-by: Filip Brozovic <fbrozovic@gmail.com>
2019-12-18 22:06:39 +01:00
Filip Brozovic
fc2dfae64f drivers: i2c: add STM32G0X I2C support
Add I2C driver support for STM32G0X SoC series.

Signed-off-by: Filip Brozovic <fbrozovic@gmail.com>
2019-12-18 22:06:27 +01:00
Pushpal Sidhu
2ce8fa1e42 spi: stm32: Enable sending 16bits at a time in 8bit mode if possible
If possible, allow sending 16bits at once instead of 8bits. I found
large delays (up to 3us) between sending bytes due to Zephyr SPI
overhead, so allowing 16bits at a time if possible helps save that
time.

Signed-off-by: Pushpal Sidhu <psidhu.devel@gmail.com>
2019-12-18 22:01:20 +01:00
Pushpal Sidhu
8f0788ee69 spi: stm32: remove spi_stm32_next_tx helper
Remove usage of this helper to stage for 16bit frame transfers in 8bit
mode.

Signed-off-by: Pushpal Sidhu <psidhu.devel@gmail.com>
2019-12-18 22:01:20 +01:00
Pushpal Sidhu
cf228ec2f8 spi: stm32: Add ll_func_set_fifo_threshold_16bit helper
Add this function to allow the fifo to be set for 16bits.

Signed-off-by: Pushpal Sidhu <psidhu.devel@gmail.com>
2019-12-18 22:01:20 +01:00
NavinSankar Velliangiri
e5328b8931 drivers: wifi: Fix the use of net_pkt_write() in eswifi driver
net_pkt_write() function returns 0 on success. But in this driver a
warning is thrown when zero is returned. Hence fix the driver to throw
the warning only when the negative value is returned.

Signed-off-by: NavinSankar Velliangiri <navin@linumiz.com>
2019-12-18 21:58:21 +01:00
Tomasz Bursztyka
9abc0e2efd include/drivers: Move 2 specific intc headers into public location
sam0 and stm32 specific interrupt controller headers are meant to be
public, and as such should be found in
include/drivers/interrupt_controller and not in
drivers/interrupt_controllers.

Fixing documentation issues as well.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-12-18 21:49:46 +01:00
Tomasz Bursztyka
4ada2f65d2 drivers/interrupt_controller: Renaming s1000 to cavs
If it is such a thing (a CAVT intc), it will not be targeting Intel
s1000 SoC only. UP squarde ADSP use the same intc. So renaming it to
CAVS. Though CAVS name might be wrong (CAVS being an overall
architecture name, and not an IP block specification).

Reducing the amount of lines by using if/endif as well.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-12-18 21:49:46 +01:00
Tomasz Bursztyka
ff0625185f drivers/interrupt_controller: Split Kconfig for clarity
Let's move loapic and dw related options into there own Kconfig file.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-12-18 21:49:46 +01:00
Tomasz Bursztyka
c30600d4ab drivers/interrupt_controller: Adopt file naming as other drivers
Pattern being <domain>_<model>.<c/h>.
Here interrupt_controller as a domain would be far too long so
shortening it to "intc", as DTS does actually.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-12-18 21:49:46 +01:00
Pauli Salmenrinne
ca6eee5444 boards: stm32f411e_disco: Add pwm to drive green led
This enables the fade_led example to work with this board.

Signed-off-by: Pauli Salmenrinne <susundberg@gmail.com>
2019-12-18 14:48:06 -06:00
Andrew Boie
13b8b41676 drivers: watchdog: add system calls
wdt_install_timeout() was skipped as it installs an ISR-context
callback handler function. The rest are simple wrappers.

Added myself as the maintainer of the syscall handlers. WDT
subsystem appears to not currently have an owner.

Fixes: #21432

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-12-18 09:28:52 -05:00
Sahaj Sarup
d072ab83ac arm: 96b_stm32_sensor_mez: spi: Enable SPI4
This patch enables SPI4 on the 96Boards STM32 Sensors Mezzanine.
SPI4 has been broken out to a Grove Connector on the board.

Changes:

- Updated board dts to enable spi4
- Updated board Kconfig
- Updated board documentation
- Update board pinmux
- Updated stm32f4 pinmux header file
- Updated stm32f401 dtsi
- Updated stm32f4 defconfig to enable PORTE GPIO
- Added board to spi_loopback test

Test: spi_loopback test passed

Signed-off-by: Sahaj Sarup <sahaj.sarup@linaro.org>
2019-12-18 07:34:37 -06:00
Loic Poulain
90a42bbd45 drivers: counter: mcux_gpt: Add count-up flag
The GPT based counter is a count up timer.
This fixes counter_basic_api tests.

Fix over 80 chars coding style issue.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2019-12-18 07:30:36 -06:00
Krzysztof Chruscinski
d716e3a66c various: Cleanup COND_CODE_1 usage or replace with IF_ENABLED()
Cleanup around COND_CODE_1 usage and replacing with
IF_ENABLED if applicable.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-12-18 08:14:52 -05:00
Pawel Dunaj
e0ed8ebac4 drivers: wdt_nrfx: Handle PM callback properly
All drivers must have power management callbacks specified.

Signed-off-by: Pawel Dunaj <pawel.dunaj@nordicsemi.no>
2019-12-18 12:10:19 +01:00
Pawel Dunaj
6d911b8f2c drivers: uart_rtt: Handle PM callback properly
All drivers must have power management callbacks specified.

Signed-off-by: Pawel Dunaj <pawel.dunaj@nordicsemi.no>
2019-12-18 12:10:19 +01:00
Krzysztof Chruscinski
00156ad80a drivers: clock_control: nrf: Switch to single clock device
Low frequency and high frequency clocks had separate devices
while they are actually handled by single peripheral with single
interrupt. The split was done probably because opaque subsys
argument in the API was used for other purposes and there was
no way to pass the information which clock should be controlled.
Implementation changes some time ago and subsys parameter was
no longer used. It now can be used to indicate which clock should
be controlled.

Change become necessary when nrf5340 is taken into account where
there are more clocks and current approach would lead to create
multiple devices - mess.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-12-17 14:38:19 +01:00
Emil Obalski
27186a8606 drivers: hwinfo: Use HAL for reading deviceID.
Do not refer to registers directly when reading DEVICEID.
Rely on HAL instead.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2019-12-17 09:11:37 +01:00
Emil Obalski
dddc435f80 drivers: hwinfo: Depend HWINFO_NRF on all SoCs
Depend chosing HWINFO_NRF on any nRF device.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2019-12-17 09:11:37 +01:00
Robert Lubos
649ec80c9e net: openthread: Update OpenThread version and better CMake integration
OpenThread recently introduced CMake build system into its repostiory
so we no longer need autotools to build OpenThread libraries and can
integrate them natively.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2019-12-16 11:08:09 +02:00
Andrzej Puzdrowski
073e0b77d6 drivers/flash: remove NRF flash protection emulation
NRF devices hardware has flash protection which doesn't
reflect flash API definition well. So fare protection
mechanism was emulated by the software and the driver deals
with hardware flash protection on its own.
Recent change to protection behavior requirement allows
to remove flash API behavior emulation at all.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-12-15 10:35:09 -05:00
Erwan Gouriou
3a95dda66c drivers/eeprom: stm32: Enables only for L1 series
Setting EEPROM_STM32 with `default y` under `if SOC_FAMILY_STM32`
overrides `depends on SOC_SERIES_STM32L1X` in EEPROM_STM32
definition.
Then, if ever EEPROM is set in any file (as in
tests/drivers/build_all`), EEPROM_STM32 will be indeed set,
with potential issues on series where driver is not yet correctly
handled.

Fix this by removing EEPROM_STM32 definition in STM32 generic
file and set `default y` along with the `depends on` to keep
it effective.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-12-15 10:19:25 -05:00
Maureen Helm
95743561a6 drivers: serial: Use generated dts macros in mcux flexcomm driver
Uses the generated device tree macros, DT_NXP_LPC_USART_USART_*, in the
mcux flexcomm driver and removes the now unused dts fixups from the
lpc54xxx and lpc55xxx socs.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-12-13 18:45:54 +01:00
Maureen Helm
72e0080e56 drivers: serial: Rename lpc usart shim driver
Renames the lpc usart shim driver to more accurately reflect the
flexcomm hardware IP and to prepare for instantiating it on an SoC
outside the LPC family.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-12-13 18:45:54 +01:00
Gerson Fernando Budke
67289d07fe drivers: ieee802154: rf2xx: Add initial driver
Add initial Atmel at86rf2xx transceiver driver. This driver uses device
tree to configure the physical interface. The driver had capability to
use multiple transceiver and systems with multiple bands can be used.
With this, 2.4GHz ISM and Sub-Giga can be used simultaneous.

Below a valid DT example. This samples assume same SPI port with two
transceivers.

&spi0 {
    status = "okay";
    label = "SPI_RF2XX";
    cs-gpios = <&porta 31 0 &porta 30 0>;

    rf2xx@0 {
        compatible = "atmel,rf2xx";
        reg = <0x0>;
        label = "RF2XX_0";
        spi-max-frequency = <7800000>;
        irq-gpios = <&portb 2 0>;
        reset-gpios = <&porta 3 0>;
        slptr-gpios = <&portb 3 0>;
        status = "okay";
    };

    rf2xx@1 {
        compatible = "atmel,rf2xx";
        reg = <0x1>;
        label = "RF2XX_1";
        spi-max-frequency = <7800000>;
        irq-gpios = <&portb 4 0>;
        reset-gpios = <&porta 4 0>;
        slptr-gpios = <&portb 4 0>;
        status = "okay";
    };
};

At the moment driver assume two transceiver are enouth for majority of
appications. Sub-Giga band will be enabled in future.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2019-12-13 11:23:23 +02:00
Jose Alberto Meza
7c25431655 drivers: pwm: xec: Use unique log module identifier for PWM
Use unique log module identifier for PWM to avoid link error.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2019-12-12 11:47:50 -08:00
Kwon Tae-young
69924b19c8 drivers: eeprom: add driver support for EEPROM of STM32L1
Could not find a supported LL with EEPROM.
So I used HAL.

Tested with: 96b_wistrio

Signed-off-by: Kwon Tae-young <tykwon@m2i.co.kr>
2019-12-12 07:57:33 -06:00
Jukka Rissanen
e124c1cd34 eth: mcux: Do not set carrier ON if interface is not known
It is possible that the network interface is not yet initialized
when status of the PHY changes. In this case we must not call
net_eth_carrier_on() as that will cause a crash.
This was noticed with mimxrt1050_evk board.

Fixes: #21257

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-12-12 09:50:29 +02:00
Jose Alberto Meza
9fa30e02f2 drivers: espi: xec: Enable OOB channel by default
Enable ESPI OOB channel by default in XEC driver.
Enable OOB channel transmit interrupt and handle OOB up/down correctly.
Change interrupt clearing, clear low level interrupt bits in subhandlers
and high level interrupt in aggregate handlers at the end.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2019-12-11 13:22:38 -08:00
Jose Alberto Meza
53f2097967 drivers: i2c: xec: Adhere to MCHP I2C spec recomendations
MCHP I2C spec recommends that for repeated start update control register
De-assert ACK in preparation for NACK to end transfer.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2019-12-11 13:21:47 -08:00
Feng Cheng
ee57c8e749 drivers: flash: Add the flash driver of the stm32f1x family
Most of the code is copied from the stm32f0x family
Tested on stm32f103ze soc

Signed-off-by: Feng Cheng <i@fengch.me>
2019-12-11 12:40:33 -06:00
Ulf Magnusson
984bfae831 global: Remove leading/trailing blank lines in files
Remove leading/trailing blank lines in .c, .h, .py, .rst, .yml, and
.yaml files.

Will avoid failures with the new CI test in
https://github.com/zephyrproject-rtos/ci-tools/pull/112, though it only
checks changed files.

Move the 'target-notes' target in boards/xtensa/odroid_go/doc/index.rst
to get rid of the trailing blank line there. It was probably misplaced.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-11 19:17:27 +01:00
Benjamin Valentin
2ffb8dd9f1 usb: sam0: use TRIM registers when available
Newer SoCs like SAME54 provide dedicated registers to store
the USB trim configuration.

Use those registers if they are defined in ASF to access the
calibration data.

Signed-off-by: Benjamin Valentin <benpicco@googlemail.com>
2019-12-11 11:13:24 +01:00
Benjamin Valentin
e0b94e92d5 usb: sam0: Add support for MCLK
On newer sam0 SoCs peripherals are enabled through the MCLK
instead of the PM register.

Use the MCLK register if it's availiable.

Signed-off-by: Benjamin Valentin <benpicco@googlemail.com>
2019-12-11 11:13:24 +01:00
Benjamin Valentin
2ff38cc631 usb: sam0: Support more then one USB IRQ
Newer SoCs like SAME54 have multiple IRQs for the USB peripheral.
Automatically enable all IRQs configured in the DTS.

Signed-off-by: Benjamin Valentin <benpicco@googlemail.com>
2019-12-11 11:13:24 +01:00
Johann Fischer
9a7a1b0132 drivers: usb_dc_nrfx: remove not relevant bashing comments
Remove not relevant bashing comments.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-12-11 11:10:01 +01:00
Johann Fischer
b22035de45 drivers: usb_dc_nrfx: free memory if event is intended to be dropped
Free memory block if event is intended to be dropped.

Resolves: #20953

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-12-11 11:10:01 +01:00
Andrei Emeltchenko
e770c8d855 drivers: ipm: Cleanup IPM Kconfig
Make all option be hidden behind IPM menu

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-12-10 10:26:38 -05:00
Maureen Helm
a63676761b drivers: spi: Add mcux flexcomm driver
Adds a shim layer around the mcux lpc flexcomm driver to adapt it to the
zephyr spi interface. It leverages heavily from the existing mcux dspi
shim driver.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-12-10 08:48:56 -06:00
Maureen Helm
d55d532ebd drivers: spi: Add configs for instances 7 and 8
Adds configs for spi instances 7 and 8.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-12-10 08:48:56 -06:00
Kumar Gala
6561b19bc5 include: Fix use of <crc.h> -> <sys/crc.h>
Fix #include <crc.h> as it has been deprecated and
should be #include <sys/crc.h>.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-12-10 08:39:37 -05:00
Kumar Gala
cd0f8d5c4f include: Fix use of <sys_io.h> -> <sys/sys_io.h>
Fix #include <sys_io.h> as it has been deprecated and
should be #include <sys/sys_io.h>.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-12-10 08:39:37 -05:00
Kumar Gala
530b9a7132 include: Fix use of <i2c.h> -> <drivers/i2c.h>
Fix #include <i2c.h> as it has been deprecated and
should be #include <drivers/i2c.h>.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-12-10 08:39:37 -05:00
Kumar Gala
bb9efbfbd0 include: Fix use of <gpio.h> -> <drivers/gpio.h>
Fix #include <gpio.h> as it has been deprecated and
should be #include <drivers/gpio.h>.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-12-10 08:39:37 -05:00
Kumar Gala
24ae1b1aa7 include: Fix use of <misc/FOO.h> -> <sys/FOO.h>
Fix #include <misc/FOO.h> as misc/FOO.h has been deprecated and
should be #include <sys/FOO.h>.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-12-10 08:39:37 -05:00
Carlo Caione
7baf3f74a9 interrupt_controller: gic: Support PPIs
The GIC-400 driver currently only supports SPIs because the (32) offset
for the INTIDs is hard-coded in the driver. At the driver level there is
no really difference between PPIs and SPIs so we can easily extend the
driver to support PPIs as well.

This is useful if we want to add support for the ARM Generic Timers that
use INTIDs in the PPI range.

SPI interrupts are in the range [0-987]. PPI interrupts are in the range
[0-15].

This commit adds interrupt 'type' cell to the GIC device tree binding
and changes the 'irq' cell to use interrupt type-specific index, rather
than a linear IRQ number.

The 'type'+'irq (index)' combo is automatically fixed up into a linear
IRQ number by the scripts/dts/gen_defines.py script.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2019-12-10 06:59:55 +01:00
Henrik Brix Andersen
132130d17a drivers: i2c: lpspi: add support for the bus idle timeout property
Add support for the bus idle timeout property specified in the device
tree.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-12-09 16:01:38 -06:00
Ulf Magnusson
7c8421c2fd drivers: entropy: rv32m1: Turn pointless 'menuconfig' into 'config'
Same deal as in commit 677f1e6 ("config: Turn pointless/confusing
'menuconfig's into 'config's"), for a newly introduced symbol.

Also clean up a header to be consistent with recent cleanups.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-09 16:39:30 -05:00
Benjamin Valentin
a0d6289289 i2c: sam0: Add support for SAME54
It shares the same peripheral with other sam0 parts while differing
in the clock config.

Signed-off-by: Benjamin Valentin <benpicco@googlemail.com>
2019-12-09 16:37:39 -05:00
Thomas Schmid
9a06428244 sensor: add ms5607 sensor
Implement a driver for the te connectivity ms5607 pressure and
temperature sensor.

Signed-off-by: Thomas Schmid <tom@lfence.de>
2019-12-09 12:22:25 -06:00
Peter Bigot
647062adcd drivers: clock_control: nrf_power_clock: use unsigned reference count
The implementation did not account for the incrementing the reference
count past the maximum positive value.  Doing so on a signed integer
results in undefined behavior.  Switch to an unsigned integer where
such an increment results in a zero count, and add an assert that this
has not happened.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-12-09 12:54:06 -05:00
Krzysztof Chruscinski
a124f29032 drivers: clock_control: nrf: Add protection to getting item from list
When items were removed from the list there was not lock which may
lead to race condition and list corruption. Extracted list handling
into external function.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-12-09 12:54:06 -05:00
Krzysztof Chruscinski
aada984132 drivers: clock_control: nrf: Fix race condition in clock start
If clock started immediately after requesting then request was
not yet placed in the list and user callback was not called.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-12-09 12:54:06 -05:00
Emil Obalski
c1f5e11bb6 usb: Cleanup for multiplied defines
Some of defines are present in several header files.
Those defines are the same with value but with different naming.

Common defines are brought to usb_common.h

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2019-12-09 12:48:13 -05:00
Robert Lubos
44c947ec3e drivers: ieee802154_kw41z: Create a fake ACK frame for upper layers
Upper layers like OpenThread expect the radio driver to forward ACK
frame received by the radio.
Simulate this behavior on kw41z by recreating the ACK frame from the
available data.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2019-12-09 12:47:45 -05:00
Robert Lubos
2624d65b60 drivers: ieee802154_nrf5: Add ACK handling
nRF5 driver did not utilize `ieee802154_radio_handle_ack` API, therefore
did not provide ACK frames to the upper layer. This commit fixes this
problem.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2019-12-09 12:47:45 -05:00
Olof Kindgren
754d56891e drivers: interrupt_controller: Add SweRV PIC support
Add support for the built-in Programmable Interrupt Controller
found in the SweRV EH1 RISC-V CPU

Signed-off-by: Olof Kindgren <olof.kindgren@gmail.com>
2019-12-09 12:46:56 -05:00
Jan Van Winkel
cba129ae96 drivers/flash: Removed native posix flash driver
Removed native posix flash driver as functionality is merged with flash
simulator driver.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2019-12-09 11:56:21 -05:00
Jan Van Winkel
8cd4a817d9 drivers/flash/flash_simulator: Added file back end for posix arch
Extended flash simulator for posix architecture to read/write data
from a binary file on the host file system.

Further enable the flash simulator by default on native_posix(_64)
boards and updated the documentation accordingly.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2019-12-09 11:56:21 -05:00
Daniel Leung
01c03a27d7 counter: mchp_xec: update driver for counter tests
The counter driver tests have been updated so the driver needs
to be updated too.

() Test expects a free running counter.
() Test expects any alarms cannot be set beyond the top value.
() Also, the counter only triggers interrupts when counter reaches
   zero (as configured as counting down), it can be do relative
   alarms. So return -ENOTSUP when absolute alarms are requested.
() The test expects the callback to be removed once alarm is
   triggered. Implement this too.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-12-09 11:53:21 -05:00
Carlo Caione
ea9b2086c7 interrupt_controller: shared_irq: DT_<COMPAT> is deprecated
Switch to the new DT_INST.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2019-12-09 09:49:12 -06:00
Martin Jaeger
5441016f66 drivers: pinmux: stm32l0: More I2C pinmuxes added
Based on alternate functions table in STM32L073 datasheet

Signed-off-by: Martin Jaeger <17674105+martinjaeger@users.noreply.github.com>
2019-12-09 09:48:23 -06:00
Song Qiang
65c1d764bb drivers: dma: stm32: add missing assignment for fifo threshold
Fixes #20490.

Signed-off-by: Song Qiang <songqiang1304521@gmail.com>
2019-12-09 09:42:24 -06:00
Song Qiang
40962a81e7 drivers: dma: stm32: add missing fifo operation
The DMA driver of stm32 used to use `stm32_dma_enable_fifo()`,
which is located in dma_stm32_v1.c to set DMDIS bit, enable
interrupt generation and set FIFO threshold. Now since FIFO
threshold is initialized with `stm32_dma_get_fifo_threshold()`
and interrupt generation is also configured in dma_stm32.c, this
function will only have one job, to configure FIFO mode.
We can add FIFO mode operation in dma_stm32.c directly and
remove it from dma_stm32_v1.c.

Signed-off-by: Song Qiang <songqiang1304521@gmail.com>
2019-12-09 09:42:02 -06:00
Ioannis Konstantelias
226d71a9c2 drivers: watchdog: Fix callback call on STM32 WWDG enable
When using the EWIF it is a good idea to clear it before enabling the
watchdog. Otherwise, the watchdog callback will be called upon watchdog
enable if EWIF is enabled. This patch fixes this case.

Signed-off-by: Ioannis Konstantelias <ikonstadel@gmail.com>
2019-12-09 16:36:12 +01:00
Ulf Magnusson
87e917a925 kconfig: Remove redundant 'default n' and 'prompt' properties
Bool symbols implicitly default to 'n'.

A 'default n' can make sense e.g. in a Kconfig.defconfig file, if you
want to override a 'default y' on the base definition of the symbol. It
isn't used like that on any of these symbols though.

Also replace some

    config
    	prompt "foo"
    	bool/int

with the more common shorthand

    config
    	bool/int "foo"

See the 'Style recommendations and shorthands' section in
https://docs.zephyrproject.org/latest/guides/kconfig/index.html.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-09 16:14:50 +01:00
Andrzej Głąbek
69c75c7267 drivers: spi: nrfx: Move MISO lines pull configuration to DT
After switching to nrfx 2.0.0, the Kconfig choice options that allowed
enabling of pull-up or pull-down for MISO lines in SPIs and SPIMs are
not properly supported, they are simply ignored. This commit restores
the possibility of applying pull configuration for MISO lines.

In earlier nrfx versions, the MISO pull configuration could be only
set globally, in nrfx_config files, for all SPI and SPIM instances
together. Since nrfx 2.0.0, this configuration can be applied per
instance. This commit takes advantage of this possibility and instead
of using a common Kconfig option as a global setting for all instances,
allows applying individual instance settings via devicetree.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-12-09 16:08:39 +01:00
Josh Gao
2717b28b0f usb: usb_dc_native_posix: fix control transfers with data.
Previously, if a control transfer had data, it would be unhandled and
left in the usbip socket to be interpreted as the next usbip packet,
leading to explosions.

Signed-off-by: Josh Gao <josh@jmgao.dev>
2019-12-09 16:08:27 +01:00
Andrzej Głąbek
377002d4b5 drivers: spi_nrfx_spim: Fix handling of extended SPIM configuration (2)
This is a follow-up to commit 84f8235005.

Default initialization to 0 of the .dcx_pin field in the extended part
of the SPIM configuration is incorrect, because this means that pin 0
should be used as the D/CX line. For the SPIM instance that provides
the extended functionality, this results in undesired assignment of
the pin 0, and for the other SPIM instances, this causes that their
initialization fails with the NRFX_ERROR_NOT_SUPPORTED code.

This commit sets this field to NRFX_SPIM_PIN_NOT_USED, to indicate that
the D/CX line is not supposed to be used.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-12-09 16:07:55 +01:00
ZhongYao Luo
6412c070eb bluetooth: h5: sending priority events through bt_recv_pri
By default all events are processed through bt_recv, which results
in lost events and subsys/bluetooth/hci_core.c:hci_event function
assertions fail to pass

Signed-off-by: ZhongYao Luo <LuoZhongYao@gmail.com>
2019-12-09 17:04:24 +02:00
ZhongYao Luo
994246f7c6 bluetooth: h5: Handling the the zero length ack packet
If H5_HDR_LEN is equal to zero, remaining will grow
negatively, the commit fixes the problem.

Signed-off-by: ZhongYao Luo <LuoZhongYao@gmail.com>
2019-12-09 17:04:24 +02:00
ZhongYao Luo
5758a9e1c6 bluetooth: h5: Fix memory access error
According to the context information, the processing of
net_buf_add_u8 within the get_evt_buf function is
redundant and incorrect.

Signed-off-by: ZhongYao Luo <LuoZhongYao@gmail.com>
2019-12-09 17:04:24 +02:00
Anas Nashif
23bdddea0c Revert "interrupt_controller: ioapic_intr: revert CPU target change"
This reverts commit 005aff7743.

Sporadic failures in Qemu X86_64

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-12-03 20:34:47 -06:00
Daniel Leung
005aff7743 interrupt_controller: ioapic_intr: revert CPU target change
Commit 5a9a33b0cf changes interrupt
destination in an attempt to broadcast interrupts. However, this
change causes interrupts to stop working on the UP Squared board
in non-SMP configuration. According to QEMU source code,
physical destination address 0xFF000000 is a special case where
it broadcasts the interrupts. However, none of the IOAPIC
documentation (that I can find) describes this behavior. So,
revert that commit.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-12-03 16:55:06 -06:00
Tomasz Bursztyka
c9e0876421 drivers/pwm: Fix abs() usage in xec driver
Seems to be fine to temporarly cast to int there as frequencies are in
Mhz and not Ghz.

Fixes #20497
Coverity CID: 205638

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-12-03 13:34:19 -05:00
Andrzej Głąbek
84f8235005 drivers: spi_nrfx_spim: Fix handling of extended SPIM configuration
Fill the `rx_delay` field in the SPIM configuration structure only when
the RXDELAY feature is present in a given SPIM instance, to prevent
compilation errors when some other SPIM instance is enabled together
with SPIM3.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-12-03 12:26:12 -06:00
Anas Nashif
d0aa6fc212 drivers: kscan_mchp_xec: fix memory corruption
Fixes memory corruption (Out-of-bounds write ) case discovered by
coverity.

Fixes #20494
Coverity CID: 205617

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-12-02 15:46:11 -06:00
Patrik Flykt
12f381888f drivers: modem: Document UART device name
Document that the third argument is the UART device name.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2019-12-02 15:34:45 +01:00
Peter Bigot
fd5b502b64 drivers: timer: nrf_rtc_timer: avoid starving clock announcements
When setting a timeout measure the number of accumulated unannounced
ticks.  If this value exceeds half the 24-bit cycle counter range
force an announcement so the unannounced cycles are incorporated into
the system tick counter.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-12-02 15:28:12 +01:00
Andrei Emeltchenko
105e0997f2 usb: usb_dc_native_posix: Refactor similar code to function
Use skip_setup() function helper in a place we need to skip setup
data.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-11-29 07:54:14 -05:00
Andrei Emeltchenko
0957f4978c usb: usb_dc_native_posix: Use return code for skip_setup()
Use return code for usbip_skip_setup()

Fixes #20840

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-11-29 07:54:14 -05:00
Andrei Emeltchenko
80dbcfa306 usb: usb_dc_native_posix: Check return code in handle_usb_data()
Fixes coverity complaints dealing with send()

Fixes #20839
Fixes #20841

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-11-29 07:54:14 -05:00
Andrei Emeltchenko
1d81c0cf31 usb: usb_dc_native_posix: Fix buffer and max data 0 case
When both buffer and max data to read are zero return
the available data in buffer.

Fixes #20838

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-11-29 07:54:14 -05:00
Andrei Emeltchenko
5b22c88184 usb: usb_dc_native_posix: Check return values in dc_write()
Fixes coverity issue:

Fixes #20836
Fixes #20837

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-11-29 07:54:14 -05:00
Andrei Emeltchenko
959b833f91 usb: usb_dc_native_posix_adapt: Check correct size
Fixes Coverity issues

Fixes #20842

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-11-29 07:54:14 -05:00
Mieszko Mierunski
b7ae41779d drivers: nrf: Add CTS and RTS pins to UART and UARTE PM
Add gpio management for CTS and RTS pins in UART and UARTE drivers

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2019-11-29 09:04:55 +01:00
Peter Bigot
ccfdc3c34b drivers: nrf_clock_calibration: wait for sensor initialization
When using the RC clock source a periodic calibration is invoked that
involves reading from the die temperature sensor.  The code did not
protect against execution order that caused the periodic calibration
to be invoked before the temperature sensor was initialized.

Update the temperature sensor to detect that it has not been
initialized and so should reject attempts to fetch a reading.

Update the calibration code to do nothing when temperature reading
fails.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-11-28 14:21:49 -05:00
Andrei Gansari
6d1e10635d drivers: flash_handlers fixes stray semicolon
z_vrfy_flash_get_page_count defined as a function prototype in place of
a real function due to a stray semicolon.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2019-11-28 13:39:00 -05:00
Daniel Leung
12948fdf37 counter: mchp_xec: fix logical/bit-wise AND
Coverity discovered that a logical AND was used in place of
a bit-wise AND. So fix it.

Fixes #20489

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-11-28 07:14:02 -05:00
Kamil Piszczek
362f2299cd drivers: bluetooth: hci: rpmsg: fix handling of hci events
Fixed handling of HCI events in the HCI driver over RPMsg. Now,
the driver makes use of discardable buffer pool when allocating
memory for certain HCI event types (e.g. Advertising Report Event).
Applications that are flooded with Advertising Reports will run
much better after this change (e.g. Mesh applications).

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2019-11-28 10:55:32 +02:00
Daniel Leung
ceb2303dd0 pwm: pwm_mchp_xec: fix potential out of bound access
Fix an issue discovered by Coverity where there is a potential
out of bound access on the divisor arrays.

Fixes #20495
Fixes #20496

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-11-27 13:00:13 -05:00
Andy Ross
5f63c9d907 drivers/timer: Clamp after tick adjustment, not before
Some early tickless drivers had a common pattern where they would
compute a tick maximum for the request (i.e. the maximum the hardware
counter can handle) but apply it only on the input tick value and not
on the adjusted final value, opening up the overflow condition it was
supposed to have prevented.

Fixes #20939 (Strictly it fixes the specific pattern that was
discovered in that bug.  It's not impossible that other drivers with
alternative implementations have a similar issue, though they look OK
to me via a quick audit).

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-11-27 18:43:53 +01:00
Marcin Szymczyk
57f7801bc4 drivers: ipm: nrfx: add event_index assertion
event_index must be lower than NRFX_IPC_ID_MAX_VALUE.
As of now, maximum index is 16.

Fixes #20962, #20964, #20967

Signed-off-by: Marcin Szymczyk <marcin.szymczyk@nordicsemi.no>
2019-11-27 12:14:22 -05:00
Ioannis Glaropoulos
ea2324dd2a drivers: timer: SysTick: enforce proper min & max SysTick LOAD values
Similar to what we do in other timer drivers, the maximum ticks
supplied in z_clock_set_timeout(..) needs to be MAX_TICKS at
maximum, when K_FOREVER is supplied as argument to the function.

In addition to that, the value we load onto the SysTick LOAD
register shall be truncated to MAX_CYCLES. This is required
to prevent loading a trash value to LOAD register, as only
the lowest 24 bits may be safely written.

Finally, we move the enforcement of the minimum delay to be
programmed on LOAD (i.e. MIN_DELAY) at the end step of the
calculation of the cycles-to-be-programmed. This prevents
from misscalculating the delay, as any required adjustment
is applied at the end, after the delay is rounded up to
the next tick boundary.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-11-26 13:34:30 -06:00
Peter Bigot
3594f136d7 drivers: systick: avoid starving clock announcements
When setting a timeout measure the number of accumulated unannounced
ticks.  If this value exceeds half the 32-bit cycle counter range
force an announcement so the unannounced cycles are incorporated into
the system tick counter.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-11-26 13:34:30 -06:00
Ioannis Glaropoulos
b3574bdad7 drivers: systick: fix calculation of absolute cycles count in ISR
The commit fixes the update of the absolute counter of HW cycles
in the SysTick ISR for TICKLESS mode.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-11-26 13:34:30 -06:00
Peter Bigot
f16a403e64 drivers: timer: SysTick: rework late overflow check
The previous solution depended on a magic number and was inefficient
(entered the second-wrap conditional even when a second wrap hadn't
been observed).  Replace with an algorithm that is deterministic.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-11-26 13:34:30 -06:00
Ioannis Glaropoulos
f7aa227c07 drivers: timer: SysTick: document internal function and variables
Add detailed documentation for the internal 'elapsed()'
function, as well as for the local counter variables used
in the SysTick driver.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-11-26 13:34:30 -06:00
Ioannis Glaropoulos
35886463dd drivers: timer: SysTick: remove unnecessary masking
Unsupported bits of the Current Value Register
are read as zero, so we remove the redundant
ANDing with the max supported counter value.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-11-26 13:34:30 -06:00
Peter Bigot
4592ac8ca4 drivers: timer: nrf_rtc_timer: fix lost ticks from unannounced elapsed
The original code assumed that limiting the tick count to the maximum
cycle value representable without wrapping would guarantee that adding
the resulting cycle offset to last_count would not lap the counter.
This is not true when elapsed time, which is also added to the cycle
offset, exceeds one tick.  Cap the maximum offset at the number of
cycles corresponding to the maximum number of ticks without wrapping.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-11-26 08:23:50 -05:00
Mieszko Mierunski
21e0d48750 drivers: nrf: Fix UART and UARTE hanging on RX errors
Add clearing error event to UART and UARTE drivers.
Without it driver goes into infinite interrupt loop.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2019-11-26 09:01:22 +01:00
Johann Fischer
dfe57ca9e1 drivers: amg88xx: check i2c write return value
Check i2c write return value.

Fixes: #20498
Coverity-CID: 205628

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-11-21 07:48:35 -06:00
Andrzej Puzdrowski
dbe56337a0 drivers/flash: nRF driver uses relative addresses
So fare all nRF flash memories had flash base address at 0.
nRF flash driver was implemented in such way that it
really used absolute addresses, while convention are relative
addresses (for flash_map as well), which was not visible as start
address offset was 0.
It will become visible on nRF53 which has networking flash
with non-zero base address.

This patch switch nRF flash driver to use relative addresses for flash.
UICR absolute addressing is kept.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-11-21 13:35:28 +01:00
Johann Fischer
d4ba8fff66 drivers: usb_dc_stm32: do not restrict out stage transfers to one MPS
Do not restrict control out stage transfers to one MPS.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-11-21 11:33:41 +01:00
Francisco Munoz
377aa876a3 drivers: ps2: Compile out PS/2 in terms of an eSPI peripheral
Add the possibility to compile out the PS/2 driver if
the application is not using the KBC 8042 peripheral. This
helps to remove warnings for unused PS/2 isr function

Signed-off-by: Francisco Munoz <francisco.munoz.ruiz@intel.com>
2019-11-20 15:02:08 -05:00
Francisco Munoz
66baf7f38d drivers: espi: Implement peripheral api in the driver
Initial implementation of the keyboard controller peripheral
in the eSPI driver. This allows to communicate ps2 and kscan
data between EC and Host

Signed-off-by: Francisco Munoz <francisco.munoz.ruiz@intel.com>
2019-11-20 15:02:08 -05:00
Francisco Munoz
4538ddaea3 drivers: espi: Kconfig cosmetic changes
Several cosmetic changes applied to the Kconfig for ESPI driver

Signed-off-by: Francisco Munoz <francisco.munoz.ruiz@intel.com>
2019-11-20 15:02:08 -05:00
Kamil Piszczek
83107e5ffd drivers: bluetooth: hci: driver based on RPMsg transport
This commit contributes an RPMsg-based transport for BLE HCI.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2019-11-20 19:29:06 +01:00
Johan Hedberg
d67416321e Bluetooth: hci_raw: Add support for specifying buffer headroom
The HCI transport implemented by an application using the HCI raw
interface may have its own buffer headroom requirements. Currently the
available headroom gets completely determined by the selected HCI
driver. E.g. most of the time this is the native controller driver
which doesn't reserve any headroom at all.

To cover for the needs of HCI raw users, add a new Kconfig variable
for the apps to set to whatever they need. Correspondingly, use the
maximum of the HCI driver and HCI raw headroom requirements for the
buffer pool definitions and the headroom initializations.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-11-20 19:29:06 +01:00
Karol Lasończyk
434c3cb22c drivers: ipm: add nRFx IPM driver
This commit contributes the nRFx IPM driver.

Signed-off-by: Karol Lasończyk <karol.lasonczyk@nordicsemi.no>
2019-11-20 19:29:06 +01:00
Wentong Wu
aa37522fe3 spi: fix spell typo in spi handler
fix spell typo in spi handler.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
2019-11-20 09:56:53 -08:00
Wentong Wu
b82e202988 spi: pass correct buffer to spi driver given NULL to spi_transceive
When pass NULL to spi_transceive with user space enabled, stack buffer
is still passed to spi driver and it will cause kinds of problems like
MPU fault, so change it to pass relevant NULL pointers in the actual
transceive call.

Fixes: #20811.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
2019-11-20 09:56:53 -08:00
Johann Fischer
324938b5b2 drivers: eth_enc424j600: check received frame length
Check received frame length.

Fixes: #20493
Coverity-CID: 205668

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-11-20 17:00:38 +01:00
Ulf Magnusson
d0a6f682d1 kconfig: Fix up newly-introduced copy-pasted headers
Same deal as in https://github.com/zephyrproject-rtos/zephyr/pull/20280,
for newly-introduced stuff.

Will avoid failures with the new CI test in
https://github.com/zephyrproject-rtos/ci-tools/pull/112, though it only
checks changed files.

Also fix some un-indented properties on choices. Choice properties work
the same as symbol properties syntactically.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-11-19 15:25:08 -05:00
Piotr Mienkowski
8f0aa32ad5 soc: gecko: Enable SWO output during SoC initialization
Enable SWO debug output during system initialization and not as part of
GPIO driver initialization. After the modification the logger output
becomes available earlier during the boot process. Also, it's not
necessary anymore to build full GPIO driver only to enable SWO. This may
be critical when building small images.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2019-11-19 13:56:06 -05:00
Peter A. Bigot
825aab3c28 drivers: i2c_sifive: fix deprecation warnings
The init macro used outdated spellings for the instance-specific
properties, resulting in build warnings when I2C was enabled.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-11-19 13:55:27 -05:00
Francois Ramu
d3ffa8d089 driver: serial: Error handling issues in uart_stm32_set_baudrate
This patch tests the return code when calling clock_control_get_rate
and completes the issue #20503 seen on watchdog
[Coverity CID :205655]

Fixes #20503

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2019-11-18 09:18:13 -06:00
Francois Ramu
458a8a0a41 driver: pwm: Error handling issues in pwm_stm32_get_cycles_per_sec
This patch tests the return code when calling clock_control_get_rate
and completes the issue  #20503 seen on watchdog
[Coverity CID :205655]

Fixes #20503

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2019-11-18 09:18:13 -06:00
Francois Ramu
a0bd434fa5 driver: spi: Error handling issues in spi_stm32_configure
This patch tests the return code when calling clock_control_get_rate
and completes the issue  #20503 seen on watchdog
[Coverity CID :205655]

Fixes #20503

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2019-11-18 09:18:13 -06:00
Francois Ramu
fe28447cdf driver: i2c: Error handling issues in i2c_stm32_runtime_configure
This patch tests the return code when calling clock_control_get_rate
and completes the issue  #20503 seen on watchdog
[Coverity CID :205655]

Fixes #20503

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2019-11-18 09:18:13 -06:00
Francois Ramu
fc06346a77 driver: watchdog: Error handling issues in wdt_wwdg_stm32.c #20503
This patch tests the return code when calling clock_control_get_rate
[Coverity CID :205655]

Fixes #20503

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2019-11-18 09:18:13 -06:00
Jan Tore Guggedal
8134001148 drivers: sensor: bme680: Use DBG log level for non-error
Use LOG_DBG instead of LOG_ERR when BME680 chip is detected
and its ID verified successfully.

Signed-off-by: Jan Tore Guggedal <jantore.guggedal@nordicsemi.no>
2019-11-15 16:00:46 -05:00
Loic Poulain
14a5fcdb35 video: mt9m114: Fix integer handling issues
Fix 32-bit endian conversion.

CID: 205643

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2019-11-15 10:11:05 +01:00
Krzysztof Chruscinski
7c5a2d6d22 drivers: clock_control: Fix Coverity issue in nrf_clock_calibration
Fix issue reported by Coverity.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-11-14 19:14:07 -05:00
Peter Bigot
83b2bb614b drivers: sensor: mcp9808: clean up I2C API usage
The i2c_msg API details do not work correctly with Nordic TWI.  Switch
to the higher-level and simpler API for register read and write.  Also
add a tree configuration on a Nordic-based board.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-11-13 15:16:54 -06:00
Mieszko Mierunski
117bc6dfa4 drivers: nrf: Fix values in UARTE async API callback.
There is possibility that endrx interrupt will be triggered in the
middle of timer interrupt responsible for UARTE timeout, this
patch handles this case.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2019-11-13 15:09:12 -06:00
Marcin Niestroj
44841646a1 sensors: lis2dh: use proper scale factor for lsm303agr
LSM303AGR is a special one in terms of raw value scale among all devices
supported by lis2dh.c driver. Apply proper scale factor based on
sensitivity scale provided in LIS2DH and LSM303AGR datasheets.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2019-11-13 14:43:25 -06:00
Marcin Niestroj
59648bd1a5 sensors: lis2dh: fix raw value scaling
All values were scaled by 8 instead of 12 for 16g compile-time selected
range. This resulted with values around 6.5 m/s^2. Scaling for runtime
configurable ranges was broken for all except 2g range option due to
totally broken lis2dh_range_to_reg_val().

Fix wrong scaling for 16g compile-time and all runtime selectable ranges
by reworking code that scales raw value. While doing this, change
lis2dh->scale type from 16 to 32 bits. This allows to slightly increase
final result precision by using the fact that raw values have maximum 12
bits precision, allowing us to multiply lis2dh->scale by (1 << 4)
compared to previous implementation.

Fix bug #19872.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2019-11-13 14:43:25 -06:00
Marcin Niestroj
27b2914da2 sensors: lis2dh: fix raw value to sensor_value conversion
According to struct sensor_value documentation, val2 should be negative
for negative result. So drop code that tries to make val2 positive.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2019-11-13 14:43:25 -06:00
Wayne Ren
66856e5478 drivers: timer: fix the bug for SMP
* fix the smp timer dirver bugs found in debug and test.
for smp case, GFRC is used as clock source, and local
internal timer is used to trigger time event.

* because 64-bits gfrc is used, so idle can be igored as no kernel
tick will be missed

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2019-11-13 12:04:18 -08:00
Christian Taedcke
5ddc46e477 gpio: silabs gecko: Add support for more ports
The gecko gpio driver can now utilize ports a to k.

Signed-off-by: Christian Taedcke <hacking@taedcke.com>
2019-11-13 12:05:48 -06:00
Christian Taedcke
0ae98c1caf gpio: silabs gecko: Use macro for port initialization
This removes a lot of copy-and-paste.

Signed-off-by: Christian Taedcke <hacking@taedcke.com>
2019-11-13 12:05:48 -06:00
Marcin Niestroj
dfda0cb114 gpio: stm32: support disabling and reenabling interrupts on gpio pin
Up to now interrupts could be only configured once, with no way to
disable them in runtime.

Allow interrupts to be disabled in runtime and then properly reenabled
on user request. This allows to ignore interrupts when software is not
expecting them.

The improvement over previously reverted patch [1] is that we disable
interrupts only when we configure port for which interrupt line was
previously selected. This for example prevents to disable interrupts
line 2 in case PA2 was previously configured as interrupt source, but we
are currently configuring PB2 as output.

[1] 0951ce2d34 ("gpio: stm32: support disabling and reenabling
  interrupts on pin")

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2019-11-13 12:05:48 -06:00
Marcin Niestroj
7edcbedc70 gpio: stm32: split helper functions from gpio_stm32_enable_int()
This patch doesn't change functionality, but is only related to improved
readability and reusability.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2019-11-13 12:05:48 -06:00
Marcin Niestroj
09a57a5e81 gpio: stm32: statify gpio_stm32_enable_int()
This allows compiler to inline function body and reduce overall code
size.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2019-11-13 12:05:48 -06:00
Erwan Gouriou
dd0d567e8b drivers/gpio: stm32: Rework configure function exit for dual core
With dual core handling introduction, we now need to take care to
always release lock before exiting function.
Rework gpio_stm32_config to take this into account.
Additionally, since ENOSYS usage is resevred to system calls
handling, replace with EIO.


Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-11-13 12:05:48 -06:00
Emil Obalski
6c82c80a3c drivers: Add support for nRF52833 in several drivers
By adding new SoC to Zephyr drivers has to be updated.
Commit affects:
 - USB driver
	- support for nRF52833 added.
	- support for USB_DEVICE_REMOTE_WAKEUP in hid-mouse added.
 - SPI
 - IEEE 802.15.4
 - CLOCK CONTROL

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2019-11-13 10:33:38 -06:00
Francois Ramu
80d58e7f39 driver: timer: st_stm32: add lptimer management to stm32wb series
This patch introduces the support of the LowPower Timer
     for the STM32WBxx from STMicroelectronics.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2019-11-13 10:31:06 -06:00
Alexander Wachter
c180e059bf soc: stm32f103Xb: Enable CAN support for this SoC
This commit enables CAN on the STM32F103Xb SoC series.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-11-13 10:30:19 -06:00
Armando Visconti
fdf809d21c driver/sensor: lsm6dso: Fix unchecked return value
Cast to (void) the lsm6dso_mem_bank_set() calls as we
are not interested to the return value.

Coverity-CID: 205625

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-11-12 18:10:07 +01:00
Yannis Damigos
732b815f4b i2c_ll_stm32: Allow to send zero length message
Some applications, like i2c_scanner, require to
send zero length messages.

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2019-11-12 16:58:00 +01:00
Francois Ramu
f9a3007029 driver: watchdog: Incorrect expression in wdt_wwdg_stm32.c #20504
[Coverity CID :205661]

Fixes #20504

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2019-11-12 15:10:34 +01:00
Peter A. Bigot
7dca60dfcb drivers: gpio: fix sifive interrupt management
The translation to encoded multi-level interrupts failed to account
for the GPIO interrupt number being encoded in at bit position 8,
and being offset by 1 in the base encoding.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-11-12 07:08:18 -06:00
Vincent Wan
0297756342 drivers: i2c: use CPU clock frequency in configuration on CC13XX/CC26XX
The I2C peripheral should be configured using the CPU clock frequency
and not the system clock frequency. This used to be fine because they
were the same before #19232, but now that the system clock is
RTC-based (which has a different frequency), we can no longer make
that assumption.

Fixes #20480

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-11-11 08:19:28 -06:00
Peter A. Bigot
2d4d6f05e6 drivers: spi_nor: improve documentation and validation on flash layout size
The smallest region that can be erashed is one sector, so setting
SPI_NOR_FLASH_LAYOUT_PAGE_SIZE=2048 will fail at runtime when the
flash page API is used to erase a single (or misaligned) page.  Add a
compile-time check that the requested layout page size is erasable.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-11-09 15:26:06 +01:00
Peter A. Bigot
98a344fe21 drivers: spi_nor: support deep-power-down mode
Add internal API to enter and exit deep power-down mode.  Add Kconfig
option to return to DPD whenever device is not active.

When device power management becomes more mature it should be possible
to implement it, which would allow use of DPD without having to enter
and exit DPD between consecutive transactions.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-11-09 15:26:06 +01:00
Peter A. Bigot
c2e9441ad5 drivers: spi_nor: refactor device mutex management
Convert the LOCK/UNLOCK macros to acquire/release functions in
preparation for extending those steps to include power management.

Also commit to always allocating a semophore, and use a more clean
way of conditionalizing the operations.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-11-09 15:26:06 +01:00
Peter A. Bigot
e4c3729ba7 drivers: spi_nor: generalize support for ULBPR instruction
Replace the hard-coded check for JEDEC IDs with a property that must
be set in the devicetree entry.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-11-09 15:26:06 +01:00
Peter Bigot
80faac41bc coccinelle: update int literal to timeout
Re-run the int_literal_to_timeout script to update calls introduced
since the last cleanup.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-11-08 19:30:42 -05:00
Ioannis Glaropoulos
5556908160 drivers: entropy: set default RNG priority for nRF5340
For nRF5340, set the range and the default IRQ level
for the RNG interrupt.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-11-08 19:26:35 +01:00
Kevin Townsend
740f6868a5 sensor: hmc5883l: convert to device tree
This commit converts the existing hcm5883l 3-axis magnetometer
driver to use device tree for the I2C and GPIO selection.

It also adds a basic sample application for this sensor, using the
frdm-k64f development board to demonstrate how the interrupt
GPIO pin and I2C bus can be selected.

Signed-off-by: Kevin Townsend <kevin@ktownsend.com>
2019-11-08 12:12:38 -06:00
Henrik Brix Andersen
30fc72a50e drivers: flash: native_posix: remove unused mutex
Remove unused mutex in the flash_native_posix driver.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-11-08 18:59:02 +01:00
Francois Ramu
0ae7023405 driver: timer: st_stm32: add lptimer management to stm32xx series
This patch introduces the support of the LowPower Timer
 for the STM32xx from STMicroelectronics.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2019-11-08 10:04:21 -06:00
David Leach
d36b1b11f7 boards: riscv: rv32m1: enable BT related configuration
Specific SW defined BLE LL parameters need to be set
if the user enables it on this platform. As such, conditionally
enable them directly into the defconfig.

INTMUX CH2 and CH3 are not available to be used if BT support
is enabled on Vega, because they are used internally by the
BLE SW LL

Signed-off-by: David Leach <david.leach@nxp.com>
2019-11-08 15:38:57 +01:00
David Leach
d65ddcd7d3 boards: riscv: rv32m1: use xoroshiro as default RNG
Don't use use the RV32M1 TRNG as a random source since it can
be  quite slow. Instead, use the software implemented xoroshiro
RNG.

Signed-off-by: David Leach <david.leach@nxp.com>
2019-11-08 15:38:57 +01:00
George Stefan
cb03eba697 drivers: entropy: add openisa/RV32M1 entropy driver
Wrapper for openisa/RV32M1 TRNG driver

Signed-off-by: George Stefan <george.stefan@nxp.com>
2019-11-08 15:38:57 +01:00
Andrzej Głąbek
b1d5eed262 drivers: nrfx: Update implementations after switching to nrfx 2.0.0
Update calls to nrfx HAL functions to reflect API changes introduced in
nrfx 2.0.0. All these functions are now called with the first parameter
pointing to the structure of registers of the relevant peripheral.
Also a few functions got renamed:
- nrf_gpiote_int_is_enabled to nrf_gpiote_int_enable_check
- nrf_gpiote_event_is_set to nrf_gpiote_event_check
- nrf_rng_event_get to nrf_rng_event_check
- nrf_rng_int_get to nrf_rng_int_enable_check
- nrf_rtc_event_pending to nrf_rtc_event_check
- nrf_rtc_int_is_enabled to nrf_rtc_int_enable_check
- nrf_timer_cc_read to nrf_timer_cc_get
- nrf_timer_cc_write to nrf_timer_cc_set

Default configuration values were removed from nrfx_config files,
so the drivers pwm_nrfx and spi_nrfx_spis no longer can use those.

Function nrfx_pwm_init() now takes one more parameter - context pointer
that is passed to the event handler, not used in the pwm_nrfx driver.

HALs for UART and UARTE now allow configuration of the parity type
and the number of stop bits, for SoCs that provide the corresponding
registers.

Signed-off-by: Karol Lasończyk <karol.lasonczyk@nordicsemi.no>
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-11-08 14:54:12 +01:00
Karol Lasończyk
ec2a401bf3 drivers: wdt_nrfx: Add multi-instance support
Update the driver to support multiple watchdog instances
and add the corresponding Kconfig options.

Signed-off-by: Karol Lasończyk <karol.lasonczyk@nordicsemi.no>
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-11-08 14:54:12 +01:00
Kumar Gala
36c94ddd36 sensor: bmc150_magn: Convert to DTS
Convert bmc150_magn sensor driver to utilize device tree.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-11-08 07:44:54 -06:00
Kumar Gala
62f5ac1ad4 sensor: bmg160: Convert to DTS
Convert bmg160 sensor driver and sample app to utilize device tree.

Introduce a dts board overlay on the frdm_k64f board to ensure we at
least have a single platform in which the sample gets built.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-11-08 07:44:54 -06:00
Kumar Gala
7b8b5524be sensor: bmm150: Convert to DTS
Convert bmm150 sensor driver and sample app to utilize device tree.

Introduce a dts board overlay on the frdm_k64f board to ensure we at
least have a single platform in which the sample gets built.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-11-08 07:44:54 -06:00
Kumar Gala
3700a46632 sensor: hp206c: Convert to DTS
Convert hp206c sensor driver to utilize device tree.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-11-08 07:44:54 -06:00
Kumar Gala
c2aa25b358 sensor: isl29035: Convert to DTS
Convert isl29035 sensor driver to utilize device tree.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-11-08 07:44:54 -06:00
Kumar Gala
ddddbf9f84 sensor: max44009: Convert to DTS
Convert max44009 sensor driver and sample app to utilize device tree.

Introduce a dts board overlay on the frdm_k64f board to ensure we at
least have a single platform in which the sample gets built.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-11-08 07:44:54 -06:00
Kumar Gala
30ea840eb1 sensor: mcp9808: Convert to DTS
Convert mcp9808 sensor driver and sample app to utilize device tree.

Introduce a dts board overlay on the frdm_k64f board to ensure we at
least have a single platform in which the sample gets built.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-11-08 07:44:54 -06:00
Kumar Gala
03c7cb4f46 sensor: sx9500: Convert to DTS
Convert sx9500 sensor driver and sample app to utilize device tree.

Introduce a dts board overlay on the frdm_k64f board to ensure we at
least have a single platform in which the sample gets built.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-11-08 07:44:54 -06:00
Kumar Gala
c7fae66952 sensor: tmp007: Convert to DTS
Convert tmp007 sensor driver to utilize device tree.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-11-08 07:44:54 -06:00
Kumar Gala
b388b178a0 sensor: tmp112: Convert to DTS
Convert tmp112 sensor driver and sample app to utilize device tree.

Introduce a dts board overlay on the frdm_k64f board to ensure we at
least have a single platform in which the sample gets built.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-11-08 07:44:54 -06:00
Kumar Gala
0e9e67297e sensor: th02: Convert to DTS
Convert th02 sensor driver and sample app to utilize device tree.

Introduce a dts board overlay on the frdm_k64f board to ensure we at
least have a single platform in which the sample gets built.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-11-08 07:44:54 -06:00
Andy Ross
8892406c1d kernel/sys_clock.h: Deprecate and convert uses of old conversions
Mark the old time conversion APIs deprecated, leave compatibility
macros in place, and replace all usage with the new API.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-11-08 11:08:58 +01:00
Andrew Boie
4f77c2ad53 kernel: rename z_arch_ to arch_
Promote the private z_arch_* namespace, which specifies
the interface between the core kernel and the
architecture code, to a new top-level namespace named
arch_*.

This allows our documentation generation to create
online documentation for this set of interfaces,
and this set of interfaces is worth treating in a
more formal way anyway.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-11-07 15:21:46 -08:00
Vincent Wan
27c035fff4 drivers: spi: use CPU clock frequency in configuration on CC13XX/CC26XX
The SPI peripheral should be configured using the CPU clock speed and
not the system clock speed. This used to be fine because they were the
same before #19232, but now that the system clock is RTC-based (which
has a different frequency), we can no longer make that assumption.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-11-07 15:55:21 -06:00
Henrik Brix Andersen
4c9a1c59fe drivers: eeprom: add driver for Atmel AT24 I2C and AT25 SPI EEPROMs
Add driver for Atmel AT24 (and compatible) I2C along with Atmel AT25
(and compatible) SPI EEPROMs.

Tested with: AT24LC025, AT24C256, AT25AA02E48, and AT25080.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-11-07 16:32:15 -05:00
Henrik Brix Andersen
a54c945ddd drivers: eeprom: add driver for a zephyr native posix EEPROM
Add driver for emulating an EEPROM device using the native POSIX
board. The EEPROM is backed by a binary file in the host file system.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-11-07 16:32:15 -05:00
Henrik Brix Andersen
e72e4aa813 tests: board_shell: enabled EEPROM shell
Enable EEPROM shell commands in the board_shell test application.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-11-07 16:32:15 -05:00
Henrik Brix Andersen
4d4d4cd0b0 drivers: eeprom: add EEPROM shell commands
Add shell commands for reading from and writing to an EEPROM device.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-11-07 16:32:15 -05:00
Henrik Brix Andersen
546c3f2f21 drivers: i2c: eeprom_slave: update driver to match the new dts bindings
Update the I2C slave EEPROM driver to match the new atmel,at24 device
tree binding, where the size of the EEPROM is specified in bytes.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-11-07 16:32:15 -05:00
Henrik Brix Andersen
a2a7b776cb drivers: eeprom: add API for EEPROM devices
Add API for accessing Electrically Erasable Programmable Read-Only
Memory (EEPROM) devices.

EEPROMs have an erase block size of 1 byte, a long lifetime, and allows
overwriting data on byte-by-byte access.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-11-07 16:32:15 -05:00
Peter A. Bigot
a58d8ebaa6 driver: uart: make deprecation effective
Several macros were documented as deprecated but lacked the
infrastructure to produce deprecation warnings.  Add the deprecation
marker, and fix the in-tree references to the deprecated spellings.

Note that one non-deprecated macro should have been deprecated, and
is, referring to a newly added line control bit.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-11-07 12:44:15 -06:00
Andrzej Głąbek
51d055c520 drivers: pwm_nrfx: Fix the driver to allow changing period on the fly
Previously it was not possible to change the PWM period, even if only
a single channel was in use, without first stopping the peripheral,
i.e. setting pulse cycles for the channel to 0. This patch corrects
this behavior.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-11-07 16:14:29 +01:00
Jukka Rissanen
e7be6e12d4 drivers: eth: enc424j600: Set carrier status by link up/down
Set the network interface up / down according to link status.
This means that we call Ethernet carrier on/off function in
proper places.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-11-07 14:50:52 +01:00
Benjamin Valentin
10a1b25da6 interrupt_controller: sam0: Add support for SAME54
The EIC/PORT peripheral works very much alike the one in
previous sam0 parts.

Signed-off-by: Benjamin Valentin <benpicco@googlemail.com>
2019-11-06 17:49:28 -08:00
Benjamin Valentin
224174bc99 gpio: sam0: provide PORT_PMUX_PMUXE_A_Val define
SAMD5x/SAME5x header files do not provide this define anymore.
On SAMD2x it was 0, this is still valid.

Signed-off-by: Benjamin Valentin <benpicco@googlemail.com>
2019-11-06 17:49:28 -08:00
Benjamin Valentin
3d11666c4e pinmux: sam0: Add support for PORTD
Some devices like SAME54 have an additional GPIO port.

Signed-off-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2019-11-06 17:49:28 -08:00
Benjamin Valentin
82ec48b471 gpio: sam0: Add support for PORTD
Some devices like SAME54 have an additional GPIO bank.

Signed-off-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2019-11-06 17:49:28 -08:00
Benjamin Valentin
2fc60df918 watchdog: sam0: Add support for SAME54
The watchdog peripheral on SAME5x/SAMD5x MCUs is very simmilar
to the one found on the SAMD2x parts with only a few register
names changed.

Signed-off-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2019-11-06 17:37:10 -08:00
Benjamin Valentin
ca9a64bd13 serial: sam0: Add support for SAME54
The SAME5x/SAMD5x MCUs share their SERCOM peripherals with the
samd2x and saml1x MCUs with only few registers changed.

Signed-off-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2019-11-06 17:36:23 -08:00
Stephanos Ioannidis
2d7460482d headers: Refactor kernel and arch headers.
This commit refactors kernel and arch headers to establish a boundary
between private and public interface headers.

The refactoring strategy used in this commit is detailed in the issue

This commit introduces the following major changes:

1. Establish a clear boundary between private and public headers by
  removing "kernel/include" and "arch/*/include" from the global
  include paths. Ideally, only kernel/ and arch/*/ source files should
  reference the headers in these directories. If these headers must be
  used by a component, these include paths shall be manually added to
  the CMakeLists.txt file of the component. This is intended to
  discourage applications from including private kernel and arch
  headers either knowingly and unknowingly.

  - kernel/include/ (PRIVATE)
    This directory contains the private headers that provide private
   kernel definitions which should not be visible outside the kernel
   and arch source code. All public kernel definitions must be added
   to an appropriate header located under include/.

  - arch/*/include/ (PRIVATE)
    This directory contains the private headers that provide private
   architecture-specific definitions which should not be visible
   outside the arch and kernel source code. All public architecture-
   specific definitions must be added to an appropriate header located
   under include/arch/*/.

  - include/ AND include/sys/ (PUBLIC)
    This directory contains the public headers that provide public
   kernel definitions which can be referenced by both kernel and
   application code.

  - include/arch/*/ (PUBLIC)
    This directory contains the public headers that provide public
   architecture-specific definitions which can be referenced by both
   kernel and application code.

2. Split arch_interface.h into "kernel-to-arch interface" and "public
  arch interface" divisions.

  - kernel/include/kernel_arch_interface.h
    * provides private "kernel-to-arch interface" definition.
    * includes arch/*/include/kernel_arch_func.h to ensure that the
     interface function implementations are always available.
    * includes sys/arch_interface.h so that public arch interface
     definitions are automatically included when including this file.

  - arch/*/include/kernel_arch_func.h
    * provides architecture-specific "kernel-to-arch interface"
     implementation.
    * only the functions that will be used in kernel and arch source
     files are defined here.

  - include/sys/arch_interface.h
    * provides "public arch interface" definition.
    * includes include/arch/arch_inlines.h to ensure that the
     architecture-specific public inline interface function
     implementations are always available.

  - include/arch/arch_inlines.h
    * includes architecture-specific arch_inlines.h in
     include/arch/*/arch_inline.h.

  - include/arch/*/arch_inline.h
    * provides architecture-specific "public arch interface" inline
     function implementation.
    * supersedes include/sys/arch_inline.h.

3. Refactor kernel and the existing architecture implementations.

  - Remove circular dependency of kernel and arch headers. The
   following general rules should be observed:

    * Never include any private headers from public headers
    * Never include kernel_internal.h in kernel_arch_data.h
    * Always include kernel_arch_data.h from kernel_arch_func.h
    * Never include kernel.h from kernel_struct.h either directly or
     indirectly. Only add the kernel structures that must be referenced
     from public arch headers in this file.

  - Relocate syscall_handler.h to include/ so it can be used in the
   public code. This is necessary because many user-mode public codes
   reference the functions defined in this header.

  - Relocate kernel_arch_thread.h to include/arch/*/thread.h. This is
   necessary to provide architecture-specific thread definition for
   'struct k_thread' in kernel.h.

  - Remove any private header dependencies from public headers using
   the following methods:

    * If dependency is not required, simply omit
    * If dependency is required,
      - Relocate a portion of the required dependencies from the
       private header to an appropriate public header OR
      - Relocate the required private header to make it public.

This commit supersedes #20047, addresses #19666, and fixes #3056.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2019-11-06 16:07:32 -08:00
Nick Ward
ee99749ee5 drivers: CAN: MCP2515: Optimise TX SPI data length
When loading the TX buffer via SPI only transfer the data bytes of
the CAN message that will be used as defined by the DLC.

Signed-off-by: Nick Ward <nix.ward@gmail.com>
2019-11-06 21:45:08 +01:00
Alexander Wachter
d558fd055a drivers: CAN: Limit the DLC to 8
This commit limits the data length code to eight.
DLC > 8 returns a newly introduced CAN_TX_EINVAL error code.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-11-06 21:00:45 +01:00
Kumar Gala
134eea2ff4 watchdog: Refactor how we set HAS_DTS_WDT in Kconfig
Now that all watchdog drivers support DTS we can move setting of
HAS_DTS_WDT to the global watchdog symbol instead of per driver.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-11-06 13:51:20 -06:00
Kumar Gala
f8db0fa2eb watchdog: Remove CONFIG_WDT_0_NAME usage
Replace CONFIG_WDT_0_NAME with DT_ALIAS_WATCHDOG_0_LABEL in samples and
test code.  Now that all drivers are DT aware we don't ever set the
Kconfig option.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-11-06 13:51:20 -06:00
Kumar Gala
31f525fafc watchdog: mcux: Move to using DT define for driver name
Move from CONFIG_WDT_0_NAME to DT_INST_0_NXP_KINETIS_WDOG_LABEL as the
way we get the name.  Doing this so we can remove CONFIG_WDT_0_NAME
usage.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-11-06 13:51:20 -06:00
Kumar Gala
c111b7e49d watchdog: cmsdk: Convert to use DT generated label for device name
Convert driver to use DT_INST_0_ARM_CMSDK_WATCHDOG_LABEL instead of
CONFIG_WDT_0_NAME.  This requires we introduce a "label" property in all
the related dts files.  Also introduce a standard watchdog alias
('watchdog0') that can be utilized by sample/test code in the future.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-11-06 13:51:20 -06:00
Erwan Gouriou
4e8f6f0fe5 sensors: lis3mdl: Fix warning when TIGGER_OWN_THREAD is enabled
No need to cast dev in  k_thread_create.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-11-06 17:10:49 +01:00
Kumar Gala
7185055b38 sensor: lis3mdl-magn: Convert GPIO INT to device tree
Update lis3mdl-magn dts binding to include GPIO interrupt pin and change
driver code to get the GPIO pin and controller info from DT instead of
Kconfig.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-11-06 17:10:49 +01:00
Anas Nashif
7984f6c363 drivers: gpio: remove altera gpio driver
Remove unsupported driver.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-11-06 10:56:41 -05:00
Song Qiang
ee5104cd62 drivers: i2s: fix block size for DMA interface
`block_count` in `dma_cfg` is described as how many bytes to be
transfered in dma.h. So it should be 2 since the source data size
and dest data size are all 16 bits in this application. And all
block size should represent just bytes.

Signed-off-by: Song Qiang <songqiang1304521@gmail.com>
2019-11-06 14:14:39 +01:00
Song Qiang
c086597e21 drivers: i2s: apply new data size for DMA interface
the old DMA driver used to use 1 to stand for 16 bits, while the
new driver uses 2 to stand for 16 bits, which means the
'source_data_size' and the 'dest_data_size' should be 2.

Signed-off-by: Song Qiang <songqiang1304521@gmail.com>
2019-11-06 14:14:39 +01:00
Song Qiang
749d2d21bf drivers: dma: add generic driver support for some series of stm32
This commit adds driver support for DMA on f0/f1/f2/f3/f4/l0/l4
series stm32.

Notice due to some bugs, this is currently not working with f7.

There are two kinds of IP blocks are used across these stm32, one is the
one that has been used on F2/F4/F7 series, and the other one is the one
that has been used on F0/F1/F3/L0/L4 series.

Memory to memory transfer is only supported on the second DMA on
F2/F4 with 'st,mem2mem' to be declared in dts.

This driver depends on k_malloc to allocate memory for stream instances,
so CONFIG_HEAP_MEM_POOL_SIZE must be big enough to hold them.

Common parts of the driver are in dma_stm32.c and SoC related parts are
implemented in dma_stm32_v*.c.

This driver has been tested on multiple nucleo boards, including
NUCLEO_F091RC/F103RB/F207ZG/F302R8/F401RE/L073RZ/L476RG with the
loop_transfer and chan_blen_transfer test cases.

Signed-off-by: Song Qiang <songqiang1304521@gmail.com>
2019-11-06 14:14:39 +01:00
Song Qiang
f0d3ee52fb drivers: i2s: change the stm32 DMA in the driver to use dts
This commit moves DMA parameters previously hard coded in the driver
to the dts.

Signed-off-by: Song Qiang <songqiang1304521@gmail.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-11-06 14:14:39 +01:00
Song Qiang
9561785ea7 drivers: i2s: add some missing DMA parameters
src_addr_increment, dst_addr_increment, fifo_threshold and priority
are missing as parameters for configuring DMA. This commit adds them
to the driver.

Signed-off-by: Song Qiang <songqiang1304521@gmail.com>
2019-11-06 14:14:39 +01:00
Song Qiang
ad5f81b2e7 drivers: i2s: change stm32 i2s driver to use two DMA controllers
The i2s driver assumes the tx channel and rx channel of dma are using
the same dma controller. This commit changes it to be able to use
different dma controllers.

Signed-off-by: Song Qiang <songqiang1304521@gmail.com>
2019-11-06 14:14:39 +01:00
Song Qiang
0b11de57cd drivers: i2s: code refactor
Declaration code for the I2S devices in the driver has too much
duplicate code. This commit uses a help macro to save some work
and some lines of code.

Signed-off-by: Song Qiang <songqiang1304521@gmail.com>
2019-11-06 14:14:39 +01:00
Kumar Gala
819276e082 sensor: ccs811: Convert GPIOs to device tree
Update ccs811 dts binding to include GPIO pins for wakeup, reset, and
interrupt and change driver code to get the GPIO pin and controller
info from DT instead of Kconfig.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-11-06 11:13:04 +01:00
Erwan Gouriou
0e4dc5f33a drivers/flash: stm32f4: Return error on Dual Bank configuration
Some stm32f4 1MB SoCs support optional Dual Bank configuration.
This is not yet supported by stm32f4 driver, so report an
error when configuration is detected

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-11-05 16:37:25 -06:00
Erwan Gouriou
fb979e7ca7 drivers/flash: stm32f4: Offset SNB from sector 12 on 2MB parts
On 2MB parts, on sector 12 and above SNB is offset by 4.

Fixes #20016

Signed-off-by: Florian Vaussard <florian.vaussard@gmail.com>
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-11-05 16:37:25 -06:00
Benjamin Valentin
90cc723e65 drivers: dma: sam0: fix DMA to peripheral transfer on SAMD5x
We need to select TRIGACT_BLOCK for DMA to peripheral to work.

Signed-off-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2019-11-05 23:29:50 +01:00
Armando Visconti
58d5d237b4 driver/sensor: lis2mdl: handle SPI 4-wires mode selection
The LIS2MDL supports SPI half duplex mode with a single data line
by default (3-wire), but it might configured to switch to standard
full duplex mode (4-wire).

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-11-05 15:42:00 -06:00
Henrik Brix Andersen
3a13c97ad7 drivers: pwm: add PWM shell
Add shell commands for setting PWM period and duty cycle (in cycles,
microseconds, or nanoseconds).

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-11-05 15:10:21 -06:00
Kumar Gala
cd35a4a753 sensor: vl53l0x: Convert GPIO XSHUT to device tree
Update vl53l0x dts binding to include GPIO XSHUT pin and change
driver code to get the GPIO pin and controller info from DT instead of
Kconfig.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-11-05 15:07:18 -06:00
Kumar Gala
b09b773bb5 sensor: nrf5: Convert name to come from device tree
Update the binding for nordic,nrf-temp to require the label property and
use the generated define (DT_INST_0_NORDIC_NRF_TEMP_LABEL) instead of
Kconfig symbol (CONFIG_TEMP_NRF5_NAME).

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-11-05 19:56:28 +01:00
Marcin Niestroj
afa5183ee3 sensors: lis2dh: support disabling SDO/SA0 pull-up during init
Some chips supported by lis2dh driver (such as LIS2DH12 and LIS3DH)
contain CTRL_REG0 (1Eh) register to control internal pull-up on SDO/SA0
line (enabled by default). Add disconnect-sdo-sa0-pull-up boolean
device-tree property to allow disconnecting pull-up during driver
initialization. This allows to save around 180uA at 3.6V in
accelerometer power-down mode.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2019-11-05 19:40:12 +01:00
Marcin Niestroj
d3f2878460 sensors: lis2dh: compile lis2dh_reg_field_update() unconditionally
There is little reason to compile lis2dh_reg_field_update() function
conditionally, based on enabled features. If it is not used, then linker
will drop it anyway.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2019-11-05 19:40:12 +01:00
Ulf Magnusson
1f38ea77ba kconfig: Clean up 'config FOO' (two spaces) definitions
Must've been copy-pasted around.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-11-04 17:31:27 -05:00
Ulf Magnusson
bd6e04411e kconfig: Clean up header comments and make them consistent
Use this short header style in all Kconfig files:

    # <description>

    # <copyright>
    # <license>

    ...

Also change all <description>s from

    # Kconfig[.extension] - Foo-related options

to just

    # Foo-related options

It's clear enough that it's about Kconfig.

The <description> cleanup was done with this command, along with some
manual cleanup (big letter at the start, etc.)

    git ls-files '*Kconfig*' | \
        xargs sed -i -E '1 s/#\s*Kconfig[\w.-]*\s*-\s*/# /'

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-11-04 17:31:27 -05:00
Karsten Koenig
ee2dd7322f drivers: spi: rv32m1: Add driver for RV32M1 LPSPI
Add SPI driver and bindings for LPSPI peripheral for the RV32M1 SOC.
Based heavily on the existing mcux LPSPI driver.

Signed-off-by: Karsten Koenig <karsten.koenig.030@gmail.com>
2019-11-04 14:11:18 -06:00
Mohamed ElShahawi
21096b0316 esp32: pinmux: Add Device tree support
- Add PINMUX module to esp32.dtsi

Signed-off-by: Mohamed ElShahawi <ExtremeGTX@hotmail.com>
2019-11-04 19:45:50 +01:00
Mohamed ElShahawi
2d2f4de5b8 drivers: watchdog: esp32: Add Watchdog Device tree support
- Add WDT(0,1) to esp32.dtsi
- Extend the module to be able to use WDT(0,1)
- Some minor refactoring due to usage of device tree

Tests:
- samples/drivers/watchdog
- tests/drivers/watchdog/wdt_basic_api

Note:
- timer module interrupt registers shall be removed when
timer driver implemented.

Signed-off-by: Mohamed ElShahawi <ExtremeGTX@hotmail.com>
2019-11-04 18:00:36 +01:00
Marcio Montenegro
5634d70374 drivers: hci: stm32_ipm: add UID BLE address
The STM32WB has a 64 bit Unique Device Number UID.
The UID is used by firmware to derive 48-bit
Device Address EUI-48.

Signed-off-by: Marcio Montenegro <mtuxpe@gmail.com>
2019-11-04 16:40:01 +01:00
Ulf Magnusson
c8e5ca3852 kconfig: Turn pointless/confusing 'menuconfig's into 'config's
Same deal as in commit 677f1e6db9 ("config: Turn pointless/confusing
'menuconfig's into 'config's"), for some newly introduced (or maybe
overlooked) stuff.

Also clean up formatting a bit, replacing spaces with tabs and
shortening the header.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-11-03 12:47:30 +01:00
Ulf Magnusson
975de21858 kconfig: Global whitespace/consistency cleanup
Clean up space errors and use a consistent style throughout the Kconfig
files. This makes reading the Kconfig files more distraction-free, helps
with grepping, and encourages the same style getting copied around
everywhere (meaning another pass hopefully won't be needed).

Go for the most common style:

 - Indent properties with a single tab, including for choices.

   Properties on choices work exactly the same syntactically as
   properties on symbols, so not sure how the no-indentation thing
   happened.

 - Indent help texts with a tab followed by two spaces

 - Put a space between 'config' and the symbol name, not a tab. This
   also helps when grepping for definitions.

 - Do '# A comment' instead of '#A comment'

I tweaked Kconfiglib a bit to find most of the stuff.

Some help texts were reflowed to 79 columns with 'gq' in Vim as well,
though not all, because I was afraid I'd accidentally mess up
formatting.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-11-01 15:53:23 +01:00
Jan Van Winkel
9555f82d28 libc: Use select REQUIRES_FULL_LIBC instead of select NEWLIB_LIBC
Changed select NEWLIB_LIBC to select REQUIRES_FULL_LIBC

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2019-11-01 14:18:36 +01:00
Jan Van Winkel
0e59f6846f libc: Changed dependencies of NEWLIB_C into !MINIMAL_LIBC
Changed Kconfig dependencies of NEWLIB_C into !MINIMAL_LIBC

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2019-11-01 14:18:36 +01:00
David B. Kinder
241044f178 doc: fix misspellings in Kconfig files
Fix misspellings in Kconfig files missed during regular reviews.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-10-30 10:24:30 +01:00
Henrik Brix Andersen
4c8d127966 drivers: adc: mcux_adc12: use DT_INST defines for instances
Convert the NXP Kinetis ADC12 driver from relying on CONFIG_ADC_n
Kconfig defines to using DT_INST defines for instance configuration.

This resolves the issue of having e.g. ADC12 instances 2 and 3
enabled, but not instance 0.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-10-30 09:21:45 +01:00
Ulf Magnusson
3b98417ef2 drivers: serial: liteuart: Remove unused UART_LITEUART_PORT_0 symbol
Added in commit f9efca4b4f ("boards: riscv32: add LiteX VexRiscV
board"), then never used.

Found with a script.

Also change UART_LITEUART from a 'menuconfig' symbol to a 'config'
symbol, as it's no longer followed by symbols that depend on it
(UART_LITEUART_PORT_0 should have been a plain 'config' too).

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-10-29 06:16:27 +01:00
Ulf Magnusson
5bb149e414 drivers: i2c: kconfig: Remove unused I2C_EEPROM_SLAVE_0/1 symbols
Unused since commit f3f8f96842 ("tests: i2c_slave_spi: update to
proposed DT compatible naming").

Found with a script.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-10-29 06:15:55 +01:00
Jose Alberto Meza
da5a595f24 drivers: espi: mchp: Remove duplicated KConfig option
Fix #20086 by removing duplicate kconfig option.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2019-10-26 07:36:55 -05:00
Daniel Leung
b7eb04b300 x86: consolidate x86_64 architecture, SoC and boards
There are two set of code supporting x86_64: x86_64 using x32 ABI,
and x86 long mode, and this consolidates both into one x86_64
architecture and SoC supporting truly 64-bit mode.

() Removes the x86_64:x32 architecture and SoC, and replaces
   them with the existing x86 long mode arch and SoC.
() Replace qemu_x86_64 with qemu_x86_long as qemu_x86_64.
() Updates samples and tests to remove reference to
   qemu_x86_long.
() Renames CONFIG_X86_LONGMODE to CONFIG_X86_64.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-10-25 17:57:55 -04:00
Loic Poulain
14a0def31e drivers: video: Remove dedicated sensor dir
Keep flat video driver directory for now.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2019-10-25 15:13:53 -05:00
Loic Poulain
3587134f91 drivers: video: Add software video pattern generator
This is a virtual device generating video pattern for testing
purpose. It supports colobar pattern for now.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2019-10-25 15:13:53 -05:00
Loic Poulain
92ee992e7c drivers: video: Add Aptina MT9M114 driver
MT9M114 is a CMOS digital image sensor.
Implement video interface.
Only VGA (640x480) supported for now.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2019-10-25 15:13:53 -05:00
Loic Poulain
43e58aed34 drivers: video: Add MCUX CSI video driver
Add support for CMOS Sensor Interface video driver.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2019-10-25 15:13:53 -05:00
Peter Bigot
f875c3fc48 sensor: lis2dh: support I2C use on Nordic platforms
The default I2C driver on Nordic platforms does not support the I2C
burst operations, so replace those calls with ones that work on the
platform.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-10-25 11:02:58 -05:00
Nick Ward
0c5ef3e156 drivers: CAN: MCP2515: Add and use Read RX Buffer instruction
Reduces SPI RX buffer read overhead by a byte and further reduces the
SPI use by automatically clearing the associated receive flag RXxIF.

Signed-off-by: Nick Ward <nix.ward@gmail.com>
2019-10-25 15:20:32 +03:00
Nick Ward
d5a5d960e6 drivers: CAN: MCP2515: Add and use RTS instruction
Reduces SPI data required for Request To Send from 4 bytes to 1

Signed-off-by: Nick Ward <nix.ward@gmail.com>
2019-10-25 15:20:32 +03:00
Nick Ward
4816d06cfb drivers: CAN: MCP2515: Add and use Load TX Buffer instruction
Reduces SPI data for loading TX buffer by 1 byte

Signed-off-by: Nick Ward <nix.ward@gmail.com>
2019-10-25 15:20:32 +03:00
Nick Ward
a64f998645 drivers: CAN: MCP2515: Read INT GPIO pin to check interrupt status
Faster than the 3 byte SPI read operation when no interrupt flags are
expected to be set.

Signed-off-by: Nick Ward <nix.ward@gmail.com>
2019-10-25 15:20:32 +03:00
Dennis Wildmark
582e5e58c9 drivers: serial: Configurable GPIO management in NRFX UARTE
In some applications where power management is used, it is not expected
that the GPIO pins of the UARTE is reconfigured upon power state change.
Added a Kconfig option to disable the UARTE driver management of GPIOs.
It defaults to y in order to not affect current behavior unless the user
configures it specifically.

Signed-off-by: Dennis Wildmark <dennis.wildmark@assaabloy.com>
2019-10-25 08:50:25 +02:00
Henrik Brix Andersen
aefd30cd45 shell: adc: add support for ADC instance 2
Add support for configuring and reading ADC instance number 2.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-10-24 12:49:13 -05:00
Ulf Magnusson
2b61031c8f kconfig: Remove symbol types from Kconfig.defconfig files
Same deal as in commit 7fdb525754 ("kconfig: Use 'default' instead of
'def_bool' in Kconfig.defconfig files"), but I hacked Kconfiglib to also
find cases where the type is given separately as e.g.

    config FOO
            int
            default 3

Motivation (from a note in
https://docs.zephyrproject.org/latest/guides/kconfig/index.html):

    For a symbol defined in multiple locations (e.g., in a
    Kconfig.defconfig file in Zephyr), it is best to only give the
    symbol type for the "base" definition of the symbol, and to use
    'default' (instead of 'def_<type>' value) for the remaining
    definitions. That way, if the base definition of the symbol is
    removed, the symbol ends up without a type, which generates a
    warning that points to the other definitions. That makes the extra
    definitions easier to discover and remove.

It's also nice if 'def_bool' and the like turn into a semi-reliable flag
that the symbol is only defined in Kconfig.defconfig files. That might
be a sign that things could be cleaned up.

Will do a separate pass later to remove some symbols only defined in
Kconfig.defconfig files.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-10-24 12:40:22 -05:00
Mohamed ElShahawi
55471982f6 esp32: drivers: Add Entropy Device tree support
- Add TRNG module to esp32.dtsi
- Updated the note about TRNG register address

Signed-off-by: Mohamed ElShahawi <ExtremeGTX@hotmail.com>
2019-10-24 09:09:41 -05:00
Alexander Wachter
c0da8a7901 drivers: can: Extend CAN API for bus-state management.
This commit extends the CAN API with the following functions:
- can_get_state
- can_recover
- can_register_state_change_isr

This functions can be used to get the error-counters and the state
of the CAN controller. The recover function can be used to recover
from bus-off state when automatic recovery is disabled.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-10-24 12:28:01 +03:00
Scott Worley
c8b1eb79a1 drivers : spi : mec1501 : XEC SPI driver
SPI driver for MEC1501 QMSPI supporting synchronous only.

Signed-off-by: Scott Worley <scott.worley@microchip.com>
2019-10-23 19:18:32 -07:00
Kumar Gala
4e772c4322 led: lp5562: remove non-DTS support
Now that all I2C bus drivers support DTS we can remove the non-DTS
driver support.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-10-23 15:34:28 -05:00
Kumar Gala
613b77a761 led: pca9633: remove non-DTS support
Now that all I2C bus drivers support DTS we can remove the non-DTS
driver support.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-10-23 15:34:28 -05:00
Kumar Gala
0c806f10a9 led: lp3943: remove non-DTS support
Now that all I2C bus drivers support DTS we can remove the non-DTS
driver support.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-10-23 15:34:28 -05:00
Kumar Gala
48e946db21 gpio: sx1509b: remove non-DTS support
Now that all I2C bus drivers support DTS we can remove the non-DTS
driver support.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-10-23 15:34:28 -05:00
Kumar Gala
9784f800a6 i2c: Rename CONFIG_I2C_[0..5]_NAME -> DT_I2C_[0..5]_NAME
Now that everything is DT based for I2C drivers we can rename the
CONFIG_I2C_[0..5]_NAME define to DT_I2C_[0..5]_NAME.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-10-23 11:31:32 -05:00
Kumar Gala
669e0f3b32 i2c: Move how we set HAS_DTS_I2C
Now that all I2C drivers utilize DTS we can select HAS_DTS_I2C in a
common place and don't need to do it per driver.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-10-23 11:31:32 -05:00
Kumar Gala
7e96ca5d80 i2c: Remove non DTS Kconfig params
All drivers utilize DTS now so we can remove the Kconfig params related
to !HAS_DTS_I2C.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-10-23 11:31:32 -05:00
Yannis Damigos
edb57a51d7 i2c_ll_stm32.c: Use macro to add I2C5 instance
Use macro to add I2C5 instance

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2019-10-23 06:43:56 -05:00
Andrei Gansari
2adccabf6a drivers: remove arm's qemu systick workaround
Removed workarounds in systick driver as they prevent normal usage in
TICKLESS systems. Driver still behaved like an interrupt based ticker.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2019-10-22 23:06:41 -04:00
Ulf Magnusson
66682a2ee9 drivers: dma: kconfig: Remove unused DMA_1/2_IRQ_PRI symbols
Added in commit bb36c0af86 ("dma: Add possibility for up to 3 DMA
Controllers") in February 2017, then never used.

Found with a script.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-10-22 23:41:01 +02:00
Olof Kindgren
d09614ab59 drivers: spi: Add simple_spi driver
Add support for the OpenCores simple_spi controller

Signed-off-by: Olof Kindgren <olof.kindgren@gmail.com>
2019-10-22 15:54:03 -05:00
Ulf Magnusson
d5ff890547 sensor: bmg160: Use BMG160_THREAD_PRIORITY instead of ignoring it
The value of BMG160_THREAD_PRIORITY has never been used after the symbol
was added. Use it.

The value defaults to 10 in Kconfig too, so this is a no-op in itself.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-10-22 14:32:55 -05:00
Johann Fischer
85697f32bd drivers: ssd16xx: fix GPIO controller name for BUSY pin
Fix GPIO controller name for BUSY pin.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-10-22 14:13:25 -05:00
Stephane D'Alu
2dad6f75f4 display/ssd1306: build time selection of reversed display
Resolves: #19871

Signed-off-by: Stephane D'Alu <sdalu@sdalu.com>
2019-10-22 14:11:33 -05:00
Ulf Magnusson
677f1e6db9 kconfig: Turn pointless/confusing 'menuconfig's into 'config's
Defining a symbol with 'menuconfig' just tells the menuconfig to display
any dependent symbols that immediately follow it in a separate menu.
'menuconfig' has no effect on symbol values.

Making a symbol that doesn't have any dependent symbols after it a
'menuconfig' should be avoided, because then you end up with an empty
menu, which is shown as e.g.

    [*] Enable foo ---

This is how it would be shown if there were children but they all
happened to be invisible as well.

With a regular 'config', it turns into

    [*] Enable foo

Change all pointless 'menuconfig's to 'config's.

See the section on 'menuconfig' on the Kconfig - Tips and Best Practices
page as well.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-10-22 13:53:06 -05:00
Alexander Wachter
91818d2c07 drivers: sensors: ens210: fix fractional part calculation
This commit fixes the calculation of the fractional part
for both values.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-10-22 13:48:12 -05:00
Ulf Magnusson
53c688292a drivers: sensor: ens210: Fix broken CONFIG_ENS210_CRC_CHECK checks
The CONFIG_* prefix was missing, making the #ifdefs always false.

Found with a script (CONFIG_ENS210_CRC_CHECK was unused).

Also make ens210_crc7() static. Guessing it's unused outside this file.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-10-22 09:44:46 -05:00
Mohamed ElShahawi
566d07e00c [ESP32] drivers: Add I2C Device tree support
- Add I2C modules to esp32.dtsi
- I2C Pins and bitrate config moved to esp32.dts

Signed-off-by: Mohamed ElShahawi <ExtremeGTX@hotmail.com>
2019-10-22 08:01:24 -05:00
Ulf Magnusson
c433a2ba33 can: loopback: kconfig: Remove unused CAN_LOOPBACK_FRAME_BUF_SIZE sym
Added in commit 0e807c3f54 ("drivers: can: Add loopback driver"), then
never used.

Found with a script.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-10-21 15:28:26 -05:00
Ulf Magnusson
894ec29606 can: loopback: kconfig: Remove unused CAN_RECEIVER_WORKQ_PRIO symbol
Added in commit 0e807c3f54 ("drivers: can: Add loopback driver"), then
never used.

Found with a script.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-10-21 15:28:26 -05:00
Ulf Magnusson
3a2aebf476 drivers: clock_control: Remove unused CLOCK_STM32_PLL2_* symbols
CLOCK_STM32_PLL2_MULTIPLIER and CLOCK_STM32_PLL2_PREDIV2 were added in
commit e1a90583d4 ("drivers: clock_control: provide LL based driver to
stm32f1xx series"). They have never been used.

Found with a script.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-10-21 15:13:24 -05:00
Ulf Magnusson
6e4d31b995 interrupt_controller: Remove unused IOAPIC_DEBUG symbol
Unused since commit 876c86e1a8 ("ioapic_intr: remove dead code").

Found with a script.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-10-21 15:12:16 -05:00
Ulf Magnusson
1dbf64884d drivers: i2c: slave: Kconfig: Remove unused LOG_I2C_SLAVE_LEVEL symbol
Unused since commit f7dac85d15 ("drivers: i2c: move to new logger").

Found with a script.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-10-21 15:10:50 -05:00
Henrik Brix Andersen
3d9eefc023 drivers: serial: mcux_lpuart: use base address from DTS for LPUART0
Use the base address from the device tree for instance 0 (LPUART0)
instead of hardcoding the address using the NXP MCUX HAL definition.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-10-21 12:25:26 -05:00
Daniel Craviee
256c5c4e17 drivers: spi: Add LiteX SPI driver
This commit adds LiteX SPI drivers and its bindings.

Signed-off-by: Daniel Craviee <dcraviee@internships.antmicro.com>
Signed-off-by: Mateusz Holenko <mholenko@antmicro.com>
2019-10-21 08:40:09 -05:00
Ulf Magnusson
a9759d2cab drivers: lsm6dsl: kconfig: Remove unused internal pull-up symbol
Added in commit 180b139786 ("drivers: sensor: lsm6dsl: Adding sensorhub
support"), then never used.

Found with a script.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-10-21 08:20:59 -05:00
Ulf Magnusson
4310babed8 drivers: sensor: lis2mdl: kconfig: Remove unused fixed ODR symbols
After commit 44f373e806 ("driver/sensor: lis2mdl: make use of STdC
definitions"), the code only looks at LIS2MDL_MAG_ODR_RUNTIME, and not
at the LIS2MDL_MAG_ODR_<frequency> symbols.

LIS2MDL_MAG_ODR_RUNTIME is now a yes/no thing in practice, so remove the
choice and turn it into a regular bool symbol.

Found with a script.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-10-21 08:20:23 -05:00
Ulf Magnusson
38866eb3f1 drivers: spi_nor: Remove unused SPI_NOR_{PAGE,SECTOR}_SIZE symbols
Unused since commit 2a590d3fa5 ("drivers/spi_nor: remove configurability
of page/sector/block sizes"). The help texts already say they're unused,
but it probably doesn't hurt to remove them as well.

Found with a script.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-10-21 08:17:50 -05:00
Ulf Magnusson
ca43e023bf drivers: adc: kconfig: Remove unused ADC_INIT_PRIORITY symbol
Unused after commit a8d0e5af07 ("adc: ti_adc108s102: Remove driver as
its bit-rotted").

Found with a script.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-10-21 08:17:05 -05:00
Ulf Magnusson
b222cf67f1 drivers: console: kconfig: Remove unused NATIVE_STDIN_PRIO symbol
Unused since commit 140a8d0c8a ("console: Remove deprecated function
console_register_line_input").

Found with a script.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-10-21 08:16:42 -05:00
Johann Fischer
2011f73718 drivers: eth: initialize ethernet stack in enc424j600 and enc28j60
Initialize ethernet stack in drivers enc424j600 and enc28j60.

Fixes: #19398

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-10-21 14:01:52 +03:00
Ulf Magnusson
616f9bd825 drivers: net: kconfig: Remove unused SLIP_MTU symbol
Added in commit 184e251fdb ("slip: Add driver for host to qemu
connectivity"), then moved to drivers/net/Kconfig in commit 0612651deb
("drivers: slip: Consolidate under drivers/net/"). Never used.

Found with a script.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-10-21 09:58:23 +03:00
Ulf Magnusson
f9d2added7 drivers: net: kconfig: Remove unused NET_PPP_MTU symbol
Added in commit aa46bac54c ("drivers: net: ppp: Driver for
point-to-point protocol"). Never used.

Found with a script.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-10-21 09:58:07 +03:00
Ulf Magnusson
af7aa3fd28 drivers: net: kconfig: Remove unused NET_PPP_CALC_FCS symbol
Added in commit aa46bac54c ("drivers: net: ppp: Driver for
point-to-point protocol"). Never used.

Found with a script.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-10-21 09:57:47 +03:00
Ulf Magnusson
7e8cb3c591 drivers: console: kconfig: Remove unused IPM_CONSOLE_INIT_PRIORITY sym
Unused after commit 578ae40761 ("boards: remove quarl_se_c1000").

Found with a script.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-10-20 08:43:59 -05:00
Manivannan Sadhasivam
4f79e31566 soc: arm: st_stm32: stm32l1: Add RTC/Counter support
Add RTC/Counter support for STM32L1 SoCs.

Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
2019-10-18 10:40:45 -05:00
Pavlo Hamov
3674d3343f drivers: hci: stm32_ipm: disable proper LSI
LSI1 is used for RTC, LTC2 for RF.
Disable LSI2 instead of LSI1 on BLE with LSE start

Signed-off-by: Pavlo Hamov <pavlo_hamov@jabil.com>
2019-10-18 08:24:42 -05:00
Pavlo Hamov
535bfeb784 drivers: hci: stm32_ipm: Add possibility to work on LSI
Use CLOCK_STM32_LSE as switch for the RF low speed clock source

Signed-off-by: Pavlo Hamov <pavlo_hamov@jabil.com>
2019-10-18 08:24:42 -05:00
Carlo Caione
1c4626d324 kconfig: uart_pl011: Do not limit PL011 driver to ARM family
The driver is not specific to 32bit ARM family. For example it is
currently used by the QEMU ARM64 virt machine.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2019-10-18 08:11:48 -05:00
Carlo Caione
6148b5bd9e drivers: uart_pl011: Fix unused variable warning
Fix GCC complain when CONFIG_UART_INTERRUPT_DRIVEN=n

  warning: unused variable ‘config’ [-Wunused-variable]

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2019-10-18 08:11:48 -05:00
Mateusz Holenko
a524373004 drivers: litex_timer: fix usage of DT_ defines
This commit switches from using device tree automatically
generated address-based defines to the instance id-based ones.

Without this change it is not be possible to re-use the driver
on boards where the device is located at different location
than 0xe0002800.

Signed-off-by: Mateusz Holenko <mholenko@antmicro.com>
2019-10-18 07:48:14 -05:00
Mateusz Holenko
b8f54e7c05 drivers: interrupt_controller: fix usage of DT_ defines
This commit switches from using device tree automatically
generated address-based defines to the instance id-based ones.

Without this change it is not be possible to re-use the driver
on boards where the timer and uart devices are located at different
locations than 0xe0002800 and 0xe0001800 respectively.

Signed-off-by: Mateusz Holenko <mholenko@antmicro.com>
2019-10-18 07:48:14 -05:00
Mateusz Holenko
ee36c2ce53 drivers: uart_liteuart: fix usage of DT_ defines
This commit switches from using device tree automatically
generated address-based defines to the instance id-based ones.

Without this change it is not be possible to re-use the driver
on boards where the device is located at different location
than 0xe0001800.

Signed-off-by: Mateusz Holenko <mholenko@antmicro.com>
2019-10-18 07:48:14 -05:00
Pavlo Hamov
7bf66b432d drivers: clock: stm32wb: enable PWR only if exists
Hide LL_APB1_GRP1_PERIPH_PWR enabling under ifdef

Signed-off-by: Pavlo Hamov <pavlo_hamov@jabil.com>
2019-10-17 14:02:40 -05:00
Peter Bigot
9e473f9fea drivers: sensor: lsm6dsl: correct initialization order
The function that initializes interrupts configures the sensor
register to enable interrupts.  It is called before the function that
resets the sensor.  Swap the order.

Also correct the mask argument to the configuration command, and use
the BIT() macro to construct the set argument.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-10-17 13:17:02 -05:00
Armando Visconti
dc9e297e09 modules/hal_st: Align sensor drivers to stmemsc HAL i/f v1.02
Align all sensor drivers that are using stmemsc (STdC) HAL i/f
to new APIs of stmemsc v1.02.

Requires https://github.com/zephyrproject-rtos/hal_st/pull/3

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-10-17 13:07:50 -05:00
Ulf Magnusson
ac9fe11f2f Kconfig: Remove copy-pasted comments on some promptless symbols
Remove the

    # Omit prompt to signify a "hidden" option

comments that appear on some symbols. They seem to have been copy-pasted
at random, as there are lots of promptless symbols that don't have them
(that's confusing in itself, because it might give the idea that the
ones with comments are special in some way).

I suspect those comments wouldn't have helped me much if I didn't know
Kconfig either. There's a lot more Kconfig documentation now too, e.g.
https://docs.zephyrproject.org/latest/guides/kconfig/index.html.

Keep some comments that give more information than the symbol having no
prompt.

Also do some minor drive-by cleanup.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-10-17 13:05:24 -05:00
Francisco Munoz
0d85074d9a drivers: kscan: Add driver for Microchip XEC family
Add the Keyboard Scan matrix driver for XEC

Signed-off-by: Francisco Munoz <francisco.munoz.ruiz@intel.com>
2019-10-16 13:29:21 -07:00
Francisco Munoz
edf24998b0 drivers: kscan: Add syscall handler for Keyboard Matrix API
Introduction of syscall handlers for the Keyboard Scan Matrix API

Signed-off-by: Francisco Munoz <francisco.munoz.ruiz@intel.com>
2019-10-16 13:29:21 -07:00
Francisco Munoz
453427d5d1 drivers: kscan: Add Kconfig for Keyboard scan driver
Introduces the Kconfig for generic Keybard Scan matrix drivers

Signed-off-by: Francisco Munoz <francisco.munoz.ruiz@intel.com>
2019-10-16 13:29:21 -07:00
Iosif Macesanu
24508a777d drivers: sensor: Add OPT3001 light sensor driver
Add OPT3001 light sensor driver

Signed-off-by: Iosif Macesanu <iosif@actinius.com>
2019-10-16 14:51:07 -05:00
Iosif Macesanu
884485667d drivers: sensor: Add SI7060 temperature sensor driver
Add SI7060 temperature sensor driver

Signed-off-by: Iosif Macesanu <iosif@actinius.com>
2019-10-16 14:48:12 -05:00
Karl Palsson
e3fdf47b85 pinmux: stm32l1: add spi2 pins
SPI1 pins were already included, add SPI2.

Signed-off-by: Karl Palsson <karlp@etactica.com>
2019-10-16 14:42:54 -05:00
Marcin Niestroj
74fc8fe071 sensor: lis2dh: fix SPI burst transfers
After switching to new SPI API there is no need to reserve first dummy
byte in buffer and ignore that in application later on. Instead two
buffers can be specified, which is how it is done already in lis2dh
driver. The problem is that dummy byte is still part of the buffer, but
it clearly should no longer be. As an example we write 0x7 (bits to
enable XYZ axes) into CTRL2 instead of CTRL1 register. When reading
measurements on the other hand we have filled buffer starting from 0,
instead of 1 as the driver code has expected.

Fix driver in all places that use burst transfers by removing first
dummy byte from input/output buffer.

Fixes: 2f7e6b6d42 ("drivers/sensors: Switch lis2dh driver to new SPI
  API")
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2019-10-14 17:16:03 -05:00
Jose Alberto Meza
d52a3660de drivers: espi: xec: Report espi reset correctly to app
Handle espi reset interrupt before clearing it
So it can send correct notification.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2019-10-14 14:15:26 -07:00
Adam Kondraciuk
d7dbb572e3 drivers: flash: nrfx: Modify flash address validation
Modifications in 'is_regular_addr_valid()' function which didn't work
properly when flash base address was different than 0x00000000.
Added calculating address bounds with respect to flash base address.

Signed-off-by: Adam Kondraciuk <adam.kondraciuk@nordicsemi.no>
2019-10-14 21:05:23 +02:00
Jose Alberto Meza
cb6097d283 drivers: i2c: xec: Handle additional I2C flags for read
I2C restart flag is now handled during I2C reads

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2019-10-11 14:44:03 -07:00
Krzysztof Chruscinski
ac417abdf0 drivers: sensors: Fix log module registration
All sensors were using legacy log module registeration method
where LOG_LEVEL was defined before registeration. This method
was error prone as it requires preserving includes order.

Replaced with LOG_MODULE_REGISTER(foo, level).

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-10-11 07:33:08 -05:00
Andrew Boie
b12a094d63 drivers: hpet: fix includes
IRQ APIs were being used without pulling in the proper header.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-10-09 09:14:18 -04:00
Peter Bigot
e28f330a8e coccinelle: standardize k_thread create/define calls with integer timeouts
Re-run with updated script to convert integer literal delay arguments
to k_thread_create and K_THREAD_DEFINE to use the standard timeout
macros.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-10-09 08:38:10 -04:00
Peter Bigot
6e5db350b2 coccinelle: standardize k_sleep calls with integer timeouts
Re-run with updated script to convert integer literal delay arguments to
k_sleep to use the standard timeout macros.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-10-09 08:38:10 -04:00
Tommy Vestermark
22be864af3 stm32: Fix uart_irq_tx_complete() to output correct status
Currently both uart_stm32_irq_tx_complete() and
uart_stm32_irq_tx_ready() return the TXE flag. However
uart_irq_tx_complete() should really return the TC flag to output true
"Transmit Complete" status.

Signed-off-by: Tommy Vestermark <tovsurf@vestermark.dk>
2019-10-09 06:30:14 -05:00
Alexander Wachter
8b214117ec drivers: CAN: MCP2515: Move OSC frequency definition to device-tree
Move the oscillator frequency definition from Kconfig to device-tree.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-10-09 06:27:53 -05:00
Krzysztof Chruscinski
ce0a6ed406 drivers: counter: nrf_rtc: Fix wrapping with PPI
PPI allocation and freeing was not handled correctly. Additionally,
RTC event was not enabled when PPI was enabled which resulted in
lack of RTC counter clearing.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-10-09 13:25:36 +02:00
Krzysztof Chruscinski
a3ff7f54ab drivers: counter: nrf_rtc: Add detection of late alarm request
Implemented latest extensions to the counter API related to
detection of alarms being set too late and short relative alarms.
Implementation could not be realized on nrfx_rtc driver thus
driver has been reimplemented based on nrf_rtc hal.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-10-09 13:25:36 +02:00
Krzysztof Chruscinski
d91b2325bb drivers: counter: nrf_timer: Add detection of late alarm request
Implemented latest extensions to the counter API related to
    detection of alarms being set too late and short relative alarms.
    Implementation could not be realized on nrfx_timer driver thus
    driver has been reimplemented based on nrf_timer hal.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-10-09 13:25:36 +02:00
Noah Pendleton
d68de09c0f boards: arm: stm32: fix out of bounds access
Fix an out of bounds access when `CONFIG_SOC_SERIES_STM32F1X` is
enabled.

Signed-off-by: Noah Pendleton <noah.pendleton@gmail.com>
2019-10-08 15:51:14 -05:00
Carlo Caione
26ff7603f1 drivers: uart_pl011: Fix compilation when CONFIG_UART_INTERRUPT_DRIVEN=n
The driver fails to compile when CONFIG_UART_INTERRUPT_DRIVEN=n. This is
due to a nested ifdef on CONFIG_UART_INTERRUPT_DRIVEN that is excluding
pieces of code unrelated to the uart interrupts management.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2019-10-08 10:22:46 -07:00
Carlo Caione
a76a74c541 drivers: uart_pl011: Remove cortex_m header
The PL011 driver is not specific to the cortex_m arch and the driver
does not really use anything from the cmsis header file. Remove it.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2019-10-08 10:22:46 -07:00
Krzysztof Chruscinski
a3bc87504c drivers: clock_control: nrf_power_clock: Make isr function global
Some tests are failing because nrf_power_clock_isr was static.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-10-08 16:23:14 +02:00
Andrei Emeltchenko
288940dbbd drivers: pwm: pwm_mchp_xec: Fix u32_t overflow for freq calculation
Fixes u32_t overflow during intermediary calculations using u64_t for
it. on_off is temporary value used for calculating on and off and it
got overflowed with simple test in tests/drivers/pwm/pwm_api
([period]: 2000, [pulse]: 2000)

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-10-07 21:53:46 -04:00
Charles E. Youse
5a9a33b0cf drivers/interrupt_controller/ioapic_intr.c: broadcast interrupts
When SMP is enabled, the kernel expects that interrupts be delivered
to all CPUs in the system. Change the I/O APIC RTEs accordingly.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-10-07 19:46:55 -04:00
Charles E. Youse
a981f51fe6 arch/x86: drivers/loapic_intr.c: move local APIC initialization
In the general case, the local APIC can't be treated as a normal device
with a single boot-time initialization - on SMP systems, each CPU must
initialize its own. Hence the initialization proper is separated from
the device-driver initialization, and said initialization is called
from the early startup-assembly code when appropriate.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-10-07 19:46:55 -04:00
Henrik Brix Andersen
00f0fb73fd drivers: flexcan: fix loopback mode
Fix CAN loopback mode in the NXP MCUX FlexCAN driver by only disabling
self-reception when loopback mode was not requested.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-10-07 12:38:44 -05:00
Pavlo Hamov
82ed1681f0 drivers: ipm_stm32wb: add workaround for conn_complete
Enhanced connection complete message lacks of
the peer address (FF::FF), which leads to pairing/bonding failure.

Fixes: #19509

Signed-off-by: Pavlo Hamov <pavlo_hamov@jabil.com>
2019-10-04 18:47:31 -07:00
Richard Osterloh
37514ae660 drivers: usb: Add STM32G4X USB support
Add USB driver support for STM32G4X SoC series.

Signed-off-by: Richard Osterloh <richard.osterloh@gmail.com>
2019-10-04 18:44:24 -07:00
Richard Osterloh
3e5187b458 drivers: entropy: Add STM32G4X RNG support
Add RNG driver support for STM32G4X SoC series.

Signed-off-by: Richard Osterloh <richard.osterloh@gmail.com>
2019-10-04 18:44:24 -07:00
Richard Osterloh
c678d4508d drivers: counter: Add STM32G4X counter support
Add counter driver support for STM32G4X SoC series.

Signed-off-by: Richard Osterloh <richard.osterloh@gmail.com>
2019-10-04 18:44:24 -07:00
Richard Osterloh
af4678f885 drivers: adc: Add STM32G4X ADC support
Add ADC driver support for STM32G4X SoC series.

Signed-off-by: Richard Osterloh <richard.osterloh@gmail.com>
2019-10-04 18:44:24 -07:00
Richard Osterloh
794606f866 drivers: spi: Add STM32G4X SPI support
Add SPI driver support for STM32G4X SoC series.

Signed-off-by: Richard Osterloh <richard.osterloh@gmail.com>
2019-10-04 18:44:24 -07:00
Richard Osterloh
4ce35300c8 drivers: i2c: Add STM32G4X I2C support
Add I2C driver support for STM32G4X SoC series.

Signed-off-by: Richard Osterloh <richard.osterloh@gmail.com>
2019-10-04 18:44:24 -07:00
Richard Osterloh
c68e027c28 drivers: flash: Add STM32G4X flash support
Add flash driver support for STM32G4X SoC series.

Signed-off-by: Richard Osterloh <richard.osterloh@gmail.com>
2019-10-04 18:44:24 -07:00
Richard Osterloh
1d2a030ee3 drivers: serial: Add STM32G4X serial support
Add UART driver support for STM32G4X SoC series.

Signed-off-by: Richard Osterloh <richard.osterloh@gmail.com>
2019-10-04 18:44:24 -07:00
Richard Osterloh
6a499f46ab drivers: interrupt_controller: Add STM32G4X exti support
Add EXTI driver support for STM32G4X SoC series.

Signed-off-by: Richard Osterloh <richard.osterloh@gmail.com>
2019-10-04 18:44:24 -07:00
Richard Osterloh
f7bad922f0 drivers: gpio: Add STM32G4X gpio support
Add GPIO driver support for STM32G4X SoC series.

Signed-off-by: Richard Osterloh <richard.osterloh@gmail.com>
2019-10-04 18:44:24 -07:00
Richard Osterloh
b0ecf0fec3 drivers: pinmux: Add STM32G4X pinmux support
Add pinmux support for STM32G4X SoC series.

Signed-off-by: Richard Osterloh <richard.osterloh@gmail.com>
2019-10-04 18:44:24 -07:00
Richard Osterloh
ca7cbb5a08 drivers: clock_control: Add STM32G4X clock support
Add clock support for STM32G4X SoC series.

Signed-off-by: Richard Osterloh <richard.osterloh@gmail.com>
2019-10-04 18:44:24 -07:00
Ioannis Konstantelias
556cf41021 drivers: sensor: Add TMP116
Added driver for TI's TMP116. This driver does not use the Alert
functionality.

Signed-off-by: Ioannis Konstantelias <ikonstadel@gmail.com>
2019-10-04 15:31:56 -05:00
Andrzej Głąbek
5239bef610 drivers: pwm_nrf5_sw: Remove PWM_NRF5_SW_0_DEV_NAME Kconfig option
This option determines the name under which the device represented by
the `sw_pwm` node is registered in the system. But when the value of
this option does not match the `label` property of the `sw_pwm` node,
a problem arises when the `sw_pwm` node is referenced by a "pwm-leds"
compatible node, since the `*_PWMS_CONTROLLER` macro that is generated
for this referencing node contains a non-existing device name (as it is
the `label` property value, not the Kconfig option value).
This commit solves the issue described above by removing the Kconfig
option and replacing all of its occurrences in sample applications
by the standard macro generated for the `sw_pwm` node, containing
the value of the `label` property of this node.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-10-04 17:21:32 +02:00
Krzysztof Chruscinski
43af941131 drivers: Align nrf counter, timer and usb driver to new clock_control
Align drivers to use new clock control API.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-10-04 17:15:39 +02:00
Krzysztof Chruscinski
6700f2f194 drivers: clock_control: nrf: reimplementation including API updates
Reimplementation of clock control driver for nrf platform. It includes
latest API changes: asynchronous starting and getting clock status.

Additionally, it implements calibration algorithm which optionally
skips calibration based on no temperature change. Internal temperature
sensor is used for that.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-10-04 17:15:39 +02:00
Pavlo Hamov
9bb7da060b drivers: flash: add omitted dependency
FLASH_SHELL must depend on the base SHELL

Signed-off-by: Pavlo Hamov <pavlo_hamov@jabil.com>
2019-10-04 09:19:44 -05:00
Andrew Boie
8c98a97581 arm: arch code naming cleanup
This patch re-namespaces global variables and functions
that are used only within the arch/arm/ code to be
prefixed with z_arm_.

Some instances of CamelCase have been corrected.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-10-04 10:46:23 +02:00
Peter Bigot
ab91eef23b coccinelle: standardize kernel API timeout arguments
Use the int_literal_to_timeout Coccinelle script to convert literal
integer arguments for kernel API timeout parameters to the standard
timeout value representations.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-10-03 11:55:44 -07:00
Ulf Magnusson
ecf2563b47 bindings: nordic,nrf-rtc.yaml: Do not require 'ppi-wrap' property
Looking at the code, this flag was probably made 'required: true' by
mistake. Combining 'type: boolean' with 'required: true' for 'ppi-wrap'
means that all nodes that use this binding are required to have a
'ppi-wrap;' property.

The mistake was hidden by a bug in edtlib (failing to flag missing
'required: true' booleans).

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-10-03 05:41:23 -07:00
Ioannis Glaropoulos
b0ef6d0693 drivers: timer: nrf: minor comment fix
Fix an inline comment in nrf_rtc_timer.c correcting the
path to the mentioned test.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-10-02 21:06:54 -04:00
Charles E. Youse
6e89842d3d drivers/i2c/i2c_dw: really, really make 64-bit clean
The base_address in the device configuration is used as a handle
to access an entity in memory. In C, we call that a 'pointer'.
Also in C, (versus, say, PL/M) we name these pointer things after
what they point not ('regs') not what they are ('base address').

Thus, we change the member to a pointer type and change its name.
This makes it compile cleanly regardless of machine pointer size,
while also cutting down on a bunch of casting noise.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-10-02 10:24:56 -07:00
Charles E. Youse
89a984e644 drivers/i2c/i2c_dw.c: make 64-bit clean
Use UINT_TO_POINTER() macros to silence warnings about casts.

Fixes: #19219

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-10-01 18:12:28 -04:00
Sebastian Bøe
e169818b68 cmake: Cleanup ethernet include directory handling
The zephyr/subsys/net/l2 include directory has been added through the
'zephyr_library_' API to modify the 'zephyr' library, when the
'zephyr_' API should have been used.

This patch fixes this problem. Using 'zephyr_library_' in this context
works by accident when 'zephyr' is the current library but has no
guarantees of working in the future.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2019-10-01 18:05:58 -04:00
Anas Nashif
9d70a87f20 drivers: espi: move header to include/drivers
Driver APIs need to go into include/drivers/.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-10-01 16:18:36 -04:00
Jose Alberto Meza
4c095b5cbc drivers: gpio: xec: Ensure GPIO input is enabled
All GPIOs except VCI pins come in default GPIO mode and  input disabled
Need to explicitly enable input apart from setting direction.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2019-09-30 13:42:58 -07:00
Andrew Boie
9e1dda8804 timing_info: rename globals
Global variables related to timing information have been
renamed to be prefixed with z_arch, with naming arranged
in increasing order of specificity.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-09-30 15:25:55 -04:00
Henrik Brix Andersen
8940c25145 drivers: can: flexcan: disable self-reception and support listen-only
Add work-around for the NXP MCUxpresso SDK not exposing APIs for
setting the listen-only (LOM) bit of the FlexCAN MCR register and the
self-reception disable (SRXDIS) bit of the CTRL1 register.

These bits can only be written when the FlexCAN module is in freeze
mode. Add a set of simplified functions (not supporting errata 9595) for
entering/exiting freeze mode.

This work-around can be removed again once the NXP MCUxpresso SDK
exposes the needed functionality.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-09-30 12:31:27 -05:00
Andrei Emeltchenko
582bb03296 drivers: adc: adc_mchp_xec: Add error logs
Adding error logs helps to find issue with incorrect mask and
channels.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-09-30 12:20:39 -05:00
Andrei Emeltchenko
2f6371c1ad drivers: adc: adc_mchp_xec: Fix incorrect channel mask check
Value MCHP_ADC_MAX_CHAN_MASK defined in microchip hal as
0x07u which is different method for mask calculation then used in Zephyr
API for 8 channels (MCHP_ADC_MAX_CHAN = 8).

Calculate bitmask ourselves using BIT_MASK().

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-09-30 12:20:39 -05:00
Yannis Damigos
2f4c1ea362 i2c_ll_stm32_v2: Send STOP manually after NACK
In master trasmitter mode AutoEndMode is
always disabled, so we need to send STOP
manually if NACK is received.

Fixes #19059

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2019-09-27 13:51:15 -07:00
Kumar Gala
0228c181b0 serial: mcux_lpc: Fix up driver to work on new SDK
The new SDK version 2.6.3 for LPC55S69 changes how CLOCK_GetFreq works.
Change to use CLOCK_GetFlexCommClkFreq which can work on both the old
and new SDK.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-09-27 13:41:13 -07:00
Andy Ross
bab348e915 drivers/timer/hpet: Work around crazy qemu behavior
At least twice (to be fair: twice among thousands of test runs), I've
seen this device return "backwards" times in SMP, where the counter
value read from one CPU is behind the saved value already seen on the
other.  On hardware this should obviously never happen, HPET is a
single global device.

Add a simple workaround on QEMU targets so the math doesn't blow up.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-09-26 16:54:06 -04:00
Andrei Emeltchenko
9ed544ba7c drivers: pwm: pwm_mchp_xec: Fix spelling
Correct function name spelling syclet -> cycles.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-09-26 16:52:58 -04:00
Andrei Emeltchenko
14c200d022 drivers: pwm: Fix wrong dc calculation for pwm tests
Values used in tests/drivers/pwm/pwm_api overflows calculation inside
xec_compute_dc(). Make calculation to be done in u64_t and then
convert to int.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-09-26 13:49:21 -07:00
Armando Visconti
82b9172718 driver/sensor: lis2mdl: remove sensitivity
LIS2MDL sensor has a fixed sensitivity equal to 1500 uGauss/LSB.
So, use a constant value directly.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-09-26 13:42:59 -07:00
Armando Visconti
44f373e806 driver/sensor: lis2mdl: make use of STdC definitions
Port the lis2mdl sensor driver on top of the lis2mdl_StdC
HAL interface (in modules/hal/st/sensor/stmemsc/).

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-09-26 13:42:59 -07:00
Armando Visconti
a34a5885b8 driver/sensor: lis2mdl: change order of operations in trigger init
Creation of callback thread is moved before the enabling of
the callback itself.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-09-26 13:42:59 -07:00
Armando Visconti
89199dcbaf driver/sensor: lis2mdl: Fix the temperature fractional value
The temperature fractional value has to be assigned multiplied
by 10^6.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-09-26 13:42:59 -07:00
Andrzej Głąbek
f43bae38e8 dts: Use separate compatibles for Nordic SPI/SPIM/SPIS peripherals
This commit introduces separate "compatible" strings for DTS nodes
representing different types of Nordic SPI peripherals. Previously
"nordic,nrf-spi" was used for both SPI and SPIM. SPIS was already
handled separately.

Quite a few files need to be touched by this commit but the changes can
be divided into groups of related or very similar ones, distinguishable
by the initial part of the path to the modified file:

* dts/bindings/spi/
  new binding for "nordic,nrf-spim" is added and common fields for all
  3 types of Nordic SPI peripherals are extracted to a shared file

* dts/arm/nordic/
  "compatible" properties in spiX nodes are updated (when there is no
  choice as only one type of SPI peripheral is available) or replaced
  with a comment pointing out that the proper type of peripheral needs
  to be picked at some upper layer

* drivers/spi/
  spi_nrfx_spim driver is updated with the new form of macros generated
  from dts

* boards/
  all spiX nodes in dts files for boards equipped with an nRF chip are
  updated with the proper "compatible" property, according to the type
  of SPI peripheral that is currently selected for the board by the
  corresponding Kconfig choice option (SPI_x_NRF_SPI*)

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-09-26 19:13:17 +02:00
Andrzej Głąbek
dd4c57d564 dts: Use separate compatibles for Nordic TWI/TWIM/TWIS peripherals
This commit introduces separate "compatible" strings for dts nodes
representing different types of Nordic TWI peripherals. Previously
"nordic,nrf-i2c" was used for both TWI and TWIM, and TWIS was not
supported.

Quite a few files need to be touched by this commit but the changes can
be divided into groups of related or very similar ones, distinguishable
by the initial part of the path to the modified file:

* dts/bindings/i2c/
  new bindings for "nordic,nrf-twim" and "nordic,nrf-twis" are added
  and the one for "nordic,nrf-i2s" is renamed to "nordic,nrf-twi",
  common fields for all these bindings are extracted to a shared file

* dts/arm/nordic/
  "compatible" properties in i2cX nodes are updated (when there is no
  choice as only one type of TWI peripheral is available) or replaced
  with a comment pointing out that the proper type of peripheral needs
  to be picked at some upper layer

* drivers/i2c/
  both flavors of i2c_nrfx drivers are updated with the new names of
  macros generated from dts

* boards/
  all i2cX nodes in dts files for boards equipped with an nRF chip are
  updated with the proper "compatible" property, according to the type
  of TWI peripheral that is currently selected for the board by the
  corresponding Kconfig choice option (I2C_x_NRF_TWI*)

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-09-26 19:13:17 +02:00
Johann Fischer
51f550cd07 usb: allow hardware to handle ZLP for Variable-length Data Stage
Allow hardware to handle ZLP for Variable-length Data Stage.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-09-26 13:19:02 +02:00
Jim Paris
f1137e4782 drivers: pwm_nrfx: use IS_ENABLED to eliminate a bunch of #ifndefs
For the macros that take on 0/1 values, we can use the existing
IS_ENABLED macro to remove a bunch of code.

Signed-off-by: Jim Paris <jim@jtan.com>
2019-09-25 17:42:53 +02:00
Jim Paris
4aaa08acfd drivers: pwm_nrfx: Add support for center-aligned mode
Add support for up-and-down counter mode, which aligns the center of
each channel's pulses instead of their initial edges.  This is enabled
on a PWM periphral by adding the "center-aligned" property to the
device tree, e.g.:

    &pwm0 {
        status = "okay";
        center-aligned;
        ch0-pin = <15>;
        ch1-pin = <17>;
        ch1-inverted;
    };

Signed-off-by: Jim Paris <jim@jtan.com>
2019-09-25 17:42:53 +02:00
Timo Teräs
52453082f8 drivers: spi_nor: support Microchip SPI flash global unblock
Microchip SPI flash require Global unblock command before writing
is allowed.

Signed-off-by: Timo Teräs <timo.teras@iki.fi>
2019-09-25 17:41:31 +02:00
Yannis Damigos
efec7f73b7 dts: esp32: Add GPIO support in DT
Add GPIO support in DT

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2019-09-25 17:39:42 +02:00
Oane Kingma
536e785b93 drivers: (le)u(s)art_gecko: use DT defined clock identifiers
Use the device tree to assign the correct peripheral clock to each
UART/USART/LEUART. Previously, the clock identifier was determined
through the sequence number of the instantiated UART. This meant
configuring all UARTs when only one of the later UARTs was required.

Signed-off-by: Oane Kingma <o.kingma@interay.com>
2019-09-25 03:43:47 -07:00
Daniel Leung
f3361f4027 drivers/adc: Add support for Microchip's XEC ADC device
Such ADC is found on mec1501.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-09-25 06:12:52 -04:00
Brett Witherspoon
48533751e0 drivers: ieee802154: add CC13xx / CC26xx driver
Add IEEE 802.15.4 suuport for TI CC13xx / CC26xx devices.

Signed-off-by: Brett Witherspoon <spoonb@cdspooner.com>
2019-09-25 08:49:55 +03:00
Ioannis Glaropoulos
cfa2fb278f drivers: serial: mcux: enforce an error-free header inclusion
We need to change the order of inclusions in
uart_mcux_lpuart.c, to avoid build errors. This
is required since the driver structures contain
a field named DATA, which is also a macro defined
in the linker script.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-09-24 21:53:49 -04:00
Andrei Emeltchenko
a4ba22c627 drivers: counters: Fix coding style issues
Replace zephyr_library_sourceS_ifdef with zephyr_library_sources_ifdef
and follow cmake coding style.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-09-24 11:40:53 -07:00
Ulf Magnusson
e833fafd4b drivers: usb: stm32: Fix broken DT_USB_ENABLE_PIN_REMAP test
'enable-pin-remap' is defined as 'type: boolean' in
dts/bindings/usb/st,stm32-usb.yaml, so it generates either

    #define DT_USB_ENABLE_PIN_REMAP 1

or

    #define DT_USB_ENABLE_PIN_REMAP 0

depending on if 'enable-pin-remap;' appears on the node or not.

Since a macro is always generated, #ifdef won't work. The test needs to
be this instead:

    #if DT_USB_ENABLE_PIN_REMAP == 1

(Should be careful with '#if HMZ == 0' though, because it's true even if
HMZ is undefined.)

This behavior was inherited from the old scripts, and some things depend
on it, e.g. by expanding macros in initializers.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-09-24 09:36:31 -07:00
Andrzej Głąbek
35754375bc soc: nordic: Get rid of nrf_common.h
This file contains redundant definitions of a bunch of nRF IRQ numbers
(not all, however) that only generates confusion, as enumeration values
provided by MDK can be used instead.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-09-24 16:20:16 +02:00
Andrzej Głąbek
c24c463328 soc: nordic: Include <nrfx.h> instead of <nrf.h> from <soc.h>
This change is done so that there is no need to additionaly include
<nrfx.h> before <soc/nrfx_coredep.h> (what might be a bit surprising)
and so that <nrfx_config.h> doesn't need to be include separately for
nRF SoCs requiring a special mapping of peripheral accessing symbols.

This commit removes also no longer needed inclusions and updates
the hal_nordic module with required minor correction of nrfx_glue.h.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-09-24 16:20:16 +02:00
Andrzej Głąbek
57c6cfc9cd nordic: Use hal/ in all inclusions of nrfx HAL header files
Header files of nrfx HALs are not supposed to be included directly
but only with their names prepended with the hal/ directory (so that
an inclusion of an nrfx HAL header clearly differs from an inclusion
of an nrfx driver header).

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-09-24 16:20:16 +02:00
Mieszko Mierunski
cacb529206 drivers: nrf: Add 2 stop bits option to nrf UARTE and UART driver
nrf52840 and nrf9160 have possible configuration of two stop bits
for UART and  UARTE, this commit adds handling of it to driver.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2019-09-24 15:23:33 +02:00
Krzysztof Chruscinski
3036c3627d drivers: counter: nrf_rtc: Fix top value handling
Top value interrupt was not enabled because channel index was
used instead of mask. Additionally, interrupt was enabled only
when user callback was provided and not in case there was
custom top value and no top callback.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-09-24 09:01:22 +02:00
Ioannis Glaropoulos
95c2968d32 soc: arm: nxp: cleanup in soc.h headers
A commit that organizes the soc.h header of NXP SoCs:
- removing redundant inclusions of sys/util.h
- removing inclusions of device.h and kernel_includes.h
- including the auto-generated DTS board header
- including the fsl_common.h header
- fixing minor style issues

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-09-23 18:02:00 -07:00
Charles E. Youse
bd094ddac2 arch/x86: inline x2APIC EOI in 64-bit code
Like its 32-bit sibling, the 64-bit code should EOI inline rather than
invoking a function. Defeats the performance advantages of x2APIC.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-09-23 17:50:09 -07:00
Jakub Wegnerowski
ab1ba3d4cf drivers: hwinfo: Add LiteX DNA driver
This commit adds driver supporting reading DNA ID value for LiteX SoC
builder.

Signed-off-by: Jakub Wegnerowski <jwegnerowski@internships.antmicro.com>
Signed-off-by: Mateusz Holenko <mholenko@antmicro.com>
2019-09-21 21:36:00 +02:00
Jose Alberto Meza
e9dd54ed1c drivers: espi: xec: Ensure all eSPI VW are transmitted
When a eSPI slave needs to send back-to-back packets
updating status signal need to guarantee both status
reach the eSPI host, i.e. SCI=0 followed by SCI=1.
This change guarantees both packets are transmitted
over esSPI bus.

Allow to map eSPI host logical UART to a soc UART.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2019-09-20 14:30:40 -04:00
Pavlo Hamov
85c1d90fd6 drivers: i2c: stm32_Slave: Fix addr flag handling
In the main Addr handler code the F1 workaround was used.
Add compile time swith depending on SOC family.
So workaround is not afffecting F2/F4 families.

Signed-off-by: Pavlo Hamov <pavlo_hamov@jabil.com>
2019-09-19 20:52:23 -04:00
Markus Fuchs
8c69941642 drivers: ethernet: stm32: Add MAC address configuration support
This patch adds support for configuring the MAC address through the
Network Management API to the STM32 Ethernet driver.

Signed-off-by: Markus Fuchs <markus.fuchs@de.sauter-bc.com>
2019-09-19 20:46:56 -04:00
Daniel Leung
1ee9e1046a drivers/pwm: Add support for Microchip's XEC PWM devices
A 16bits on/off based PWM, found on MEC1501.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-09-19 20:45:37 -04:00
Vincent Wan
aeb8d017b5 drivers: timer: add RTC support as system clock for CC13X2/CC26X2
Add RTC timer driver for CC13X2/CC26X2, and use it instead of systick
as system clock. It is necessary to use this timer for power
management support, so that the system can exit from deep sleep upon
expiry of timeouts.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-09-19 13:43:10 -05:00
Peter Bigot
d566254e3f drivers: fix k_thread_create timeout argument
Use the named representation for no-wait to future-proof against a
change to the representation of timeout values.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-09-19 17:35:53 +02:00
Armando Visconti
3f72c4262c drivers: pinmux: stm32l4x: Add missing SPI macros
This commit adds:

 1. pin definitions for SPI1 on PE12-15 on STM32L4 devices
 2. SPI3 on PA15_SPI3_NSS

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-09-19 09:47:45 -05:00
Armando Visconti
c79925bd0f driver/sensor: IIS3DHHC: Fix DT_ macro typo for CS GPIO
The correct suffix name for selecting the GPIO for SPI Chip Select
is _CS_GPIOS_CONTROLLER and not _CS_GPIO_CONTROLLER.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-09-19 09:47:45 -05:00
Erwin Rol
efa44b1885 arm: stm32f4: Add CAN1 support
Add CAN1 pinmux definitions and DT entries for STM32F4 series.

Signed-off-by: Erwin Rol <erwin@erwinrol.com>
2019-09-19 08:52:53 -05:00
Michał Oleszczyk
2663f71c6a drivers/sensor: lis2dw12: fix for wrong gpio_callback handling
It seems that gpio_pin_disable_callback() has never been working
for that sensor as it was expected. We used there argument 'dev'
as its own (lis2dw12) device pointer. While this argument is a
gpio_port device pointer not lis2dw12 sensor device pointer. So
cfg->int_gpio_pin always tries to disable callback for some random
pin read from accidental data sector.

Signed-off-by: Michał Oleszczyk <oleszczyk.m@gmail.com>
2019-09-19 08:04:05 -05:00
Kumar Gala
140a8d0c8a console: Remove deprecated function console_register_line_input
console_register_line_input has been deprecated for at least 2 releases
so we can now remove it.  Remove native_stdin_register_input that is
associated with console_register_line_input.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-09-18 19:14:25 -05:00
Michał Oleszczyk
da4d00ee0a drivers/sensor: sht3xd: implement single shot mode
For now there is only periodic data acquisition mode implemented.
This mode is quite power consuming. Based on datasheet in idle
state in periodic data acquisition mode SHT3X consumes 45uA but
in single shot mode 0.2uA. For many applications where power
consumption has to be kept as low as possible single shot mode
is the only choice. Tester on custom board NRF52832 + SHT31-DIS.

Signed-off-by: Michał Oleszczyk <oleszczyk.m@gmail.com>
2019-09-18 18:03:32 -05:00
Johann Fischer
06733d53df drivers: ssd16xx: do not write default value to CTRL1 before update
Do not write default value to CTRL1 register before update.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-09-18 15:00:38 -05:00
Johann Fischer
17f7c59c83 drivers: ssd16xx: allow only specific RAM to update
Allow only spedific RAM to update.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-09-18 15:00:38 -05:00
Johann Fischer
8dcd06ff7c drivers: ssd16xx: use bytestring property for LUT and parameters
Use bytestring property for LUT, gdv, sdv and
softstart parameter.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-09-18 15:00:38 -05:00
Johann Fischer
b696e0f411 drivers: ssd16xx: cleanup Kconfig
Cleanup Kconfig.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-09-18 15:00:38 -05:00
Erwin Rol
c0ae674630 drivers: ethernet: stm32, sam, mcux: correctly set LAA bit
When randomly generating MAC addresses they will always be
locally administrated addresses, so the LAA bit should be set.
The LAA bit is the 2nd bit of the 1st byte of the MAC address
not the 2nd bit of the 4th byte.

Fixes: #16452

Signed-off-by: Erwin Rol <erwin@erwinrol.com>
2019-09-18 19:14:39 +03:00
Anas Nashif
d7f2055dd7 usb: remove QMSI include
No users of this after dropping quark platforms.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-09-18 11:06:18 -05:00
Anas Nashif
d14794a837 drivers: pinmux: remove qmsi pinmux driver
No users of this driver after dropping quark platforms.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-09-18 11:06:18 -05:00
Anas Nashif
27ff3f15f6 drivers: counter: remove qmsi counter driver
No users of this driver after dropping quark platforms.

COUNTER_0_NAME was only defined by the QMSI driver and was defined but
not used in DTS fixup files of ateml_sam0 SoCs. Removing those leftover
defines as well.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-09-18 11:06:18 -05:00
Anas Nashif
3138e10d5b drivers: i2c: remove qmsi I2C driver
No users of this driver after dropping quark platforms.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-09-18 11:06:18 -05:00
Anas Nashif
08b43fc9ef drivers: uart: remove qmsi UART driver
No users of this driver after dropping quark platforms.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-09-18 11:06:18 -05:00
Anas Nashif
5cde4ea245 drivers: dma: remove qmsi DMA driver
No users of this driver after dropping quark platforms.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-09-18 11:06:18 -05:00
Anas Nashif
ab48889164 drivers: watchdog: remove qmsi watchdog driver
No users of this driver after dropping quark platforms.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-09-18 11:06:18 -05:00
Anas Nashif
5a058dc29e drivers: flash: remove qmsi flash driver
No users of this driver after dropping quark platforms.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-09-18 11:06:18 -05:00
Anas Nashif
d314dc74a7 drivers: pwm: remove qmsi pwm driver
No users of this driver after dropping quark platforms.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-09-18 11:06:18 -05:00
Anas Nashif
8c2a63ab7d drivers: gpio: remove qmsi gpio driver
No users of this driver after dropping quark platforms.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-09-18 11:06:18 -05:00
Anas Nashif
6bdfe5dc16 drivers: gpio: remove sch gpio driver
Was used on galileo which was removed.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-09-18 11:06:18 -05:00
Pavlo Hamov
97e1ad1b8c boards: stm32f429i_disc1: add SPI5 support
Add support of RCC configuration.
Add pinmux items

Signed-off-by: Pavlo Hamov <pavlo_hamov@jabil.com>
2019-09-18 06:43:47 -05:00
Piotr Mienkowski
f98084131e drivers: clean up flags in gpio_intel_apl driver
Modify the way we test for flags as a precursor to the new GPIO API.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2019-09-18 13:28:58 +08:00
Peter A. Bigot
dc553f8fde drivers: gpio: fix misuse of u8_t where bool is intended
GPIO configuration flags will move and some that used to be in the low
8 bits are now higher, resulting in implicit constant conversion
overflows.  Use a boolean data type to hold boolean values.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2019-09-18 13:28:58 +08:00
Francisco Munoz
278da905bf drivers: ps2: Add driver for Microchip XEC family
Add the PS2 driver for XEC

Signed-off-by: Francisco Munoz <francisco.munoz.ruiz@intel.com>
2019-09-18 13:23:52 +08:00
Francisco Munoz
4426f49da1 drivers: ps2: Add syscall handler for PS/2 API
Introduction of syscall handlers for the PS/2 API

Signed-off-by: Francisco Munoz <francisco.munoz.ruiz@intel.com>
2019-09-18 13:23:52 +08:00
Francisco Munoz
86e6b8d5ea drivers: ps2: Add Kconfig for PS/2 driver
This commit adds the Kconfig for generic PS/2 drivers

Signed-off-by: Francisco Munoz <francisco.munoz.ruiz@intel.com>
2019-09-18 13:23:52 +08:00
Charles E. Youse
3038209695 drivers/timer/hpet.c: migrate to devicetree
This driver was still using CONFIG_* values to determine its address,
IRQ, etc. Add a binding for an "intel,hpet" device and migrate this
driver to devicetree.

Fixes: #18657

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-09-17 22:37:09 +08:00
Watson Zeng
75a65a0ad1 drivers: spi_dw: add WORD only access support
In some hardware, e.g. ARC HS Development kit,the peripheral
space of DesignWare SPI only allowes WORD access,
byte acess will raise bus error.

This commit adds support for this case

Signed-off-by: Watson Zeng <zhiwei@synopsys.com>
2019-09-17 20:40:38 +08:00
Watson Zeng
9eb379f2bf arc: hsdk: add pinmux driver support and doc enhancement
* add pinmux driver. hsdk board has arduino, mikrobus and
  pmod interfaces, which can be confiured for different function,
  such as: gpio, spi, uart, iic.
* add introduction for arduino, mikrobus and pmod interfaces.

Signed-off-by: Watson Zeng <zhiwei@synopsys.com>
2019-09-17 20:40:38 +08:00
Johann Fischer
e3ffd143c1 drivers: ssd1306: fix style
Fix style.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-09-17 06:49:37 -05:00
Johann Fischer
2388e3169c drivers: ssd1306: add DT properties to support 128x32 display
Add DT properties to support 128x32 display.

Fixes: #13725

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-09-17 06:49:37 -05:00
Johann Fischer
feef83d864 drivers: amg88xx: rework sensor driver to use DT
Rework sensor driver to use DT.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-09-17 06:27:21 -05:00
Jan Van Winkel
7e5c65d521 uart: native_posix: Moved declaration of native_uart_status
Move declaration of struct native_uart_status before definition of
a variable of its type

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2019-09-17 11:27:19 +02:00
Henrik Brix Andersen
5d4607554e drivers: can: flexcan: limit number of concurrent rx filters on k6x soc
Limit the number of concurrent FlexCAN RX filters in Kconfig on the
NXP Kinetis K6x SoC.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-09-16 15:36:37 -05:00
Markus Fuchs
f08caaf677 drivers: ethernet: stm32: Add carrier state detection
This patch adds carrier state detection to the STM32 Ethernet driver.

Fixes #16097

Signed-off-by: Markus Fuchs <markus.fuchs@de.sauter-bc.com>
2019-09-16 15:27:11 -05:00
Armando Visconti
871d132577 driver/sensor: add IIS3DHHC accelerometer sensor
Add support to STM IIS3DHHC the ultra-low noise, high-stability
three-axis linear accelerometer.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-09-16 14:07:56 -05:00
Erwan Gouriou
c9dcf37e6c Revert "gpio: stm32: support disabling and reenabling interrupts on pin"
This reverts commit 0951ce2d34.

This change introduces regression on GPIO interrupts handling
when several GPIOs are configured.

Fixes #19177

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-09-16 05:44:15 -05:00
Kumar Gala
29e55d74e8 rtc: Remove old rtc functionality
Remove the old rtc functionality as its been deprecated for 2 releases
now.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-09-14 07:33:38 -05:00
Tomasz Bursztyka
41c93a589c driver/counter: Add support for Microchip's XEC basic timer devices
Such basic timer is found on MEC150x for instance.
Since instances have dedicated data, let's define specifice instance
based on unique DT base address definition.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-09-14 12:13:49 +08:00
Kumar Gala
038d2b272d kconfig: counter: nrfx: Convert to use new kconfigfunctions
Convert use of dt_int_val to dt_node_has_bool_prop.  As we want to
remove dt_int_val.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-09-13 11:42:34 -05:00
Kumar Gala
8a50048b2b kconfig: serial: sam0: Convert to use new kconfigfunctions
Convert use of dt_int_val to dt_compat_enabled.  As we want to
remove dt_int_val.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-09-13 11:42:34 -05:00
Kumar Gala
8ce0cf0126 kconfig: Convert device tree chosen properties to new kconfigfunctions
Convert how we get the various chosen properties like "zephyr,console"
to use the new kconfig functions like dt_chosen_to_label.

Because of how kconfig parses things we define a set of variables of the
form DT_CHOSEN_Z_<PROP> since comma's are parsed as field seperators in
macros.

This conversion allows us to remove code in gen_defines.py for the
following chosen properties:

zephyr,console
zephyr,shell-uart
zephyr,bt-uart
zephyr,uart-pipe
zephyr,bt-mon-uart
zephyr,uart-mcumgr
zephyr,bt-c2h-uart

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-09-13 11:42:34 -05:00
Alexander Wachter
ec0e199206 drivers: can: mcux: Persuade the driver to send in chronological order
The mcux CAN controller uses frame ID and position to calculate the
priority, but the driver expects chronological ordering.
This PR mimics this behavior by only using the last free message box.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-09-13 09:58:11 -05:00
Saravanan Sekar
1aa696bc2b wifi: eswifi: Implement TCP/UDP socket offload with TLS
Newly implement socket based communication on eswifi mainly to
achive TLS. Tested with Inventek ISM43362-M3G-L44.

Signed-off-by: Saravanan Sekar <saravanan@linumiz.com>
2019-09-13 16:54:57 +03:00
Kumar Gala
c17297c18a drivers: ens210: Fix error in header guard
Looks like some copy/paste bug snuck in.  Fix the include header guard
to define the proper name.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-09-12 22:04:55 -05:00
Piotr Mienkowski
b914ba8831 drivers: remove gpio_atmel_sam3 driver
The gpio_atmel_sam3 is no longer required since the gpio_sam, common
SAM family GPIO driver, provides improved functionality.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2019-09-12 13:25:30 -05:00
Piotr Mienkowski
17b3ead21a drivers: fix #ifdef in gpio_sam driver
- prefix SOC_SERIES_ defines with CONFIG_
- exclude pull down configuration on sam3x series

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2019-09-12 13:25:30 -05:00
Philémon Jaermann
a1aabbb08a drivers: watchdog: Pass timeout in ms if iwdg is started at boot
iwdg_stm32_install_timeout expects a timeout passed in
milli seconds. As the timeout is defined in micro
seconds in Kconfig.stm32, we need to divide by
USEC_PER_MSEC when CONFIG_IWDG_START_AT_BOOT is
activated because iwdg_stm32_install_timeout makes
the multiplication by USEC_PER_MSEC.

Fixes #18695

Signed-off-by: Philémon Jaermann <p.jaermann@gmail.com>
2019-09-12 08:46:34 -05:00
Björn Stenberg
b6454d5f3f STM32 wdg: Remove use of float
Using int avoids pulling in several kilobytes of float math code.

Signed-off-by: Björn Stenberg <bjorn@haxx.se>
2019-09-12 08:43:33 -05:00
Marcin Niestroj
0951ce2d34 gpio: stm32: support disabling and reenabling interrupts on pin
Up to now interrupts could be only configured once, with no way to
disable them in runtime.

Allow interrupts to be disabled in runtime and then properly reenabled
on user request. This allows to ignore interrupts when software is not
expecting them.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2019-09-12 08:41:44 -05:00
Erwan Gouriou
b42ad680c5 dts/Kconfig: Remove symbol HAS_DTC_USB
Symbol not used, so clean it up.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-09-12 08:16:42 -05:00
Erwan Gouriou
21d39eff6c dts/Kconfig: Remove symbol HAS_DTS_QDEC.
Symbol not used, so clean it up.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-09-12 08:16:42 -05:00
Erwan Gouriou
555936f771 dts/Kconfig: Remove unused HAS_DTS_SPI
Symbol is always "and'ed" with the symbol that
selects it, so no effect. Clean it up.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-09-12 08:16:42 -05:00
Erwan Gouriou
e7574e1c00 dts/Kconfig: Remove unused HAS_DTS_ADC
Symbol not used clean it up.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-09-12 08:16:42 -05:00
Armando Visconti
b7944510a4 dts/bindings: sensors: remove '-magn' extension from lis2mdl name
The LIS2MDL is not a combo device, but pure magnotemeter.
Hence, '-magn' extension is not adding information and can
be removed from dts compatible name as well as binding filename.

Instead specify '-i2c' or '-spi' to distinguish between the names.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-09-12 07:58:34 -05:00
Johann Fischer
d8d7782790 drivers: eth: add driver for ENC424J600 Ethernet Controller
Add driver for ENC424J600 Ethernet Controller.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-09-12 11:30:19 +03:00
Andrew Boie
6fd6b7e50a xtensa: remove legacy arch implementation
We re-wrote the xtensa arch code, but never got around
to purging the old implementation.

Removed those boards which hadn't been moved to the new
arch code. These were all xt-sim simulator targets and not
real hardware.

Fixes: #18138

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-09-12 01:26:34 -04:00
Andy Ross
643701aaf8 kernel: syscalls: Whitespace fixups
The semi-automated API changes weren't checkpatch aware.  Fix up
whitespace warnings that snuck into the previous patches.  Really this
should be squashed, but that's somewhat difficult given the structure
of the series.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-09-12 11:31:50 +08:00
Andy Ross
075c94f6e2 kernel: Port remaining syscalls to new API
These calls are not accessible in CI test, nor do they get built on
common platforms (in at least one case I found a typo which proved the
code was truly unused).  These changes are blind, so live in a
separate commit.  But the nature of the port is mechanical, all other
syscalls in the system work fine, and any errors should be easily
corrected.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-09-12 11:31:50 +08:00
Andy Ross
346cce31d8 kernel: Port remaining buildable syscalls to new API
These calls are buildable on common sanitycheck platforms, but are not
invoked at runtime in any tests accessible to CI.  The changes are
mostly mechanical, so the risk is low, but this commit is separated
from the main API change to allow for more careful review.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-09-12 11:31:50 +08:00
Andy Ross
6564974bae userspace: Support for split 64 bit arguments
System call arguments, at the arch layer, are single words.  So
passing wider values requires splitting them into two registers at
call time.  This gets even more complicated for values (e.g
k_timeout_t) that may have different sizes depending on configuration.
This patch adds a feature to gen_syscalls.py to detect functions with
wide arguments and automatically generates code to split/unsplit them.

Unfortunately the current scheme of Z_SYSCALL_DECLARE_* macros won't
work with functions like this, because for N arguments (our current
maximum N is 10) there are 2^N possible configurations of argument
widths.  So this generates the complete functions for each handler and
wrapper, effectively doing in python what was originally done in the
preprocessor.

Another complexity is that traditional the z_hdlr_*() function for a
system call has taken the raw list of word arguments, which does not
work when some of those arguments must be 64 bit types.  So instead of
using a single Z_SYSCALL_HANDLER macro, this splits the job of
z_hdlr_*() into two steps: An automatically-generated unmarshalling
function, z_mrsh_*(), which then calls a user-supplied verification
function z_vrfy_*().  The verification function is typesafe, and is a
simple C function with exactly the same argument and return signature
as the syscall impl function.  It is also not responsible for
validating the pointers to the extra parameter array or a wide return
value, that code gets automatically generated.

This commit includes new vrfy/msrh handling for all syscalls invoked
during CI runs.  Future commits will port the less testable code.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-09-12 11:31:50 +08:00
Ioannis Konstantelias
414e4d30a0 drivers: watchdog: stm32: Add implementation for WWDG
Added drivers for System Window Watchdog of STM32 platform.

Signed-off-by: Ioannis Konstantelias <ikonstadel@gmail.com>
2019-09-11 22:13:36 -05:00
Filip Brozovic
2a2113e966 drivers: i2c: mcux_i2c: add instances 2 and 3
Adds instances 2 and 3 to the mcux i2c shim driver.

Signed-off-by: Filip Brozovic <fbrozovic@gmail.com>
2019-09-11 09:23:28 -05:00
Filip Brozovic
1fd4ec9577 drivers: i2c: mcux_i2c: add instance initialization macro
Use a macro instead of repeating the initialization code
for each i2c instance.

Signed-off-by: Filip Brozovic <fbrozovic@gmail.com>
2019-09-11 09:23:28 -05:00
Filip Brozovic
e464e98067 drivers: serial: Add instance 4 to mcux lpuart shim driver
Adds instance 4 to the mcux lpuart shim driver.

Signed-off-by: Filip Brozovic <fbrozovic@gmail.com>
2019-09-11 09:23:28 -05:00
Mohamed ElShahawi
bcd9e49f3f drivers: esp32: UART - use dts config for HW flow Control
- dts updated for UART1/2
- Additional check added to _INIT macro to configure flow control mode
- Additional check added to _INIT macro to set CTS/RTS gpios values
- Additional check added for gpio config

Signed-off-by: Mohamed ElShahawi <ExtremeGTX@hotmail.com>
2019-09-11 07:50:20 -05:00
Mohamed ElShahawi
0705be344c drivers: esp32: UART Fix yaml/dts binding name
replace "xtensa" with "espressif", as the latter is the correct
vendor name.

Signed-off-by: Mohamed ElShahawi <ExtremeGTX@hotmail.com>
2019-09-11 07:50:20 -05:00
Mohamed ElShahawi
2d035c4191 drivers: esp32: Add UART Driver with FIFO/Interrupt support
- Fixes #3981
- Implement UART Polling functions
- Implement UART Interrupt APIs
- Remove dependency on esp32_rom_uart_xxx functions
- Update Device tree with UART addresses and pin config
- Update ESP32 UART KConfig

Notes about implementation:
- Interrupts now defined as a local macros, and should be removed
later on, when interrupts for esp32 are supported in dts

- Threshold interrupts are used for TX/RX
- Reseting FIFOs using _RST bit will corrupt FIFO of UART2 when used for
UART1 and vice-versa, so a generic way is used for all three UARTs

- Old Silicon rev is not supported

Signed-off-by: Mohamed ElShahawi <ExtremeGTX@hotmail.com>
2019-09-11 07:50:20 -05:00
Kumar Gala
b546ef3748 drivers: audio: tlv320dac310x: Explicitly set GPIO_DIR_OUT
As a precursor to the new GPIO API in which GPIO_DIR_OUT isn't a dts
flag move setting of GPIO_DIR_OUT from the dts to explicitly in the
code.  We remove setting the flag in intel_s1000_crb.dts as part of this
cleanup.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-09-11 05:16:09 -05:00
Chris Schramm
ed9c1ce55d drivers/gpio: pcal9535a: fix i2c write
writing to both port registers of pcal9535a
was broken

fixes #17625

Signed-off-by: Chris Schramm <schramm@makaio.com>
2019-09-10 15:09:53 -05:00
Kumar Gala
95f78bcacf interrupt: Convert RISC-V plic to use multi-level irq support
Utilize the multi-level irq infrastructure and replace custom handling
for PLIC on riscv-privilege SoCs.  The old code offset IRQs in drivers
and various places with RISCV_MAX_GENERIC_IRQ.  Instead utilize Zephyr's
encoded IRQ and replace offsets in drivers with the IRQ define from DTS.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-09-10 07:34:57 -05:00
Kumar Gala
d16b9c37af interrupt_controller: plic: remove plic.h
Fold plic.h into plic.c as the .h only defined two things that are
only used in plic.c.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-09-10 07:34:57 -05:00
Erwan Gouriou
90df6a3291 drivers/pinmux: stm32: Use pull-up for _SPI_NSS pins
To work efficiently, SPI_NSS pins require pull-up configuration.
Fix this for whole STM32 series.

Fixes #17998

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-09-10 06:39:50 -05:00
Andrzej Głąbek
70d426bd33 modules: Kconfig: Unify the way of enabling instances in nrfx drivers
Use a consistent way of enabling particular instances of peripherals
in nrfx drivers through options defined in modules/Kconfig.nordic,
to make the usage of nrfx drivers in Zephyr, especially the ones for
which there are no Zephyr driver shims (yet), easier.

Jira: NCSDK-2744

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-09-10 13:23:44 +02:00
Vincent Wan
7bcaf3696d drivers: wifi: simplelink: fixes to support CONFIG_NET_NATIVE=n
Remove unnecessary calls to net_if_ipv4_addr_add() and
net_if_ipv4_set_gw(), to prevent link errors when CONFIG_NET_NATIVE
is set to n.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-09-10 12:45:38 +03:00
Jukka Rissanen
6cf1da486d net: Add CONFIG_NET_NATIVE option for selecting native IP
Allow user to disable native IP stack and use offloaded IP
stack instead. It is also possible to enable both at the same
time if needed.

Fixes #18105

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-09-10 12:45:38 +03:00
Michał Oleszczyk
e4ed17472f driver/sensor: lis2dw12: single/double tap trigger implementation
Implementation for two new interrupt triggers: single tap and
double tap. Add new Kconfig options to configure those triggers:
trigger mode (single/single and double), latency/quiet/shock time,
threshold levels, active axes.

Signed-off-by: Michał Oleszczyk <oleszczyk.m@gmail.com>
2019-09-09 10:52:57 -05:00
Charles E. Youse
4a166f4913 drivers/pci: remove legacy PCI implementation
This has been subsumed by the new implementation in drivers/pcie.
We remove the legacy subsystem, related tests, shell module, and
outdated documentation/config references.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-09-08 22:09:10 -04:00
Charles E. Youse
34ffdd0aab drivers/spi/spi_intel.c: remove Quark SPI support
This was only used on Quark SoCs. It is no longer used, can no
longer be tested, and it's reliant upon the deprecated legacy PCI
subsystem. Remove it to prevent bitrot.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-09-08 22:09:10 -04:00
Charles E. Youse
cda625b726 drivers/ethernet/eth_dw: remove DesignWare Ethernet driver
This was only used on the Quark SoCs. It is no longer used, can no
longer be tested, and it's reliant upon the deprecated legacy PCI
subsystem. Remove it to prevent bitrot.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-09-08 22:09:10 -04:00
Charles E. Youse
68f45fd6d4 drivers/gpio/gpio_dw: remove support for legacy PCI interface
Only Quark SoCs used this IP block hanging off a PCI bus, and the PCI
support is written for the deprecated legacy PCI subsystem, so remove.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-09-08 22:09:10 -04:00
Charles E. Youse
f8789d5276 drivers/pci: remove support for Quark PCI legacy bridge
We have dropped support for Quark SoCs, and so too for this device.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-09-08 22:09:10 -04:00
Jose Alberto Meza
599c2b80d2 drivers: i2c: xec: Add proper error handling for I2C transactions
Adjust I2C timeouts after k_busy_wait precision has increased.
Report error on first I2C message failure.
Send STOP condition when error is detected.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2019-09-08 17:11:26 -04:00
Christoph Schramm
ce4cc465fc driver: modem: add simple power management to modem receiver
As modem receiver is using UART, it requires disabling
of the UART and its callbacks to save power.
This adds simple sleep/wake functions which should be
called from defined device_pm functions in modem drivers later.

Signed-off-by: Christoph Schramm <schramm@makaio.com>
2019-09-08 12:41:29 +02:00
Johann Fischer
e16217aa06 drivers: usb_dc_sam: validate pointer in usb_dc_ep_is_stalled
Validate pointer argument in usb_dc_ep_is_stalled.

Fixes: #18824

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-09-08 12:35:23 +02:00
Frank Li
a55620e281 drivers: ssd1306: Write data from any coordinate
Support write data from any coordinate.
ssd1306 can work with lvgl

Signed-off-by: Frank Li <lgl88911@163.com>
2019-09-07 17:15:41 +02:00
Daniel Leung
460e3c0094 drivers/interrupt_controller: rv32m1_intmux: add get_line_state
This implements the new API to query whether a particular IRQ
line is enabled.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-09-07 10:20:51 -04:00
Daniel Leung
635aadc9a9 drivers/interrupt_controller: dw_ictl: add get_line_state()
This implements the new API to query whether a particular IRQ
line is enabled.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-09-07 10:20:51 -04:00
Daniel Leung
958f2d5295 drivers/interrupt_controller: cavs_ictl: add get_line_state()
This implements the new API to query whether a particular IRQ
line is enabled.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-09-07 10:20:51 -04:00
Tomasz Bursztyka
939fc26c2e drivers/watchdog: Add support for Microchip XEC device
Such watchdog timer is found on mec1501.
It comes with a support of dbg stall feature and interrupt support.

It does not support multistaging.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-09-07 09:56:58 -04:00
Scott Worley
26c411f6bd drivers : timer : MEC1501 RTOS timer load delay work-around.
MEC1501 RTOS timer internal counter is on the 32KHz clock domain.
The register interface is on the AHB clock. When the timer is started
hardware synchronizes to the next 32KHz clock edge resulting is a
variable delay moving the value in the preload register into the
count register. The maximum delay is one 32KHz clock period (30.5 us).
We work-around this delay by checking if the timer has been started
and not using the count value which is still 0. Instead we state zero
counts have elapsed.

Signed-off-by: Scott Worley <scott.worley@microchip.com>
2019-09-03 18:37:46 +02:00
Mieszko Mierunski
6a6ed174b7 drivers: uart: Properly configure pins in NRF UARTE power management
Configure pins before enabling and after disabling UARTE through
power management functions.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2019-08-28 14:04:18 +02:00
Marcin Niestroj
c62b57fbd4 gpio: stm32: fix build for stm32l0x with no GPIOH
Some smaller stm32l0x MCUs, such as stm32l011x, do not have GPIOH
port. Fix build for those by checking LL_SYSCFG_EXTI_PORTH macro.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2019-08-26 09:48:54 -05:00
Mieszko Mierunski
f2bd628c5a drivers: nrf: Fix RX timeout and ENDRX ISR handling.
Ensure that two routines won't interfere with eachother.
In current situation there is possibility that ENDRX will be called
during rx_timeout routine or vice-versa which will result in wrong
offset and length passed to user.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2019-08-26 16:21:25 +02:00
Mieszko Mierunski
4a13041c38 drivers: uart: Fix incorrect len and offset in nrf UARTE async API.
Due to longer than expected user callback handling, rx byte counting
got out of sync with real values. It leads to incorrect values
reported to user. This fix adds sync point at the end of buffer.

When using hardware rx counting this issue should not occur.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2019-08-26 16:21:25 +02:00
Ioannis Glaropoulos
99cca4672c drivers: sam: entropy: implement get_entropy_isr
The commit contributes the implementation of
get_entropy_isr API function for the SAM entropy
driver. The implementation is similar to get_entropy,
with the difference that it does not invoke k_yield()
when called with the ENTROPY_BUSYWAIT options flag set.
When the function is invoked without the ENTROPY_BUSYWAIT
flag, it simply returns whatever data is available,
without busy waiting on the RNG herdware.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-08-23 17:03:18 +02:00
Ioannis Glaropoulos
75f9512755 drivers: entropy: nrf: fic minor typos
Fix a couple of minor typos in entropy/entropy_nrf5.c.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-08-23 17:03:18 +02:00
Vincent Wan
0134a7de73 drivers: wifi: simplelink: fix 'log_strdup missing' error messages
Due to commit a211afb041, an error on
missing log_strdup() call is seen when running samples for CC32xx
devices that use the Wi-Fi driver. Adding log_strdup() calls to fix
this.

Fixes #18563

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-08-22 01:44:55 -05:00
Anas Nashif
f156e95bbd ext: hal: make TI HAL a zephyr module
Move TI HAL to a module repository:
https://github.com/zephyrproject-rtos/hal_ti

managed by west.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-08-21 12:46:39 -05:00
Anas Nashif
a47f0a35b9 i2c: remove unused qmsi driver
This driver was used by the sensor subsystem in Arudino 101. Remove as
the board was dropped.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-08-21 09:52:01 -04:00
Anas Nashif
ab9c528734 gpio: remove unused qmsi driver
This driver was used by the sensor subsystem in Arudino 101. Remove as
the board was dropped.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-08-21 09:52:01 -04:00
Peter Bigot
d28e65a784 drivers/timer/nrf_rtc_timer: clarify intent of ZLI compensation
The variable enabling entry to the zero latency interrupt compensation
loop was named generically, and its logic inverted, making the code
difficult to understand.  Change the name and initial value to more
clearly indicate its role.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-08-20 08:34:15 +02:00
Kumar Gala
59bbf3a521 drivers: espi: espi_mchp_xec: Fix wrong size type for status var
In status variable in espi_pc_isr should have been a 32-bit unsigned int
as ESPI_PC_REGS->PC_STATUS is 32-bits.

Fixes #18359
Coverity-CID: 203521

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-08-19 17:48:42 +02:00
Karsten Koenig
758c461252 drivers: can: mcp2515: fix devicetree bindings
Adding required fields to the devicetree overlay of the CAN sample as
this is often used as a reference. Also use these fields instead of the
KConfig entries.

Signed-off-by: Karsten Koenig <karsten.koenig.030@gmail.com>
2019-08-18 09:56:42 +02:00
Erwan Gouriou
0381e8cbe9 drivers/flash: stm32l4: Handle pages_per_bank for all variants
Variable pages_per_bank has been introduced to ease page erase
in dual bank configurations. This has been implemented using
FLASH_OPTR_DUALBANK definition.
It happen that this was not taking into account L4+ series that
use FLASH_OPTR_DBANK instead of FLASH_OPTR_DUALBANK. This lead
to compilation issue for this driver in case of L4+ series.
So, this patch is adding the support of FLASH_OPTR_DBANK definition.

Besides, FLASH_OPTR_DUALBANK (as FLASH_OPTR_DBANK) are actually
defining availability of an option byte to configure use of Dual
Bank. So besides of its definition, its value in flash OPTR register
should be checked to ensure Dual Bank configuration is used.
This patch is taking this into account by adding the check of this
byte. Error -ENOTSUP is returned in case Single Bank is configured
since it has not be validated yet (in case Dual Bank is possible but
not configured).

Fixes #18246 for nucleo_l4r5zi

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-08-17 20:05:21 +02:00
Andrzej Głąbek
c542a4c56f drivers: gpio_nrfx: Correct the way the callbacks are fired
Add additional masking of the pins with fired callback triggers
against the currently enabled callbacks, in order to not call
handlers for callbacks that got disabled in some other callback
handlers that were called in the same ISR execution.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-08-14 14:49:55 +02:00
Michael Scott
a7379234ba drivers: modem: socket: sock_fd isn't an index in modem_socket_put()
modem_socket_put() originally took an index as a parameter and was
later swapped to sock_fd as the reference.

The internal code was never updated to reflect that sock_fd isn't an
index -- it's a separate reference generated via z_reserve_fd().

Let's correct the modem_socket_put() logic.

Fixes: https://github.com/zephyrproject-rtos/zephyr/issues/18238

Reported-by: Tobias Svehagen <tobias.svehagen@gmail.com>
Signed-off-by: Michael Scott <mike@foundries.io>
2019-08-14 11:01:47 +02:00
Alexander Wachter
4c8901869c drivers: can: mcux: Fix can_detach
The detach function didn't call FLEXCAN_TransferAbortReceive.
The state of the mailbox after detaching was still kFLEXCAN_StateRxData
and therefore a new filter couldn't be attached.
This PR calls FLEXCAN_TransferAbortReceive and releases the mailbox.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-08-14 08:49:50 +02:00
Alexander Wachter
41c36b7cd6 drivers: can: mcux: Fix set can_send callbacks
The callback function and callback argument were not set when the
filter is attached, and therefore, the callback function was never
called. This commit sets the function and callback correct.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-08-14 08:49:50 +02:00
Peter Bigot
5f481bb042 drivers: rearrange for standard use of extern "C" in private headers
Consistently place C++ use of extern "C" after all include directives,
within the negative branch of _ASMLANGUAGE if used.

Only updated in headers that already had support for drivers built with
a C++ compiler.

The spi_dw.h file defines macros to declare functions, then uses them
within a file that may have out-of-tree overrides.  In this case we
leave the including file extern "C" active for backward compatibility.

Background from issue #17997:

Declarations that use C linkage should be placed within extern "C"
so the language linkage is correct when the header is included by
a C++ compiler.

Similarly #include directives should be outside the extern "C" to
ensure the language-specific default linkage is applied to any
declarations provided by the included header.

See: https://en.cppreference.com/w/cpp/language/language_linkage
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-08-13 18:00:31 +02:00
Wayne Ren
4fb8bf61c0 drivers: ns16550: add WORD only access support
In some hardware,e.g. ARC HS Development kit,the
peripheral space of ns16550 only allowes WORD
access,  byte acess will raise bus error.

This commit adds support for this case

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2019-08-10 20:11:29 +02:00
Wayne Ren
cca39204c2 arch: arc: add initial support of ARC TEE
* it's based on ARC SecureShield
* add basic secure service in arch/arc/core/secureshield
* necesssary changes in arch level
   * thread switch
   * irq/exception handling
   * initialization
* add secure time support

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2019-08-10 17:45:22 +02:00
Michael Scott
ee92cf4d68 drivers: modem: ublox-sara-r4: Support SARA-U2 modems, sense VINT
This adds support for SARA-U2 modems. They have different timings on
the PWR_ON pin, don't support AT+CESQ and require a manual GPRS
connection setup.

The VINT pin is used as a more reliable and faster way to power on the
modem.

Based on work by Göran Weinholt <goran.weinholt@endian.se>

Signed-off-by: Michael Scott <mike@foundries.io>
2019-08-10 00:03:39 +02:00
Michael Scott
ebf6520d87 drivers: modem: ublox SARA convert to modem context
Let's convert the SARA modem to use the more generic modem context
layers so that we don't maintain a lot of what should be shared code.

This conversion includes:
- modem context as the helper umbrella
- uart modem interface layer
- generic command handler layer
- modem socket helper
- move from net_context offload API to socket offload API

Signed-off-by: Michael Scott <mike@foundries.io>
2019-08-10 00:03:39 +02:00
Michael Scott
f5c45c2946 drivers: modem: introduce socket helper layer
Many modems implement socket-based APIs to manage data connections.
This layer provides much of the groundwork for keeping track of
these "sockets" throughout their lifecycle (from the initial offload
API calls through the command handler call back layers):
- structure for holding socket data like IP protocol, destination,
  source and incoming packet sizes
- configuration to note modem starting socket id and number of
  sockets
- methods to get/put socket structs from/to the pool
- function to update the # and size of packets in the modem receive
  queue
- prebuilt modem_socket_poll() method for socket offload poll() API

Example modem driver setup code looks like this:

/* socket data */
static struct modem_socket_config socket_config;
static struct modem_socket sockets[MDM_MAX_SOCKETS];

static int modem_init(struct device *dev)
{
  ...
  /* setup socket config */
  socket_config.sockets = &sockets[0];
  socket_config.sockets_len = ARRAY_SIZE(sockets);
  socket_config.base_socket_num = 0;
  ret = modem_socket_init(&socket_config);
  ...
}

Signed-off-by: Michael Scott <mike@foundries.io>
2019-08-10 00:03:39 +02:00
Michael Scott
02abddccd6 drivers: modem: cmd handler: introduce cmd handler driver layer
This is a generic command handler implementation which uses the
supplied modem interface to process incoming data and hand it
back to the modem driver via callbacks defined for:
- modem responses
- unsolicited messages
- specified handlers for current operation

The individual modem drivers define functions as command handlers
via the MODEM_CMD_DEFINE() macro.

To use these handlers, a modem operation defines a series of
modem_cmd structures and passes them to the modem_cmd_send()
function.  The modem_cmd includes data for:
- a matching string for when to execute the handler
- # of parameters to parse after the matching string
- delimeters for the parameters

Example modem driver setup code looks like this:

/* create modem context object */
static struct modem_context mctx;

/* net_buf receive pool */
NET_BUF_POOL_DEFINE(mdm_recv_pool, MDM_RECV_MAX_BUF,
		    MDM_RECV_BUF_SIZE, 0, NULL);

/* modem cmds */
static struct modem_cmd_handler_data cmd_handler_data;
static u8_t cmd_read_buf[MDM_RECV_BUF_SIZE];
static u8_t cmd_match_buf[MDM_RECV_BUF_SIZE];

/* modem response handlers */
static struct modem_cmd response_cmds[] = {
	MODEM_CMD("OK", on_cmd_ok, 0U, ""),
	MODEM_CMD("ERROR", on_cmd_error, 0U, ""),
	MODEM_CMD("+CME ERROR: ", on_cmd_exterror, 1U, ""),
};

/* unsolicited handlers */
static struct modem_cmd unsol_cmds[] = {
	MODEM_CMD("+UUSOCL: ", on_cmd_socknotifyclose, 1U, ""),
	MODEM_CMD("+UUSORD: ", on_cmd_socknotifydata, 2U, ","),
	MODEM_CMD("+UUSORF: ", on_cmd_socknotifydata, 2U, ","),
	MODEM_CMD("+CREG: ", on_cmd_socknotifycreg, 1U, ""),
};

/* setup cmd handler data */
cmd_handler_data.cmds[CMD_RESP] = response_cmds;
cmd_handler_data.cmds_len[CMD_RESP] = ARRAY_SIZE(response_cmds);
cmd_handler_data.cmds[CMD_UNSOL] = unsol_cmds;
cmd_handler_data.cmds_len[CMD_UNSOL] = ARRAY_SIZE(unsol_cmds);
cmd_handler_data.read_buf = &cmd_read_buf[0];
cmd_handler_data.read_buf_len = sizeof(cmd_read_buf);
cmd_handler_data.match_buf = &cmd_match_buf[0];
cmd_handler_data.match_buf_len = sizeof(cmd_match_buf);
cmd_handler_data.buf_pool = &mdm_recv_pool;
cmd_handler_data.alloc_timeout = BUF_ALLOC_TIMEOUT;
ret = modem_cmd_handler_init(&mctx.cmd_handler, &cmd_handler_data);

Signed-off-by: Michael Scott <mike@foundries.io>
2019-08-10 00:03:39 +02:00
Michael Scott
d56a05f7a7 drivers: modem: interface: introduce UART interface driver layer
The UART-based modem interface layer implements the modem context
interface for Zephyr's UART APIs.  This driver closely resembles
the existing modem receiver, but conforming to the modem interface
agreements.

Example modem driver setup code looks like this:

/* create modem context object */
static struct modem_context mctx;

/* create uart interface data object and buffers */
static struct modem_iface_uart_data iface_data;
static u8_t iface_isr_buf[MDM_RECV_BUF_SIZE];
static u8_t iface_rb_buf[MDM_MAX_DATA_LENGTH];

iface_data.isr_buf = &iface_isr_buf[0];
iface_data.isr_buf_len = sizeof(iface_isr_buf);
iface_data.rx_rb_buf = &iface_rb_buf[0];
iface_data.rx_rb_buf_len = sizeof(iface_rb_buf);
ret = modem_iface_uart_init(&mctx.iface, &iface_data,
			    UART_DEV_NAME);

Signed-off-by: Michael Scott <mike@foundries.io>
2019-08-10 00:03:39 +02:00
Michael Scott
90e778d983 drivers: modem: context helper: introduce modem context helper driver
Initial support for modems in Zephyr use the following driver model:
- Main portions of code live in the modem specific driver.
  This includes internal socket management, command parsing, etc.
- They leverage a UART-based modem receiver helper to gather data.
- Interface with Zephyr networking via net_context offload APIs.

This implementation was good enough to kick start interest in
supporting modem usage in Zephyr, but lacks future scalability:
- The net_context offload APIs don't allow for operations such
  as offloaded DNS, SSL/TLS and other HW specific features.
- Since most of the code lives within the modem drivers, it's
  very hard for the Zephyr community to improve the driver layer
  over time.  Bugs found in 1 driver probably affect others due
  to copy/paste method of development.
- Lack of abstraction for different modem interfaces and command
  handlers makes it impossible to write a "dummy" layer which
  could be used for testing.
- Lack of centralized processing makes implementing low power modes
  and other advanced topics more difficult.

Introducing the modem context helper driver and sub-layers:
- modem context helper acts as an umbrella for several configurable
  layers and exposes this data to externals such as the modem shell.
  Included in the helper is GPIO pin config functions which are
  currently duplicated in most drivers.
- modem interface layer: this layer sits on the HW APIs for the
  peripheral which communicates with the modem.  Users of the modem
  interface can handle data via read/write functions.  Individual
  modem drivers can select from (potentially) several modem
  interfaces.
- modem command parser layer: this layer communicates with the
  modem interface and processes the data for use by modem drivers.

Fixes: https://github.com/zephyrproject-rtos/zephyr/issues/17922

Signed-off-by: Michael Scott <mike@foundries.io>
2019-08-10 00:03:39 +02:00
Wendy Liang
4ef9d4b6bf timer: Add Xilinx ZynqMP PS ttc timer
Add Xilinx PS ttc timer for Xilinx ZynqMP platform.

Signed-off-by: Wendy Liang <wendy.liang@xilinx.com>
2019-08-09 22:50:50 +02:00
Wendy Liang
5364a389e5 serial: Add Xilinx ZynqMP PS uart driver
Add ZynqMP PS uart driver for Xilinx ZynqMP platform

Signed-off-by: Wendy Liang <wendy.liang@xilinx.com>
2019-08-09 22:50:50 +02:00
Bradley Bolen
571d3b54db interrupt_controller: gic: Add support for the GIC400
The GIC400 is a common interrupt controller that can be used with the
Cortex A and R series processors.  This patch adds basic interrupt
handling for the GIC, but does not handle multiple routing or
priorities.

Signed-off-by: Bradley Bolen <bbolen@lexmark.com>
2019-08-09 22:50:50 +02:00
Andrzej Głąbek
16162f25b5 drivers: entropy: nrf5: Fix dependency of the enabling Kconfig option
This driver makes use of the nRF RNG peripheral, so it can be used only
for SoCs that are equipped with one, and not all nRF SoCs are.
The option enabling the driver should then depend on `HAS_HW_NRF_RNG`,
which indicates the presence of this peripheral in a given SoC.

This patch removes also entries disabling this driver in default
configurations for nRF9160 SoC, as these were needed only because
of the invalid dependency of the ENTROPY_NRF5_RNG option.

A minor adjustment of Kconfig files of the nrf52_bsim board was
required as well, so that this board's configuration can properly
handle this corrected dependency.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-08-09 20:14:24 +02:00
Henrik Brix Andersen
84c74993d4 drivers: pwm: mcux_ftm: use device tree for obtaining clock frequency
Use clock specified in the device tree for obtaining the source clock
frequency for the pwm_mcux_ftm driver instead of relying on having an
NXP Kinetis MCG clock available in all SoCs supporting FlexTimer (FTM)
modules.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-08-09 07:32:43 -05:00
Henrik Brix Andersen
a9a839179f drivers: clock_control: mcux_mcg: add driver for NXP Kinetis MCG
Add driver shim for the NXP Kinetis Multipurpose Clock Generator (MCG)
module.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-08-09 07:32:43 -05:00
Marc Reilly
b0203ac95b display: Add support for an ST7789V based LCD
This adds a driver for st7789v lcd controller, and TL019FQV01 lcd.
The bulk of the driver is based on the existing ili9340 driver.

Signed-off-by: Marc Reilly <marc@cpdesign.com.au>
2019-08-08 10:11:47 -05:00
Alexander Wachter
d864f5de5b net: l2: canbus: Add support for canbus Ethernet translator
This commit adds support for a 6LoCAN Ethernet border translator.
CAN frames with the translator CAN address are translated and forwarded
to Ethernet. Ethernet frames with the first 34 bits matching the MAC
address of the translator are translated and forwarded to 6LoCAN.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-08-08 13:25:01 +03:00
Alexander Wachter
35f01673ac net: l2: 6LoCAN implementation
This commit is an implementation of 6LoCAN, a 6Lo adaption layer for
Controller Area Networks. 6LoCAN is not yet standardised.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-08-08 13:25:01 +03:00
Alexander Wachter
c8c5f3bbf3 net: canbus: Rename canbus to canbus_raw
Rename the socket_can implementation from CANBUS to CANBUS_RAW.
This is a preperation for 6LoCAN which is a CANBUS L2 for IPv6.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-08-08 13:25:01 +03:00
Andrei Gansari
ef9fdc3137 drivers: eth_mcux: event corrected init->reset
Redoes ENET device bootup event sequence (K6x enters reset).

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2019-08-08 09:52:55 +02:00
Nicolas Pitre
75bf3c5368 riscv: freedom: rename RISCV32 to RISCV
This code is common to 32- and 64-bit builds.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-08-08 00:29:24 -04:00
Nicolas Pitre
e5981f2b71 drivers: sifiv: make them 64-bit compatible
Make those drivers compatible with a 64-bit build.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-08-08 00:29:24 -04:00
Ulf Magnusson
d1dff7129b drivers: gpio: Remove redundant GPIO dep. from GPIO_HT16K33
GPIO_HT16K33 is defined in drivers/gpio/Kconfig.ht16k33, which is
source'd within an 'if GPIO' in drivers/gpio/Kconfig.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-08-07 08:14:10 -05:00
Loic Poulain
447029d7c3 drivers: pwm: Add NXP MCUX PWM driver
This driver handles eFlexPWM submodules via MCUX hal.
Each submodule has two channels (A/B).

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2019-08-07 07:38:40 -05:00
Nick Ward
ea366e9aa3 drivers: can: mcp2515: Fix interrupt bit tests for empty TX buffers
TX1 and TX2 buffer empty busy flags would have been cleared only for
TX0 empty interrupts and there would have been extra unwarranted
TX callbacks for TX1 and TX2 if the callbacks had previously been used.

Signed-off-by: Nick Ward <nick.ward@setec.com.au>
2019-08-07 15:14:28 +03:00
Wayne Ren
31a0371a0a drivers: arcv2_timer0: add support for smp
* use global free running counter as global wall clock (clock source)
* use arc internal timer 0 as local time event (clock event)

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2019-08-07 12:21:00 +02:00
Ulf Magnusson
a9490541d6 drivers: espi: kconfig: Remove redundant ESPI_PERIPHERAL_CHANNEL deps.
The ESPI_PERIPHERAL_* symbols are surrounded by an
'if ESPI_PERIPHERAL_CHANNEL' in the same file, so no
need to put 'depends on ESPI_PERIPHERAL' on them.

'if' is just a shorthand for 'depends on'.

Also remove a redundant 'if ESPI' from ESPI_XEC.
drivers/espi/Kconfig.xec is sourced within an 'if ESPI' in
drivers/espi/Kconfig.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-08-07 04:27:03 -04:00
Ulf Magnusson
cc8cf88e2c drivers: flash: Remove redundant FLASH dep. from FLASH_NATIVE_POSIX
FLASH_NATIVE_POSIX is defined in drivers/flash/Kconfig.native_posix,
which is source'd within an 'if FLASH' in drivers/flash/Kconfig.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-08-07 04:26:48 -04:00
Ulf Magnusson
2d8982d21b drivers: flash: Remove redundant FLASH dep. from FLASH_SIMULATOR
FLASH_SIMULATOR is defined in drivers/flash/Kconfig.simulator, which is
source'd within an 'if FLASH' in drivers/flash/Kconfig.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-08-07 04:26:27 -04:00
Ulf Magnusson
f754143699 drivers: ethernet: Remove redundant NET_L2_ETHERNET dep. from ETH_LITETH
ETH_LITEETH is defined in drivers/ethernet/Kconfig.liteeth, which is
source'd within a menu that has 'depends on ETH_LITEETH', in
drivers/ethernet/Kconfig.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-08-07 10:50:19 +03:00
Vaishali Pathak
0923ae4172 drivers: sensors: Add Si7006 temperature/humidity sensor driver
Adds driver for Silicon Labs Si7006 chip.

Signed-off-by: Vaishali Pathak <vaishali@electronut.in>
2019-08-06 15:05:25 -05:00
Armando Visconti
6dceb4987e driver/sensor/lsm6dso: Fix deprecated macros CS_GPIO_* to CS_GPIOS_*
The lsm6dso driver was in pre-merging state when a614a026
was committed. So, let's make the modification manually.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-08-06 11:09:34 -04:00
Henrik Brix Andersen
9a7734abf5 drivers: can: flexcan: implement timestamp for RX frames
This commit implements timestamps for receiving frames on the
NXP MCUX FlexCAN CAN driver.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2019-08-06 16:39:35 +03:00
Alexander Wachter
9923cf2dda drivers: can: stm32: Implement timestamp for RX frames
This commit implements timestamps for receiving frames on
stm32 CAN driver.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-08-06 16:39:35 +03:00
Alexander Wachter
3febaad1d6 can: Add RX timestamp to zcan_frame
This commit introduces a timestamp for received CAN frames.
The timestamp is optional and can be activated via Kconfig.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-08-06 16:39:35 +03:00
Jukka Rissanen
5c05ef5101 net: Move include files outside of extern "C" block
This is related to findings in #17997 and changes network related
header files to have include files outside of extern "C" { } block.

Declarations that use C linkage should be placed within extern "C"
so the language linkage is correct when the header is included by
a C++ compiler.

Similarly #include directives should be outside the extern "C" to
ensure the language-specific default linkage is applied to any
declarations provided by the included header.

See: https://en.cppreference.com/w/cpp/language/language_linkage

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-08-06 14:46:36 +03:00
Yaël Boutreux
e0d6534f09 drivers: spi: spi_ll_stm32: Add support for STM32MP1x SoC
Add SPI driver support for STM32MP1x SoC.

Signed-off-by: Yaël Boutreux <yael.boutreux@st.com>
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Alexandre Torgue <alexandre.torgue@st.com>
2019-08-05 13:52:34 -05:00
Yaël Boutreux
3a967f92c3 soc: arm: st_stm32: stm32mp1: Add SPI support
Add SPI support for STM32MP1x SoC.

Signed-off-by: Yaël Boutreux <yael.boutreux@st.com>
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Alexandre Torgue <alexandre.torgue@st.com>
2019-08-05 13:52:34 -05:00
Yaël Boutreux
876eb63ac3 drivers: spi: st_stm32: Abstract LL function for spi ver. compatibility
Abstract some SPI LL function call for future driver compatibility with
a new SPI peripheral version (introduced with STM32MP1x and STM32H7x
SoC)

Signed-off-by: Yaël Boutreux <yael.boutreux@st.com>
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Alexandre Torgue <alexandre.torgue@st.com>
2019-08-05 13:52:34 -05:00
Yaël Boutreux
c935508c05 drivers: spi: spi_ll_stm32: set NSS before mode
This commit solves an issue where the NSS must be set before the
mode on the stm32mp157c_dk2, else LL_SPI_SetMode won't affect the
mode registry.
stm32mp1x (and stm32h7) LL function SPI_Init seems to also define
first the NSS then the mode, unlike other STM32 boards where this
is not specified.
Changing the order shouldn't have bad repercussions on other boards,
ZephyrnSPI driver test has been passed successfully on disco_l475_iot1
board.

Signed-off-by: Yaël Boutreux <yael.boutreux@st.com>
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Alexandre Torgue <alexandre.torgue@st.com>
2019-08-05 13:52:34 -05:00
Peter A. Bigot
d60d16d4cd drivers/spi_nor: de-pessimize reads
SPI NOR devices require that writes be performed within only one page at
a time.  There is no such limitation on reads.  Remove the code that
forced reads to be performed in 256-byte chunks.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-08-05 13:27:49 +02:00
Peter A. Bigot
86dcf3c173 drivers/spi_nor: fix writes across page boundaries
The code failed to increment the address after completing a partial
write, causing writes that cross a page boundary overwrite at a page
level.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-08-05 13:27:49 +02:00
Findlay Feng
4b18a079d9 drivers: gpio: add stm32f1x SWJ configuration
Add the serial wire JTAG configuration of the stm32f1x family.
Before gpio is initialized, you can choose to turn off the debug pin to
make the used pins available.

Signed-off-by: Findlay Feng <i@fengch.me>
2019-08-05 13:22:34 +02:00
Saravanan Sekar
0fd92b463b wifi: eswifi: Select socket before configuration
Socket selection needs to be first in the order of operation

Signed-off-by: Saravanan Sekar <saravanan@linumiz.com>
2019-08-05 13:21:15 +02:00
Erwan Gouriou
77db273f6f stm32: clock_control: Enforce HCLK prescaler value
STM32 clock control subsystem allows to configure a different
frequency value for core clock (SYSCLK) and AHB clock (HCLK).
Though, it is HCLK which is used to feed Cortex Systick timer
which  is used in zephyr as reference system clock.
If HCLK frequency is configured to a different value from SYSCLK
frequency, whole system is exposed to desynchro between zephyr clock
subsytem and STM32 HW configuration.
To prevent this, and until zephyr clock subsystem is changed to be
aware of this potential configuration, enforce AHB prescaler value
to 1 (which is current default value in use for all STM32 based
boards).

On STM32H7, enforce D1CPRE which fills the same role as ABH precaler.

On STM32MP1, the equivalent setting is done on A7 core, so it is
not exposed to the same issue as long as SYS_CLOCK_HW_CYCLES_PER_SEC
is set with the 'mlhclk_ck' clock frequency value. Update
matching boards documentation.

Fixes #17188

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-08-03 14:18:55 -04:00
Nicolas Pitre
1f4b5ddd0f riscv32: rename to riscv
With the upcoming riscv64 support, it is best to use "riscv" as the
subdirectory name and common symbols as riscv32 and riscv64 support
code is almost identical. Then later decide whether 32-bit or 64-bit
compilation is wanted.

Redirects for the web documentation are also included.

Then zephyrbot complained about this:

"
New files added that are not covered in CODEOWNERS:

dts/riscv/microsemi-miv.dtsi
dts/riscv/riscv32-fe310.dtsi

Please add one or more entries in the CODEOWNERS file to cover
those files
"

So I assigned them to those who created them. Feel free to readjust
as necessary.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-08-02 13:54:48 -07:00
Tomasz Bursztyka
d93b0f3e6a driver/pinumx: Adding missing braces for XEC driver
Even one liner if () statement should have braces.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-08-02 23:24:34 +03:00
Tomasz Bursztyka
e555ddd9e6 drivers/gpio: Adding missing braces for XEC driver
Even one liner if () statement should have braces.

Fixing parameter indentation as well.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-08-02 23:24:34 +03:00
Ulf Magnusson
5d0db517b9 dts: riscv: Add sifive,plic-1.0.0 binding and fix riscv,ndev values
Add a new sifive,plic-1.0.0 binding that inherits from the riscv,plic0
binding. The new binding adds a required riscv,ndev property, which
gives the number of external interrupts supported.

Use the new binding for microsemi-miv.dtsi (with a value of 31 for
riscv,ndev, from http://www.actel.com/ipdocs/MiV_RV32IMAF_L1_AHB_HB.pdf)
and riscv32-fe310.dtsi (which already assigns riscv,ndev).

Also remove a spurious riscv,ndev assignment from
riscv32-litex-vexriscv.dtsi.

Also make edtlib and the old scripts/dts/ scripts replace '.' in
compatible strings with '_' when generating identifiers.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-08-02 11:44:09 +02:00
Piotr Mienkowski
707a111ca8 drivers: fix printf formatting in flash drivers
This commit fixes following issues in printf formatting used by flash
drivers:
- cast values of type off_t to long to remove warnings generated when
  compiling with Newlib.
- use 'z' modifier (as in "%zu") to print values of type size_t
- prefix all hex numbers with '0x'

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2019-08-01 11:33:17 -07:00
Yaël Boutreux
ebcd6506fa drivers: spi: spi_ll_stm32: Long line cleanup
Split a long line remaining in the driver.

Signed-off-by: Yaël Boutreux <yael.boutreux@st.com>
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Alexandre Torgue <alexandre.torgue@st.com>
2019-08-01 11:58:02 -04:00
Yaël Boutreux
13ceab4c3b drivers: spi: spi_ll_stm32: Add config to manage slave select
Allow the user to use software slave select instead of the
hardware pin, in order to free the related GPIO and avoid
unwanted SS triggering on the hardware pin. The default SS
is still the hardware pin.

Signed-off-by: Yaël Boutreux <yael.boutreux@st.com>
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Alexandre Torgue <alexandre.torgue@st.com>
2019-08-01 11:58:02 -04:00
Ioannis Konstantelias
dca08c95dd stm32: pinmux: spi: Opt for lower power consumption
Fixes #16739. Changed the STM32's SPI MISO/MOSI configurations in order
to reduce the power consumption by approximately 20uA per pin.

According to STM32's Application Notes on GPIO configuration for
low-power consumption, the input pins should be configured with internal
pull-up or pull-down resistor. If a pin is configured as a floating
input, and there is no signal present, the Schmitt trigger randomly
toggles between the logical levels induced by the external noise, thus
increasing the consumption.

Signed-off-by: Ioannis Konstantelias <ikonstadel@gmail.com>
2019-08-01 11:52:31 -04:00
Peter A. Bigot
5a39bcae84 drivers/adc: provide API to access reference voltage
Required for any real-world use of ADC_REF_INTERNAL.

Relates-to: issue #11922
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-08-01 13:28:41 +02:00
Robert Lubos
9f34d17cc1 drivers: timer: nrf_rtc_timer: Fix set_comparator corner case
Update the logic in a corner case, when the target comparator value is
one cycle ahead of the counter value.

Experiments have shown, that `set_comparator(cyc + 1);` might be not
enough in that case, and we still may (rarely) miss the interrupt.
This could happen when the counter incremented its value after the `dt`
variable was set. As we should set the comparator value two cycles
ahead to be on the safe side, increment the target comparator value
by 2 instead of 1.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2019-08-01 12:29:36 +02:00
Findlay Feng
3bc7d9e50e drivers: spi: Fix spi related files of stm32f1x
pinmux: Add the relevant definition of the spi3 pin
dts: Fix a bug, spi3 does not have a label
soc: Supplement spi3 related definition

Signed-off-by: Findlay Feng <i@fengch.me>
2019-07-31 14:26:50 -05:00
Pavel Kral
b7db90da43 drivers: serial: uart_rtt: Virtual UARTs over RTT channels
Add support for virtual UART device that uses Segger RTT channels
for data transfers. Due to the RTT principle, this driver supports
only polling API.

Signed-off-by: Pavel Kral <pavel.kral@omsquare.com>
2019-07-31 17:23:57 +02:00
Armando Visconti
9e5c97edae driver/sensor: add STTS751 temperature sensor
Add support to STM STTS751 temperature sensor.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-07-31 10:32:10 -04:00
Yaël Boutreux
3a6b46e263 drivers: spi: spi_ll_stm32: Fix uncleared MODF flag
Clear raised MODF flag, if not done the flag stay set forever.

Fixes https://github.com/zephyrproject-rtos/zephyr/issues/17363

Signed-off-by: Yaël Boutreux <yael.boutreux@st.com>
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Alexandre Torgue <alexandre.torgue@st.com>
2019-07-31 10:30:44 -04:00
Andrzej Głąbek
dd7999d253 soc: nordic: Add HAS_HW_NRF_RADIO_IEEE802154 Kconfig option
Add a hidden Kconfig option indicating that a given SoC is equipped
with the IEEE 802.15.4 capable radio so that the corresponding driver
configuration can depend on it.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-07-31 16:09:30 +03:00
Christophe Priouzeau
0e0444af02 drivers/pinmux: add i2c5 pinmux for stm32mp1x
The i2c5 instance are used on arduino connector of
stm32mp157c-dk2.

Signed-off-by: Christophe Priouzeau <christophe.priouzeau@linaro.org>
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@linaro.org>
2019-07-31 05:59:16 -04:00
Christophe Priouzeau
303ff3fb8c drivers/i2c: Add support of stm32mp1
Add support of I2C. Add I2C5 configuration for the
arduino connector support.

Signed-off-by: Christophe Priouzeau <christophe.priouzeau@linaro.org>
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@linaro.org>
2019-07-31 05:59:16 -04:00
Pavlo Hamov
dca45cb29d drivers: i2c: Add STM32F10X slave support
Add i2c-slave support for STM3210X SoC series.

Signed-off-by: Pavlo Hamov <pavlo_hamov@jabil.com>
2019-07-31 05:40:19 -04:00
Rick Conrey
b8b8d46daa drivers: adc: Enable ADC on STM32WB
remove legacy define of common ADC instance

Signed-off-by: Rick Conrey <rick.conrey@witiproducts.com>
2019-07-31 05:38:25 -04:00
Rick Conrey
5ba6d57602 drivers: pinmux: enable ADC pins on STM32WB
Enable ADC pins on STM32WB

Signed-off-by: Rick Conrey <rick.conrey@witiproducts.com>
2019-07-31 05:38:25 -04:00
Rick Conrey
837f07a301 drivers: adc: enable ADC on STM32WB
Enable ADC on STM32WB

Signed-off-by: Rick Conrey <rick.conrey@witiproducts.com>
2019-07-31 05:38:25 -04:00
Yannis Damigos
12a9ff3b0d i2c_ll_stm32: Use macros to add I2C instances
Use macros to add I2C instances

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2019-07-31 05:35:01 -04:00
Kumar Gala
4e7863dc41 dts: Make instance defines consistent
We generated a define for each instance to convey its existance of the
form:
	#define DT_<COMPAT>_<INSTANCE> 1

However we renamed all other instance defines to be of the form
DT_INST_<INSTANCE>_<FOO>.  To make things consistent we now generate a
define of the form:

	#define DT_INST_<INSTANCE>_<COMPAT> 1

We also now deprecate the DT_<COMPAT>_<INSTANCE> form and fixup all uses
to use the new form.

Fixes: #17650

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-07-30 17:10:31 -05:00
Anas Nashif
cb412df725 x86: remove code for interrupt forwarding bug
This only applied to quark_se, so removing it.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-07-29 21:30:25 -07:00
Anas Nashif
578ae40761 boards: remove quarl_se_c1000
This board and SoC was discontinued some time ago and is currently not
maintained in the zephyr tree.
Remove all associated configurations and variants from the tree.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-07-29 21:30:25 -07:00
Ioannis Konstantelias
4fffe790be drivers: flash: stm32l4x: Support SOCs with < 1MB
Up to now, the only SOC that was supported in the STM32L496 series was
STM32L496XG with flash of 1MB. With the recent support of STM32L496XE,
this implementation is not correct. This patch adds support for the
other SOCs that come with flashes of 512KB and 256KB.

Signed-off-by: Ioannis Konstantelias <ikonstadel@gmail.com>
2019-07-29 09:53:58 -04:00
Andrzej Głąbek
e6fe542465 drivers: i2c_nrfx_twi: Make use of NRFX_TWI_FLAG_SUSPEND
Make use of the new flag introduced in nrfx v1.7.2 that suspends
transfers, in order to properly handle scattered I2C transactions,
especially to perform i2c_burst_write() in the way expected by
display drivers, i.e. as a continuous transaction on the bus,
without the repeated START between its two parts.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-07-29 13:10:30 +02:00
Alexander Wachter
75f3e17b45 drivers: can: Add CAN shell
Implement a CAN shell. With this shell you can send messages,
attach and tetach filters.
Messages that match the attached filters are printed to the shell.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-07-29 10:27:54 +03:00
Jukka Rissanen
d09248219d tests: net: ppp: Add unit tests for PPP driver
Make sure that we are able to parse incoming PPP data
correctly.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-07-29 10:24:46 +03:00
Jukka Rissanen
aa46bac54c drivers: net: ppp: Driver for point-to-point protocol
The ppp driver uses uart_pipe driver for data transfer.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-07-29 10:24:46 +03:00
Rick Conrey
69af47d058 drivers: pinmux: enable PWM pins on STM32WB
Enable PWM pins on STM32WB

Signed-off-by: Rick Conrey <rick.conrey@witiproducts.com>
2019-07-26 11:27:15 -04:00
Erwan Gouriou
b44f0eacd5 drivers/gpio: stm32h7: Don't use HSEM_CR_COREID_CURRENT as process id
HSEM_CR_COREID_CURRENT was used as process number parameter in
LL_HSEM_ReleaseLock function. While this is working, this
define should not be used in this context.
Also, process number parameter is actually proposed in case of HSEM
use in inter-process context but is not required for inter-core
resource lock. Replace HSEM_CR_COREID_CURRENT with 0.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-07-26 11:25:05 -04:00
Arnaud Pouliquen
725a3c9a15 drivers: introduce ipm driver for stm32
IPM driver relies on STM32 IPCC internal peripheral.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
2019-07-26 14:38:43 +02:00
Jose Alberto Meza
64c334f0b3 drivers: espi: Add driver for microchip XEC family
Add eSPI Microchip XEC driver
Include support for peripheral & virtual wires (channel 0-1)
OOB and flash support can be added in the future

Fix compilation error in pinmux driver

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2019-07-25 08:23:38 -07:00
Jose Alberto Meza
a7e44ebf44 drivers: espi: Add Kconfig for eSPI driver
Adds the Kconfig for generic eSPI drivers

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2019-07-25 08:23:38 -07:00
Kwon Tae-young
6a01db3be0 drivers: i2c_ll_stm32_v1: add timeout
Sometimes i2c operation does not return in a while loop.
Fix this by adding timeout to the i2c driver.

Fixes: #12261

Signed-off-by: Kwon Tae-young <tykwon@m2i.co.kr>
2019-07-25 10:50:50 -04:00
Rick Conrey
3f58038c03 drivers: pinmux: enable SPI pins on stm32wb
enable spi pins on stm32wb

Signed-off-by: Rick Conrey <rick.conrey@witiproducts.com>
2019-07-25 10:49:58 -04:00
Rick Conrey
32a3ae8ab9 drivers: spi: Enable SPI on stm32wb
Enable FIFO for stm32wb

Signed-off-by: Rick Conrey <rick.conrey@witiproducts.com>
2019-07-25 10:49:58 -04:00
Scott Worley
bdaab8cfa0 drivers : timer : Add MEC1501 32KHz kernel timer driver
Add a kernel timer driver for the MEC1501 32KHz RTOS timer.
This timer is a count down 32-bit counter clocked at a fixed
32768 Hz. It features one-shot, auto-reload, and halt count down
while the Cortex-M is halted by JTAG/SWD. This driver is based
on the new Intel local APIC driver. The driver was tuned for
accuracy at small sleep values. Added a work-around for RTOS
timer restart issue. RTOS timer driver requires board ticks per
second to be 32768 if tickless operation is configured.

Signed-off-by: Scott Worley <scott.worley@microchip.com>
2019-07-24 14:58:41 -07:00
Peter A. Bigot
794e0109d6 drivers/spi_nor: enable logging API
Just register it.  For now it's only used in one place where it was
needed to identify a problem.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-07-24 09:20:56 -04:00
Peter A. Bigot
660149b500 drivers/spi_nor: fix writes across page boundaries
The previous code limited the length of a write to the size of a page,
but did not check whether the starting position was far enough into the
page that the write would still cross a page boundary.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-07-24 09:20:56 -04:00
Peter A. Bigot
fa10a9640b dts/spi-nor: use bytestring for JEDEC ID
This was always intended to be a bytestring rather than an array, but
full support was missing.  Since that has been addressed switch it to
the preferred format.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-07-24 09:20:56 -04:00
Peter A. Bigot
eb3858cbbd drivers/spi_nor: allow application control of flash layout page size
The driver historically used the erase block size (64 KiBy) as the page
size.  There are other viable "sector" sizes, and for some applications
this one may be too large.  Allow the application to specify the desired
flash page size.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-07-24 09:20:56 -04:00
Peter A. Bigot
50550e02c0 drivers/spi_nor: remove write-block-size devicetree property
Devices using this driver do not require any special alignment for
writes.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-07-24 09:20:56 -04:00
Peter A. Bigot
2a590d3fa5 drivers/spi_nor: remove configurability of page/sector/block sizes
The JEDEC API defines the hardware page, sector, and block sizes.
Deprecate the Kconfig settings, remove the `erase-size-block` property,
and add `has-be32k` to indicate that 32K-byte erase is supported.
Rework the driver to use the constants instead of configured values.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-07-24 09:20:56 -04:00
Piotr Zięcik
70d61cdd55 drivers: adc_stm32: Get clock frequency from DTS
The adc_stm32 driver used system timer frequency as a base for
busy-wait delay calculation. This commit corrects that by obtaining
the needed value from SystemCoreClock variable.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-07-24 15:10:02 +02:00
Piotr Zięcik
a901e32a38 drivers: wdog_cmsdk_apb: Get clock frequency from DTS
The wdog_cmsdk_apb driver used system clock frequency
as a base for timeout calculation. This commit corrects
that by obtaining the needed value from DTS.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-07-24 15:10:02 +02:00
Piotr Zięcik
08f8abcfe4 drivers: uart_cc13xx_cc26xx: Get clock frequency from DTS
The uart_cc13xx_cc26xx driver used system clock frequency
as a base for baudrate calculation. This commit corrects
that by obtaining the needed value from DTS.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-07-24 15:10:02 +02:00
Piotr Zięcik
9e9f5cecff drivers: uart_stellaris: Get clock frequency from DTS
The uart_stellaris driver used system clock frequency
as a base for baudrate calculation. This commit corrects
that by obtaining the needed value from DTS.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-07-24 15:10:02 +02:00
Piotr Zięcik
dc44cb00d1 drivers: uart_qmsi: Get clock frequency from DTS
The uart_qmsi driver used system clock frequency
as a base for baudrate calculation. This commit corrects
that by obtaining the needed value from DTS.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-07-24 15:10:02 +02:00
Piotr Zięcik
69bbcec74f drivers: uart_msp432p4xx: Get clock frequency from DTS
The uart_msp432p4xx driver used system clock frequency
as a base for baudrate calculation. This commit corrects
that by obtaining the needed value from DTS.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-07-24 15:10:02 +02:00
Piotr Zięcik
170e93bb17 drivers: uart_cc32xx: Get clock frequency from DTS
The uart_cc32xx driver used system clock frequency
as a base for baudrate calculation. This commit corrects
that by obtaining the needed value from DTS.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-07-24 15:10:02 +02:00
Piotr Zięcik
60314555ef drivers: uart_pl011: Get clock frequency from DTS
The uart_pl011 driver used system clock frequency
as a base for baudrate calculation. This commit corrects
that by obtaining the needed value from DTS.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-07-24 15:10:02 +02:00
Piotr Zięcik
e858805742 drivers: uart_cmsdk_apb: Get clock frequency from DTS
The uart_cmsdk_apb driver used system clock frequency
as a base for baudrate calculation. This commit corrects
that by obtaining the needed value from DTS.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-07-24 15:10:02 +02:00
Piotr Zięcik
4a543e138d drivers: spi_dw: Get clock frequency from DTS
The spi_dw driver used system clock frequency
as a base for SPI bus frequency calculation.
This commit corrects that by obtaining the needed value from DTS.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-07-24 15:10:02 +02:00
Piotr Zięcik
0509d0638b drivers: beetle_clock_control: Get CPU clock frequency from DTS
The clock control initialization code used system clock
frequency as a CPU clock frequency. This commit corrects
that by obtaining the needed value from DTS.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-07-24 15:10:02 +02:00
Piotr Zięcik
8f22b16b6c drivers: i2c_cc32xx: Get clock frequency from DTS
The i2c_cc32xx driver used system clock frequency
as a base for I2C clock frequency calculation.
This commit corrects that by obtaining the needed value from DTS.

Please note, that for I2C devices the clock-frequency property
specifies SCK frequency, instead of frequency of the clock driving
peripheral. To solve that problem, a new property was added.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-07-24 15:10:02 +02:00
Piotr Zięcik
0c0c0d93ea drivers: timer: Do not use CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC
On some SoCs the frequency of the system clock is obtained at run time
as the exact configuration of the hardware is not known at compile time.
On such platforms using CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC define
directly introduces timing errors.

This commit replaces CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC by the call
to inline function sys_clock_hw_cycles_per_sec() which always returns
correct frequency of the system clock.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-07-24 15:10:02 +02:00
Piotr Zięcik
129a23bea7 drivers: pwm_qmsi: Do not use CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC
On some SoCs the frequency of the system clock is obtained at run time
as the exact configuration of the hardware is not known at compile time.
On such platforms using CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC define
directly introduces timing errors.

This commit replaces CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC by the call
to inline function sys_clock_hw_cycles_per_sec() which always returns
correct frequency of the system clock.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-07-24 15:10:02 +02:00
Piotr Zięcik
aa363178d3 drivers: i2c_bitbang: Do not use CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC
On some SoCs the frequency of the system clock is obtained at run time
as the exact configuration of the hardware is not known at compile time.
On such platforms using CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC define
directly introduces timing errors.

This commit replaces CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC by the call to
inline function sys_clock_hw_cycles_per_sec() which always returns
correct frequency of the system clock.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-07-24 15:10:02 +02:00
Yannis Damigos
0f52c7137d i2c_ll_stm32_v2: Set slave_attached to false on slave unregister
Set slave_attached to false before exit
i2c_stm32_slave_unregister().

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2019-07-23 10:53:22 +02:00
Marcin Niestroj
710f9e7b3e sensors: lis2dh: support high resolution mode
So far we supported normal (10 bit) and low-power (8 bit) modes. Add
support for high-resolution mode as a third option.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2019-07-23 10:52:08 +02:00
Mateusz Holenko
ebd349091a dts: riscv32: fix reg-names for liteeth
Liteeth exposes two memory regions:
* set of rx/tx buffers (aka slots) to exchange packets,
* control and status registers.

Signed-off-by: Mateusz Holenko <mholenko@antmicro.com>
2019-07-23 10:51:21 +02:00
Andrzej Głąbek
f69e194ece drivers: usb_dc_nrfx: Use dedicated work queue for handling ISR events
This patch introduces a dedicated work queue for handling the events
from ISR (i.e. for notifying the USB device stack, for executing the
enpoints callbacks, etc.). The system work queue cannot be used for
this purpose as it might be used in applications for scheduling USB
transfers and this could lead to a deadlock when the USB device stack
would not be notified about certain event because of a system work
queue item waiting for a USB transfer to be finished.

The FIFO named so far `work_queue` is renamed to `usbd_evt_fifo`
to better indicate its purpose and to avoid confusion.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-07-22 18:19:33 +02:00
Mariusz Glebocki
35edfedf68 drivers: ethernet: Add LiteEth driver
Add LiteX Ethernet driver with bindings for this device.

Signed-off-by: Mariusz Glebocki <mglebocki@antmicro.com>
Signed-off-by: Mateusz Holenko <mholenko@antmicro.com>
2019-07-22 15:28:54 +03:00
Vinayak Kariappa Chettimada
f4eb03c538 Bluetooth: controller: Rename BT_LL_SW to BT_LL_SW_LEGACY
Rename the controller Kconfig option BT_LL_SW to
BT_LL_SW_LEGACY in preparation towards switch to new Link
Layer implementation.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2019-07-22 14:23:42 +02:00
Jan Van Winkel
400cafe7bb drivers: sdl: Added support to set def pix format
Added support to SDL display driver to set default pixel format through
Kconfig.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2019-07-22 12:33:32 +02:00
Jan Van Winkel
00d6fe49b2 drivers: ssd16xx: Removed blanking support
Removed blanking_on and blanking_off support from SSD16XX driver as it
is not supported.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2019-07-20 08:25:59 -04:00
Alexander Wachter
0fbaaa1350 drivers: ethernet: stm32: Put DMA buffer to DTCM section
For STM32F7 MCU the actual implementation doesn't work when the
DMA buffers are placed in the SRAM.
This might be a problem with caches.
To overcome this problem, the buffer is moved to the DTCM.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-07-19 10:05:46 +02:00
Carver Forbes
9d42858821 drivers/counter_cmos.c: Add config struct
Added config struct to enable use of generic API functions.

Signed-off-by: Carver Forbes <carver.forbes@gmail.com>
2019-07-18 11:06:20 -04:00
Andrzej Puzdrowski
428c281bc6 drivers/flash/flash_simulator: fix flash size calculation
Flash size calculation was don with assumption that flash page size
is always 1 KB and flash size was parameterized with such granularity.

This patch correct this bug.

Flash pages number under statistic can't be calculated via preprocessor
anymore - thus are parameterized via Kconfig.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-07-17 13:49:26 -07:00
Andrzej Puzdrowski
891ccdc182 drivers/flash/flash_simulator: switch to use DT_FLASH_SIM labels
It Need to start using DT_FLASH_SIM_xxx labels after sim_flash was
un-chosen as zephyr,flash.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-07-17 13:49:26 -07:00
Francois Ramu
474c99c9ef drivers: usb/stm32: use dts information to populate clock settings
This patch populates "clocks" property in stm32 usb nodes
for clock related usb configuration code of each  dtsi files

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2019-07-16 09:08:51 -04:00
Alberto Escolar Piedras
f16ea52e11 native_posix: Replace system timer driver
The native_posix timer driver was still using the
legacy timer API.
Replace it with a new version, which is aligned with
the new kernel<->system timer driver API,
and which has TICKLESS_CAPABLE support

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2019-07-15 14:15:16 +02:00
Mieszko Mierunski
914daf4ec7 drivers: nrf: Fix PM for TWI and TWIM in case of multi instance
TWI and TWIM used single static variable for multiple instances.
It would cause problems in case of multiple instances of peripheral.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2019-07-15 12:05:19 +02:00
Mieszko Mierunski
f4b999a389 drivers: nrf: Add power management to nrf SPI driver.
Add power management to nrf SPI driver.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2019-07-15 12:05:19 +02:00
Mieszko Mierunski
23992a0614 drivers: nrf: Add power management to nrf SPIM driver.
Add power management functions to nrf SPIM driver.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2019-07-15 12:05:19 +02:00
Anas Nashif
437692c057 drivers: pwm: imx: replace deprecated DTS macros
Replace deprecated DT macros with DT_INST_ variants.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-07-12 05:54:16 -07:00
Anas Nashif
aca5edf10b drivers: pwm: sifive: fix DTS defines
Remove deprecated macros and use DT_INST_* variants instead.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-07-12 05:54:16 -07:00
Robert Lubos
5d2002d3dc drivers: ieee802154_nrf: Fix SoC header inclusion
The nRF 802.15.4 radio driver should not include nRF52840 header
directly, but rely on soc.h instead. Otherwise, it will not work with
different SoCs supporting 802.15.4.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2019-07-12 12:16:21 +02:00
Rick Conrey
f8424c6d06 drivers: counter: enable counter for STM32WB
Add specific LL functions for STM32WB series for RTC control

Signed-off-by: Rick Conrey <rick.conrey@witiproducts.com>
2019-07-11 13:10:15 -05:00
Peter A. Bigot
7f00f38dfe drivers: eth_stellaris: update for dts change to local-mac-address
uint8_array values are now generated as structure initializers.  Update
the code accordingly.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-07-11 06:50:27 -04:00
Peter A. Bigot
ec2ba8d968 drivers: eth_mcux: update for dts change to local-mac-address
uint8_array values are now generated as structure initializers.  Update
the code accordingly.  The implementation assumes that existing
devicetree source does not provide the correct OUI so preserves the
in-driver override of the value provided by devicetree and its setting
for random/unique addresses.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-07-11 06:50:27 -04:00
Peter A. Bigot
388460ac14 drivers: eth_enc28j60: update for dts change to local-mac-address
uint8_array values are now generated as structure initializers.  Update
the code accordingly.  The implementation assumes that existing
devicetree source does not provide the correct OUI so preserves the
in-driver override of the value provided by devicetree.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-07-11 06:50:27 -04:00
Jun Yang
27d8329fc9 clock/usdhc: Enable clock of USDHC of i.MXRT
Enable clock of USDHC of i.MXRT.

Add clock interface for USDHC in ccm.

Signed-off-by: Jun Yang <jun.yang@nxp.com>
2019-07-10 11:58:15 -05:00
Kumar Gala
c016cd2c4e sensor: lis2dh: Fix stray use of old DT define
Convert old DT_ST_LIS2DH_0_BUS_SPI to DT_ST_LIS2DH_BUS_SPI.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-07-10 10:25:21 -05:00
Krzysztof Chruscinski
1baae96af6 drivers: counter: Extend set channel alarm flags
Added flags for controling detection of setting alarm to late.
Updated drivers to return -ENOTSUP when new option is requested.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-07-10 07:42:12 -05:00
Krzysztof Chruscinski
a37fce6171 drivers: counter: Add optional flags to alarm configuration structure
Flags in alarm configuration structure will allow further extention
without breaking API. Initially, existing absolute flag was added
as the only flag.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-07-10 07:42:12 -05:00
Roger N'Guessan
1c7eecb1ed Bluetooth: drivers: ipm_st32wb: Fix compilation
Issue faced while running bluetooth sample (peripheral, central, ...)

on stm32wb55rg with the latest zephyr version

Signed-off-by: Roger N'Guessan <roger.nguessan@st.com>
2019-07-09 21:35:44 +03:00
Francois Ramu
f9d2a41612 drivers: interrupt_controller: Add STM32G0X interrupt support
Add interrupt support for STM32G0X SoC series.

Signed-off-by: Philippe Retornaz <philippe@shapescale.com>
Signed-off-by: Francois Ramu <francois.ramu@st.com>

# Conflicts:
#	drivers/interrupt_controller/exti_stm32.c
2019-07-05 10:35:55 -05:00
Francois Ramu
dd3ee06af7 drivers: gpio: Add STM32G0X pinmux support
Add gpio support for STM32G0X SoC series.

Signed-off-by: Philippe Retornaz <philippe@shapescale.com>
Signed-off-by: Francois Ramu <francois.ramu@st.com>

# Conflicts:
#	drivers/gpio/gpio_stm32.h
2019-07-05 10:35:55 -05:00
Francois Ramu
9b2025c891 drivers: pinmux: Add STM32G0X pinmux support
Add pinmux support for STM32G0X SoC series.

Signed-off-by: Philippe Retornaz <philippe@shapescale.com>
Signed-off-by: Francois Ramu <francois.ramu@st.com>

# Conflicts:
#	drivers/pinmux/stm32/pinmux_stm32.h
2019-07-05 10:35:55 -05:00
Francois Ramu
da48451a01 drivers: pwm: Add STM32G0XX pwm support
Add pwm support for STM32G0X SoC series.

Signed-off-by: Philippe Retornaz <philippe@shapescale.com
Signed-off-by: Francois Ramu <francois.ramu@st.com>
2019-07-05 10:35:55 -05:00
Francois Ramu
624c566306 drivers: clock_control: Add STM32G0XX clock support
Add clock support for STM32G0X SoC series.

Signed-off-by: Philippe Retornaz <philippe@shapescale.com
Signed-off-by: Francois Ramu <francois.ramu@st.com>
2019-07-05 10:35:55 -05:00
Francois Ramu
bfc2ea6dd5 drivers: flash: Add STM32G0XX flash support
Add flash support for STM32G0X SoC series.

Signed-off-by: Philippe Retornaz <philippe@shapescale.com
Signed-off-by: Francois Ramu <francois.ramu@st.com>
2019-07-05 10:35:55 -05:00
Johann Fischer
1e9a53e548 drivers: usb_dc_nrfx: make macros names less confusing
Rename EP_BUF_* to EP_BUF_POOL*.
Rename MAX_*EP_BUF_SZ to *EP_BUF_MAX_SZ.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-07-05 08:31:38 -04:00
Johann Fischer
7f118be601 drivers: usb_dc_nrfx: remove unused EPSTATUS defines
Remove unused EPSTATUS defines.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-07-05 08:31:38 -04:00
Johann Fischer
6904a86835 drivers: usb_dc_nrfx: cleanup USB_NRFX_EVT_QUEUE_SIZE
Cleanup around USB_NRFX_EVT_QUEUE_SIZE option.
Add value range for USB_NRFX_EVT_QUEUE_SIZE to Kconfig.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-07-05 08:31:38 -04:00
Johann Fischer
226a429c97 drivers: usb_dc_nrfx: fix style issues
Fix style issue reported by checkpatch.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-07-05 08:31:38 -04:00
Johann Fischer
04b91579ae drivers: usb_dc_nrfx: use REQTYPE_GET_DIR and REQTYPE_GET_TYPE macros
Use REQTYPE_GET_DIR and REQTYPE_GET_TYPE macros from
USB subsystem instead of specially introduced.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-07-05 08:31:38 -04:00
Ioannis Konstantelias
a1d815ea9b drivers: flash: stm32: Fix insufficient wait time
flash_erase cannot erase a page from the STM32xx SOC flash. It seems
that the erase wait time is not enough and against to what the SOC's
datasheet states. As a result this patch doubles the wait time.

Signed-off-by: Ioannis Konstantelias <ikonstadel@gmail.com>
2019-07-05 10:29:10 +02:00
Johann Fischer
eb57607c7d drivers: usb_dc_nrfx: validate pointer in usb_dc_ep_is_stalled
Validate pointer argument in usb_dc_ep_is_stalled.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-07-04 21:36:07 +02:00
Johann Fischer
cb37505976 drivers: usb_dc_nrfx: check the device state before disable or uninit
Check the device state before nrfx_usbd_disable and
nrfx_usbd_uninit. Otherwise it may lead to an ASSERT
inside the HAL driver.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-07-04 21:36:07 +02:00
Johann Fischer
38cc23a7d9 drivers: usb_dc_nrfx: do not use NRF_USBD_EP_NR_GET in ep_is_valid
Do not use NRF_USBD_EP_NR_GET in ep_is_valid because
it masks the higher nibble. Although this behavior is valid
to get an index from an endpoint, it is not suitable to check
if the address is incorrect, such as: 0x11.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-07-04 21:36:07 +02:00
Yaël Boutreux
3704e8b8b4 drivers: bluetooth: hci: spi: Handle when the buffer is empty
Check if the buffer size is not empty before spi transceive and buffer's
data processing. This fixes the need to slow down MCUs to 16MHz when
using BlueNRG-MS chips.
Tested samples : Beacon, Central, Peripheral

Signed-off-by: Yaël Boutreux <yael.boutreux@st.com>
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Alexandre Torgue <alexandre.torgue@st.com>
2019-07-04 09:22:18 -04:00
Kwon Tae-young
d44f6317ee drivers: pinmux: stm32f3: Add SPI3, USB support of STM32F302x8
Added pin muxing for using SPI3 in STM32F3.
Added pin muxing to use USB on STM32F302x8.

Signed-off-by: Kwon Tae-young <tykwon@m2i.co.kr>
2019-07-04 08:50:43 -04:00
Erwan Gouriou
0914f1031d drivers/gpio: stm32: Add semaphore on gpio_configure
Protect gpio_configure function in dual core context.
This operation is not needed for other fuctions of the api:
* init
* read
* write

Protecting gpio_configure also protects access to
interrupt_controller IP.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-07-04 08:50:04 -04:00
Erwan Gouriou
edd2b44a0f drivers/clock_control: stm32h7: Disable configuration for CM4 core
On STM32H7, in Dual core configuration, we restrict configuration
access to CM7 core. CM4 can access to API but not the init part of
the driver.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-07-04 08:50:04 -04:00
Erwan Gouriou
4d7a58069b drivers/pinmux: stm32: Add UART headers for STM32H7
Add UART headers for STM32H7 series

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-07-04 08:50:04 -04:00
Erwan Gouriou
fda2ea7253 drivers/serial: stm32: Add support for STM32H7 series
Add needful to enable uart on STM32H7.
This mostly impact dts but as well soc for fixup.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-07-04 08:50:04 -04:00
Erwan Gouriou
d185ec4cff drivers/gpio: Add support on STM32H7 series
Add GPIO support on STM32H7.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-07-04 08:50:04 -04:00
Erwan Gouriou
80278f7a48 drivers/interrupt_controller: stm32: Add support for stm32h7
Add bare minimum to enable EXTI on STM32H7,
in single core configuration.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-07-04 08:50:04 -04:00
Erwan Gouriou
2805ea9193 drivers/clock_control: STM32H7 support
Provide basic clock control driver for STM32H7.
Bus clock activation is done through CM7 and CM4 common registers
so we don't have to care to the CPU Id before accessing.
Accesses are not protected for now. Only possible configuration
is system clock source set to HSE driven PLL.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-07-04 08:50:04 -04:00
Erwan Gouriou
8c6070d89b drivers: stm32: Fix leading space warnings
In two stm32 drivers, fix leading spaces warning.


Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-07-04 08:50:04 -04:00
Johann Fischer
fdc0874fa6 drivers: ssd16xx: add defines to resolve coding style issues
Generated defines that come from DT are terribly long.
Add defines to resolve coding style issues.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-07-04 07:27:09 -04:00
Johann Fischer
fc57ea8d3c drivers: ssd1673: rename driver to ssd16xx
ssd1673 driver supports different controllers,
rename it to more generic ssd16xx.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-07-04 07:27:09 -04:00
Andrew Boie
3338c2878c drivers: ipm_console: increase coverage stack size
Code coverage requires significantly more stack space.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-07-04 07:25:44 -04:00
Erwan Gouriou
4b5095d350 drivers/interrupt_controller: stm32: Fix table irq reading
We allow reading too far in exti_irq_table.
Fix if condition.

Fixes #17200

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-07-03 19:24:36 +02:00
Armando Visconti
72ae24d8d5 driver/sensor: lsm6dso: Add support
Add support to STM LSM6DSO 6-axis IMU sensor driver.
This driver supports communication with device though both
I2C and SPI bus and both polling and drdy trigger mode.

This driver supports also the sensorhub mode with the possibility
to connect a maximum of two external devices, typically a
magnetometer and an environmental sensor, currently selected among
following devices: lis2mdl magnetometer, lps22hh or lps22hb
pressure and temperature sensors, HTS221 humidity sensor.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-07-03 12:17:43 -05:00
Armando Visconti
9dbdd81abe driver/sensor: add LPS22HH sensor support
Add support to STM LPS22HH pressure and temperature sensor.
The driver support I2C and SPI bus communication and both
polling and drdy trigger mode.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-07-03 11:59:17 -05:00
Wentong Wu
f4ff0a66b2 driver: timer: loapic_timer: fix compile issue
fix compile issue when DEVICE_POWER_MANAGEMENT enabled.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
2019-07-03 11:56:40 -04:00
Andy Ross
17051e42d6 drivers/sensor/hp206c: Clarify tick rate warning
The default tick rate is now 10 kHz, but that driver was demanding
that it be exactly 1 kHz instead of at least that rate.  I checked the
source, and the driver isn't actually extracting "ticks" from the
kernel illegally, it just needs fine-grained timers that work with the
existing millisecond API.  Let it build, this is fine.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-07-02 22:52:29 -04:00
Andy Ross
0baf72e1c7 drivers/timer/nrf_rtc_timer: Fix round-up for rapid tick rates
When the tick rate was less than MIN_DELAY, bumping a "too soon"
expiration by just one tick may not be enough and we could
theoretically miss the counter.

Instead, eliminate the MIN_DELAY computation and write to the spec:
NRF guarantees that the RTC will generate an interrupt for a
comparator value two cycles in the future.  And further, we can test
at the set point to see if we "just missed" the interrupt (i.e. zero
cycles delay) and flag a synchronous interrupt.  So we only need to
miss a requested interrupt now for the special case of exactly one
cycle in the future, and then we're only late by one cycle.  That's
optimal.

Also fixes an off-by-one in the next cycle computation.  By API
convention, an ticks argument of one or less means "at the next tick"
and not "right now".  So we need to add one to the target cycle to
avoid incorrectly triggering a synchronous interrupt.  This was a
non-issue when a tick is longer than a hardware cycle but is needed
now.

Also handles the edge case with zero latency interrupts (which are
unmaskable) which might mess up timing.  This was always a problem,
but we're more sensitive now and it's comparatively more likely to
occur.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-07-02 22:52:29 -04:00
Charles E. Youse
0325a3d972 arch/x86: eliminate include/arch/x86/irq_controller.h
The MVIC is no longer supported, and only the APIC-based interrupt
subsystem remains. Thus this layer of indirection is unnecessary.

This also corrects an oversight left over from the Jailhouse x2APIC
implementation affecting EOI delivery for direct ISRs only.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-07-02 19:30:00 -04:00
Charles E. Youse
6f3009ecf0 arch/x86: move include/arch/x86/asm.h to include/arch/x86/ia32/asm.h
This file is 32-bit specific, so it is moved into the ia32/ directory
and references to it are updated accordingly.

Also, SP_ARG* definitions are no longer used, so they are removed.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-07-02 19:30:00 -04:00
Yannis Damigos
2d537f49a9 usb_dc_stm32: Don't update ret_bytes if send fails in usb_dc_ep_write()
Don't update ret_bytes if send fails in usb_dc_ep_write().

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2019-07-02 19:05:37 -04:00
Henrik Brix Andersen
7cb92552f3 drivers: watchdog: mcux_wdog32: add driver for the NXP Kinetis WDOG32
Add driver shim for the NXP Kinetis WDOG32 module.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-07-02 18:00:16 -05:00
Alexander Wachter
fc23fd1989 drivers: can: stm32: Update enable driver help message
Updated "Tested on" statements in the help

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-07-02 18:57:23 -04:00
Alexander Wachter
d644007c32 drivers: can: stm32 Add error message for buffer overflow
This commit adds an LOG_ERR message for RX fifo overflow.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-07-02 18:57:23 -04:00
Alexander Wachter
82a1661c99 drivers: can: stm32: Change TX priority to chronological order
This commit changes the TX priority from ID based priority to
chronological order. The advantage is that when messages with
the same ID are sent, the order is retained.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-07-02 18:57:23 -04:00
Alexander Wachter
2b6b065d82 drivers: can: stm32: Remove STM CAN_Init
Removed the STM32 CAN_Init function and implemented the initialization
in the driver.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-07-02 18:57:23 -04:00
Krzysztof Chruscinski
f1b349aa72 drivers: sensor: temp_nrf5: Code cleanup
Reworked nrf5 internal temperature sensor driver to use hal

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-07-02 15:54:25 -04:00
Krzysztof Chruscinski
c661cc6c78 drivers: clock_control: nrf: Add option to use external LF source
Extended clock configuration to allow usage of external clock
source for nrf52 series.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-07-02 12:58:06 +02:00
Loic Poulain
8462f331f5 wifi: eswifi: Implement TCP listen/accept
Start es-wifi TCP server on accept.
An asynchronous (spi) message is received on client connection.
Only one connection is supported at a time.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2019-07-02 09:08:59 +03:00
Loic Poulain
033b267085 wifi: eswifi: Allow nested locking
In order to prevent potential deadlock in various callbacks such as
accept, recv, etc... Add support for nested eswifi locking, allowing
callee to safely access back to the eswifi methods.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2019-07-02 09:08:59 +03:00
Loic Poulain
50fa6bdd5e wifi: eswifi: Parse async messages
The eswifi controller can generate events via asynchronous messages
which can be polled via the 'MR\r' command. The messages will have a
Start Of Message Asynchronous [SOMA] and End Of Message Asynchronous
[EOMA] delimiters.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2019-07-02 09:08:59 +03:00
Loic Poulain
41bfeb54c2 drivers: counter: Add NXP MCUX GPT counter driver
Add driver for General Purpose Timer module which can act as a counter.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2019-07-01 11:53:07 -05:00
Johan Hedberg
0d9dab300e Bluetooth: Introduce separate pool for discardable events
Introduce a separate buffer pool for events which the HCI driver
considers discardable. Examples of such events could be e.g.
Advertising Reports. The benefit of having such a pool means that the
if there is a heavy inflow of such events it will not cause the
allocation for other critical events to block and may even eliminate
deadlocks in some cases.

Also update all mesh samples not to specify explicit RX buffer counts
anymore. Instead, create appropriate defaults in Kconfig so that we
only need to override this in the app for cases like the bbc:microbit
with limited memory.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-07-01 16:36:15 +03:00
Johan Hedberg
fc2fcd10cf Bluetooth: Add dedicated pool for HCI_Num_Completed_Packets HCI event
This event is a priority one, so it's not safe to have it use the RX
buffer pool which may be depleted due to non-priority events (e.g.
advertising events). Since the event is consumed synchronously it's
safe to have a single-buffer pool for it. Also introduce a new
bt_buf_get_evt() API for HCI drivers to simplify the driver-side code,
this effectively also deprecates bt_buf_get_cmd_complete() which now
has no in-tree HCI driver users anymore.

Fixes #16864

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-07-01 16:36:15 +03:00
Andy Ross
1db9f18a08 kernel/timeout: Remove "clock_always_on", replace with "SLOPPY_IDLE"
This is an oddball API.  It's untested.  In fact testing its proper
behavior requires very elaborate automation (you need a device outside
the Zephyr hardware to measure real world time, and a mechanism for
getting the device into and out of idle without using the timer
driver).  And this makes for needless difficulty managing code
coverage metrics.

It was always just a hint anyway.  Mark the old API deprecated and
replace it with a kconfig tunable.  The effect of that is just to
change the timeout value passed to the timer driver, where we can
manage code coverage metrics more easily (only one driver cares to
actually support this feature anyway).

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-06-28 14:24:56 -07:00
Nicolai Glud
e5e45af4b0 shell: adc: adc shell for testing adcs
The adc shell makes it possible to configure ADC_0 and ADC_1 for testing
purposes. It includes helpful printouts if the number of arguments is
wrong.

Signed-off-by: Nicolai Glud <nigd@prevas.dk>
2019-06-28 10:07:18 -05:00
Erwan Gouriou
6b40394df9 drivers/usb/device: stm32: Remove reference to unsupported low speed
Low speed isn't supported in device mode for any of the STM32
references.
Remove the code that refer to it.

Fixes #17114

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-06-28 06:16:10 -04:00
Anas Nashif
5b0aa794b2 cleanup: include/: move misc/reboot.h to power/reboot.h
move misc/reboot.h to power/reboot.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
efb8df5366 cleanup: include/: move misc/stack.h to debug/stack.h
move misc/stack.h to debug/stack.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
a2fd7d70ec cleanup: include/: move misc/util.h to sys/util.h
move misc/util.h to sys/util.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
d222553931 cleanup: include/: move misc/speculation.h to sys/speculation.h
move misc/speculation.h to sys/speculation.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
536dd5a71f cleanup: include/: move misc/slist.h to sys/slist.h
move misc/slist.h to sys/slist.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
9ab2a56751 cleanup: include/: move misc/printk.h to sys/printk.h
move misc/printk.h to sys/printk.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
5d001f3e41 cleanup: include/: move misc/byteorder.h to sys/byteorder.h
move misc/byteorder.h to sys/byteorder.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
5eb90ec169 cleanup: include/: move misc/__assert.h to sys/__assert.h
move misc/__assert.h to sys/__assert.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
7435e5e089 cleanup: include/: move ring_buffer.h to sys/ring_buffer.h
move ring_buffer.h to sys/ring_buffer.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
9e35d53d1f cleanup: include/: move display.h to drivers/display.h
move display.h to drivers/display.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
d1b2718687 cleanup: include/: move uart.h to drivers/uart.h
move uart.h to drivers/uart.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
bd70f6f1ed cleanup: include/: move spi.h to drivers/spi.h
move spi.h to drivers/spi.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
8c1f89fa99 cleanup: include/: move sensor.h to drivers/sensor.h
move sensor.h to drivers/sensor.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
fd359c21e9 cleanup: include/: move rtc.h to drivers/rtc.h
move rtc.h to drivers/rtc.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
5843884887 cleanup: include/: move pwm.h to drivers/pwm.h
move pwm.h to drivers/pwm.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
a8167ab17d cleanup: include/: move pinmux.h to drivers/pinmux.h
move pinmux.h to drivers/pinmux.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
afa85cdc0f cleanup: include/: move led_strip.h to drivers/led_strip.h
move led_strip.h to drivers/led_strip.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
a14ef3bf01 cleanup: include/: move led.h to drivers/led.h
move led.h to drivers/led.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
6524925753 cleanup: include/: move ipm.h to drivers/ipm.h
move ipm.h to drivers/ipm.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
f2e35134b0 cleanup: include/: move i2s.h to drivers/i2s.h
move i2s.h to drivers/i2s.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
8f692c7d38 cleanup: include/: move i2c.h to drivers/i2c.h
move i2c.h to drivers/i2c.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
f901e26de9 cleanup: include/: move hwinfo.h to drivers/hwinfo.h
move hwinfo.h to drivers/hwinfo.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
6aa9c3a68f cleanup: include/: move gpio.h to drivers/gpio.h
move gpio.h to drivers/gpio.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
08a9961678 cleanup: include/: move gna.h to drivers/gna.h
move gna.h to drivers/gna.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
fe051a9055 cleanup: include/: move flash.h to drivers/flash.h
move flash.h to drivers/flash.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
969f8f1c68 cleanup: include/: move entropy.h to drivers/entropy.h
move entropy.h to drivers/entropy.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
46a5d1e5cb cleanup: include/: move dma.h to drivers/dma.h
move dma.h to drivers/dma.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
7e7a9bdf88 cleanup: include/: move counter.h to drivers/counter.h
move counter.h to drivers/counter.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
17ddd1714c cleanup: include/: move clock_control.h to drivers/clock_control.h
move clock_control.h to drivers/clock_control.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
c0c9396d44 cleanup: include/: move can.h to drivers/can.h
move can.h to drivers/can.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
8007266e6a cleanup: include/: move aio_comparator.h to drivers/aio_comparator.h
move aio_comparator.h to drivers/aio_comparator.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
f4709f2c2f cleanup: include/: move adc.h to drivers/adc.h
move adc.h to drivers/adc.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
d4d20677ac cleanup: include/: move watchdog.h to drivers/watchdog.h
move watchdog.h to drivers/watchdog.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
ef281c4237 cleanup: include/: move sys_io.h to sys/sys_io.h
move sys_io.h to sys/sys_io.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
190e368275 cleanup: include/: move power.h to power/power.h
move power.h to power/power.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
e1e05a2eac cleanup: include/: move atomic.h to sys/atomic.h
move atomic.h to sys/atomic.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
52e0efac97 cleanup: include/: move stats.h to stats/stats.h
move stats.h to stats/stats.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Kumar Gala
a614a026b7 dts: Rename DT_.*_GPIO_* to DT_.*_GPIOS_*
Convert DT_.*_GPIO_{CONTROLLER,PIN,FLAGS} ->
	DT_.*_GPIOS_{CONTROLLER,PIN,FLAGS)

Used the following commands to make these conversions:

git grep -l DT_.*_GPIO_CONTROLLER | xargs sed -i 's/DT_\(.*\)_GPIO_CONTROLLER/DT_\1_GPIOS_CONTROLLER/g'
git grep -l DT_.*_GPIO_PIN | xargs sed -i 's/DT_\(.*\)_GPIO_PIN/DT_\1_GPIOS_PIN/g'
git grep -l DT_.*_GPIO_FLAGS | xargs sed -i 's/DT_\(.*\)_GPIO_FLAGS/DT_\1_GPIOS_FLAGS/g'

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-06-27 13:02:34 -05:00
Anas Nashif
0eee0a3c6c drivers: apic_timer: fix include of system_timer.h
Fix path for system_timer.h and loapic.h, we moved it to
include/drivers/timer/ and include/drivers/interrupt_controller/

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 10:51:32 -07:00
Charles E. Youse
c17c298749 drivers/timer/apic_timer.c: new local APIC timer for TICKLESS_KERNEL
The existing local APIC timer driver (loapic_timer.c) has bitrotted
and doesn't support TICKLESS_KERNEL, which is the preferred mode of
operation. This patch introduces a completely new driver, called
the APIC timer driver - the name is changed to allow the drivers to
continue to coexist in the short term, and also because "APIC timer"
isn't ambiguous (the I/O APICs do not have timers).

This driver makes no attempt to work with the MVIC timer as the
previous version did, because MVIC support is deprecated.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-06-27 07:20:54 -04:00
Robert Lubos
7bf0124adf drivers: sensor: Update DT symbols in qdec_nrfx driver
Currently used IRQ DT symbols became deprecated.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2019-06-27 07:16:33 -04:00
Andrzej Głąbek
6e75d644de drivers: usb_dc_nrfx: Add pre-transfer checks if endpoint is enabled
The shim didn't check if a given endpoint was enabled before requesting
the nrfx_usbd driver to perform a read or write operation on it.
In certain circumstances this led to nrfx_usbd driver being stuck in
a loop waiting for the associated DMA transfer to complete.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-06-27 12:17:45 +02:00
Andrzej Głąbek
1b3514a07e Revert "drivers: usb: usb_dc_nrfx: Set cfg.en to false on Reset"
This reverts commit 03ef375f5f.

The cfg.en flag contains only the state of the endpoint as seen by the
shim. It is mainly used to enable the endpoints when the USB peripheral
becomes ready for operation (and the USB stack may want to enable some
endpoints earlier, especially the control ones, so the operation must
be sometimes deferred). In particular, setting this flag to false has
no effect on the actual state of the endpoint in the hardware.
Moreover, this flag was set to false for all the endpoints, including
the control ones which should not be disabled, so such operation
actually fooled the shim.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-06-27 12:17:45 +02:00
Andrzej Głąbek
036791364c usb: kconfig: nrf52840: Enable REMOTE_WAKEUP option only when needed
This patch removes the "hard" selection of the USB_DEVICE_REMOTE_WAKEUP
Kconfig option for USB devices made on the nRF52840 SoC. Now it's up to
the application to decide if it wants to enable the option. This change
makes it possible to pass the USB3CV Chapter 9 Tests for applications
that don't use the remote wakeup feature, since when a USB device only
reports that it supports this feature, and the mentioned option makes
it to do so, one of the test cases expects the USB device to actually
perform the remote wakeup. And when the feature is not reported as
supported, the test case is skipped.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-06-27 12:17:45 +02:00
Alexander Wachter
f5b227641c drivers: can: mcux_flexcan: Add support for MK64
Add support for Kinetis MK64 series.
Interrupts are adapted because MK64 has other interrupts than KEx1F.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-06-26 16:05:51 -05:00
Parthiban Nallathambi
b7b9458ec6 wifi: eswifi: add UDP support
Add UDP support for eswifi driver. eswifi now can co-exist
with TCP and UDP functionality with 4 as max socket connection.

Tested UDP with custom DNS sample (wifi connect + DNS)

Signed-off-by: Parthiban Nallathambi <parthitce@gmail.com>
2019-06-26 23:20:22 +03:00
Armando Visconti
ab4f280661 driver/sensor: lis2dw12: make use of STdC definitions
Port the lis2dw12 sensor driver on top of the lis2dw12_StdC
HAL interface (in modules/hal/st/sensor/stmemsc/).

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-06-26 15:41:40 -04:00
Manivannan Sadhasivam
4d05cdfac0 drivers: pinmux: stm32mp1: Add missing UART4 and UART7 pinctrl definitions
Add missing UART4 and UART7 pinctrl definitions for STM32MP157 MPU.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
2019-06-26 07:37:35 -04:00
Anas Nashif
158d921cde drivers: modem: modem_receiver.h: move header from /include/
Move modem_receiver.h to the driver directory. No other users in the
tree and it is a private header.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-25 15:27:00 -04:00
Anas Nashif
cdc78108d5 drivers: serial: ns16550: move header from /include/
Move ns16550 to the driver directory. No other users in the tree and it
is a private header.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-25 15:27:00 -04:00
Anas Nashif
68c389c1f8 include: move system timer headers to include/drivers/timer/
Move internal and architecture specific headers from include/drivers to
subfolder for timer:

   include/drivers/timer

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-25 15:27:00 -04:00
Anas Nashif
43a49335f4 include: move interrupt controller headers to interrupt_controller/
Move internal and architecture specific headers from include/drivers to
subfolder for interrupt_controller:

include/drivers/interrupt_controller/

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-25 15:27:00 -04:00
Anas Nashif
1c6c657dbe drivers: pinmux: do not include local pinmux.h
Stray include which would include the same public pinmux.h again.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-25 15:27:00 -04:00
Anas Nashif
1034c5e398 drivers: uart_console: removed commented code
Remove all commented and unused code.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-25 15:27:00 -04:00
Anas Nashif
7635cf80ab drivers: uart_console: do not include arch/cpu.h directly
No need tp include arch/cpu.h directly here.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-25 15:27:00 -04:00
Anas Nashif
e8a182ce26 drivers: uart_console: include correct path
include console.h from include/drivers/console

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-25 15:27:00 -04:00
Mieszko Mierunski
5867c36950 drivers: nrf: Add power management to nrf TWI driver.
Add power management to nrf TWI driver.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2019-06-25 14:55:30 +02:00
Mieszko Mierunski
05cdd285cf drivers: nrf: Add power management to nrf TWIM peripheral.
Add power management to nrf TWIM peripheral.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2019-06-25 14:55:30 +02:00
Jukka Rissanen
c9aaab74db net: ptp: clock: Add usermode support to ptp_clock_get()
It is useful that the ptp_clock_get() function can be called from
the userspace. Create also unit test for calling that function
from userspace.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-06-25 15:22:51 +03:00
Charles E. Youse
3dc7c7a6ea drivers/interrupt_controller/mvic.c: remove MVIC interrupt controller
The Quark D2000 is the only x86 with an MVIC, and since support for
it has been dropped, the interrupt controller is orphaned. Removed.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-06-25 08:06:43 -04:00
Charles E. Youse
c6c9dcf28c drivers/adc/adc_intel_quark_d2000: remove Quark D2000 ADC driver
Remove orphaned driver (Quark D2000 SoC no longer supported).

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-06-25 08:06:43 -04:00
Charles E. Youse
57b46bbc85 soc/x86/intel_quark: remove support for Quark D2000 SoC
Removed Quark D2000 SoC files and first-order related DT bindings.

A few config options have been moved from the CONFIG_* space to
the DT_* space, as they were defined in the D2000 Kconfig files
and "leaked" into the other Quark trees.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-06-25 08:06:43 -04:00
Piotr Zięcik
69406e0f9c counter: Update counter API in order to provide more flexibility
This commit introduces new top_value setting configuration structure
with flag for controlling resetting of the counter during change of
top value.

Such change allows for #12068 implementation on hardware which
does not provide alarms.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Signed-off-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2019-06-25 11:05:45 +02:00
Henrik Brix Andersen
b5e3be9e8a soc: arm: nxp: ke1xf: enable MCUX SCG clock controller driver
Enable the MCUX SCG clock controller driver by default for the NXP
Kinetis KE1xF SoC series. Move the generic CLKOUT configuration from
SoC to the clock controller driver.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-06-24 14:33:46 -05:00
Henrik Brix Andersen
13847a315d drivers: clock_control: mcux_scg: add NXP MCUX SCG clock control driver
Add clock controller driver for the NXP Kinetis System Clock Generator
(SCG) clock module.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-06-24 14:33:46 -05:00
Henrik Brix Andersen
652fdfe3a1 drivers: can: add support for the NXP Kinetis FlexCAN controller
Add MCUX driver shim for the NXP Kinetis FlexCAN CAN bus controller.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-06-24 14:33:46 -05:00
Henrik Brix Andersen
dded1d076a dts: can: allow individual specification of prop seg and phase seg1 quanta
Allow individual specification of the time quanta used for the CAN bus
propagation segment and phase segment 1.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-06-24 14:33:46 -05:00
Henrik Brix Andersen
64a9a04500 drivers: can: add support for two CAN controller instances
Add support for two CAN bus controller instances and disable both of
them by default. Enable CAN_1 for the STM boards currently supporting
CAN.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-06-24 14:33:46 -05:00
Kumar Gala
0a99f53c80 sensor: lis2dh: Use general DT_<COMPAT>_BUS_<BUS> define.
Match what other drivers are doing and use the general BUS define.
Change DT_ST_LIS2DH_0_BUS_SPI to DT_ST_LIS2DH_BUS_SPI

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-06-24 07:28:19 -05:00
Kumar Gala
f20d2b6f41 drivers: rv32m1: remove bogus IRQ_PRI related defines
The defines related to IRQ priority don't exist and aren't used.  So
just pass 0 to IRQ_CONNECT for the priority field.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-06-24 07:22:27 -04:00
Derek Hageman
59786b43b3 drivers: sam0: Fix deprecated instance macro usage
During conversion in #16815 a few device tree instance macro aliases
where missed (probably due to them existing to support future SoCs
and so not currently compiled), this fixes their usage.

Signed-off-by: Derek Hageman <hageman@inthat.cloud>
2019-06-24 07:21:26 -04:00
Derek Hageman
4c27e5b72e drivers: sam0: Fix deprecated IRQ macro usage
During conversion in #16937 a few IRQ macro aliases where missed
(probably due to lack of enabled test cases that compile them),
this fixes their usage.

Signed-off-by: Derek Hageman <hageman@inthat.cloud>
2019-06-24 07:21:26 -04:00
Andrei Gansari
58e05ddcc1 drivers: uart for LPC devices interrupt enabled
NXP's MCU LPC families uart interrupt was enabled.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2019-06-21 11:24:09 -05:00
Kumar Gala
a52df691d1 drivers/i2c_rv32m1_lpi2c: Remove accidently added debug code
Some stray debug code that causes a build error got added, remove it so
things build propertly.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-06-21 08:17:57 -05:00
Kumar Gala
dba65ce47c drivers: Update DT IRQ alias defines
The defines should have had a _0 on them, now that we generate the
proper defines, fixup the cases that used that old scheme.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-06-21 07:53:05 -05:00
Charles E. Youse
783a43e265 drivers/counter/counter_cmos.c: implement counter with PC AT "CMOS" RTC
Enable use of the PC/AT "CMOS" RTC as a simple 1Hz counter.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-06-19 15:23:47 -07:00
Anas Nashif
f2cb20c772 docs: fix misspelling across the tree
Found a few annoying typos and figured I better run script and
fix anything it can find, here are the results...

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-19 15:34:13 -05:00
Andrei Emeltchenko
d385db0884 usb: drivers: usb_dc_stm32: Fix coverity issue
Fixes coverity issue CID: 198865.

Fixes #16582

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-06-19 11:08:26 +02:00
Andrei Emeltchenko
1d61bef39e usb: drivers: usb_dc_stm32: Fix coverity issue
Add __ASSERT() for coverity issue CID: 198874. Assert is used instead
of check since this is callback we get from stm32cube.

Fixes #16573

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-06-19 11:08:26 +02:00