Commit graph

696 commits

Author SHA1 Message Date
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
Nathaniel Graff 218d7a0aa9 riscv: Rename the FE310 SoC to Sifive Freedom
FE310 is the name of one SoC out of a range of products in the SiFive
Freedom line. The FE310 SoC port in Zephyr is compatible with all of
these products, so rename the SoC to SiFive Freedom

Signed-off-by: Nathaniel Graff <nathaniel.graff@sifive.com>
2018-08-16 06:23:01 -07:00
Ulf Magnusson 8cf8db3a73 Kconfig: Use a short, consistent style for prompts
Consistently use

    config FOO
            bool/int/hex/string "Prompt text"

instead of

    config FOO
            bool/int/hex/string
            prompt "Prompt text"

(...and a bunch of other variations that e.g. swapped the order of the
type and the 'prompt', or put other properties between them).

The shorthand is fully equivalent to using 'prompt'. It saves lines and
avoids tricking people into thinking there is some semantic difference.

Most of the grunt work was done by a modified version of
https://unix.stackexchange.com/questions/26284/
how-can-i-use-sed-to-replace-a-multi-line-string/26290#26290, but some
of the rarer variations had to be converted manually.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-08-15 04:10:10 -07:00
Nathaniel Graff 45d5d5db48 boards: riscv: Convert HiFive1 to DTS
Adds DTS bindings for sifive,pwm0, sifive,uart0, sifive,spi0, and
riscv,plic0.

Signed-off-by: Nathaniel Graff <nathaniel.graff@sifive.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
2018-08-13 18:35:38 -05:00
Paul Sokolovsky 2681199c29 drivers: serial: uart_sam: Fix typo in param name.
The refactor to add callback user data param in 57286afd, contained
typo just for this driver. It sneaked past the PR CI due to the fact
that issue affected just a couple of platforms, and we select just
a few of them randomly for PR CI (vs full CI).

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-08-08 07:54:46 -05:00
Paul Sokolovsky 57286afdd6 drivers: uart: Allow to pass arbitrary user data to irq callback
Zephyr UART drivers offer very low-level functionality. Oftentimes,
it would be useful to provide higher-level wrappers around UART
device which would offer additional functionality. However, UART
driver irq callback routine receives just a pointer to (low-level)
UART device, and it's not possible to get to a wrapper structure
(without introducing expensive external mapping structures). This
is an indirect reason why the current UARt wrappers - uart_pipe,
console - are instantiated statically just for one underlying UART
device and cannot be reused for multiple devices.

Solve this by allowing to pass an arbitrary user data to irq
callback, set by new uart_irq_callback_user_data_set() function.
Existing uart_irq_callback_set() keeps setting a callback which
will receive pointer to the device.

While public API maintains compatibility, drivers themselves need
to be updated to support arbitrary user data storage/passing (as
legacy uart_irq_callback_set() functionality is now implemented in
terms of it).

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-08-02 19:20:12 +02:00
Ulf Magnusson d1684a83a4 Kconfig: Clean up some symbol definitions
- Remove redundant 'n' defaults. 'n' is the default value for bool
  symbols.

  This makes the auto-generated documentation clearer as well: You get
  "implicitly defaults to n" instead of
  "- n if <propagated dependencies>".

- Shorten

      <type>
      prompt "foo"

  to

      <type> "foo"

  This works for all types, not just bool.

- Various formatting nits.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-08-01 12:47:17 -04:00
Andrzej Głąbek 18226b1100 drivers: serial: Add power management to nRF UART driver
This patch changes the way the transmitter is handled in the UART
driver, so that it is activated only when there is something to send.
The current UART API does not allow to disable RX completely, since
the poll_in function description implies that UART must continuously
listen. To provide a way of disabling the entire UART and lowering the
current consumption, this patch adds the power management to the UART
driver. When instructed to enter any of the power saving states,
the driver will disable the UART, and it will enable the UART back
when it is switched again to the active state.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2018-07-26 12:11:17 -04:00
Daniel Leung f9cd4995ff drivers/serial: ns16550: extend to support 4 ports
This extends the NS16550 driver to support 4 ports.
Also, this adds the necessary bits to enable PCI enumeration
on port 2.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2018-07-20 14:11:33 -04:00
Daniel Leung 7fd3eb60d9 drivers: uart_ns16550: restore config UART_NS16550_PORT_1_PCI
The CONFIG_UART_NS16550_PORT_1_PCI was accidentally removed in
commit 26b474c987. So adds it back.
This allows PCI driver to probe the resources for port 1.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2018-07-16 22:24:48 -04:00
Diego Sueiro ecc891b296 drivers: Fix asserts in i.MX UART Driver
After running some tests which enable assert macro I found some issues
with the i.MX UART configuration.

This patch configures the Tx Fifo Watermark and Modem Mode accordingly.

Signed-off-by: Diego Sueiro <diego.sueiro@gmail.com>
2018-07-16 11:04:18 -05:00
Jakub Rzeszutko f0de6e06f8 drivers: serial: nrf: Serial driver modification to use DT
1. dts.fixup files updated with peripheral address and IRQ NUMBER.
2. Peripheral address is taken from DT.
3. IRQ number is taken from DT.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-07-13 11:08:03 +02:00
Jakub Rzeszutko f733da8ded drivers: serial: nrf: Adopting define for UART driver.
Change define used to select interrupt driven functions
from CONFIG_UART_INTERRUPT_DRIVEN to CONFIG_UART_0_INTERRUPT_DRIVEN.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-07-11 10:03:03 +02:00
Jakub Rzeszutko 7449657e72 drivers: serial: nrf: Adding UARTE driver for the nRFx family
1. Added support for two instances of UARTE.

2. Kconfig.nrfx is capable to configure UART and UARTE driver.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-07-11 10:03:03 +02:00
Wayne Ren 8a528a797f drivers: serial: add virtual uart driver for nsim
In nsim, 'nsim_mem-dev=uart0,base=0xf0000000,irq=24'
is used to enable a virtual uart.

This uart is only used to output now, so only poll output
is implemented.

If required, input and interrupt driven are possible.

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2018-07-10 19:05:13 -04:00
Christian Taedcke e9e8bce91b drivers: serial: Adapt gecko uart driver for Silabs EFR32
The gecko usart driver can now also handle the usart peripheral.

Signed-off-by: Christian Taedcke <hacking@taedcke.com>
2018-07-10 12:53:50 -05:00
Jakub Rzeszutko c8a2131743 drivers: serial: nrf: Adding missing baud rates to UART driver
Add missing baudrates supported by Nordic HAL:
 - NRF_UART_BAUDRATE_31250
 - NRF_UART_BAUDRATE_56000

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-07-10 13:51:34 +02:00
Jakub Rzeszutko 101d493622 drivers: serial: nrf: Use nrfx GPIO HAL to properly handle pins from P1
The dependency on the GPIO driver was a bit artificial, since the UART
driver used the GPIO API functions only to configure the pins at its
initialization. This configuration will be done by using nrfx GPIO HAL
functions directly, just like in case when a shim is using
an nrfx driver underneath.

HAL functions can be fed with the absolute pin numbers, that are
currently used for Nordic SoCs in Kconfig and DT, and for the GPIO
driver an additional translation would be required, to extract
the port and its relative pin number.

UART driver has to be initialized at PRE_KERNEL_1 (because of the
console using it) and currently the GPIO driver is initialized
at POST_KERNEL stage, so calling its API function form the UART
initialization routine was incorrect.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-07-10 13:51:34 +02:00
qianfan Zhao bdeece01b8 driver: uart_stm32: add support for stm32f2 series
clear RXNE flag in fifo_read, remove TEACK and REACK
check when uart_stm32_init because stm32f2 doesn't
has those flags.

Signed-off-by: qianfan Zhao <qianfanguijin@163.com>
2018-07-05 11:26:07 -05:00
Ulf Magnusson 86c46864ee drivers: ethernet: Kconfig: Remove redundant 'default n' 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, and is
inconsistent.

This will make the auto-generated Kconfig documentation have "No
defaults. Implicitly defaults to n." as well, which is clearer than
'default n if ...'

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-07-03 17:11:31 -04:00
Jakub Rzeszutko 197740bdfe drivers: uart: nrf: fixing interrupt driven API
1. API function: uart_nrfx_irq_tx_enable is expected to enable and
trigger TXDRDY interrupt. Due to HW limiation before first byte has
been sent TXDRDY interrupt will not be triggered so it must be forced
by the software.

2. Common function: uart_nrfx_irq_tx_ready_complete is used for two
API entries: irq_tx_ready, irq_tx_complete because Nordic hardware does
not distinguish between them. This function returns 1 when driver is
ready to accept data and 0 otherwise.

3. Removed Hungarian prefixes.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-07-02 10:56:57 +02:00
Olivier Martin 0ba41f5b46 drivers: serial: Fix syntax error
`uart_handler.c` does not build when `CONFIG_UART_LINE_CTRL`
is defined.

Signed-off-by: Olivier Martin <olivier.martin@proglove.de>
2018-06-29 10:18:48 +02:00
Jakub Rzeszutko daef3cc5be drivers: uart: nrf: fixing hardware flow control
Commit: 8a255eaf39d3e1a170297fc59c4674c080f99db8
broke flow control initialization.
This PR adds missing:
 - GPIO initialization for RTS and CTS.
 - RTS and CTS pins assignment for flow control.
 - Function for setting default hight state for TXD and RTS pins.
In addition obsolete cast to void has been removed.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-06-25 14:39:25 +02:00
Karol Gugala 1765d75ff4 riscv32: riscv-privilege: Microsemi Mi-V support
This commit adds support for Microsemi Mi-V RISC-V softcore CPU
running on the M2GL025 IGLOO2 FPGA development board.

signed-off-by: Karol Gugala <kgugala@antmicro.com>
2018-06-20 11:57:07 -04:00
Jakub Rzeszutko fab8246bc5 drivers: serial: simplify Kconfig.nrfx by using HAS_HW_NRF_UART0
Condition:
depends on ((SOC_SERIES_NRF52X || SOC_SERIES_NRF51X) && (!SOC_NRF52810))
for displaing configuration for UART0 peripheral has been replaced with:
depends on HAS_HW_NRF_UART0.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-06-19 20:02:51 +02:00
Erwan Gouriou 13a96574cd drivers/serial: stm32: Put LPUART code under LPUART Kconfig symbol
In order to ease integration of new series, remove reference to
series in code activation. Use LPUART support Kconfig symbol instead.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-06-18 15:21:54 -04:00
Erwan Gouriou 80b8c501c9 drivers/serial: stm32: simplify check of TEACK/REACK flags
Remove reference to SoC series in activation of TEACK/REACK flags
checks. Use flags definitions instead which is defined, if supported,
in STM32Cube packages.
Decouple the checks since REACK is not supported in some series.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-06-18 15:21:54 -04:00
Joakim Andersson fc4fc655d3 drivers: serial: Revert change to init level for nrfx uart driver.
The nrfx uart driver will get stuck in uart_poll_out function since
the uart_console driver has been initialized at PRE_KERNEL_1 level
and is making calls to the uart driver before the uart driver has been
initialized.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2018-06-18 12:08:47 -05:00
Ulf Magnusson 88de5bd84b drivers: serial: Remove SOC_NRF52810 Kconfig reference
This symbol will be added by
https://github.com/zephyrproject-rtos/zephyr/pull/7915.

Having it in there doesn't hurt that much by itself (undefined symbols
default to 'n'), but I'm about to turn references to undefined Kconfig
symbols turn into an error.

Remove the reference.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-06-18 11:25:35 +02:00
Jakub Rzeszutko 3f99eefe5a drivers: uart: Rename nrf5 namings to nrfx
UART driver renamed to keep the same convention as SPI and TWI drivers.
All substrings: "UART_NRF5" in defines renamed to  "UART_NRFX_UART".

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-06-12 13:21:18 +02:00
Jakub Rzeszutko e7252fbbfe drivers: uart: Refactor nrf uart shim
Replace all register defines and calls with Nordic nrfx HAL.
Simplification of uart shim - assumed only one uart instance.
Added parity bit to configuration options.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-06-12 13:21:18 +02:00
Adithya Baglody 963a0bee8d drivers: serial: Remove usage of zephyr_library_ifdef
Phasing out the usage of this cmake macro from the drivers/serial
folder.

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
2018-05-28 13:23:13 -04:00
Andrzej Głąbek 373a02126e drivers: serial: nrf: Fix interrupts enabling/disabling
This patch corrects the way the INTENSET and INTENCLR registers are
accessed. When these registers are written with a bitmask, specified
bits are set or cleared in the INTEN (interrupt enabling) register,
so there is no need to read the previous state of these registers
(when they are read, the current state of INTEN is returned).
For INTENSET this patch eliminates only one unnecessary read, but for
INTENCLR the change is crucial because in the previous version any
write to the register disabled all the enabled interrupts.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2018-05-28 14:27:51 +02:00
Ilya Tagunov 1e6d827a53 drivers: serial: stm32: add LPUART support for L0/L4 series
LPUART (Low-power UART) peripheral is just like ordinary U(S)ART
which lives in a separate clock/power domain.
Therefore already existing code could be reused as is
almost entirely.

Signed-off-by: Ilya Tagunov <tagunil@gmail.com>
2018-05-25 11:54:42 -05:00
Ilya Tagunov 967c31bc07 drivers: serial: stm32: enable LBD only for UARTs with LIN support
LBD interrupt manupulation makes sense for UART with LIN support only.
Otherwise this bit should not be touched.

Signed-off-by: Ilya Tagunov <tagunil@gmail.com>
2018-05-25 11:54:42 -05:00
Ilya Tagunov fd26514a4d drivers: serial: stm32: rework macros and fixups
STM32Lx LPUART peripherals do not fit well into existing U(S)ART
port numbering scheme, so there will be two separate namespaces
in Kconfig: one for U(S)ARTs and one for LPUARTs.

Signed-off-by: Ilya Tagunov <tagunil@gmail.com>
2018-05-25 11:54:42 -05:00
Ilya Tagunov 6632ffa60f drivers: serial: stm32: remove HAL driver legacy
Remove UART_HandleTypeDef instance, which is used
only to store baudrate value.

Signed-off-by: Ilya Tagunov <tagunil@gmail.com>
2018-05-25 11:54:42 -05:00
Kumar Gala 23bf9426ad drivers: serial: uart_fe310: Match Kconfig defines in comment
The trailing #endif comments used CONFIG_FE310_UART_{0,1} and they
should be CONFIG_UART_FE310_PORT_{0,1}.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-05-25 08:04:16 -05:00
Ulf Magnusson 45221a9706 serial: nsim: Fix impossible-to-enable CONFIG_UART_NSIM
CONFIG_UART_NSIM depends on CONFIG_NSIM, which was removed in commit
9bc69a46fa ("boards: Update arc em_starterkit support from 2.2 to
2.3"). Remove the dependency, and also remove the CONFIG_NSIM=y setting
from the test_nsim test (which should now work).

Also change the condition for EXTERN()ing _VectorTable in
include/arch/arc/v2/linker.ld to check CONFIG_UART_NSIM instead of
CONFIG_NSIM. I'm guessing the EXTERN() is there to make the symbol
visible to nSIM, though I don't know anything about it.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-05-24 13:09:28 -04:00
Savinay Dharmappa 6701d44967 dts: xtensa: Fix build error due to dts changes for ns16550 driver.
patch add clock frequency and interrupt property to uart
node in intel_s1000.dtsi. Include soc.h after types.h to
prevent build error.

Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>
2018-05-22 08:51:59 -04:00
Tomasz Bursztyka 00bbbae41d drivers/serial: Add port 2 instance in ns16550 driver
Looks lik ARC arch snps_esmk can provide a 3rd port of this controller,
so let's add the necessary bits and pieces to get it instanciated if one
enable this port in DTS.

PCI settings are not introduced for that port as there is no known
arch/board exposing a 3rd port on PCI bus.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-05-18 20:18:50 +03:00
Tomasz Bursztyka 61ef30d10e drivers/uart: Use dts to set uart options for ns16550 driver
Fix the ns16550 uart driver and relevant SoCs accordingly.
All generic settings are now DTS based.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-05-18 20:18:50 +03:00
Tomasz Bursztyka 17c6456678 drivers/uart: Use dts to set uart priorities for QMSI driver
Fix the qmsi uart driver and relevant SoCs accordingly.
Also: using config for irq everwhere relevantly and not an hardcoded
value in the driver.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-05-18 20:18:50 +03:00
Carles Cufi c4a62e0427 drivers: serial: nrf: Fix is_pending handling
In order to check whether an interrupt is pending for the driver user,
the driver itself needs to verify what interrupt paths are enabled (RX
and or TX) so that as not to return true misleadingly.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-05-18 13:30:49 +02:00
Andrew Boie 8345e5ebf0 syscalls: remove policy from handler checks
The various macros to do checks in system call handlers all
implictly would generate a kernel oops if a check failed.
This is undesirable for a few reasons:

* System call handlers that acquire resources in the handler
  have no good recourse for cleanup if a check fails.
* In some cases we may want to propagate a return value back
  to the caller instead of just killing the calling thread,
  even though the base API doesn't do these checks.

These macros now all return a value, if nonzero is returned
the check failed. K_OOPS() now wraps these calls to generate
a kernel oops.

At the moment, the policy for all APIs has not changed. They
still all oops upon a failed check/

The macros now use the Z_ notation for private APIs.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-05-17 23:34:03 +03:00
Thiago Silveira 05c45e359a drivers: serial: Fix race condition in nRF5 UART TX
Fix a somewhat rare race condition when the thread gets
preempted in the middle of sending a byte through UART.

If the other thread also sends another byte through UART
and "consumes" the EVENTS_TXDRDY value, the first thread
will get stuck in the while loop forever.

By moving the reset to the function start, we guarantee that
the baseline state of EVENTS_TXRDY is 1. Therefore, the first
thread will continue normally when it executes again.

Signed-off-by: Thiago Silveira <thiago@exati.com.br>
2018-05-16 18:10:03 +02:00
Adithya Baglody b0db28b512 drivers: Cmake: Add __ZEPHYR_SUPERVISOR__ macro for driver files.
Normally a syscall would check the current privilege level and then
decide to go to _impl_<syscall> directly or go through a
_handler_<syscall>.
__ZEPHYR_SUPERVISOR__ is a compiler optimization flag which will
make all the system calls from the driver files directly link
to the _impl_<syscall>. Thereby reducing the overhead of checking the
privileges.

In the previous implementation all the source files would be compiled
by zephyr_source() rule. This means that zephyr_* is a catchall CMake
library for source files that can be built purely with the include
paths, defines, and other compiler flags that all zephyr source
files uses. This states that adding one extra compiler flag for only
one complete directory would fail.
This limitation can be overcome by using zephyr_libray* APIs. This
creates a library for the required directories and it also supports
directory level properties.
Hence we use zephyr_library* to create a new library with
macro _ZEPHYR_SUPERVISOR_ for the optimization.

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
2018-05-15 17:48:18 +03:00
Andrew Boie a0c3aadde4 uart_qmsi: fix possible divide-by-zero
The line control value could result in a baud divisor of zero.
Check this condition and return -EINVAL if that is the case.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-05-07 22:25:48 -04:00
Leandro Pereira c200367b68 drivers: Perform a runtime check if a driver is capable of an operation
Driver APIs might not implement all operations, making it possible for
a user thread to get the kernel to execute a function at 0x00000000.

Perform runtime checks in all the driver handlers, checking if they're
capable of performing the requested operation.

Fixes #6907.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2018-04-26 02:57:12 +05:30
Maureen Helm 57e80e5345 ext: mcux: Reorganize imported drivers into soc family subfolders
We have been combining imported mcux drivers into a flattened directory
structure to maximize driver reuse, but the introduction of additional
nxp soc families (lpc and imx) to zephyr has introduced driver naming
conflicts. This caused us to rename and modify imported files, such as
fsl_gpio.c/h, to make them unique across all three nxp soc families.
This makes updating the the mcux drivers complicated, especially for the
lpc family.

Reoganize the mcux drivers into soc family subfolders, so we can just
copy all the drivers from an mcux distribution (which is done on an
soc-basis) into the appropriate soc family folder. Undo all of the
naming changes that occurred when lpc and imx drivers were originally
imported. Undo the accidental squashing of the kinetis watchdog and dcdc
drivers that occurred when the imx drivers were introduced.

The drawback to this approach is that we have duplicate files when the
same hw ip modules exist in multiple soc families, however there are
only few cases where this occurs, such as fsl_lpuart and fsl_trng.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-04-24 07:55:48 -05:00
Diego Sueiro 346165b2e8 serial: Add imx uart driver shim
Adds a shim layer around the imx uart driver to adapt it to the Zephyr
serial interface.

Modem mode was introduce to control it as DCE and DTE and can be
configured in the device tree:
    modem-mode:
        type: int
        category: required
        description: Set the UART Port to modem mode 0 (dce) 1 (dte)
        generation: define

For now only the UART 2 was tested.

Signed-off-by: Diego Sueiro <diego.sueiro@gmail.com>
2018-04-11 08:27:05 +02:00
Peter Gielda 1c60ba1459 drivers: serial: Add missing FE310 UART driver reference to CMakeLists
This commit adds a missing reference to uart_fe310.c to CMakeLists.txt.

Signed-off-by: Peter Gielda <pgielda@antmicro.com>
2018-03-27 19:52:28 -04:00
Kumar Gala 8a824356e0 arch: arc: em{7,9,11}d: Add initial DTS UART support
Add support for getting some basic params from the DTS for the UART.
The ns16550 driver still needs to be updated to get IRQ and address
info from DTS.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-03-23 10:13:53 +01:00
Ilya Tagunov 08418a210d drivers: uart: stm32: improve STM32L0 support
STM32L0 UARTs are named as STM32F0 ones, but their
clocking is like all other families.

Signed-off-by: Ilya Tagunov <tagunil@gmail.com>
2018-03-21 15:40:55 -04:00
Ilya Tagunov 84cffc7f29 drivers: uart: stm32: make comments and options less specific
Replace specific STM32F1 references with generic STM32 ones.
Use generic names like U(S)ARTx for instances which have different
naming across STM32 families.

Signed-off-by: Ilya Tagunov <tagunil@gmail.com>
2018-03-21 15:40:55 -04:00
Carles Cufi 6656969598 arch: arm: nordic_nrf: Restore copyright years
A previous commit had mistakenly overwritten the copyright years instead
of extending the range. Fix this mistake so that the proper range is
recorded.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-03-20 13:25:44 +01:00
Carles Cufi b2016da563 arch: arm: nrf: Rename common header to apply to all nRFx ICs
The existing nrf5_common.h now applies to other Nordic ICs that are not
part of the "5" family. Instead rename this to nrf_common.h to cover the
upcoming ICs that belong to other families.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-03-20 11:57:14 +01:00
Carles Cufi f49150cab6 arch: arm: nrf: Rename nrf5 SoC Family to nrf
Upcoming Nordic ICs that share many of the peripherals and architecture
with the currently supported nRF5x ones are no longer part of the nRF5
family. In order to accomodate that, rename the SoC family from nrf5 to
nrf, so that it can contain all of the members of the wider Nordic
family.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-03-20 11:57:14 +01:00
Justin Watson aa7c91d0c2 driver: usart: Added support for interrupt driver USART on SAM E70.
Added interrupt support in the USART SAM serial driver.

Signed-off-by: Justin Watson <jwatson5@gmail.com>
2018-03-10 11:42:25 -06:00
Sahaj Sarup 069fce7289 boards: uart: Add UART6 for 96b_carbon
Enabled UART 6 on pin PC6 and PC7 for 96b_carbon

Signed-off-by: Sahaj Sarup <sahaj.sarup@linaro.org>
2018-03-08 13:58:28 -06:00
Justin Watson c1ce290d45 serial: sam: add support for interrupt driven serial
Implements interrupt driven UART for the serial driver.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Signed-off-by: Justin Watson <jwatson5@gmail.com>
2018-02-21 11:26:20 -06:00
Sean Nyekjaer d9b105fff5 serial: sam0: add samd20 support
There are some minor differences between the UART om SAMD20 and SAMD21
that we need to take into account:

SYNCBUSY bit for the samd20 is located in the STATUS reg.

The samd20 does not have a SAMPR bit like the samd21.

Signed-off-by: Sean Nyekjaer <sean@nyekjaer.dk>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-02-21 08:07:09 -06:00
Giuliano Franchetto 8e534f7bf4 uart: fixing pin range being too tight for the nrf52840
The nrf52840 has 2 gpio ports, and 48 GPIO. We need to
adapt the range to allow the gpio on port 1 to be used
by this driver

Signed-off-by: Giuliano Franchetto <giuliano.franchetto@intellinium.com>
2018-02-17 09:06:20 -05:00
Anas Nashif 8949233390 kconfig: fix more help spacing issues
Fix Kconfig help sections and add spacing to be consistent across all
Kconfig file. In a previous run we missed a few.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-02-15 23:20:55 -05:00
Michael Hope 247782a7b3 sam0: move the UART and SPI configuration into pinmux.
Also pull out the SERCOM pads configuration to defines.  Note that the
SAM0 has a two level configuration - a signal (like TX) is mapped to a
pad, and then a pad is mapped to a function on a pin.

Signed-off-by: Michael Hope <mlhx@google.com>
2018-02-08 12:09:46 -06:00
Pushpal Sidhu 8e459172e8 drivers: serial: uart_stm32: fix call to LL_USART_SetBaudRate
Some mcu's have USART_PRESC_PRESCALER defined in the function call. Add
a prescaler of div1 to it.

Signed-off-by: Pushpal Sidhu <psidhu.devel@gmail.com>
2018-02-02 08:22:27 -06:00
Shiksha Patel 53cbfd3fd3 lpc: Add usart shim driver for lpcxpresso54114
Add usart-yaml in dts.

Build fsl_lpc_usart and fsl_lpc_flexcomm in
ext/hal/nxp/mcux/drivers/Makefile.

Only polling mode is implemented in usart now. Interrupt can be added in
future.

Signed-off-by: Shiksha Patel <shiksha.patel@nxp.com>
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-01-23 09:18:32 -06:00
Jason Wang 6de7240d55 cmake: Fix console could not work on board frdm_kl25z
The CMakeLists lost the config for uart_mcux_lpsci.c, which is the
console driver for board frdm_kl25z. So just add "uart_mcux_lpsci.c"
into drivers/serial/CMakeLists.txt to make it work.

Signed-off-by: Jason Wang <jason.yanping.wang@hotmail.com>
2018-01-23 09:03:08 +05:30
Daniel Wagenknecht 1f66015f73 drivers: serial: use the right clock busses for STM32F0 series UARTs
STM32F0 Series uses different clock busses for UARTs than other
STM32FX Series.

fixes #5406

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

Signed-off-by: Daniel Wagenknecht <wagenknecht@clage.de>
2018-01-11 19:00:19 -05:00
Michael Hope 17fcbc3f9b serial: sam0: add support for interrupt based transmit.
Signed-off-by: Michael Hope <mlhx@google.com>
2018-01-10 21:49:18 -05:00
Michael Hope b85b676ba9 serial: add a serial driver for the SAM0 family.
Signed-off-by: Michael Hope <mlhx@google.com>
2018-01-04 13:18:25 -05:00
Savinay Dharmappa 21c2cf78f2 driver: serial: Get interrupt number from dts
Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>
2017-12-15 11:22:55 -06:00
Anas Nashif 429c2a4d9d kconfig: fix help syntax and add spaces
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-13 17:43:28 -06:00
Erwan Gouriou 222bc6096b drivers: serial: stm32: report only unmasked irq
Fix #5298
irq_is_pending function returned TXE/RXNE flag status
even if IRQ was masked, which led to enless loop
in uart_pipe when no TX was performed. Fix by reporting status only when
IRQ is unmasked.

Signed-Off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-12-06 09:42:51 -06:00
Ioannis Glaropoulos ffbc28a465 drivers: serial: Fix nRF5x UART IRQ Mask values
In uart_nrf5.c the IRQ masks for the TX READY and ERROR events are
incorrect. This pull request fixes the mask values so they are
according to the nRF51/nRF52832/nRF52840 product specification.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2017-12-04 12:26:14 +01:00
Ramakrishna Pallala 37ee913908 drivers: serial: Add Altera shim driver for JTAG UART soft IP
Delete the native UART JTAG driver as we will be reusing
the Altera's HAL driver.

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

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2017-11-17 07:46:40 -05:00
Maureen Helm 175e4f4953 serial: Add another instance to the mcux lpuart driver
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-11-15 09:09:58 -06:00
Sebastian Bøe f2a3977261 cmake: Added missing zephyr_sources() calls for esp32 drivers
Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-14 10:47:15 -05:00
Piotr Mienkowski bf74e5409b drivers: serial: fix CMakeLists for Atmel SoCs
- added missing usart_sam.c entry
- removed outdated uart_atmel_sam3.c entry

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2017-11-14 08:10:34 -05:00
Gil Pitney dec93834d9 cmake: Fix drivers/serial/CMakeLists.txt to build uart_cc32xx.c
Previously, a typo prevented UART from working for any program
built for BOARD=cc3220sf_launchxl.

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

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

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

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

Install CMake 3.8.2+

Port any out-of-tree Makefiles to CMake.

Learn the absolute minimum about the new command line interface:

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

$ cd build
$ make

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

Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
Bobby Noelte 2ce56e0100 drivers: serial: provide support for stm32f091
Support the USARTs of the ST STM32F091xx SoC.

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
2017-11-06 11:39:16 -06:00
Andrew Boie b93f59e15c drivers: uart: add system call handlers
Certain interrupt-driven APIs were excluded as they are intended
only to be called from ISRs, or involve registering a callback
which runs in interrupt context.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-30 13:20:19 -07:00
Kumar Gala ace47887bd serial: atmel_sam3: remove driver as it was deprecated
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-10-26 06:10:21 +02:00
Maciej Debski eaff37e21f drivers: serial: provide support for stm32f0.
Fixes #3923

Signed-off-by: Maciej Debski <maciej.debski@rndity.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2017-10-23 12:31:47 +02:00
Erwan Gouriou da210ba0ba driver: serial: Move STM32 UART driver to LL API
STM32 UART driver was using a mix of LL/HAL APIs.  This commit removes
calls to HAL API and replaces them with LL APIs.  No functional change
have been seen during non regression testing.

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

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

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

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

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-10-20 12:28:11 -05:00
Manivannan Sadhasivam 90d288be29 drivers: serial: Add MSP-EXP432P401R UART
This patch adds support for on board UART_0 on MSP-EXP432P401R-LAUNCHXL.
Driver makes use of driverlib available in ROM by default, thus saving
code space.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
2017-10-19 12:16:11 -05:00
Christian Taedcke 4b586157d6 drivers: serial: Add uart driver for Silabs EXX32 MCUs
Signed-off-by: Christian Taedcke <hacking@taedcke.com>
2017-10-10 11:56:47 -05:00
Leandro Pereira 5f22dab17a esp32: Prefix ROM routines with esp32_rom_
Also provide their prototypes in `soc.h`.  This should help
readability, since some ROM functions, with their names as provided by
Espressif, have sometimes the same prefix as Zephyr APIs.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-10-09 20:53:22 -04:00
Savinay Dharmappa 58d54c0f2d dts: x86: qemu_x86: Add device support for uart ns16550
Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>
2017-10-06 08:35:42 -04:00
Maureen Helm fe4c3aacba mcux: nxp_kinetis: Move HAS_LPSCI config to ext
SoCs outside the Kinetis family can have the LPSCI module, so move the
HAS_LPSCI config from arch/arm/soc/nxp_kinetis to ext/hal/nxp/mcux

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-09-25 12:31:59 -05:00
Maureen Helm bbafc833db mcux: nxp_kinetis: Move HAS_LPUART config to ext
SoCs outside the Kinetis family can have the LPUART module, so move the
HAS_LPUART config from arch/arm/soc/nxp_kinetis to ext/hal/nxp/mcux

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-09-25 12:31:59 -05:00
Timo Teräs 5829965278 serial/uart_ns16500: poll THRE to determine when data can be written
TEMT is Transmitter Empty bit which is set only when the full FIFO
is empty. It makes sense to poll for THRE (Transmitter Holding
Register Empty) which is set when UART can buffer new character
for transmission (there is room in FIFO). This allows using the
FIFO in full.

Signed-off-by: Timo Teräs <timo.teras@iki.fi>
2017-09-12 11:24:56 -04:00
Timo Teräs 047a229985 serial/uart_ns16550: keep LCR settings when programming DLAB
The LCR register specifies the format of the asynchronous data
communication exchange. Keep the data/stop bit and parity settings
intact during baud rate change.

Signed-off-by: Timo Teräs <timo.teras@iki.fi>
2017-09-12 11:24:56 -04:00
Leandro Pereira 884a385fc6 drivers: serial: esp32: Return transmitted character on success
When transmitting to the UART interface using polled mode, the ESP32
driver would return 0 regardless of the success state.  Return the
character that has been transmitted to comply with the API.

Jira: ZEP-2552
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-08-22 16:38:27 -04:00
Leandro Pereira d52de29fba esp32: Fix redefinition of BIT() macro
Esp-idf defines the BIT macro that is also defined in Zephyr's
misc/util.h.  Fix the issue by including the esp-idf headers first, so
that a check in util.h won't redefine the macro if it's already
defined.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-08-19 07:50:18 -04:00
Gil Pitney 4f67a6c76d cc3200: Remove TI cc3200 SOC and LaunchXL board support
Per ZEP-1958, Phase 2 of adding CC3220sf LaunchXL support,
was to "deprecate the CC3200 launchxl support in Zephyr
(redundant to the CC3220)."

Effectively, the CC3220 SOC replaces the CC3200.

This patch removes the following:
* the imported CC3200 SDK
* CC3200 SOC, board, DTS files.
* adjusts other files where cc3200 was mentioned.

Also, it fixes explicit references to CC3200 in generic
CC32xx driver files.

Jira: ZEP-1958

Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2017-08-15 11:02:48 -05:00
Sebastian Bøe 5eef82db68 kconfig: serial: esp32: Make driver depend on SOC_ESP32
The ESP32 UART driver can only be used on the ESP32 SoC AFAICT. But it
did not have a depend clause so it was polluting the options of other
platforms.

With this patch the ESP32 driver will no longer be exposed to users of
non-ESP32 devices.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2017-08-04 08:22:59 -04:00
Kumar Gala 68732efe00 arm: nxp: mcux lpuart: Get IRQ info from DTS
Move to using the generated IRQ defines from the DTS instead of soc.h.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-07-27 09:27:47 -05:00
Kumar Gala 0ef91e4d07 arm: nxp: mcux uart: Get IRQ info from DTS
Move to using the generated IRQ defines from the DTS instead of soc.h.
This change also fixes a minor bug in that the error irq priority wasn't
getting correctly picked up from device tree.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-07-27 09:27:47 -05:00
Michał Kruszewski fda632adec nrf5: uart: Add support for 300 and 600 baud rates.
Signed-off-by: Michał Kruszewski <michal.kruszewski@nordicsemi.no>
2017-07-20 07:30:04 -05:00
Justin Watson 0c6883f25a arm: dts: Modified Atmel SAM family processor's UART to DTS.
The SAM4S, SAM3X, SAME70 all use the uart_sam.c serial
driver. This patch puts the configuration in DTS and
out of Kconfig. The SAME70 uses the USART as well.
USART DTS support for the SAME70 is also in this patch.

Signed-off-by: Justin Watson <jwatson5@gmail.com>
2017-07-07 10:31:34 -05:00
Kumar Gala ccff19ed21 serial: nsim: Add missing SERIAL_HAS_DRIVER in Kconfig
The nsim driver was missing the select for SERIAL_HAS_DRIVER

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-06-29 07:07:31 -04:00
Kumar Gala 461b5018d3 serial: introduce SERIAL_SUPPORT_INTERRUPT Kconfig option
As not all drivers support interrupts we don't have a means to know if
we can allow UART_INTERRUPT_DRIVEN to be enabled and thus various
Kconfig options that select UART_INTERRUPT_DRIVEN.  Some drivers have a
interrupts, however not all do.  So introduce a Kconfig option to let us
know what the driver actually supports.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-06-29 07:07:31 -04:00
Savinay Dharmappa 0ea423d976 drivers: serial: Add device support for serial driver
patch enables qmsi serial driver to pick baudrate and name
from device tree instead of Kconfig for UART0 and UART1
instance

Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>
2017-06-22 10:23:39 -05:00
Inaky Perez-Gonzalez 271c518ec6 uart_esp32: alter the uart.h include order to avoid warning
The esp-idf package contains on the BSP a definition of the BIT macro
unconditionally #defined when rom/uart.h is #included. When Zephyr's
uart.h (which pulls in include/misc/util.h) that conditionally

This generates a compile warning on the re-definiton of BIT by the
esp-idf package.

Thus include uart.h after esp-idf's rom/uart.h to have BIT not
re-defined thanks to Zephyr's conditional definition.

Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2017-06-21 19:05:19 -04:00
Ivan Grokhotkov d58d5d1265 xtensa: esp32: configure default UART using ROM functions
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-06-21 12:35:49 -04:00
Leandro Pereira 37ea77173c drivers: esp32: Add minimal UART driver based on ROM routines
This is a minimal driver enabling console output during the port
bringup.  While the driver works, only one of the three UART devices
are supported, and there isn't any way to change any parameters or
use interrupts.  This will most likely be superceded by a proper
driver after the port has matured.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-06-21 12:35:49 -04:00
Anas Nashif 397d29db42 linker: move all linker headers to include/linker
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-18 09:24:04 -05:00
Geoffrey Le Gourriérec 4c24b1d857 uart: Use DTS labels for Stellaris driver.
Update driver to use DTS-generated #defines for port names,
and not obsolete Kconfig variables.

Signed-off-by: Geoffrey Le Gourriérec <geoffrey.legourrierec@smile.fr>
2017-06-16 16:18:12 -04:00
Geoffrey Le Gourriérec 6341258ef5 drivers: serial: uart_stellaris: Remove UART_IRQ_FLAGS
We always have UART_IRQ_FLAGS set to 0, so just call IRQ_CONNECT with a
0 argument for the flags, and remove the UART_IRQ_FLAGS.  This is
towards support for using the driver on the TI CC2650.  (we add a
comment about that as well).

Signed-off-by: Geoffrey Le Gourriérec <geoffrey.legourrierec@smile.fr>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-06-16 16:18:12 -04:00
Jens Peter Schroer b676bfafc8 drivers: serial: uart_fe310: fix function definiton name for UART1 IRQ
This commit fixes the compilation error that occurs if both UART
ports on the FE310 SoC are enabled. The error occurs due to the
missing function definition of uart_fe310_irq_cfg_func_1 .

Signed-off-by: Jens Peter Schroer <jens@manetos.com>
2017-06-07 12:17:15 -05:00
Erwan Gouriou 9413c8ba4d stm32: clean up after completion of transition to ll Clock control
Following migration of stm32f1xx series clock control driver to
STM32Cube LL API, cleanup stm32 code base in order to take into
account that this is the only clock driver available for stm32
family.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-06-02 14:11:13 -04:00
Piotr Mienkowski dffc06ddd2 drivers: serial: deprecate usage of atmel_sam3 driver
Atmel SAM3X series has been recently converted to use ASF
and should now use common SAM family drivers. The atmel_sam3
serial driver will be removed in the future.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2017-06-02 14:11:13 -04:00
Piotr Mienkowski ba50782db2 drivers: uart_sam: Configure TX pins for SAME70 only
Limit visibility of configurable TX pins to SAME70 series only.
Previously visibility of configurable SAME70 TX pins extended
to the full SAM family.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2017-05-19 10:06:48 -04:00
Piotr Mienkowski ee66ee6c34 arch: sam3x: Use ASF library
This patch converts Atmel sam3x MCU series to use register
header files from Atmel Software Framework (ASF) library.
By using ASF different Atmel SAM MCU series can use common
device drivers.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2017-05-19 10:06:48 -04:00
Kumar Gala 983e6a56fb arm: atmel: sam3: dts: use label to generate Atmel SAM3 uart name
Now that we can utilize label in the device tree we can convert to
getting the device name for the Atmel SAM3 UART out of the device
tree instead of from Kconfig.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-05-19 10:06:48 -04:00
Kumar Gala 22874ef301 arm: ti: stellaris: dts: use label to generate TI Stellaris uart name
Now that we can utilize label in the device tree we can convert to
getting the device name for the TI Stellaris UART out of the device
tree instead of from Kconfig.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-05-19 10:06:48 -04:00
Kumar Gala f13af29741 arm: ti: cc32xx: dts: use label to generate TI CC32xx uart name
Now that we can utilize label in the device tree we can convert to
getting the device name for the TI CC32xx UART out of the device
tree instead of from Kconfig.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-05-19 10:06:48 -04:00
Kumar Gala d88d4f90a5 arm: cmsdk_apb: dts: use label to generate ARM CMSDK APB uart name
Now that we can utilize label in the device tree we can convert to
getting the device name for the ARM CMSDK APB UART out of the device
tree instead of from Kconfig.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-05-19 10:06:48 -04:00
Kumar Gala a746bcd56d arm: nxp_kinetis: dts: use label to generate NXP Kinetis uart name
Now that we can utilize label in the device tree we can convert to
getting the device name for the NXP Kinetis UART out of the device tree
instead of from Kconfig.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-05-19 10:06:48 -04:00
Kumar Gala 29a6053a0d arm: nrf: dts: use label to generate NRF uart name
Now that we can utilize label in the device tree we can convert to
getting the device name for the NRF UART out of the device tree
instead of from Kconfig.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-05-19 10:06:48 -04:00
Kumar Gala bb2c32428b arm: stm32: dts: use label to generate STM32 uart name
Now that we can utilize label in the device tree we can convert to
getting the device name for the STM32 UART out of the device tree
instead of from Kconfig.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-05-19 10:06:48 -04:00
Kumar Gala 748f724d82 serial: dts: remove !HAS_DTS related Kconfig
As we now only support DTS for ARM based SoCs we can remove any
associated !HAS_DTS bits in Kconfig.  The Nordic NRF5 serial driver and
the ARM CMSDK APB serial drivers had Kconfig bits related to !HAS_DTS
builds.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-05-19 10:06:48 -04:00
Florian Vaussard a327de30cf serial: stm32: Add support for U(S)ART4/5/6/7/8/9/10
Add support for U(S)ART 4 to 10 that can be found at least on some
members of the STM32F4 family.

Change-Id: Ie870492511f885005cf023040e498bd4d800e807
Signed-off-by: Florian Vaussard <florian.vaussard@heig-vd.ch>
2017-05-15 13:22:54 -04:00
Florian Vaussard f27a5a3d6a serial: stm32: Use macro to simplify registration
The registration of each serial port differs only by a few details.
These differences can be factorized in order to create a generic
registration macro.

This has several advantages:
- Less code
- Easier to add new ports
- Less work to add support for new STM32 families

Change-Id: I6e62a96ccbbf03c9d51bc2617db6a851ff0d83c7
Signed-off-by: Florian Vaussard <florian.vaussard@heig-vd.ch>
2017-05-15 13:22:54 -04:00
Paul Sokolovsky 0fdc9b5b12 drivers: serial: Clarify usage of TX/RX IRQ predicates.
uart_irq_tx_empty() function proved to be problematic: its semantics
was not documented properly, and many hardware uses terminology like
"TX register empty" to signify condition of TX register being ready
to accept another character (what in Zephyr is tested with
uart_irq_tx_ready()). To avoid confusion, uart_irq_tx_empty() was
renamed to uart_irq_tx_complete(), propagating to drivers/serial
device methods.

The semantics and usage model of all of uart_irq_rx_ready(),
uart_irq_tx_ready(), uart_irq_tx_complete() is now described in
detail.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-05-13 10:57:31 -04:00
Paul Sokolovsky 2506e2738e stm32: Don't perform any side effects in irq_update().
The purpose of irq_update() is to cache value of UART IRQ status
register for devices which needs such caching. No other driver
performs any other side effects in this call. For STM32, clearing
TC (tx complete) bit was introduced in 8c079e91c9
which is otherwise titled as a conversion to STM32Cube HAL. Thus,
there does not seem to be specific reasons why this code was added.
On the other hand, it leads to behaviorial artifacts when dealing
with interrup-driven UART code (specific issue seen was delaying
of transmitting every other character).

Change-Id: Id20bf214b36eeb6c09e29cc2e6bfca4f7221a1a4
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-05-04 09:48:08 -05:00
Justin Watson 558281b096 arch: sam3x: update Kconfig options after move to SAM SoC family tree
The files for the Arduino Due needed to be updated to use the new
configuration when the SoC moved from the atmel_sam3 directory to
the atmel_sam/sam3x directory.

Jira: ZEP-2067

Signed-off-by: Justin Watson <jwatson5@gmail.com>
2017-05-03 13:51:37 -04:00
Kumar Gala ac0bb050dd arm: dts: ti_lm3s6965: Add device tree support for Stellaris UART
Converted Stellaris UART driver over to utilize device tree generated
defines.  Added a yaml description for the uart, and converted over the
ti_lm3s6965 SoC & qemu_cortex_m3 board port over to utilize it.

Change-Id: Ie20844eb63d2c68eb59ad4160f7f5b5a35e2943b
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-28 15:26:40 -05:00
Kumar Gala 749e02f6ea serial: uart_stellaris: remove export of uart_stellaris_isr
There isn't any reason to export the uart_stellaris_isr function, so
lets make it static and remove the associated header file.

Change-Id: I3a131b584d9d6fb6279a1503512668a71510dd4d
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-28 15:26:40 -05:00
Kumar Gala ed467a695a serial: mcux: Shim driver for LPSCI UART on KL25Z
Adds a shim layer around the mcux lpsci driver to adapt it to the Zephyr
serial interface.

Change-Id: I024f1605e3194f34bb57e8a121900e05b3085a82
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-28 15:26:38 -05:00
Erwan Gouriou 424c33825c driver: uart: clock control code refactoring
Small code refactorisation in order to ease up coming
support of stm32f1 series by stm32 commom clock control
driver

Change-Id: I486cfba137cd048d65f0732e10aa29d877bb03e5
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-04-28 15:26:11 -05:00
Erwan Gouriou 242ed389a3 stm32f4: Clean references to stm32f4 specific clock control
Following activation of stm32 common clock driver for stm32f4 series
remove references to stm32f4 specific driver.

Change-Id: I372a0ea046007bcb34944d6b2b8880077583b1d3
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-04-28 15:26:11 -05:00
Erwan Gouriou 9bd2a42d60 dts: Align uart "baud-rate" property to device tree spec "current-speed"
Devicetree.org specifies that serial devices property used to set
baud rate is "current-speed", while zephyr uses "baud-rate".
Align property name in order to keep zephyr dts files compatible
with device tree specification and could be re-used from/to
Linux for instance.  We also cleanup a few SoCs that set "baud-rate" in
the SoC dts and not the board.

Jira: ZEP-2048

Change-Id: I097e7439ee46fe77c628b56531772950382fafcc
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-28 15:06:40 -05:00
Paul Sokolovsky abf284e9fd Revert "serial: stm32: Give H/W a chance to set the TXE bit on transfer"
Don't busy-wait in uart_stm32_fifo_fill(), this routine is supposed
to be called on IRQ, and the waiting loop was shown to interfere
with interrupt-driven UART handling.

The original problem mentioned in the patch being reverted ("it is
possible to evaluate the TXE bit *before* H/W has had the
opportunity to detect that data is being processed") may still
exist and may require handling in a different way. The most obvious
way is to replace "while" loop with "if", because STM32 doesn't
have multi-level FIFO anyway. But I was dissuaded to include such a
change as part of this patch, so it's left for future analysis.

This reverts commit 49c2858d94.

Change-Id: Ib27b53ba3a29b84c1a2dccff6d33f4118680cc19
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-04-27 15:19:59 +00:00
Kumar Gala ccad5bf3e3 drivers: convert to using newly introduced integer sized types
Convert code to use u{8,16,32,64}_t and s{8,16,32,64}_t instead of C99
integer types.

Jira: ZEP-2051

Change-Id: I08f51e2bfd475f6245771c1bd2df7ffc744c48c4
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-21 10:06:48 -05:00
Kumar Gala 789081673f Introduce new sized integer typedefs
This is a start to move away from the C99 {u}int{8,16,32,64}_t types to
Zephyr defined u{8,16,32,64}_t and s{8,16,32,64}_t.  This allows Zephyr
to define the sized types in a consistent manor across all the
architectures we support and not conflict with what various compilers
and libc might do with regards to the C99 types.

We introduce <zephyr/types.h> as part of this and have it include
<stdint.h> for now until we transition all the code away from the C99
types.

We go with u{8,16,32,64}_t and s{8,16,32,64}_t as there are some
existing variables defined u8 & u16 as well as to be consistent with
Zephyr naming conventions.

Jira: ZEP-2051

Change-Id: I451fed0623b029d65866622e478225dfab2c0ca8
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-20 16:07:08 +00:00
David B. Kinder 896cf7a00a spell: fix doxygen comment typos: /drivers
Fix doxygen comment typos used to generate API docs

Change-Id: I6fd5051c99bdcc731740c92001e525349c254d85
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-04-19 10:45:34 -07:00
Piotr Mienkowski 34c16ad2f7 drivers: Add Atmel SAM serial (UART) driver
Added serial (UART) driver for Atmel SAM MCU family.

Note:
- Error handling is not implemented
- The driver works only in polling mode, interrupt mode is
  not implemented.

Tested on Atmel SMART SAM E70 Xplained board

Origin: Original

Jira: ZEP-1959
Change-Id: I3e770fd1feb2ddf92cf405a9aa17be92eb32e19b
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2017-04-14 05:56:54 -05:00
Kumar Gala 77f65b907f arm: dts: Add DTS support for NRF52832 SoC
Add plumbing to build system and SoC level dtsi for the NRF52832 SoC.
We additionally add the necessary yaml files for the UART on the NRF52
SoCs.

Change-Id: I3b4a821b2993827e33d8e84bdbbc759d1521f8bd
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-14 05:56:54 -05:00
Kumar Gala 621ba596b9 serial: stm32: remove bits related to !HAS_DTS
Now that all STM32 platforms are using device tree we can remove the
handling for !HAS_DTS from the serial driver.

Change-Id: Ifafc283f2509dd9a438f321e0b647720d4f13810
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-14 05:56:53 -05:00
Kumar Gala 27d74d8ad2 serial: mcux: remove bits related to !HAS_DTS
Now that all NXP MCUX platforms are using device tree we can remove the
handling for !HAS_DTS from the serial drivers.

Change-Id: I05185142afa7fae83ce68de954202829868af88f
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-14 05:56:53 -05:00
Gil Pitney 9b12803bf7 cc3200: Resolve DTS fixup.
As part of the transition to Device Tree, a temporary
HAS_DTS configuration variable, and a .fixup file per board
with symbol aliases were added.

This patch removes the cc32xx related fixup file
definitions, except for those used additionally outside
the cc32xx drivers.

Since cc32xx has DTS files, and since HAS_DTS will always be true,
it also removes the 'if !HAS_DTS' blocks from the cc32xx Kconfig
files.

Change-Id: I1c1b9f734795f523342f82ab32f2a38983812c0b
Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-04 17:55:12 -05:00
Gil Pitney ed1ba1e1a5 cc3200: Move pinmux and UART initialization to PRE_KERNEL_1
Previously, cc3200_launchxl board was not able to show the
Zephyr Boot Banner, as that required early initialization
of the UART driver, which was done POST_KERNEL.

This patch moves the pinmux and UART driver initialization
to PRE_KERNEL_1, allowing early printk, and the Boot Banner
to show.

Change-Id: I84a7c20c1d5bdc3de150dc6bb0adebc9a2d9f5cb
Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2017-04-04 17:55:12 -05:00
Jean-Paul Etienne a916cf7e19 serial: added support for the SiFive Freedom E310 UART driver
Change-Id: I7552b316bd328c67eabb1dbf62342cb9b663845a
Signed-off-by: Jean-Paul Etienne <fractalclone@gmail.com>
2017-04-02 15:15:21 +00:00
Lee Jones 9aeb6f895d serial: stm32: Move to more traditional formatting
Providing a new line, then an attribute on the same line as the
following closing bracket is odd.  Move to something more
transitional and in line with regular coding standards.

Change-Id: I08f7cd76ca2f522a8b5b6de2e5baf94e95b5195a
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2017-03-30 12:59:48 +01:00
Lee Jones 49c2858d94 serial: stm32: Give H/W a chance to set the TXE bit on transfer
It is possible to evaluate the TXE bit *before* H/W has had the
opportunity to detect that data is being processed.  Therefore
we should hold off on any evaluation until TXE has initially been
set.

Change-Id: Iff26bfbe3ab419734003bf81a4cb357de83908e7
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2017-03-30 12:59:48 +01:00
Florian Vaussard a57df869b4 serial: stm32: Properly put Kconfig options in their own submenu
Currently the entries for STM32 UART ports are at the same level than
the top menuconfig UART_STM32. As a result they are mixed with other
configs in the "Serial Drivers" menu.

Use if/endif grammar to put these entries under a dedicated STM32
submenu.

Change-Id: If28945204b801578d29f8cce7c2370ca3c2737a1
Signed-off-by: Florian Vaussard <florian.vaussard@heig-vd.ch>
2017-03-27 09:05:57 -05:00
Gustavo Denardin ad235dc24b arm: UART driver modifications for MKL25Z soc support
Since all interrupts come in on the status line,
we only connect it for the KL2X.

Change-Id: Ia9e0d483fe68464a0eeab08c95a043260e5793b0
Signed-off-by: Gustavo Denardin <gustavo.denardin@gmail.com>
2017-03-27 09:05:57 -05:00
Vinayak Chettimada 853fd133c1 drivers: serial: nrf5: Fix system off pin configuration
To secure correct signal levels on the pins by the UART when
the system is in OFF mode, the pins must be configured in
the GPIO peripheral as described in nRF5 Product
Specification.

UART Pin, Direction, Output Value:
RXD, Input, NA
CTS, Input, NA
RTS, Output, 1
TX, Output, 1

This commit sets the RTS line to a initial value of 1.

Change-id: I5147fe58033f42c979b9354798b6fd13d78f7f71
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2017-02-27 21:02:20 +00:00
Erwan Gouriou 726d4dc437 drivers: stm32: clean up after stm23cube based clock control
After activation of cube based driver support on L4 and F3 series,
this commits performs the clean up of F3 and L4 relative code to
native clock control drivers.
Indirectly, it makes pwm driver supported de facto on F3 series

Change-Id: Idac17103a9b5ef6eab540719343cc8f5865f15fa
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-02-10 14:47:41 -06:00
Erwan Gouriou 8c4f2a353f uart: update stm32 uart to support LL clock control driver
After introducing STM32Cube based clock control driver for
stm32 family, update stm32 serial driver to support it.
Once supported across the whole family, a clean up will be done.

Change-Id: I7100bc699e7918c8be71d58091da1860ab734e25
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-02-10 14:47:41 -06:00
Bogdan Davidoaia 5b02ba8319 kw41z: add base DTS support
This patch adds the base DTS support for the KW41Z Freedom board. The
initial set of changes include SRAM, FLASH, IRQ controller and LPUART
support.

Change-Id: Ic68c4959ddad0c5cfe70d5576a0e58372b93ec9d
Signed-off-by: Bogdan Davidoaia <bogdan.davidoaia@linaro.org>
2017-02-10 18:14:05 +00:00
Vincenzo Frascino 0da2a03234 v2m_beetle: uart: Add DTS support to UART driver
This patch adds DTS support to the ARM CMSDK UART driver.  The DTS
currently specifies the IRQ, IRQ PRIO, and base address of the port.

Change-Id: I8e5bc81c013958be4297d563495bf126b53a83a9
Signed-off-by: Andy Gross <andy.gross@linaro.org>
2017-02-10 18:14:04 +00:00
Andy Gross 670aa0cc99 stm32: uart: Add DTS support to STM32 UART driver
This patch adds device tree support to the STM32 UART driver.  The base
address, interrupt, and interrupt priority values can now come from DTS.

Change-Id: I3c383da8b200037601ecb2dc087f99ef103761bb
Signed-off-by: Andy Gross <andy.gross@linaro.org>
2017-02-10 18:14:02 +00:00
Gil Pitney b465fbe312 cc3200: Enable device tree usage for CC3200
This patch ifdef's out information that would be redefined by
information generated from DTS.  This patch also fixes up the serial
drives to work properly with the DTS generated information.

Change-Id: I912ccf35be23c107705a4866e5a68b3b51154ffa
Signed-off-by: Andy Gross <andy.gross@linaro.org>
2017-02-10 18:14:01 +00:00
Andy Gross ddce7dea40 dts: arm: Kinetis: Add base support for Kinetis
This patch adds DTS support and related files for the NXP Kinetis
platform.  The DTS files contain the base definitions for the hardware
nodes on Kinetis platforms.  The YAML files provide the definitions of
the contents of the DTS nodes.

The Kconfig changes were put in place to allow for the conversion of
existing drivers.  Once those drivers are modified, the Kconfig options
that are replaced by the DTS information will be removed.

Change-Id: If110fffa99c0b12471cf2df206da6687277e4756
Signed-off-by: Andy Gross <andy.gross@linaro.org>
2017-02-10 18:13:59 +00:00
Juan Solano ee623d21de drivers: Remove unnecessary CONFIG_SYS_POWER_DEEP_SLEEP
This commit removes unnecessary CONFIG_SYS_POWER_DEEP_SLEEP protection
in shim drivers as QMSI 1.4 has introduced empty context save/restore
functions that can be called in Quark D2000, therefore keeping common
code at the shim driver level for Quark SE and D2000.

Change-Id: Ia2a466327f999668c6511c0193014e9151bff6ae
Signed-off-by: Juan Solano <juanx.solano.menacho@intel.com>
2017-02-10 16:27:32 +00:00
Piotr Mienkowski 9d1c6de608 drivers: Add basic Atmel SAM USART driver
Added basic USART driver for Atmel SAM MCU family. USART is a very
comprehensive module, currently only basic features sufficient to
support printf functionality are implemented by this driver.

Tested on Atmel SMART SAM E70 Xplained board

Origin: Original

Jira: ZEP-978
Change-Id: Ia9710e4069243fb6c30de45953dfc1fe1266b63a
Signed-off-by: Piotr Mienkowski <Piotr.Mienkowski@schmid-telecom.ch>
2017-02-01 21:01:18 +00:00
Maureen Helm e290006144 serial: Introduce new mcux lpuart shim driver
Adds a shim layer around the mcux lpuart driver to adapt it to the Zephyr
serial interface.

NXP has multiple uart hardware blocks that implement different features
and have different register maps. The k64 has a uart block called
'uart', while the kw41 has a uart block called 'lpuart' (low power
uart). The MCUXpresso SDK provides separate drivers for each type of
uart block but with similar software interfaces. As a result, there are
also separate shim drivers in Zephyr. There is a 1:1:1 relationship
between hardware block, mcux driver, and mcux shim driver.

Because we now have two mcux shim drivers for the uart interface, a new
naming convention is created:

	<interface>_mcux_<hw block>

Where <interface> is the name of the Zephyr interface, in this case
'uart'. This convention is not new.

<hw block> is the name of the NXP hardware block, in this case 'lpuart'.
This is the new part, and distinguishes different hardware blocks
for the same interface.

Change-Id: I3a80b9bffa116bbb2b02ee950d4bdd79a19a4edc
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-01-30 11:02:35 -06:00
Maureen Helm 82eaa7cd5b gpio: serial: Fix NXP copyright
The NXP copyright should not have 'Semiconductors, Inc' in it.

Change-Id: I6e290146d49bf22d1d40b7fa764bb53b6b122303
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-01-23 15:15:53 -06:00
Maureen Helm 294fdab7bd serial: k64: Remove the uart_k20 driver
Now that we have a more generic mcux serial driver, remove the uart_k20
driver.

Jira: ZEP-719
Change-Id: I51a3237454140feabbfe18ac2c8ee451e572c7be
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-01-23 15:15:53 -06:00
Maureen Helm 38f812828e serial: Introduce new mcux shim driver
Adds a shim layer around the mcux uart driver to adapt it to the Zephyr
serial interface. Unlike the existing (and confusingly-named) uart_k20
driver, this driver can be used for k64 and other Kinetis SoCs.

Implements polling and interrupt-driven serial interface functions that
are logically equivalent to the uart_k20 driver. Adds an extra instance,
irq_tx_empty(), and err_check() that aren't implemented in the uart_k20
driver.

Jira: ZEP-719
Change-Id: Iab99542e7ec921ef4f361437768113fee01e5fe8
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-01-23 15:15:53 -06:00
Kumar Gala 05f717e71b uart/stm32: add STM32F3X support for uart
Change-Id: I9796c6a2841c972eeab15894a6d7f38ae93606d1
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-23 15:15:53 -06:00
David B. Kinder ac74d8b652 license: Replace Apache boilerplate with SPDX tag
Replace the existing Apache 2.0 boilerplate header with an SPDX tag
throughout the zephyr code tree. This patch was generated via a
script run over the master branch.

Also updated doc/porting/application.rst that had a dependency on
line numbers in a literal include.

Manually updated subsys/logging/sys_log.c that had a malformed
header in the original file.  Also cleanup several cases that already
had a SPDX tag and we either got a duplicate or missed updating.

Jira: ZEP-1457

Change-Id: I6131a1d4ee0e58f5b938300c2d2fc77d2e69572c
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-19 03:50:58 +00:00
Jean-Paul Etienne 7cf3688740 serial: added support for the riscv-qemu UART driver
riscv-qemu UART:
1) comprises only one register that is used to send or
   receive characters in a polling fashion.
2) does not have a FIFO and is not interrupt-driven.

Change-Id: I9408f1776eba4cec4aa203a5da759ec04bcddf1f
Signed-off-by: Jean-Paul Etienne <fractalclone@gmail.com>
2017-01-13 19:56:24 +00:00
Jean-Paul Etienne cfa43f5bda serial: enable 64-bytes FIFO for UART 16750 in uart_ns16550 driver
UART 16750 is basically a UART 16550 with a 64-bytes FIFO.
The 64-bytes FIFO can be enabled via register FCR.

Account for it in the uart_ns16550 driver whenever the
CONFIG_UART_NS16750 variable is set.

Change-Id: I2342b28a41d03c96410bbfbe57e4b5a4e335731d
Signed-off-by: Jean-Paul Etienne <fractalclone@gmail.com>
2017-01-05 16:05:20 +00:00
Flavio Santes 501dd224ad drivers: Add the ARG_UNUSED macro
Add the ARG_UNUSED macro to avoid compiler warnings.

Change-Id: Ia62125b5e93671aa0ab0891c92ae9fa06fadb09b
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-21 12:54:52 +00:00
Flavio Santes 0a1c29cda4 driver: Add ARG_UNUSED to console and uart drivers
This patch adds the ARG_UNUSED macros to some function
arguments to avoid compiler warnings.

Change-Id: I628aea55d98cf8519c046ae5835e95cfa70a973f
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-21 12:54:47 +00:00
Carles Cufi 3655291d5f boards: arm: Refactor the GPIO and UART dependencies
To make way for the upcoming blinky and GPIO support for nRF5x-based
boards, this change addresses the hardcoded dependencies in Kconfig
default configurations of the different boards, moving the common option
defaults to the SoC default configuration itself.

Change-Id: I8db0750311ad5a12b76237b39438376f20f6f496
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-12-20 09:14:48 -06:00
Carles Cufi e15c5527ed drivers: serial: nrf5: Undefine MDK macros to avoid conflict
The new Nordic MDK redefines certain UART signal names for backwards
compatibility with the new nRF52840 IC.
This patch addresses the potential name conflict between the redefined
signals and the existing variable names defined in the UART driver.

JIRA: ZEP-1418

Change-Id: I559d9335d2eeaa0a88d3f261b70508a1c98b989d
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-12-20 09:14:48 -06:00
Jon Medhurst bcb31523d5 uart_cmsdk_apb: Fix cut'n'paste error in device 4 init code
Change-Id: I2f11dc0da3ad8be970ac15187fb35264ef7dc0e8
Signed-off-by: Jon Medhurst <tixy@linaro.org>
2016-12-16 12:53:52 +00:00
Vincenzo Frascino 1589b7fa5d uart: Enable clock control in CMSDK APB UART driver
This patch enables the clock control interface into the ARM LTD
CMSDK APB UART driver.

Jira: ZEP-1300
Change-Id: Ic0a214beb02d56ffb02ad4e6ca26b80805c0a4e6
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
2016-12-06 10:31:45 -06:00
Erwan Gouriou 0bf6c3860d uart: stm32: Add support for STM32L4X
Deal with STM32L4X additions for clock and interrupt handling to the
uart driver.

Change-Id: I6e8dafb132dafea54b8f31a3a5cb6e35a207574d
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-12-06 10:30:45 -06:00
Erwan Gouriou 2fcf3435c1 serial: Provide new numbering scheme for stm32 UART
There was a misalignment between Zephyr UART device numbering and
SoC UART IP. Device "UART_1" was mapped to IP USART_2, which could
be confusing for user.
This commit allows to align "UART_1" to IP USART_1.
Change is propagated to all STM32F103RB/STM32F401RE based boards and
respective pinmux drivers

Change-Id: Ia8099dfeec7b9c0c686c2a58ccb4dbb1a55b6537
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2016-12-06 09:50:11 -06:00
Erwan Gouriou 8c079e91c9 serial: Provide STM32Cube based serial driver on stm32f1, stm32f4
STM32Cube based implementation allows single driver file for
all stm32 based SoCs.
By maximizing code reuse, use of STM32Cube eases new SoCs
porting into Zephyr and provides better maintanability and
maturity.

Change-Id: Ief4b723add3dfc8b2a839683559c5a4c5d5eb837
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2016-12-06 09:50:11 -06:00
Flavio Santes b04cdcd6e6 drivers: Remove legacy nanokernel.h include
This commit replaces the nanokernel.h include by kernel.h.

Change-Id: Ib42fbf2d9f77a73c0831f569b3dbbfb342ea2e1d
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-04 14:59:37 -06:00
Flavio Santes 290a2aba88 drivers: Remove unused parameter warning
This patch fixes the unused parameter warning found at the
following drivers:

- adc_ti_adc108s102.c
- gpio_dw.c
- gpio_k64.c
- exti_stm32.c
- pinmux_dev_atmel_sam3x.c
- pinmux_dev_k64.c
- pinmux_dev_stm32.c
- uart_atmel_sam3.c

Change-Id: I76a17d19176683130d57e8f48e5195e7785060f3
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-03 14:49:08 +00:00
Vincenzo Frascino bb1818a535 serial: Add driver for CMSDK (Cortex-M System Design Kit) APB UART
Add driver for CMSDK APB UART ports. The driver implements RX and TX
functionalities. Data transmission is implemented using polling and
interrupts. The driver default configuration for the port is to use
8bit data transmission, 1 stop bit, no parity control.

The driver exposes a public uart driver API and allows to register up
to five UART devices: from 'UART_0' to 'UART_4'. The driver performs
the required pinmux, the clock control configuration is left to the
platform.

The driver has been verified to work with the Hello World sample
application on a Beetle Board.

Jira: ZEP-1245
Change-Id: I5baf78b7659aae2a574d8e66205e6fd5eb579133
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-11-11 20:39:54 +00:00
Andrew Boie 0b474eef9c kernel: deprecate old init levels
PRIMARY, SECONDARY, NANOKERNEL, MICROKERNEL init levels are now
deprecated.

New init levels introduced: PRE_KERNEL_1, PRE_KERNEL_2, POST_KERNEL
to replace them.

Most existing code has instances of PRIMARY replaced with PRE_KERNEL_1,
SECONDARY with POST_KERNEL as SECONDARY has had a longstanding bug
where the documentation specified SECONDARY ran before the kernel started
up, but actually ran afterwards.

Change-Id: I771bc634e9caf7f17dbf214a270bc9967eed7d32
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-11-09 17:59:44 +00:00
Maureen Helm 33ee93d7dd serial/uart_k20: Fix instance source clock frequencies
The uart_k20 serial driver incorrectly assumed that all instances of the
UART peripheral are driven by the system clock, when actually some
instances are driven by the bus clock (which usually runs at half the
system clock). This caused incorrect baud rate calculations for UART
instances driven by the bus clock (UART2-4).

Change-Id: I38041781cdee146912bb5167e7c71d6416b966b5
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2016-11-04 23:00:04 +00:00
Gil Pitney e8b43cbc81 cc3200: Add a UART driver (polled and interrupt modes)
The pinmux configuration is done during board initialization.

This was validated using the following Zephyr apps:
- samples/hello_world
- samples/philosophers
- samples/drivers/uart
- samples/shell

UARTA0 is currently supported.

Change-Id: I85727c622d4d42183cc9f2f8b43d653e245dd17e
Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2016-11-04 14:53:33 +00:00
JuanX Solano Menacho 8a287b1016 uart_qmsi: Use qm_uart_*_context API
Remove the Zephyr implementation and
update the uart_qmsi driver to use new QMSI PM APIs.

Jira: ZEP-998
Change-Id: I418e6384c16e374e9062820e12648a2d524a312d
Signed-off-by: JuanX Solano Menacho <juanx.solano.menacho@intel.com>
2016-11-03 23:52:07 +00:00
Iván Briano 5b31f76113 uart qmsi: Use provided macros to configure IRQ
Use the macros provided by QMSI (or by ourselves, when QMSI doesn't
have them yet) to register interrupts independently of which core it's
building for.

Change-Id: I83fd7e42598b45aef8132316906a3bff291dfe92
Signed-off-by: Iván Briano <ivan.briano@intel.com>
2016-11-02 22:24:27 +00:00
Iván Briano 0094ab228d ext qmsi: Update to QMSI 1.3 release
Update the QMSI drop we maintain in Zephyr, and fix the build where
needed:

- QM_SCSS_INT is renamed to QM_INTERRUPT_ROUTER;
- every member of QM_INTERRUPT_ROUTER was renamed as well;
- QM_IRQ_* renamed too, mostly added _INT at the end;
- some isr functions were renamed to keep their names consistent;
- build for x86 needs to define QM_LAKEMONT, as QM_SENSOR was for ARC.

Change-Id: I459029ca0d373f6c831e2bb8ebd52402a55994d1
Signed-off-by: Iván Briano <ivan.briano@intel.com>
2016-10-31 13:26:06 +00:00
Kumar Gala 2f9d83d340 uart: stm32: add support for STM32F4
Change the clock accessors to a tuple of bus ID of the subsystem and enable
bits for the device - it is clearer to read than the opaque pointers.

Change-Id: I9ae73c222c04adac4cf2bc06e97f4ec199bdac3c
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-10-28 18:58:05 +00:00
Marcus Shawcroft f84ce64390 serial/uart_nsim: Make driver_api const.
Change-Id: Iefa9afe9cfdbb40e27c6e27f28c26dfea042ca79
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-26 20:50:59 +00:00
Carles Cufi 749d153afa drivers: uart_nrf5: Remove pull-up configuration from RTS
The Ready To Send (RTS) hardware flow control signal in the nRF5
UART was being configured as an output with a pull-up on it.
This was seemingly causing certain issues with btattach on Linux
and it's not done anywhere else.

Change-Id: Id792d967b043ea7a796d6598500a733c092dbc2c
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-10-26 12:57:56 +00:00
Marcus Shawcroft d3ea539afc serial/uart_stm32: Make driver_api structure const.
Change-Id: Ia877269952839299c2de12a08d56be9a809fd12c
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-25 18:45:44 +00:00
Marcus Shawcroft 7eddbaa21e serial/uart_stellaris: Make driver_api structure const.
Change-Id: I24406298b0928f7dbc154272a32293ecdc04a5d5
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-25 18:45:43 +00:00
Marcus Shawcroft 95d962cfed serial/uart_qmsi: Make driver_api structure const.
Change-Id: Iffa46ba38e106569249bce89646cb813dadc2bce
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-25 18:45:43 +00:00
Marcus Shawcroft 7c8b6498e3 serial/uart_ns16550: Make driver_api structure const.
Change-Id: Ie27216f1020504d8c6368d228e2e8e94da8fa51f
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-25 18:45:42 +00:00
Marcus Shawcroft f5bc9b12e7 serial/uart_nrf5: Make driver_api structure const.
Change-Id: I066702278afa0bbf6ce4bb916eb1780a8eb2d065
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-25 18:45:42 +00:00
Marcus Shawcroft 6121f92f21 serial/uart_k20: Make driver_api structure const.
Change-Id: I728dd079ff058e8b2a3fa40b4d8c844e8ffd1649
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-25 18:45:41 +00:00
Marcus Shawcroft 800c8722a5 serial/uart_atmel_sam3: Make driver_api structure const.
Change-Id: I745bf7060e4ae0fff5fd4c917d4b979dde1201e9
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-25 18:45:41 +00:00
Marcus Shawcroft 610e9136c6 serial/uart_altera_jtag: Make driver_api structure const.
Change-Id: Iace2f7daac33a146eb834c11f0de13bdd26e2b3d
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-25 18:45:40 +00:00
Carles Cufi 33d17497d2 drivers: uart_nrf5: Use MDK baudrate divisor constants
The baudrate calculation present in set_baudrate() is
causing the UART to emit inital bytes incorrectly, for a
reason currently unknown, but directly related to the fact
that __aeabi_uldivmod is being invoked.
Since the nRF5x Product Specifications do not provide a
standard formula to calculate baudrates and instead list
a predefined set of divisor values, we opt here to use the
official values and remove the attempt at calculating them
manually.

Change-Id: Ic3ff42ea6d065e9a1d26a5350ce5bf5ad661160a
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-10-25 18:40:56 +00:00
Johan Hedberg b1d5ae72e3 drivers/serial: Make nRF5 UART pin configuration board-specific
The exact pin numbers for the nRF5 UART configuration is
board-specific, so the Kconfig default values should be in a
board-specific file.

Change-Id: Ibaacde292db191221e32b3626c68bf972dd26016
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-10-24 15:04:46 +00:00
Ricardo Salveti 7124d95795 serial: make nrf5 driver compatible with nrf51
Default IRQ priority changed to 1 to so it can also be compatible with
nRF51 (Cortex-M0 allows up to 4 priority levels but Zephyr needs the
first two for the OS).

Change-Id: Ie57a729f5d932f020a7d1d7e55cf3741f1ecfbab
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
2016-10-22 01:25:54 +00:00
Ricardo Salveti 69b9451af1 arm/nordic: use a common header for the nrf51/nrf52 SoC families
Integrating the IRQ definitions for both nRF51 and nRF52, and defining
the set of IRQ values that are common to both.

Also switch the controller, uart and clock drivers to use the common
header definitions.

Change-Id: Id6816d7a97720896cfe4df83656fb8b1f8fb01fa
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
2016-10-22 01:25:54 +00:00
Marcus Shawcroft bad9aa1501 uart/ns16550: Make driver config_info structure const.
Change-Id: I57c71df60dfcfee1ea6bf461777775b928a61c1b
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-20 16:49:01 +00:00
Marcus Shawcroft b1d9647595 uart/nrf5: Make driver config_info structure const.
Change-Id: Ic601560c187a35b9087e058957f426fb92a1d761
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-20 16:49:00 +00:00
Marcus Shawcroft 5acbdcc34e uart/altera_jtag: Make driver config_info structure const.
Change-Id: I22b128f1b43dd081e8c9fc9473f8ba3752d4ad5d
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-20 16:49:00 +00:00
Marcus Shawcroft 6e05001c4d uart/k20: Make driver config_info structure const.
Change-Id: I7e13eb1f75d19e15fb3617687e50e06639808fda
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-20 16:48:56 +00:00
Marcus Shawcroft e75a953650 uart/qmsi: Make driver config_info structure const.
Change-Id: Ia89250aa54409cf6121f48a413e97b68e34d0b26
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-20 16:48:55 +00:00
Marcus Shawcroft b21a933366 uart/stellaris: Make driver config_info structure const.
Change-Id: Ic28bad8f474948127e69509ad7c494de92ba7c77
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-20 16:48:55 +00:00
Marcus Shawcroft 8718815ce5 uart/stm32: Make driver config_info structure const.
Change-Id: I7be12afc5b55f6a02dd2fba2896f293e7ef0eec4
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-20 16:48:54 +00:00
Marcus Shawcroft aeac8e633b serial/sam3: Make config_info structure const.
Change-Id: I7aa0ea803c00644c84952fcd6e3ddcd3e41607f6
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-20 16:48:44 +00:00
Amit Kucheria 4c2802d6b7 drivers: serial: uart_stm32: Fix typo in register field name
The field is "NF: Noise detect flag". Given that every other field name is
faithful to the manual, do the same for NF.

Change-Id: I300663e6d5016bf28071d2a1926ec73682ae3d01
Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
2016-10-19 11:55:59 +00:00
Jesus Sanchez-Palencia 7c0fc99c79 ext qmsi: Update to QMSI 1.2 release
Update the QMSI drop we maintain in Zephyr, and fix the build where
needed:

- QM_USB_BASE is renamed to QM_USB_0_BASE;
- parameter int_en from qm_uart cfg struct was removed;
- driver's folder now has a new structure, fix makefiles accordingly;
- QM_WDT_MODE and related renamed to QM_WDT_CR_RMOD;
- QM_SCSS_AON renamed to QM_AONC.

Change-Id: Iffe9c66b7a3f2fe64418326e20ff0894149b3044
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
2016-10-18 23:26:01 +00:00
Justin Watson b5e9c6d1bb driver: Fixed Atmel SAM3 serial driver.
The Atmel SAM3 serial driver poll in function checked
for new characters incorrectly.

Change-Id: I9024a991404bf949226634c9f6c6ea507577cff1
Signed-off-by: Justin Watson <jwatson5@gmail.com>
2016-10-18 17:46:41 +00:00
Marcus Shawcroft 7ee5ce75e9 serial/ns16550: Move RW objects from driver config to driver context.
PCI enumeration modifies pci_dev and port at driver initialization,
these objects move from config_info to driver_data in preparation for
config_info becoming const.

This driver shares a unified uart configuration structure with other
uart device drivers.  The structure uses 'union' and the preprocessor
to customize the structure to the drivers specific requirement.  There
appears to be no compelling reason why all the uart drivers should
share the same (customized) config_info structure.  In order to
re-organize the structure for this driver to get config_info const, an
ns16550 specific config structure is defined and the driver switched
over from the generic uart_config.

Change-Id: I31932d811f623a9370b69903114ae97b15d65886
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-15 16:44:06 +00:00
Marcus Shawcroft 2650747983 serial/uart_qmsi: Make pointers to config_info const.
Change-Id: I667315671aeb8eaa5a5f1e4157c804e9028793de
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-15 12:29:23 +00:00
Marcus Shawcroft 3316cb3898 serial/uart_nsim: Make config_info pointers const.
Preparation for const driver configuration data.

Change-Id: Ide7c5cae8c57e3b30c7bb6611b574b86562c241d
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-08 11:40:12 +00:00
Marcus Shawcroft 6b552ef2a8 serial/uart_qmsi: Make config_info pointers const.
Make pointers to struct config_info const in prepration for a const
config_info.

Change-Id: I0257e242a2d3bc4e353a3477364a4d9a7fb72b82
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-07 20:33:58 +00:00
Marcus Shawcroft dc5b363065 serial/uart_k20: Make config_info pointers const.
Preparation for const driver configuration data.

Change-Id: I0132c6fb6a1db21d4b3e8a5926e10eb40428744b
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@gmail.com>
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-07 08:05:50 -04:00
Marcus Shawcroft ca9a7932bd serial/uart_nrf5: Make config_info pointers const.
Preparation for const driver configuration data.

Change-Id: Id02596f2e35faa2e3ba2c0e0ffd7bbe8e5e92896
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@gmail.com>
2016-10-07 12:04:45 +00:00
Marcus Shawcroft 98d9c82994 serial/uart_nrf5: Remove duplicate sys_clk_freq initialization.
The drivers config structure initializer sets sys_clk_freq statically.
The runtime repeated setup of sys_clk_freq is superfluous, and
inconsitent with const driver config structures.

Change-Id: I115e2b70b193b567de83132f3984e48b2dded0a2
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-07 12:04:45 +00:00
Marcus Shawcroft c595f08bb3 serial/uart_stellaris: Make config_info pointers const.
Preparation for const driver configuration data.

Change-Id: Iaee259f70918497fdfc8fd3ef3ab3d7c953daa22
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@gmail.com>
2016-10-07 12:04:44 +00:00
Marcus Shawcroft f34d5511d6 serial/uart_stm32: Make config_info pointers const.
Make pointers to struct config_info const in prepration for a const
config_info.

Change-Id: I8ecc10b50e23d2dbe987e3318bac09e235b1e1da
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@gmail.com>
2016-10-07 12:04:43 +00:00