From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756482AbbCFT02 (ORCPT ); Fri, 6 Mar 2015 14:26:28 -0500 Received: from mail-qc0-f180.google.com ([209.85.216.180]:38376 "EHLO mail-qc0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756302AbbCFTZy (ORCPT ); Fri, 6 Mar 2015 14:25:54 -0500 From: Peter Hurley To: Greg Kroah-Hartman , Rob Herring , Grant Likely Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Hurley Subject: [PATCH v2 -next 14/14] serial: 8250_omap: Add omap8250 earlycon Date: Fri, 6 Mar 2015 14:25:30 -0500 Message-Id: <1425669930-22137-15-git-send-email-peter@hurleysoftware.com> X-Mailer: git-send-email 2.3.1 In-Reply-To: <1425669930-22137-1-git-send-email-peter@hurleysoftware.com> References: <1425669930-22137-1-git-send-email-peter@hurleysoftware.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add DT earlycon for 8250_omap driver. This boot console is included for kernels built with CONFIG_SERIAL_EARLYCON=y, CONFIG_OF=y, CONFIG_SERIAL_8250_OMAP=y, and CONFIG_OF_EARLY_FLATTREE=y. This boot console is enabled with the command line option "earlycon" (without "=...") when the DT 'stdout-path' property matches a compatible uart. For example, / { chosen { stdout-path = "serial0:115200"; }; .... aliases { serial0 = &uart0; }; .... ocp : ocp { uart0 : serial@44e09000 { compatible = "ti,omap3-uart"; } }; }; Signed-off-by: Peter Hurley --- drivers/tty/serial/8250/8250_early.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/drivers/tty/serial/8250/8250_early.c b/drivers/tty/serial/8250/8250_early.c index 53db31c..daa983d 100644 --- a/drivers/tty/serial/8250/8250_early.c +++ b/drivers/tty/serial/8250/8250_early.c @@ -169,5 +169,26 @@ static int __init early_serial8250_setup(struct earlycon_device *device, device->con->write = early_serial8250_write; return 0; } + EARLYCON_DECLARE(uart8250, early_serial8250_setup); EARLYCON_DECLARE(uart, early_serial8250_setup); + +#ifdef CONFIG_SERIAL_8250_OMAP + +static int __init early_omap8250_setup(struct earlycon_device *device, + const char *options) +{ + struct uart_port *port = &device->port; + + if (!(device->port.membase || device->port.iobase)) + return -ENODEV; + + port->regshift = 2; + device->con->write = early_serial8250_write; + return 0; +} + +OF_EARLYCON_DECLARE(omap8250, "ti,omap2-uart", early_omap8250_setup); +OF_EARLYCON_DECLARE(omap8250, "ti,omap3-uart", early_omap8250_setup); +OF_EARLYCON_DECLARE(omap8250, "ti,omap4-uart", early_omap8250_setup); +#endif -- 2.3.1