From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yoshinori Sato Date: Thu, 21 May 2015 15:31:10 +0900 Subject: [U-Boot] [PATCH 2/2] serial_sh: Add standrad SCI (w/o FIFO) support In-Reply-To: <1432189870-21598-1-git-send-email-ysato@users.sourceforge.jp> References: <1432189870-21598-1-git-send-email-ysato@users.sourceforge.jp> Message-ID: <1432189870-21598-2-git-send-email-ysato@users.sourceforge.jp> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Add support for standard type SCI (without FIFO) port. Signed-off-by: Yoshinori Sato --- doc/device-tree-bindings/serial/sh.txt | 2 +- drivers/serial/serial_sh.c | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/doc/device-tree-bindings/serial/sh.txt b/doc/device-tree-bindings/serial/sh.txt index b23b135..99634a5 100644 --- a/doc/device-tree-bindings/serial/sh.txt +++ b/doc/device-tree-bindings/serial/sh.txt @@ -1,6 +1,6 @@ * Renesas SCI serial interface Required properties: -- compatible: must be "renesas,scif" or "renesas,scifa" +- compatible: must be "renesas,scif", "renesas,scifa" or "renesas,sci" - reg: exactly one register range with length - clock: input clock frequency for the SCI unit diff --git a/drivers/serial/serial_sh.c b/drivers/serial/serial_sh.c index 32b2bf0..d2a23a6 100644 --- a/drivers/serial/serial_sh.c +++ b/drivers/serial/serial_sh.c @@ -47,6 +47,11 @@ static int scif_rxfill(struct uart_port *port) else return sci_in(port, SCRFDR); } +#elif defined(CONFIG_SCI) +static int scif_rxfill(struct uart_port *port) +{ + return (sci_in(port, SCxSR) & SCxSR_RDxF(port)) ? 1 : 0; +} #else static int scif_rxfill(struct uart_port *port) { @@ -205,6 +210,7 @@ static const struct dm_serial_ops sh_serial_ops = { #ifdef CONFIG_OF_CONTROL static const struct udevice_id sh_serial_id[] ={ + {.compatible = "renesas,sci", .data = PORT_SCI}, {.compatible = "renesas,scif", .data = PORT_SCIF}, {.compatible = "renesas,scifa", .data = PORT_SCIFA}, {} @@ -262,6 +268,8 @@ U_BOOT_DRIVER(serial_sh) = { #if defined(CONFIG_SCIF_A) #define SCIF_BASE_PORT PORT_SCIFA +#elif defined(CONFIG_SCI) + #define SCIF_BASE_PORT PORT_SCI #else #define SCIF_BASE_PORT PORT_SCIF #endif -- 2.1.4