aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDong Aisheng <aisheng.dong@nxp.com>2017-06-12 22:55:53 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-06-29 11:12:34 -0400
commit97d6f353dafa42281dc70a67006c9e40d395796a (patch)
tree426b431b368e24f805fcbd3af7e999c20505cbef
parent24b1e5f0e83c2aced8096473d20c4cf6c1355f30 (diff)
tty: serial: lpuart: add earlycon support for imx7ulp
earlycon is executed quite early before the device tree probe, so we need correctly initialize the port membase and iotype for imx7ulp during early console setup before using. Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Jiri Slaby <jslaby@suse.com> Cc: Stefan Agner <stefan@agner.ch> Cc: Mingkai Hu <Mingkai.Hu@nxp.com> Cc: Yangbo Lu <yangbo.lu@nxp.com> Acked-by: Fugang Duan <fugang.duan@nxp.com> Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/tty/serial/fsl_lpuart.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c
index 94863333f48b..a0f2666d30cf 100644
--- a/drivers/tty/serial/fsl_lpuart.c
+++ b/drivers/tty/serial/fsl_lpuart.c
@@ -1982,8 +1982,21 @@ static int __init lpuart32_early_console_setup(struct earlycon_device *device,
1982 return 0; 1982 return 0;
1983} 1983}
1984 1984
1985static int __init lpuart32_imx_early_console_setup(struct earlycon_device *device,
1986 const char *opt)
1987{
1988 if (!device->port.membase)
1989 return -ENODEV;
1990
1991 device->port.iotype = UPIO_MEM32;
1992 device->port.membase += IMX_REG_OFF;
1993 device->con->write = lpuart32_early_write;
1994
1995 return 0;
1996}
1985OF_EARLYCON_DECLARE(lpuart, "fsl,vf610-lpuart", lpuart_early_console_setup); 1997OF_EARLYCON_DECLARE(lpuart, "fsl,vf610-lpuart", lpuart_early_console_setup);
1986OF_EARLYCON_DECLARE(lpuart32, "fsl,ls1021a-lpuart", lpuart32_early_console_setup); 1998OF_EARLYCON_DECLARE(lpuart32, "fsl,ls1021a-lpuart", lpuart32_early_console_setup);
1999OF_EARLYCON_DECLARE(lpuart32, "fsl,imx7ulp-lpuart", lpuart32_imx_early_console_setup);
1987EARLYCON_DECLARE(lpuart, lpuart_early_console_setup); 2000EARLYCON_DECLARE(lpuart, lpuart_early_console_setup);
1988EARLYCON_DECLARE(lpuart32, lpuart32_early_console_setup); 2001EARLYCON_DECLARE(lpuart32, lpuart32_early_console_setup);
1989 2002