diff options
author | Eddie Huang <eddie.huang@mediatek.com> | 2015-04-28 16:40:33 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-05-10 20:00:05 +0300 |
commit | 2c40b57dc82de8e1337666341efe41a0fe9dd741 (patch) | |
tree | 6c5df636d6391673033a67c343a4ab0abf08896f /drivers/tty/serial/8250/8250_mtk.c | |
parent | 1c5841e832e2d7563c31de4946118e78baf573a3 (diff) | |
download | linux-2c40b57dc82de8e1337666341efe41a0fe9dd741.tar.xz |
tty: serial: 8250_mtk: Add earlycon
Add 8250 MTK UART driver to support earlycon device tree.
Earlycon take effect by
add "earlycon" in kernel boot argument
add "linux,sdtout-path" property in device tree file
Signed-off-by: Eddie Huang <eddie.huang@mediatek.com>
Tested-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/8250/8250_mtk.c')
-rw-r--r-- | drivers/tty/serial/8250/8250_mtk.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/tty/serial/8250/8250_mtk.c b/drivers/tty/serial/8250/8250_mtk.c index 8eb3876563f1..4488c2bdb7ba 100644 --- a/drivers/tty/serial/8250/8250_mtk.c +++ b/drivers/tty/serial/8250/8250_mtk.c @@ -305,6 +305,19 @@ static struct platform_driver mtk8250_platform_driver = { }; module_platform_driver(mtk8250_platform_driver); +static int __init early_mtk8250_setup(struct earlycon_device *device, + const char *options) +{ + if (!device->port.membase) + return -ENODEV; + + device->port.iotype = UPIO_MEM32; + + return early_serial8250_setup(device, NULL); +} + +OF_EARLYCON_DECLARE(mtk8250, "mediatek,mt6577-uart", early_mtk8250_setup); + MODULE_AUTHOR("Matthias Brugger"); MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Mediatek 8250 serial port driver"); |