Commit Graph

684 Commits

Author SHA1 Message Date
Marek Vasut
65f83802b7 serial: 16550: Add getfcr accessor
Add function which allows fetching the default FCR register setting
from platform data for DM , while retaining old behavior for non-DM
by returning UART_FCRVAL.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Tom Rini <trini@konsulko.com>
Cc: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2016-12-19 12:26:36 -05:00
Patrick Bruenn
98d62e618b arm: imx: add i.MX53 Beckhoff CX9020 Embedded PC
Add CX9020 board based on mx53loco.
Add simplified imx53 base device tree from kernel v4.8-rc8, to reuse
serial_mxc with DTE and prepare for device tree migration of other
functions and imx53 devices.

The CX9020 differs from i.MX53 Quick Start Board by:
- use uart2 instead of uart1
- DVI-D connector instead of VGA
- no audio
- CCAT FPGA connected to emi
- enable rtc

Signed-off-by: Patrick Bruenn <p.bruenn@beckhoff.com>
2016-12-16 12:57:12 +01:00
Simon Glass
ebb2c53585 serial: Drop the s3c24x0 serial driver
This is not used by any boards. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: David Müller <d.mueller@elsoft.ch>
Reviewed-by: Jagan Teki <jagan@openedev.com>
2016-12-04 13:55:00 -05:00
Fabian Vogt
cb97ad47bf serial: bcm283x_mu: support disabling after initialization
For the Raspberry Pi 3 it needs to be possible to disable the serial
device after initialization happens, as only after the GPIO device is available
it is known whether the mini uart is usable.

Signed-off-by: Fabian Vogt <fvogt@suse.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2016-11-28 20:09:50 -05:00
Fabian Vogt
165316e38f serial: pl01x: expose skip_init platdata option in DT
To be able to represent the skip-init platdata element with OF_CONTROL,
it needs to be read from the device tree as well and put into the platform data.

Cc: Eric Anholt <eric@anholt.net>
Signed-off-by: Fabian Vogt <fvogt@suse.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2016-11-28 20:09:47 -05:00
Fabian Vogt
9f755f5d09 serial: bcm283x_mu: add device tree support
This patch adds device tree support for the bcm283x mini-uart driver.

Signed-off-by: Fabian Vogt <fvogt@suse.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2016-11-28 20:09:46 -05:00
Tom Rini
ed77ccd014 Merge git://git.denx.de/u-boot-fsl-qoriq
Signed-off-by: Tom Rini <trini@konsulko.com>

Conflicts:
	arch/arm/Kconfig
2016-11-25 17:39:54 -05:00
Marcel Ziswiler
cbfa67a16b serial: pxa: integrate optional driver model handling
Optional driver model handling integration.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Marek Vasut <marex@denx.de>
2016-11-23 13:53:20 +01:00
Marcel Ziswiler
d804a5e1c3 serial: pxa: use kconfig for serial configuration
Migrate the PXA serial driver to be configured via Kconfig.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Marek Vasut <marex@denx.de>
2016-11-23 13:53:20 +01:00
Shaohui Xie
9b46213b4f lpuart: add a get_lpuart_clk function
It's not always true that LPUART clock is CONFIG_SYS_CLK_FREQ. This
patch provides a weak function get_lpuart_clk(), so that the clock
can be ovreridden on a specific board which uses different clock
for LPUART.

Signed-off-by: Shaohui Xie <Shaohui.Xie@nxp.com>
[YS: Reformat commit message]
Reviewed-by: York Sun <york.sun@nxp.com>
2016-11-21 09:20:32 -08:00
Tom Rini
1df182ddf7 Merge branch 'master' of git://git.denx.de/u-boot-atmel 2016-10-28 14:14:18 -04:00
Wenyou Yang
998cf3c2be serial: atmel_usart: Support enable an early debug UART
Add support to enable an early debug UART for debugging.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>
2016-10-28 18:37:15 +02:00
Wenyou Yang
6ec739aa52 serial: Kconfig: Add ATMEL_USART option
Add ATMEL_USART option to support to enable the Atmel usart driver
from Kconfig.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>
2016-10-28 18:37:15 +02:00
Tom Rini
4f892924d2 Merge branch 'master' of git://www.denx.de/git/u-boot-imx
Signed-off-by: Tom Rini <trini@konsulko.com>

Conflicts:
	common/Kconfig
	configs/dms-ba16_defconfig
2016-10-28 11:12:03 -04:00
Jagan Teki
8829e662ce serial: Kconfig: Add MXC_UART entry
Added kconfig for MXC_UART driver.

Cc: Simon Glass <sjg@chromium.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
2016-10-26 16:53:16 +02:00
Simon Glass
869588decd Convert CONFIG_SYS_STDIO_DEREGISTER to Kconfig
This converts the following to Kconfig:
   CONFIG_SYS_STDIO_DEREGISTER

This option should never be enabled in SPL, so use
CONFIG_IS_ENABLED(SYS_STDIO_DEREGISTER) when checking the option.

Signed-off-by: Simon Glass <sjg@chromium.org>
[trini: Re-sync]
Signed-off-by: Tom Rini <trini@konsulko.com>
2016-10-23 18:34:17 -04:00
Tom Rini
f5fd45ff64 Merge branch 'master' of git://www.denx.de/git/u-boot-imx 2016-10-08 09:33:37 -04:00
Masahiro Yamada
021abf696f Revert "ns16650: Make sure we have CONFIG_CLK set before using infrastructure"
This reverts commit 82f5279b0c.

The build failure of k2*evm boards was fixed in a different way by
the previous commit.  It is nasty to patch generic drivers around
with #ifdef CONFIG_CLK just for the KeyStone's matter.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2016-10-08 09:33:31 -04:00
Stefan Agner
a99546ab62 dm: imx: serial: support device tree
Support instatiation through device tree. Also parse the fsl,dte-mode
property to determine whether DTE mode shall be used.

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2016-10-07 12:26:14 +02:00
Alexandre Courbot
ab895d6af2 serial: ns16550: Handle -ENOENT when requesting clock
When calling clk_get_by_index(), fall back to the legacy method of
getting the clock if -ENOENT is returned.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Thierry Reding <treding@nvidia.com>
2016-10-06 10:31:59 -04:00
Stefan Roese
6985d49662 serial: Add serial_mvebu_a3700 for Armada 3700 SoC
The Armada 3700's UART is a simple serial port. It has a 32 bytes
Tx FIFO and a 64 bytes Rx FIFO integrated. This patch adds support
for this UART including the DEBUG UART functions for very early
debug output.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Wilson Ding <dingwei@marvell.com>
Cc: Victor Gu <xigu@marvell.com>
Cc: Hua Jing <jinghua@marvell.com>
Cc: Terry Zhou <bjzhou@marvell.com>
Cc: Hanna Hawa <hannah@marvell.com>
Cc: Haim Boot <hayim@marvell.com>
2016-09-27 17:29:52 +02:00
Masahiro Yamada
1221ce459d treewide: replace #include <asm/errno.h> with <linux/errno.h>
Now, arch/${ARCH}/include/asm/errno.h and include/linux/errno.h have
the same content.  (both just wrap <asm-generic/errno.h>)

Replace all include directives for <asm/errno.h> with <linux/errno.h>.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
[trini: Fixup include/clk.]
Signed-off-by: Tom Rini <trini@konsulko.com>
2016-09-23 17:55:42 -04:00
Tom Rini
82f5279b0c ns16650: Make sure we have CONFIG_CLK set before using infrastructure
We cannot call on the CONFIG_CLK based clk_get_rate function unless
CONFIG_CLK is set.

Signed-off-by: Tom Rini <trini@konsulko.com>
2016-09-22 15:39:11 -04:00
Paul Burton
50fce1d5d8 serial: ns16550: Support clocks via phandle
Previously ns16550 compatible UARTs probed via device tree have needed
their device tree nodes to contain a clock-frequency property. An
alternative to this commonly used with Linux is to reference a clock via
a phandle. This patch allows U-Boot to support that, retrieving the
clock frequency by probing the appropriate clock device.

For example, a system might choose to provide the UART base clock as a
reference to a clock common to multiple devices:

  sys_clk: clock {
    compatible = "fixed-clock";
    #clock-cells = <0>;
    clock-frequency = <10000000>;
  };

  uart0: uart@10000000 {
    compatible = "ns16550a";
    reg = <0x10000000 0x1000>;
    clocks = <&sys_clk>;
  };

  uart1: uart@10000000 {
    compatible = "ns16550a";
    reg = <0x10001000 0x1000>;
    clocks = <&sys_clk>;
  };

This removes the need for the frequency information to be duplicated in
multiple nodes and allows the device tree to be more descriptive of the
system.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2016-09-21 15:04:32 +02:00
Alexander Graf
601147b06a serial: bcm283x_mu: Detect disabled serial device
On the raspberry pi, you can disable the serial port to gain dynamic frequency
scaling which can get handy at times.

However, in such a configuration the serial controller gets its rx queue filled
up with zero bytes which then happily get transmitted on to whoever calls
getc() today.

This patch adds detection logic for that case by checking whether the RX pin is
mapped to GPIO15 and disables the mini uart if it is not mapped properly.

That way we can leave the driver enabled in the tree and can determine during
runtime whether serial is usable or not, having a single binary that allows for
uart and non-uart operation.

Signed-off-by: Alexander Graf <agraf@suse.de>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2016-09-06 13:18:19 -04:00
Masahiro Yamada
85dc2fe119 ARM: uniphier: change UNIPHIER_SERIAL to default y option
This is very likely to be necessary for normal use cases.
Set its default to 'y' for shorter defconfig files.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2016-08-28 13:11:35 +09:00
Tom Rini
c98b171e10 Merge branch 'rmobile' of git://git.denx.de/u-boot-sh
[trini: Drop CMD_BOOTI as it's now on by default on ARM64]
Signed-off-by: Tom Rini <trini@konsulko.com>
2016-08-20 16:40:34 -04:00
masakazu.mochizuki.wd@hitachi.com
6f107e4cf6 arm: rmobile: Add BLANCHE board support
BLANCHE is development board based on R-Car V2H SoC (R8A7792)

This commit supports the following periherals:
- SCIF, Ethernet, QSPI, MMC

Signed-off-by: Masakazu Mochizuki <masakazu.mochizuki.wd@hitachi.com>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
2016-08-17 10:25:35 +09:00
Hiroyuki Yokoyama
d6ee8ce51d serial: sh: Add support R8A7795
This can be used in the same way as other R-CAR serial setting.

Signed-off-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
2016-08-17 10:25:34 +09:00
Tom Rini
4711e7f7af Merge branch 'master' of git://www.denx.de/git/u-boot-imx 2016-07-28 08:45:00 -04:00
Masahiro Yamada
4e3d84066e ARM: uniphier: use (devm_)ioremap() instead of map_sysmem()
This does not have much impact on behavior, but makes code look more
more like Linux.  The use of devm_ioremap() often helps to delete
.remove callbacks entirely.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2016-07-24 00:13:10 +09:00
Michal Simek
59da82ef82 serial: zynq: Read information about clock from DT
Read information about clock frequency from DT.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Moritz Fischer <moritz.fischer@ettus.com>
2016-07-22 14:04:40 +02:00
Tom Rini
45031f1a1e Merge branch 'master' of git://git.denx.de/u-boot-sh 2016-07-21 10:40:35 -04:00
Breno Lima
5d219d46aa serial_mxc: Remove unconditional DCE setting
Commit 83fd908f28 ("dm: imx: serial: Support DTE mode when using driver
model") breaks the serial output for the imx boards that do not use
the serial driver model.

The reason for the breakage is that it's setting UFCR_DCEDTE
unconditionally for the non-dm case.

So keep the original behavior by removing UFCR_DCEDTE setting in the
non-dm case.

Tested on mx7sabresd and mx6wandboard.

Signed-off-by: Breno Lima <breno.lima@nxp.com>
Acked-by: Stefan Agner <stefan.agner@toradex.com>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
2016-07-21 10:43:52 +02:00
Stefan Agner
83fd908f28 dm: imx: serial: Support DTE mode when using driver model
The MXC UART IP can be run in DTE or DCE mode. This depends on the
board wiring and the pinmux used and hence is board specific. This
extends platform data with a new field to choose wheather DTE
mode shall be used.

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2016-07-19 19:52:13 +02:00
Tom Rini
ebe621d5fb Merge git://git.denx.de/u-boot-dm 2016-07-15 08:06:22 -04:00
Simon Glass
2fc24d5335 rockchip: serial: Add an of-platdata driver for rockchip
Add a driver that works with of-platdata. It sets up the platform data and
calls the standard ns16550 driver.

Signed-off-by: Simon Glass <sjg@chromium.org>
2016-07-14 20:40:24 -06:00
Simon Glass
b2927fbaa8 dm: serial: ns16550: Update to support of-platdata
With of-platdata this driver cannot know the format of the of-platdata
struct, so we cannot use generic code for accessing the of-platdata. Each
SoC that uses this driver will need to set up ns16550's platdata for it.
So don't compile in the generic code.

Signed-off-by: Simon Glass <sjg@chromium.org>
2016-07-14 20:40:24 -06:00
Simon Glass
b484b0daef dm: serial: Add support for of-platdata
When this feature is enabled, we cannot access the device tree to find out
which serial device to use. Just use the first serial driver we find.

Signed-off-by: Simon Glass <sjg@chromium.org>
2016-07-14 20:40:24 -06:00
Simon Glass
0110f509c8 sandbox: serial: Don't sync video in SPL
SPL does not support an LCD display so there is no need to sync the video
when there is serial output.

Signed-off-by: Simon Glass <sjg@chromium.org>
2016-07-14 20:40:24 -06:00
Toshifumi NISHINAGA
ba0a3c16e0 stm32: clk: Add 200MHz clock configuration for stm32f746 discovery board
This patch adds 200MHz clock configuration for stm32f746 discovery board.
This patch is based on STM32F4 and emcraft's[1].

[1]:  https://github.com/EmcraftSystems/u-boot

Signed-off-by: Toshifumi NISHINAGA <tnishinaga.dev@gmail.com>
2016-07-14 18:22:41 -04:00
Yoshinori Sato
747431b9d5 serial_sh: Add standrad SCI (w/o FIFO) support
Add support for standard type SCI (without FIFO) port.

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
2016-07-09 05:51:57 +09:00
Yoshinori Sato
359787cfe4 serial_sh: Device Tree support
Add Device Tree bindings.

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
2016-07-09 05:51:57 +09:00
Stephen Warren
135aa95002 clk: convert API to match reset/mailbox style
The following changes are made to the clock API:
* The concept of "clocks" and "peripheral clocks" are unified; each clock
  provider now implements a single set of clocks. This provides a simpler
  conceptual interface to clients, and better aligns with device tree
  clock bindings.
* Clocks are now identified with a single "struct clk", rather than
  requiring clients to store the clock provider device and clock identity
  values separately. For simple clock consumers, this isolates clients
  from internal details of the clock API.
* clk.h is split so it only contains the client/consumer API, whereas
  clk-uclass.h contains the provider API. This aligns with the recently
  added reset and mailbox APIs.
* clk_ops .of_xlate(), .request(), and .free() are added so providers
  can customize these operations if needed. This also aligns with the
  recently added reset and mailbox APIs.
* clk_disable() is added.
* All users of the current clock APIs are updated.
* Sandbox clock tests are updated to exercise clock lookup via DT, and
  clock enable/disable.
* rkclk_get_clk() is removed and replaced with standard APIs.

Buildman shows no clock-related errors for any board for which buildman
can download a toolchain.

test/py passes for sandbox (which invokes the dm clk test amongst
others).

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Simon Glass <sjg@chromium.org>
2016-06-19 17:05:55 -06:00
Stoica Cosmin-Stefan
1f68dbc881 serial: Introduce linflex uart support
The Linflex module is integrated on some NXP automotive SoCs part of the former
Freescale portfolio, like S32V234, an SoC for Advanced Driver Assistance
Systems.

Original-signed-off-by: Stoica Cosmin-Stefan <cosminstefan.stoica@freescale.com>
Original-signed-off-by: Chircu Bogdan <Bogdan.Chircu@freescale.com>
Original-signed-off-by: Depons Eric <eric.depons@freescale.com>
Original-signed-off-by: Eddy Petrișor <eddy.petrisor@gmail.com>

Signed-off-by: Eddy Petrișor <eddy.petrisor@gmail.com>
2016-06-13 08:56:02 -04:00
Wenyou Yang
c1631c8a04 serial: atmel_usart: Add device tree support
Add device tree support.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2016-06-12 23:49:38 +02:00
Tom Rini
d77fa2ff76 Merge http://git.denx.de/u-boot-samsung
Signed-off-by: Tom Rini <trini@konsulko.com>

Conflicts:
	configs/peach-pi_defconfig
	configs/peach-pit_defconfig
2016-06-06 13:39:43 -04:00
Marek Vasut
03c6f1761e serial: 16550: Drop OMAP1510 support
The CONFIG_OMAP1510 is no longer defined, so remove this dead code.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Tom Rini <trini@konsulko.com>
Cc: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Nishanth Menon <nm@ti.com>
2016-06-02 21:21:41 -04:00
Marek Vasut
fa4ce72316 serial: 16550: Make serial_io/out_shift available to debug mode
The ns16550 driver needs serial_in_shift() and serial_out_shift()
when compiled in debug UART mode, so shift the DM_SERIAL check a
little to make these functions available.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Tom Rini <trini@konsulko.com>
Cc: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2016-06-02 21:21:41 -04:00
Beniamino Galvani
bfcef28ae4 arm: add initial support for Amlogic Meson and ODROID-C2
This adds platform code for the Amlogic Meson GXBaby (S905) SoC and a
board definition for ODROID-C2. This initial submission only supports
UART and Ethernet (through the existing Designware driver). DTS files
are the ones submitted to Linux arm-soc for 4.7 [1].

[1] https://patchwork.ozlabs.org/patch/603583/

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2016-05-27 15:39:47 -04:00
Paul Burton
df8ec55d52 dm: ns16550: Don't map_physmem for I/O ports
If the UART is to be accessed using I/O port accessors (inb & outb) then
using map_physmem doesn't make sense, since it operates in a different
memory space. Remove the call to map_physmem when
CONFIG_SYS_NS16550_PORT_MAPPED is defined, allowing I/O port addresses
to not be mangled by the incorrect mapping.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
2016-05-26 01:34:13 +02:00
Thomas Abraham
cf75cdf96e serial: s5p: use clock api to get clock rate
On Exynos platforms that support clock driver API, allow the driver to
use clock api get the SCLK clock rate.

Cc: Minkyu Kang <mk7.kang@samsung.com>
Signed-off-by: Thomas Abraham <thomas.ab@samsung.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
2016-05-25 10:00:19 +09:00
Thomas Abraham
5ab6c4df27 serial: s5p: get the port id number from the alias of the device node
The port id, if not specified in the device node, can be obtained from
the alias of the device node listed in the aliases node.

Cc: Minkyu Kang <mk7.kang@samsung.com>
Signed-off-by: Thomas Abraham <thomas.ab@samsung.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
2016-05-25 10:00:19 +09:00
Wills Wang
773f3b2538 ar933x: serial: Remove the explicit pinctrl setting
The correct pinctrl is handled automatically so we don't need to do it in
the driver.

Signed-off-by: Wills Wang <wills.wang@live.com>
2016-05-21 01:36:38 +02:00
Wills Wang
60b49761e9 drivers: serial: add serial driver for ar933x SOC
This patch add support for ar933x serial.

Signed-off-by: Wills Wang <wills.wang@live.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2016-05-21 01:25:50 +02:00
angelo@sysam.it
e27802af54 m68k: add DM model serial driver
Boards can now use DM serial driver, or still legacy mcf uart
driver version.

Signed-off-by: Angelo Dureghello <angelo@sysam.it>
Acked-by: Simon Glass <sjg@chromium.org>
2016-05-17 09:54:43 -06:00
Stephen Warren
e3a46e3ee2 serial: bcm283x_mu: make pending values more explicit
dm_serial_ops.pending should return the number of characters, not just a
valid C Boolean integer value. The existing code does already does this,
but only as an accident since BCM283X_MU_LSR_RX_READY happens to be
BIT(0). Enhance the code to be more explicit about the values it returns.

Suggested-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
2016-04-18 17:11:47 -04:00
Alexey Brodkin
8b15010b1f arc: get rid of running_on_hw
ISS is obsolete now and nSIM is used for simulation instead.
In its turn nSIM properly handles baud-rate settings so get rid
of now useless check.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
2016-04-11 10:20:30 -07:00
Mateusz Kulikowski
142a20c367 serial: Add support for Qualcomm serial port
This driver works in "new" Data Mover UART mode, so
will be compatible with modern Qualcomm chips only.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
2016-04-01 17:18:07 -04:00
Masahiro Yamada
b37a1ccea2 serial: uniphier: use devm_get_addr() to get base address
Currently, fdtdec_get_addr_size() does not support the address
translation, so it cannot handle device trees with non-straight
"ranges" properties.  (This would be a problem with DTS for UniPhier
ARMv8 SoCs.)

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2016-04-01 00:17:07 +09:00
Stephen Warren
3917c26909 serial: add BCM283x mini UART driver
The RPi3 typically uses the regular UART for high-speed communication with
the Bluetooth device, leaving us the mini UART to use for the serial
console. Add support for this UART so we can use it.

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
2016-03-27 09:12:52 -04:00
Masahiro Yamada
d5cf32977f ARM: uniphier: support Debug UART
For ARM32 architecture, CONFIG_DEBUG_LL is available for early
low-level debugging (and actually UniPhier 32bit SoCs use it), but
ARM64 architecture does not support it.  Instead, CONFIG_DEBUG_UART
is available as an architecture-independent debug facility.

This commit supports it on all the UniPhier SoCs (including the new
ARMv8 SoCs), which is very useful for new SoC bringups.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2016-03-24 01:45:41 +09:00
Eric Anholt
cd0fa5bff8 serial: pl01x: Add support for devices with the rate pre-configured.
For Raspberry Pi, we had the input clock rate to the pl011 fixed in
the rpi.c file, but it may be changed by firmware due to user changes
to config.txt.  Since the firmware always sets up the uart (default
115200 output unless the user changes it), we can just skip our own
uart init to simplify the boot process and more reliably get serial
output.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Stephen Warren <swarren@wwwdotorg.org>
2016-03-22 12:16:12 -04:00
Michal Simek
59b35ddd26 dm: ns16550: Add support for reg-offset property
reg-offset is the part of standard 8250 binding in the kernel.
It is shifting start of address space by reg-offset.
On Xilinx platform this offset is typically 0x1000.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Moved the new field to the end of the struct to avoid problems:
Signed-off-by: Simon Glass <sjg@chromium.org>
2016-03-17 21:27:39 -06:00
Simon Glass
e4d6ab0c2c x86: Allow use of serial soon after relocation
At present on x86 machines with use cache-as-RAM, the memory goes away just
before board_init_r() is called. This means that serial drivers are
no-longer unavailable, until initr_dm() it called, etc.

Any attempt to use printf() within this period will cause a hang.

To fix this, mark the serial devices as 'unavailable' when it is no-longer
available. Bring it back when serial_initialize() is called. This means that
the debug UART will be used instead for this period.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2016-03-17 10:27:24 +08:00
Alison Wang
ab761ce9f9 dm: serial: Remove duplicated carriage return character
As the handling for carriage return and line feed is done in the common
DM driver serial-uclass.c, such handling in some serial DM drivers is
duplicated and need to be removed.

Signed-off-by: Alison Wang <alison.wang@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2016-03-14 15:34:50 -06:00
Alison Wang
055457ef25 serial: Move carriage return before line feed for some serial drivers
In general, a carriage return needs to execute before a line feed.
The patch is to change some serial drivers based on this rule, such
as serial_mxc.c, serial_pxa.c, serial_s3c24x0.c and usbtty.c.

Signed-off-by: Alison Wang <alison.wang@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2016-03-14 15:34:50 -06:00
Alison Wang
c5917b4b05 dm: serial-uclass: Move a carriage return before a line feed
In general, a carriage return needs to execute before a line feed. The
patch is to change serial DM driver serial-uclass.c based on this rule.

Signed-off-by: Alison Wang <alison.wang@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2016-03-14 15:34:50 -06:00
Tom Rini
e5e88c6596 Revert "dm: ns16550: Add support for reg-offset property"
This reverts commit d9a3bec682.

While this is a correct change to do long term it unfortunately breaks a
number of platforms that are using pdata and not named struct members so
they are getting all of their data after 'base' incorrect.

Acked-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
2016-02-29 10:26:20 -05:00
Michal Simek
966bfa7347 serial: dcc: Move driver to DM
Enabling this driver requires some DT changes.
Adding DCC to root or main bus:
dcc: dcc {
	compatible = "arm,dcc";
	u-boot,dm-pre-reloc;
};

Extend alias list to link DCC:
	serial0 = &uart0;
	serial1 = &uart1;
	serial2 = &dcc;

Change stdout-path to point to dcc port.
	stdout-path = "serial2:115200n8";

Also add support for debug uart to help with early debug.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2016-02-25 19:06:37 -05:00
Vikas Manocha
6a12cebd90 stm32x7: add support for stm32x7 serial driver
This patch adds support for stm32f7 family usart peripheral.

Signed-off-by: Vikas Manocha <vikas.manocha@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2016-02-24 18:43:54 -05:00
Michal Simek
d9a3bec682 dm: ns16550: Add support for reg-offset property
reg-offset is the part of standard 8250 binding in the kernel.
It is shifting start of address space by reg-offset.
On Xilinx platform this offset is typically 0x1000.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2016-02-22 16:21:10 +01:00
Michal Simek
6cd0f2a6cd serial: zynq: Change logic in putc
Sync logic with Linux kernel where TX empty flag is checked before char
is sent.
This logic is fixing problem with console on zynqmp platform.

For example:
DRAM:  2 GiB
Enabling Caches...
EL Level:	��   sdhci@ff170000: 0
Using default environment

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Moritz Fischer <moritz.fischer@ettus.com>
2016-02-22 16:21:04 +01:00
David Müller (ELSOFT AG)
470250e8e6 s3c24xx: serial: Remove dead code
Signed-off-by: David Müller <d.mueller@elsoft.ch>
2016-02-08 10:24:18 -05:00
David Müller (ELSOFT AG)
5a6f68d496 Remove unused CONFIG_HWFLOW option and associated dead code.
Signed-off-by: David Müller <d.mueller@elsoft.ch>
2016-02-08 10:24:17 -05:00
David Müller (ELSOFT AG)
928f605455 Remove unused CONFIG_MODEM_SUPPORT option and associated dead code.
Signed-off-by: David Müller <d.mueller@elsoft.ch>
2016-02-08 10:22:44 -05:00
Simon Glass
492f46c4f8 dm: pxa: serial: Drop serial_sa1100 serial driver
This does not appear to be used, and has not been converted to driver model
by the deadline (doc/driver-model/serial-howto.txt).

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2016-02-08 10:10:42 -05:00
Simon Glass
30b9d753ab dm: serial: Drop serial_max3100 serial driver
This does not appear to be used, and has not been converted to driver model
by the deadline (doc/driver-model/serial-howto.txt).

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2016-02-08 10:10:42 -05:00
Simon Glass
c3dd5787a3 dm: freescale: serial: Drop serial_imx serial driver
This does not appear to be used, and has not been converted to driver model
by the deadline (doc/driver-model/serial-howto.txt).

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2016-02-08 10:10:41 -05:00
Simon Glass
be479339bd dm: opencores: Drop opencores_yanu serial driver
This does not appear to be used, and has not been converted to driver model
by the deadline (doc/driver-model/serial-howto.txt).

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2016-02-08 10:10:41 -05:00
Simon Glass
baf7125aca dm: freescale: Drop mxs_auart serial driver
This does not appear to be used, and has not been converted to driver model
by the deadline (doc/driver-model/serial-howto.txt).

Signed-off-by: Simon Glass <sjg@chromium.org>
2016-02-08 10:10:40 -05:00
Vikas Manocha
dffceb4b15 serial: serial_stm32: move clock config from driver to board
This patch removes the uart clock enable from serial driver & move it in the
board code.

Signed-off-by: Vikas Manocha <vikas.manocha@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2016-02-08 10:10:36 -05:00
Bin Meng
a187559e3d Use correct spelling of "U-Boot"
Correct spelling of "U-Boot" shall be used in all written text
(documentation, comments in source files etc.).

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Minkyu Kang <mk7.kang@samsung.com>
2016-02-06 12:00:59 +01:00
Bhuvanchandra DV
5160def267 dm: lpuart: Drop the legacy code
All boards using this driver are with device tree support,
hence drop the legacy code in driver to have a pure DT solution.

Signed-off-by: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2016-02-02 21:36:09 +01:00
Paul Thacker
9e160ee823 drivers: serial: add driver for Microchip PIC32 UART controller.
This adds PIC32 UART controller support based on driver model.

Signed-off-by: Paul Thacker <paul.thacker@microchip.com>
Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2016-02-01 22:14:00 +01:00
Ricardo Ribalda Delgado
80cce2629b ppc: xilinx-ppc4xx: Port to DM serial
xilinx_uartlite has been ported to DM, this patch makes the
xilinx-ppc405-generic and the xilinx-ppc440-generic boards use the new
DM driver.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>
2016-01-27 15:57:11 +01:00
Michal Simek
842efb3a93 serial: zynq: Fix address reading from DM
Use dev_get_addr() instead of reading reg base directly in the driver.
Core function is also more robust.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2016-01-27 15:55:54 +01:00
Michal Simek
a2533183c0 serial: zynq: Extend compatible string list
ZynqMP is using updated core with cdns,uart-r1p12 compatible string.

Signed-off-by: Michal Simek <monstr@monstr.eu>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2016-01-27 15:55:54 +01:00
Michal Simek
54e24d3332 serial: uartlite: Add uartlite to Kconfig
- Move config option out of board file.
- Remove uartlite address from config file

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>
2016-01-27 15:55:49 +01:00
Michal Simek
4166ba3b23 serial: uartlite: Add support for debug console
Add support for debug console.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>
2016-01-27 15:55:49 +01:00
Michal Simek
93768393d7 serial: uartlite: Move driver to DM
Enable SPL DM too.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>
2016-01-27 15:55:49 +01:00
Thomas Chou
cc4228f9d6 ns16550: zap the rockchip serial compatible string
Zap the rockchip serial compatible string, because rockchip
serial has "snps,dw-apb-uart" compatible string in the dts.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Simon Glass <sjg@chromium.org>
2016-01-25 10:40:04 -05:00
Tom Rini
0080931abf serial: Remove serial_putc_raw_dev
clang-3.8 reports that serial_putc_raw_dev in serial_ns16550.c is
unused.  Further investigation shows that we have 3 places that
implement this function and no callers, remove.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2016-01-25 10:39:45 -05:00
Simon Glass
3ade5bc4dc dm: video: sandbox: Convert sandbox to use driver model for video
Now that driver model support is available, convert sandbox over to use it.
We can remove a few of the special hooks that sandbox currently has.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Anatolij Gustschin <agust@denx.de>
2016-01-20 19:10:16 -07:00
Bin Meng
fdbae099bf serial: lpuart: Add driver model serial support
This adds driver model support to lpuart serial driver.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com>
Tested-by: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com>
2016-01-20 19:10:14 -07:00
Bin Meng
6ca13b1239 serial: lpuart: Prepare the driver for DM conversion
Create internal routines which take lpuart's register base as
a parameter, in preparation for driver model conversion.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
2016-01-20 19:10:14 -07:00
Bin Meng
ed3021af5c serial: lpuart: Call local version of setbrg and putc directly
There is no need to go through serial driver subsystem, instead
call the driver's setbrg and putc routines directly.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
2016-01-20 19:10:14 -07:00
Bin Meng
47f1bfca40 serial: lpuart: Fix several cosmetic issues
Clean up the driver codes a little bit, by:
- Use tab instead of space in the macro defines
- Use single line comment whenever possible
- Fix insertion of blank lines

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
2016-01-20 19:10:14 -07:00
Bin Meng
5ed07cf53c serial: lpuart: Move CONFIG_FSL_LPUART to Kconfig
LPUART is seen on Freescale VF610 and QorIQ Layerscape devices.
Create a Kconfig option and move it to defconfig for all boards
that have this serial driver.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Simon Glass <sjg@chromium.org>
2016-01-20 19:10:14 -07:00
Sergey Temerkhanov
19de81502b arm: serial: Add Kconfig entries to facilitate usage of the pl01x driver for early debug output
This patch adds Kconfig entries to facilitate usage of pl01x as
a debug UART.

Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com>
Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>

Acked-by: Simon Glass <sjg@chromium.org>
2016-01-19 22:25:35 +00:00