Commit graph

721 commits

Author SHA1 Message Date
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 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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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 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
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
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
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
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
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
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
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
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
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
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
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
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
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 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
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 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
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
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
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
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
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
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
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
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
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 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
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 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 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 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 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 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 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 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
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 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
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
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 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
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
Kumar Gala dca8a62afa drivers/uart_rv32m1_lpuart: Fix DT define usage
The driver was using a mix of instance defines and alias, move to just
using the alias defines so its consistent.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-06-15 07:14:12 -04:00
Kumar Gala d4a0c3a2aa dts: Convert new/missed DT_<COMPAT>_<INSTANCE>_<PROP> to DT_INST...
Change code from using now deprecated DT_<COMPAT>_<INSTANCE>_<PROP>
defines to using DT_INST_<INSTANCE>_<COMPAT>_<PROP>.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-06-15 07:14:12 -04:00
Kumar Gala a2693975d7 dts: Convert from DT_<COMPAT>_<INSTANCE>_<PROP> to DT_INST...
Change code from using now deprecated DT_<COMPAT>_<INSTANCE>_<PROP>
defines to using DT_INST_<INSTANCE>_<COMPAT>_<PROP>.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-06-14 08:02:15 -05:00
Anas Nashif 4c32258606 style: add braces around if/while statements
Per guidelines, all statements should have braces around them. We do not
have a CI check for this, so a few went in unnoticed.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-06 15:20:21 +02:00
Benjamin Valentin 4d89ff1232 drivers/uart: introduce SERIAL_SUPPORT_ASYNC option
Not all serial drivers support ASYNC operation and if they do,
they might not support it on every SoC.

Add the SERIAL_SUPPORT_ASYNC option to indicate ASYNC operation
is availiable.

Signed-off-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2019-06-05 07:45:27 -04:00
Nathaniel Graff 3093f5cd2f drivers/gpio: Remove DTS fixups for SiFive GPIO
Change the DT macros used by the SiFive GPIO driver so that fixups
are no longer required.

Signed-off-by: Nathaniel Graff <nathaniel.graff@sifive.com>
2019-05-30 18:40:26 -04:00
Nathaniel Graff a11ebbd48a drivers/uart: Remove DTS fixups for SiFive UART
Change the DT macros used by the SiFive UART driver so that fixups
are no longer required.

Signed-off-by: Nathaniel Graff <nathaniel.graff@sifive.com>
2019-05-30 18:40:26 -04:00
Derek Hageman 55bb37e35c drivers: serial: sam0: Implement DMA async API
This adds support for the async API for SAM0 SERCOM USARTs using
DMA to drive the device.

Tested on SAMD21 with a few trivial programs and with
tests/drivers/uart/uart_async_api.

Signed-off-by: Derek Hageman <hageman@inthat.cloud>
2019-05-30 17:18:44 -04:00
Sören Tempel 52a4e4d840 drivers: serial: sifive: fix configuration of rxcnt/txcnt
The values were swapped meaning the configured value for rxcnt was used
for txcnt and vice versa.

Signed-off-by: Sören Tempel <soeren+git@soeren-tempel.net>
2019-05-29 17:22:58 -04:00
Erwan Gouriou eb97fea741 boards: nucleo_wb55rg: configure LPUART
Configure LPUART as btmon interface and
re-instantiate usart1 as console output (using ST-Link VCP)


Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-05-29 10:58:36 -04:00
Jan Van Winkel 7a246c30bd dts: posix: Add DTS support for POSIX architecture
Added device tree support for POSIX architecture based boards.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2019-05-28 21:14:19 -04:00
Erwan Gouriou 9c1ffddcaf drivers: serial: Enable LPUART for STM32WB
A required code to enable LPUART_1 on stm32wb series.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-05-21 07:49:14 -05:00
Erwan Gouriou 69a2896f3e drivers/serial: stm32: Optimize LPUART code
On STM32 series currently available in Zephyr,
LPUART and U(S)ART IPs are similar and share most of their
registers. As a consequence LL API defined for U(S)ART also
applies to LPUART.
This allows to remove specific LPUART code.

Restrict use of LL LPUART API when it diverges from UART one.


Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-05-21 07:49:14 -05:00
Jukka Rissanen f521996d71 uart: native_posix: Add support for another serial port
The second serial port (UART_1) can be used for connecting to
host serial port. This is used for example by PPP (Point-to-Point
Protocol) implementation in which case the pppd running in Linux host
connects to a pty that is linked to UART_1 in Zephyr.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-05-21 08:21:31 -04:00
Mieszko Mierunski 7b0576243a drivers: nrf: Fix long receptions in UARTE async API.
If reception was longer than rx timeout, UART_RX_RDY event
would provide data with delay, and synchronise at buffer end.

This change makes sure that all data is given to user when timeout
occurs.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2019-05-16 13:47:07 +02:00
Filip Kokosinski b3739169cb drivers: serial: add LiteUART driver
Add LiteX UART driver with bindings for this device.

Signed-off-by: Filip Kokosinski <fkokosinski@internships.antmicro.com>
Signed-off-by: Mateusz Holenko <mholenko@antmicro.com>
2019-05-15 12:52:16 -05:00
Henrik Brix Andersen 56dfb62e40 drivers: serial: uart_mcux_lpuart: add support for LPUARTs with two IRQs
Add support for NXP MCUX LPUART devices with separate IRQ lines for
transmit and receive status interrupts (e.g. the Kinetis KE1xF SoC
series).

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-05-14 15:00:11 -05:00
Benjamin Lindqvist 55e2014d99 drivers: nrf: Trigger STOP RX event and wait before disabling UARTE
Without first triggering TASKS_STOP{RX,TX}, I observed that the UARTE
was never disabled when using device_set_power_state which resulted in
the HFCLK never being shut down and several hundred microamps in
unnecessary current consumption when idle. This seems to fix the issue.

Also added special treatment of uarte if CONFIG_UART_ASYNC_API is
selected. Note that the #ifdef isn't enough, since it's possible that
the option is set, but only one of the UARTs uses it.

Signed-off-by: Benjamin Lindqvist <benjamin.lindqvist@endian.se>
2019-05-14 17:02:17 +02:00
Benoit Leforestier 9fee67d562 Driver: Uart: Add support of 9 bits data length for STM32
Some STM32 (F0, F1, F2, F3, F4, L0, L4) USART support
9bits data word length.

Signed-off-by: Benoit Leforestier <benoit.leforestier@gmail.com>
2019-05-07 23:16:55 -04:00
Charles E. Youse 4a49736bd1 drivers/uart_ns16550: fix style issues flagged by Zephyrbot
Simple whitespace and other style issues.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-05-04 18:29:32 -04:00
Charles E. Youse 869c5d2e54 drivers/uart_ns16550: enable auto IRQ detection for PCI(e) endpoints
If a UART is configured with IRQ == PCIE_IRQ_DETECT, then use the
pcie_wired_irq() to determine the IRQ at runtime, and install the
handler using the dynamic interrupt mechanism.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-05-04 18:29:32 -04:00
Charles E. Youse f2af5fe731 drivers/uart_ns16550: move UART configuration boilerplate to template
The per-UART configuration is boilerplate that is becoming a maintenance
nightmare as it grows. A template file is created, and instances are
created as needed by cmake at build time.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-05-04 18:29:32 -04:00
Charles E. Youse ef1788da70 drivers/uart_ns16550: remove unnecessary #include
There aren't any dependencies on MSI enablement in the source anymore.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-05-04 18:29:32 -04:00
Brett Witherspoon f101b77db2 soc: ti_simplelink: add support for TI CC13x2 / CC26x2 series
Add initial support for the TI CC13x2 / CC26x2 series with the CC2652R
and CC1352R SoCs. The UART and GPIO peripherals are supported. Drivers
use the driverlib HAL from the TI CC13x2 / CC26x2 SDK.

Signed-off-by: Brett Witherspoon <spoonb@cdspooner.com>
2019-05-04 09:13:43 -05:00
Derek Hageman 4709816a69 soc: sam0: Remove SERCOM defines from dts_fixup.h
Move SERCOM peripherals to use the raw defines generated from DTS
parsing.  This adds aliases to the DTS so that the SERCOM number
can still be used for clocking and pinmux.

Signed-off-by: Derek Hageman <hageman@inthat.cloud>
2019-05-03 08:46:57 -05:00
Jun Li 32d23cb3aa driver: api: uart: remove exclusive config for async api
The PR removes the exclusive limit on enabling both UART_ASYNC_API
and UART_INTERRUPT_DRIVEN so that both options can be enabled
together for same uart driver.

Also, the interrupt handler will be used for both cases. So, enable
definition of interrupt handler for both.

However, nRF UART driver still wants to enable only one of them.
So, a new config is added to disable the code for UART_ASYNC_API
when the option UART_INTERRUPT_DRIVEN is enabled.

Signed-off-by: Jun Li <jun.r.li@intel.com>
2019-05-01 08:33:16 -07:00
Sören Tempel ec2f503635 drivers: serial: sifive: Fix UART extern interrupts
IRQ_CONNECT and irq_enable calls in the SiFive UART driver were
misconfigured when the conversion to DeviceTree support occurred.

See also: https://github.com/zephyrproject-rtos/zephyr/pull/10613

Signed-off-by: Sören Tempel <soeren+git@soeren-tempel.net>
2019-05-01 10:29:28 -04:00
Charles E. Youse 18833ac0ef drivers/pcie: verify PCI(e) assigned interrupts
A new function pcie_irq_enable() is added to be used in lieu of
irq_enable() when the target device is PCI(e)-attached. The function
attempts to use MSI, when configured in the kernel and supported by
the endpoint; failing that, it will verify that IRQ requested is in
fact routed to the device by the boot firmware before enabling it.

The NS16550 UART driver is updated to use pcie_irq_enable().

The PCI(e) shell is extended to dump information about wired IRQs.

The up_squared devicetree is fixed (reverted?) to IRQ5 for UART1.

The galileo enables MSI by default.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-04-28 13:36:28 -04:00
Benjamin Valentin 4d9486fc22 soc: sam0: Enable generic peripheral selection
Make sure that when e.g. CONFIG_SERIAL is set, CONFIG_UART_SAM0 is
selected automatically when the sam0 SoC family is used.

Signed-off-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2019-04-19 14:37:17 -05:00
Ryan QIAN 6e277cff20 drivers: serial: add config for uart 4
- Add config for uart 4

Signed-off-by: Ryan QIAN <jianghao.qian@nxp.com>
2019-04-18 16:11:34 -05:00
Georgij Cernysiov 04da64db76 drivers: serial: stm32: dts binding, and fixup for flow control
Allows to enable initial RTS/CTS hardware flow control
in the dts.

Co-authored-by: Benoit Leforestier <benoit.leforestier@gmail.com>
Signed-off-by: Georgij Cernysiov <g.cernysiov@elco-automation.de>
2019-04-17 16:09:54 -05:00
Georgij Cernysiov 78eed34b78 drivers: serial: stm32: add serial hw flow control
Adds RTS CTS hardware flow control support.

Signed-off-by: Georgij Cernysiov <g.cernysiov@elco-automation.de>
2019-04-17 16:09:54 -05:00
Georgij Cernysiov c74c131e4f drivers: serial: stm32: add err_check
Adds 'err_check' implementation.

Signed-off-by: Georgij Cernysiov <g.cernysiov@elco-automation.de>
2019-04-17 15:58:56 -05:00
Georgij Cernysiov 3de55daab1 drivers: serial: stm32: remove forced RXNE clearance
Removed RXNE clearance. RXNE is cleared upon reading DR|RDR register.

Signed-off-by: Georgij Cernysiov <g.cernysiov@elco-automation.de>
2019-04-17 15:51:43 -05:00
Charles E. Youse e039053546 uart/ns16550, drivers/pcie: add PCI(e) support
A parallel PCI implementation ("pcie") is added with features for PCIe.
In particular, message-signaled interrupts (MSI) are supported, which
are essential to the use of any non-trivial PCIe device.

The NS16550 UART driver is modified to use pcie.

pcie is a complete replacement for the old PCI support ("pci"). It is
smaller, by an order of magnitude, and cleaner. Both pci and pcie can
(and do) coexist in the same builds, but the intent is to rework any
existing drivers that depend on pci and ultimately remove pci entirely.

This patch is large, but things in mirror are smaller than they appear.
Most of the modified files are configuration-related, and are changed
only slightly to accommodate the modified UART driver.

Deficiencies:

64-bit support is minimal. The code works fine with 64-bit capable
devices, but will not cooperate with MMIO regions (or MSI targets) that
have high bits set. This is not needed on any current boards, and is
unlikely to be needed in the future. Only superficial changes would
be required if we change our minds.

The method specifying PCI endpoints in devicetree is somewhat kludgey.
The "right" way would be to hang PCI devices off a topological tree;
while this would be more aesthetically pleasing, I don't think it's
worth the effort, given our non-standard use of devicetree.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-04-17 10:50:05 -07:00
Mieszko Mierunski 6a739435a0 drivers: nrf: Fix UARTE interrupt driven operation.
Bad order of interrupt calls made it unable to transmitt data
using interrupt driven API.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2019-04-10 13:53:40 -04:00
Anas Nashif 3ae52624ff license: cleanup: add SPDX Apache-2.0 license identifier
Update the files which contain no license information with the
'Apache-2.0' SPDX license identifier.  Many source files in the tree are
missing licensing information, which makes it harder for compliance
tools to determine the correct license.

By default all files without license information are under the default
license of Zephyr, which is Apache version 2.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-04-07 08:45:22 -04:00
Patrik Flykt 97b3bd11a7 drivers: Rename reserved function names
Rename reserved function names in drivers/ subdirectory. Update
function macros concatenatenating function names with '##'. As
there is a conflict between the existing gpio_sch_manage_callback()
and _gpio_sch_manage_callback() names, leave the latter unmodified.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2019-04-03 17:31:00 -04:00
Patrik Flykt 21358baa72 all: Update unsigend 'U' suffix due to multiplication
As the multiplication rule is updated, new unsigned suffixes
are added in the code.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2019-03-28 17:15:58 -05:00
Patrik Flykt 24d71431e9 all: Add 'U' suffix when using unsigned variables
Add a 'U' suffix to values when computing and comparing against
unsigned variables.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2019-03-28 17:15:58 -05:00
Mieszko Mierunski 0b2946f4f3 drivers: nrf: Add power management to uarte shim
Adds power management to uarte shim.

Fixes 12501

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2019-03-28 09:30:57 -04:00
Mieszko Mierunski b121660a8f drivers: nrf: Enable usage of Async UART API for UARTE on nrf91
Modify driver to use PPI or DPPI depending on soc.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2019-03-28 09:30:57 -04:00
Mieszko Mierunski 35aedfa532 drivers: nrf: Rework UARTE shim for uart ASYNC API.
Rework uart_nrfx_uarte shim to work with asynchronous API.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2019-03-28 09:30:57 -04:00
Ramakrishna Pallala e1639b5345 device: Extend device_set_power_state API to support async requests
The existing device_set_power_state() API works only in synchronous
mode and this is not desirable for devices(ex: Gyro) which take
longer time (few 100 mSec) to suspend/resume.

To support async mode, a new callback argument is added to the API.
The device drivers can asynchronously suspend/resume and call the
callback function upon completion of the async request.

This commit adds the missing callback parameter to all the drivers
to make it compliant with the new API.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2019-03-14 14:26:15 +01:00
Alberto Escolar Piedras 319caa25e0 uart: native_posix: Fix out of bounds access
Fix an out of bound access in the native_posix uart driver,
when generating the string to autoattach a terminal to the UART.
(The space for the null termination was missing)

Fixes: #14401
Coverity issue CID: 195855

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2019-03-13 11:58:50 -05:00
Alberto Escolar Piedras 448755e622 uart: native_posix: Check fcntl() return value
fcntl() may (very unlikely) fail when setting the new pseudoterminal
to non-blocking.
Let's check for this condition, handle it, and in the process
silence a coverity issue.

Fixes #14396
Coverity CID: 195872

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2019-03-13 11:58:26 -05:00
Ulf Magnusson 53376394b7 kconfig: Remove blank lines at the beginning/end of files
Maybe this is some "just in case" thing that got copied around. There's
no need to have a blank line at the beginning or end of Kconfig files.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-03-13 07:29:42 -05:00
Patrik Flykt 4344e27c26 all: Update reserved function names
Update reserved function names starting with one underscore, replacing
them as follows:
   '_k_' with 'z_'
   '_K_' with 'Z_'
   '_handler_' with 'z_handl_'
   '_Cstart' with 'z_cstart'
   '_Swap' with 'z_swap'

This renaming is done on both global and those static function names
in kernel/include and include/. Other static function names in kernel/
are renamed by removing the leading underscore. Other function names
not starting with any prefix listed above are renamed starting with
a 'z_' or 'Z_' prefix.

Function names starting with two or three leading underscores are not
automatcally renamed since these names will collide with the variants
with two or three leading underscores.

Various generator scripts have also been updated as well as perf,
linker and usb files. These are
   drivers/serial/uart_handlers.c
   include/linker/kobject-text.ld
   kernel/include/syscall_handler.h
   scripts/gen_kobject_list.py
   scripts/gen_syscall_header.py

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2019-03-11 13:48:42 -04:00
Ulf Magnusson 116fb2fe0a kconfig: drivers: serial: Remove redundant dependencies
One of these is from 'source'ing a file within an 'if SERIAL', and then
adding another 'depends on SERIAL' within it.

'if FOO' is just shorthand for adding 'depends on FOO' to each item
within the 'if'. Dependencies on menus work similarly. There are no
"conditional includes" in Kconfig, so 'if FOO' has no special meaning
around a source. Conditional includes wouldn't be possible, because an
if condition could include (directly or indirectly) forward references
to symbols not defined yet.

Tip: When adding a symbol, check its dependencies in the menuconfig
('ninja menuconfig', then / to jump to the symbol). The menuconfig also
shows how the file with the symbol got included, so if you see
duplicated dependencies, it's easy to hunt down where they come from.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-03-09 09:57:17 -05:00
Jiri Kubias b71b9c688c serial: u(s)art_sam: Fixed return value of usart_sam_irq_is_pending
The function usart_sam_irq_is_pending (uart_sam_irq_is_pending) return
only the masked value of US_CSR register but it doesn't respect if the
IRQ is enabled or not. For proper function it must check if the IRQ is
enabled for the event.

Signed-off-by: Jiri Kubias <jiri.kubias@leapslabs.com>
2019-03-07 06:24:48 -06:00
Andrzej Głąbek 257c28a200 drivers: nrfx: Add Kconfig checks for mutually exclusive peripherals
In Nordic SoCs, SPI and TWI peripherals with the same instance number
share certain resources and therefore cannot be used at the same time
(in nRF91 Series this limitation concerns UART peripherals as well).
This patch adds Kconfig checks ensuring that only one of such mutually
exclusive peripherals can be enabled.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-03-05 13:38:18 -05:00
Ulf Magnusson c5592de5ae uart/ns16550: Give CONFIG_NS16550_REG_SHIFT a DT_* prefix instead
This value always comes from DTS. No Kconfig symbol named
NS16550_REG_SHIFT ever existed.

Might've been missed in commit 603f068690 ("uart/ns16550: Use DT_ prefix
for remaining device configs").

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-03-03 23:43:27 -05:00
Kumar Gala 5e263f1c80 serial: uart_rv32m1_lpuart: Fix build warnings
The driver was using non-'DT_' prefixed defines which are deprecated.
Move to using proper 'DT_' prefix defines.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-03-02 03:51:03 +01:00
Ulf Magnusson 2141cb740d drivers/serial: ns16550: Remove unused Kconfig symbols
These symbols are not referenced anywhere. The values always come from
DTS, at least if https://github.com/zephyrproject-rtos/zephyr/pull/13760
was correct.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-03-01 09:20:12 +01:00
Charles E. Youse 5dd1bf15fc uart: ns16550: support Apollo Lake PRV_CLOCK_PARAMS (PCP) register
The UARTs on the Apollo Lake SoCs have PLLs that feed the baud rate
generators. This patch allows a user to specify custom M/N values for
those PLLs when custom/high-speed baud rates are required.

I'm not entirely satisfied with the way the PCP values are configured,
because it requires tweaking data in both Kconfig and DeviceTree. For
the time being I've merely taken my cue from another similar feature
(the DLF register support) and have punted on figuring out the "right
way" to expose UART configuration to the application.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-02-28 08:50:34 -08:00
Daniel Leung 603f068690 uart/ns16550: Use DT_ prefix for remaining device configs
Previous rename from CONFIG_* to DT_* left a few remaining
CONFIG_*. So rename them manually now.

Fix #13753

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-02-26 20:06:26 -06:00
Andrew Boie 743677d743 uart: ns16550: place header in correct spot
This is an application facing define, specific to this
driver, for the public uart_drv_cmd() API. Put it with
public headers.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-02-22 23:32:31 -05:00
Andy Gross 89fb37b76a uart: pl011: Use correct masking for ICR
This patch changes the ICR masking to use a fixed mask instead of
a buggy read/write of the current ICR to itself.  The ICR is write
only and reading this for information is unpredictable and should
be avoided.

Signed-off-by: Andy Gross <andy.gross@linaro.org>
2019-02-13 11:08:22 -06:00
Francisco Munoz 2ab60eb0ab serial/uart_ns16550: make UART_REG_ADDR_INTERVAL
On behalf of : Timo Teräs <timo.teras@iki.fi>

UART_REG_ADDR_INTERVAL is SOC / chip implementation specific feature,
and its width does not always correspond to current settings for
IOPORT/non IOPORT access method.

Signed-off-by: Francisco Munoz <francisco.munoz.ruiz@intel.com>
2019-02-08 21:38:54 -05:00
Kumar Gala e6e580305b serial: uart_sam0: Don't use CONFIG_ namespace for non Kconfig
The driver was defining a macro with a CONFIG_ prefix but this wasn't
coming from Kconfig.  Change the macro name not to conflict with the
Kconfig CONFIG_ namespace.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-01 19:01:16 -05:00
Kumar Gala b57357085d drivers: serial: uart_miv: Fix trivial comment mismatch
comment on #endif didn't match #ifdef

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-01 19:01:16 -05:00
Piotr Mienkowski 91786e96aa drivers: leuart_gecko: use DT_<COMPAT>_<INSTANCE>_<PROP> defines
Use the new DT_<COMPAT>_<INSTANCE>_<PROP> defines to instantiate
devices. This commit adds also ability to define individual pin
locations on SoC series that support the feature. Definitions of GPIO
pins assigned to a given location have been moved from soc_pinmap.h file
to board DTS file.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2019-02-01 04:18:50 -06:00
Kumar Gala 82f5c5e565 uart: sifive: Fix trivial CONFIG -> DT missed conversion
CONFIG_SIFIVE_UART_1_LABEL should have been DT_SIFIVE_UART_1_LABEL.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-31 11:38:40 -05:00
Wayne Ren 1e392fbd0a drivers: uart_ns16550: remove soc specific codes and bug fixes
* remove soc specific codes
* optimize the caculation of baudrate.

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2019-01-31 09:03:41 -05:00
Piotr Mienkowski a148e11e2a drivers: uart_gecko: use DT_<COMPAT>_<INSTANCE>_<PROP> defines
Use the new DT_<COMPAT>_<INSTANCE>_<PROP> defines to instantiate
devices. This commit adds also ability to define individual pin
locations on SoC series that support the feature. Definitions of GPIO
pins assigned to a given location have been moved from soc_pinmap.h file
to board DTS file.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2019-01-31 03:14:51 -06:00
Kumar Gala 352234e0b6 drivers: uart_nsim: Add device tree support
Add Device Tree support for uart nsim ARC driver.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-30 12:27:37 -06:00
Michael Scott 3588b94b06 drivers: serial: mcux: Introduce support for HW flow control
Now that a hw-flow-control DTS binding has been added for MCUX uart,
let's check for the DT_ define and enable support in the MCUX HAL
layer.

Signed-off-by: Michael Scott <mike@foundries.io>
2019-01-30 02:53:12 -06:00
Michael Scott 13c794bc1c serial: RV32M1: introduce lpuart driver / DT bindings
Add a UART driver.

Signed-off-by: Michael Scott <mike@foundries.io>
Signed-off-by: Marti Bolivar <marti@foundries.io>
2019-01-25 11:59:46 -05:00
Kumar Gala 4b6cec44ff drivers: uart: cmsdk_apb: Convert to new DT_<COMPAT>_<INSTANCE> defines
Convert cmsdk_apb driver to use new defines so we can remove the
dts_fixup.h code for it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-25 08:55:06 -06:00
Benoit Leforestier 2a1c94cbc3 Driver: Serial STM32: Fix use of TXE IRQ
In case of TX IRQ pending,
uart_stm32_irq_is_pending() function always return 0,
because "is TXE enabled ?" is checked instead of "is TC enabled ?".

Signed-off-by: Benoit Leforestier <benoit.leforestier@gmail.com>
2019-01-23 04:30:58 -06:00
Mieszko Mierunski 29c71b1fec drivers: nrf: Rework UART shim to support async UART API.
Add support for async UART API.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2019-01-22 18:54:12 +01:00
Mieszko Mierunski 117c28aad9 api: uart: Add new asynchronous UART API.
Added new UART API, that allows for longer transmissions, leaves
IRQ handling on driver side and allows for DMA usage.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2019-01-22 18:54:12 +01:00
Andrzej Głąbek 61fe47ad15 drivers: serial: nrfx: Add support for UARTE2 and UARTE3
Extend the uart_nrfx_uarte driver to support all UARTE instances
available on nRF9160.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-01-21 10:13:34 +01:00
Alberto Escolar Piedras acefd36501 native_posix: Remove all references to the defunct legacy shell
Remove all references in the documentation and Kconfig options
to the legacy shell to avoid confusing users and developers

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2019-01-18 18:25:05 -05:00
Pushpal Sidhu acd0e25384 serial: stm32: Implement configure and config_get api calls
Implement these two new api calls. Allows on-the-fly configuration
adjustment of uarts.

Signed-off-by: Pushpal Sidhu <psidhu.devel@gmail.com>
2019-01-16 21:49:03 -05:00
Maureen Helm c80b564ec2 drivers: serial: Fix mcux lpuart instance 2
The mcux lpuart shim driver was updated in commit
20202902f2 to use DT_ prefix in all
defined labels not related to Kconfig, but instance 2 was missed.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-01-16 12:32:16 -06:00
Andy Gross 9cc4b59069 serial: Add Support for ARM PL011 UART
This patch adds a serial driver for the ARM PL011 IP block.

Signed-off-by: Andy Gross <andy.gross@linaro.org>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-15 15:40:37 -06:00
Varun Sharma 77c643a5a3 drivers: Modify drivers to use DEVICE_AND_API_INIT()
Modified drivers to use DEVICE_AND_API_INIT() instead of DEVICE_INIT()

This will make sure driver_api,is populated at build time and is exposed
to user space

Signed-off-by: Varun Sharma <varun.sharma@intel.com>
2019-01-15 10:39:34 -08:00
Wayne Ren f0db0b8815 driver: uart_ns16550.c: necessary changes for arc iot soc
1. optimize the baudrate calulation
2. For arc iot soc, the interval val is 4
3. before write any regs, the clk of uart must be enabled

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2019-01-10 07:05:51 -05:00
Erwan Gouriou 11eacffdd4 drivers/serial: stm32: Remove superfluous dependency in Kconfig
In Kconfig.stm32, all UART port symbols were defined with a dependency
on symbol UART_STM32. This is redundant since they are located under
if UART_STM32 condition.


Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-01-09 08:05:24 -06:00
Erwan Gouriou 4a25ae1694 drivers/serial: stm32: rename symbol UART_LPUART_1 to LPUART_1
Following recent renaming of STM32 UART Kconfig UART symbols,
LPUART was named as UART_LPUART_1.
Rename to LPUART_1.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-01-09 08:05:24 -06:00
Piotr Mienkowski aa2c27d007 soc: silabs_exx32: Add independent Kconfig options for HAL libraries
Zephyr gecko drivers depend on libraries provided by the vendor. The
same libraries may also be used directly by the application code or
RAIL library. To facilitate the latter use case scenario this commit
adds Kconfig options to independently enable compilation of vendor
HAL library modules.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2019-01-08 13:31:42 -06:00
Piotr Mienkowski 973af2c8d7 dts: silabs: use 'aliases' to remove dts_fixup defines
By adding 'aliases' node in SoC .dtsi file it is possible to generate
DT_ defines which specify a logical name rather than relay on module
location on APB bus. E.g. DT_SILABS_GECKO_USART_40010000_LABEL becomes
DT_SILABS_GECKO_USART_USART_0_LABEL. Thus it is possible to remove
dts_fixup.h defines.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2019-01-08 11:56:02 -06:00
Sebastian Bøe acb6486489 kconfig: Hide the Stellaris serial driver on unsupported platforms
Hide the Stellaris serial driver on unsupported platforms.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-12-30 16:24:50 -05:00
Andrzej Głąbek 4b43065cfc drivers: nrf: Enable nRF drivers by default in Kconfig
Make the following nRF peripheral drivers:
- ADC
- GPIO
- I2C
- SPI
- UART
- USB_DEVICE
enabled by default so that users do not need to explicitly enable them
in their applications after choosing an nRF SoC as the build target.

Kconfig options enabling these drivers depend on both a given hardware
feature (e.g. I2C) and an nRF family SoC selected, so effectively they
will be automatically enabled only when it is adequate (and in most
cases these drivers are the only option for a given hardware feature
on nRF SoCs).

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2018-12-21 21:01:37 +01:00
Andrzej Głąbek 7c13ba9965 drivers: serial: nrf: Remove false dependency on the gpio driver
Implementations of both flavors of serial drivers for Nordic SoCs
are no longer dependent on the gpio driver. Remove the dependency
from Kconfig.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2018-12-21 21:01:37 +01:00
Erwan Gouriou b1008ccb02 drivers/serial: stm32: Modify Kconfig instance flags
STM32 uart Kconfig instance flags were not following
same naming scheme than other drivers (i2c, spi, ..)

Update driver to use UART_X instead of UART_STM32_PORT_X

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-12-14 09:59:37 -06:00
Erwan Gouriou 9062e97a45 drivers: stm32: check clock_control_on return value
Check clock_control_on return value now that it is checking appropriate
bus is used in the request.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-12-07 11:31:48 -05:00
Patrik Flykt 8ff96b5a57 drivers: Add 'U' to unsigned variable assignments
Add 'U' to a value when assigning it to an unsigned variable.
MISRA-C rule 7.2

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2018-12-04 22:51:56 -05:00
Diego Sueiro f1caf676ca drivers/serial: Fix uart issues for i.MX7 and i.MX6
This patch fixes the uart isr calling the callback with wrong data
(#11465) and the uart_poll_in checking the wrong status flag.

Signed-off-by: Diego Sueiro <diego.sueiro@gmail.com>
2018-12-03 15:15:36 -05:00
Alberto Escolar Piedras c34d919139 uart: native_posix driver: Fix typo
Just a typo fix.
Fixes #11179

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-11-30 08:00:34 -08:00
Flavio Ceolin 98d03266f1 serial: Change poll_out signature
poll_out function was returning the character that was sent. It
happens that it is always constant and the return of this functions is
never tested. Changing it to be a void function.

MISRA-C rule 17.7

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-11-29 10:18:59 -08:00
Mieszko Mierunski 94b72e7bea drivers: nrf: Add UART and UARTE configure function.
Add UART configure function for UART and UARTE shims.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2018-11-29 14:59:35 +01:00
Paul Sokolovsky 45b1d73164 drivers: serial: uart_cmsdk_apb: Ack IRQs before callback to avoid races
This effectively reverts part of earlier 49bb163756 which moved
interrupt acknowledgement until after return from the user callback.
This was done confusing the flow of this driver with how some other
drivers do it, where pending interrupt status is checked by
uart_irq_rx_ready()/uart_irq_tx_ready(), which should be called by
the callback. But the uart_cmsdk_apb driver actually uses different
hardware register in these functions. And acking IRQs after user
callback can lead to race condition and losing an IRQ, and the
simple fix in this case is just move acknowledgement to where it
was before.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-11-22 13:14:19 -05:00
Mieszko Mierunski 1bfa721373 drivers: nrf: nrf uarte fix TX interrupts disabling.
Make sure that TX interrupts are disabled after transmission
is finished.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2018-11-22 14:06:01 +01:00
Mieszko Mierunski ad7c15c77b drivers: nrf: Fix nrf uarte fifo_fill function.
Calling fifo_fill function from uart_nrfx_uarte in the same
interrupt more than once, would break previous transmission.

Following fix adds checking if previous data was sent, and
if not, returns 0.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2018-11-22 14:06:01 +01:00
Andrzej Głąbek f4675758d7 drivers: serial: Update more DTS-derived labels with DT_ prefix
This is a follow-up to commit b3ca789ef25627bcf7b02ec2aa7fa900fba37227.
Apparently, another driver needed to be updated but this was not caught
up in CI builds at that time.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2018-11-21 05:02:21 -06:00
Mieszko Mierunski 34cb33daa8 dts: nrf: Remove UART dts.fixup defines and use aliases instead.
Changed driver to use defines from aliases instead of fixup.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2018-11-20 22:18:09 +01:00
Gil Pitney 759b987f72 drivers: serial: Update cc32xx uart interrupt handling
The Zephyr console and shell interrupt processing assumes
a TX interrupt is evoked upon first enabling the TX
interrupt via uart_irq_tx_enable.

This was not the case with the cc32xx uart, coming out of
reset, with FIFO's disabled.

The only way found to achieve this behavior is to fill
the fifo with a non-printable character on initialization.

Also, the uart driver was explicitly clearing TX/RX interrupts in
its isr, which was unnecessary, as the act of reading/writing
did that implicitly.

These fixes allow the cc32xx uart to work with the
current Zephyr console/shell design.

Fixes: #11202

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

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

3. Update stale comments.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-11-16 11:48:06 -06:00
Andrzej Głąbek 20202902f2 dts_fixups: Use DT_ prefix in all defined labels not related to Kconfig
These changes were obtained by running a script  created by
Ulf Magnusson <Ulf.Magnusson@nordicsemi.no> for the following
specification:

1. Read the contents of all dts_fixup.h files in Zephyr
2. Check the left-hand side of the #define macros (i.e. the X in
   #define X Y)
3. Check if that name is also the name of a Kconfig option
   3.a If it is, then do nothing
   3.b If it is not, then replace CONFIG_ with DT_ or add DT_ if it
       has neither of these two prefixes
4. Replace the use of the changed #define in the code itself
   (.c, .h, .ld)

Additionally, some tweaks had to be added to this script to catch some
of the macros used in the code in a parameterized form, e.g.:
- CONFIG_GPIO_STM32_GPIO##__SUFFIX##_BASE_ADDRESS
- CONFIG_UART_##idx##_TX_PIN
- I2C_SBCON_##_num##_BASE_ADDR
and to prevent adding DT_ prefix to the following symbols:
- FLASH_START
- FLASH_SIZE
- SRAM_START
- SRAM_SIZE
- _ROM_ADDR
- _ROM_SIZE
- _RAM_ADDR
- _RAM_SIZE
which are surprisingly also defined in some dts_fixup.h files.

Finally, some manual corrections had to be done as well:
- name##_IRQ -> DT_##name##_IRQ in uart_stm32.c

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2018-11-13 10:44:42 -06:00
Andrzej Głąbek 8dd11d9736 drivers: serial: Update DTS-derived labels with DT_ prefix
Update a couple of labels generated from DTS used directly (not through
dts_fixups) in some serial drivers, to the reflect recent changes made
to the extracting script.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2018-11-13 10:44:42 -06:00
Erwan Gouriou e886d16f67 drivers/serial: stm32: factorize device declaration
Following use of clock information from device tree,
factorize devices declarations.


Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-11-12 08:17:28 -05:00
Erwan Gouriou d76a5592e4 drivers/serial: stm32: Get clocks information from device tree
Provide CONFIG macros for clocks bits and bus properties in fixup
files and use them to simplify logic in uart devices instanciation
code

Fixes #10448

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-11-12 08:17:28 -05:00
Himanshu Jha d0a98b7cf9 drivers: Remove redundant semicolon
Remove the redundant semicolon used as a terminator in
`if`, `switch`, `while` statements.

Found using Coccinelle.

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
2018-11-07 10:34:06 -05:00
Anas Nashif c2c6a6a245 qemu_riscv32: use hifive1 configuration
Use hifive1 configuration for this qemu and set
SYS_CLOCK_HW_CYCLES_PER_SEC to 10000000

Fixes #10043

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-05 11:00:38 -05:00
Kumar Gala 6d08958ad5 drivers: uart_sam0: move sercom pad info to dts
Move the setting of the SERCOM PAD for rxpo/txpo for the uart driver
into device tree out of board.h

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-05 10:05:47 -05:00
Kiril Zyapkov 7a602fc615 drivers: uart_stm32: fix ORE hogging the CPU
If data is received before an IRQ handler was set and enabled,
hardware sets the ORE flag. Once set, the IRQ routine starts
hogging the CPU until ORE is cleared. This change will clear
the flag when user code attempts to drain incoming data.

Signed-off-by: Kiril Zyapkov <k.zyapkov@allterco.com>
2018-11-05 09:01:30 -05:00
Kumar Gala 751b02a49c drivers: serial: uart_miv: Convert to use DTS
Update the uart_miv driver to get params like name, addr, baud-rate,
clock freq from DTS generated defines.  Fixup related board and soc code
as needed.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-03 06:58:23 -04:00
David B. Kinder ee47f7fb7a doc: fix kconfig misspellings
Fix misspellings in Kconfig files that show up in the configuration
documentation (and make menuconfig screens).

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-11-02 17:58:16 -04:00
Kumar Gala aa2bdbe322 drivers: Remove board.h include
We either don't need board.h in the driver or we should be include soc.h
instead.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-01 13:21:11 -04:00
Diego Sueiro 3b0260939c drivers: Introduce Silabs leuart shim serial driver
Adds the Low Energy UART shim serial driver for Silabs Gecko Devices.

Signed-off-by: Diego Sueiro <diego.sueiro@gmail.com>
2018-10-31 09:00:38 -05:00
Jakub Rzeszutko a794e3981e drivers: serial: nrfx: fix spelling mistake in an error message
Preprocesor error message was changed from UARTE0 to UARTE1
for instance 1 of UARTE.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-10-19 12:03:40 +02:00
Diego Sueiro 0c7a28c4cc drivers: serial: Rework Silabs Gecko UART Driver
Introduces the location property and adds the ability to use values
generated by the device tree configuration.

Signed-off-by: Diego Sueiro <diego.sueiro@gmail.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-10-16 15:59:37 -05:00
Diego Sueiro eb20984143 drivers: Add more uart instances for Silabs Devices
Add more uart/usart instances for Silabs Gecko Devices and remove
the *_GPIO_LOC configs.

Signed-off-by: Diego Sueiro <diego.sueiro@gmail.com>
2018-10-16 15:59:37 -05:00
qianfan Zhao 7f92deb641 drivers: usart_sam: fix usart2 device config informations
1. fix typo: PORT_3_PERIPHERAL_ID -> PORT_2_PERIPHERAL_ID
2. add missing irq_config_func

Signed-off-by: qianfan Zhao <qianfanguijin@163.com>
2018-10-12 06:07:21 -05:00
Marcio Montenegro 53a86f0a33 drivers: serial: Adapt gecko uart driver for Silabs EFM32HG
Happy Gecko has 2 USART not UART and also supports more pin locations.

Signed-off-by: Marcio Montenegro <mtuxpe@gmail.com>
Signed-off-by: Christian Taedcke <hacking@taedcke.com>
2018-10-10 12:00:06 -05:00
Ioannis Glaropoulos ce4e00db65 drivers: serial: nrf: remove obsolete PIN Kconfig definitions
This commit removes the Kconfig symbol definitions
that signify the UARTE_1 pins. The symbols are
already removed for UARTE_0.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2018-10-09 14:51:03 -04:00
Kumar Gala 5a24afadb8 drivers: serial: uart_sifive: Get clock frequency from device tree
Move to getting the clock frequency of the uart from the device tree
instead of a define in the board file.  Cleaned up hifive1 board code to
reflect this change in addition to the driver.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-10-05 13:21:49 -05:00
Alberto Escolar Piedras 013f279111 uart: Add driver for posix arch
Added a new UART driver for posix arch boards.
The driver can be configured to either attach to a new
pseudo-terminal, or to connect to the invoking shell
stdin-out.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-09-27 17:24:34 +02:00
Maureen Helm 00d60055fb drivers: serial: Add instances to mcux lpuart shim driver
Adds instances 2 and 3 to the mcux lpuart shim driver.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-09-27 05:55:55 +05:30
Nazar Chornenkyy edd6c7df41 drivers: serial: Add Cypress PSoC6 UART driver
Added basic PSoC6 UART driver and added two UART nodes in the PSoC6
device tree to have output from CM0+ and CM4 cores.

Signed-off-by: Nazar Chornenkyy <nazar.chornenkyy@cypress.com>
Signed-off-by: Oleg Kapshii <oleg.kapshii@cypress.com>
2018-09-21 18:50:59 -04:00
Flavio Ceolin 67ca176754 headers: Fix headers across the project
Any word started with underscore followed by and uppercase letter or a
second underscore is a reserved word according with C99.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-09-17 15:49:26 -04:00
Paweł Zadrożniak 7c2197f2d8 boards: nrf: uart: Moved UART pin configuration to DTS (nRF boards)
UART pins (TX, RX, RTS, CTS) are now configured in DTS files.
RTS and CTS definitions are optional. If flow control is enabled
and RTS/CTS pins are not defined, then compiler will issue
an error message.

Signed-off-by: Paweł Zadrożniak <pawel.zadrozniak@nordicsemi.no>
2018-09-11 23:29:50 -05:00
Flavio Ceolin 0866d18d03 irq: Fix irq_lock api usage
irq_lock returns an unsigned int, though, several places was using
signed int. This commit fix this behaviour.

In order to avoid this error happens again, a coccinelle script was
added and can be used to check violations.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-08-16 19:47:41 -07:00