From dac65f99e8bf1fbe2e15fa96ef901623bb49dc89 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Tue, 26 Nov 2013 13:08:28 +0100 Subject: console: Set Linux console parameter automatically Linux specifies the linux,stdout-path property in the /chosen node in the devicetree. Unfortunately this is ignored in most cases. For cases in which barebox uses this property for its own use we translate this into a Linux boot arg with: - the console name provided by the serial driver - the the instance from the 'serial' alias - the baudrate from the actual baudrate. So with this it's for devicetee enabled boards no longer necessary to manually assign a console= parameter. Should a user not want to use the automatically assigned parameter it should do: global.linux.bootargs.console= in the environment. Signed-off-by: Sascha Hauer --- drivers/serial/serial_imx.c | 1 + drivers/serial/serial_ns16550.c | 3 +++ 2 files changed, 4 insertions(+) (limited to 'drivers/serial') diff --git a/drivers/serial/serial_imx.c b/drivers/serial/serial_imx.c index 8468fa0adc..e0bd185c8b 100644 --- a/drivers/serial/serial_imx.c +++ b/drivers/serial/serial_imx.c @@ -336,6 +336,7 @@ static int imx_serial_probe(struct device_d *dev) cdev->getc = imx_serial_getc; cdev->flush = imx_serial_flush; cdev->setbrg = imx_serial_setbaudrate; + cdev->linux_console_name = "ttymxc"; imx_serial_init_port(cdev); diff --git a/drivers/serial/serial_ns16550.c b/drivers/serial/serial_ns16550.c index a8487b0ed3..f1da44b7f7 100644 --- a/drivers/serial/serial_ns16550.c +++ b/drivers/serial/serial_ns16550.c @@ -57,6 +57,7 @@ static inline struct ns16550_priv *to_ns16550_priv(struct console_device *cdev) struct ns16550_drvdata { void (*init_port)(struct console_device *cdev); + const char *linux_console_name; }; /** @@ -251,6 +252,7 @@ static struct ns16550_drvdata ns16550_drvdata = { static __maybe_unused struct ns16550_drvdata omap_drvdata = { .init_port = ns16550_omap_init_port, + .linux_console_name = "ttyO", }; /** @@ -312,6 +314,7 @@ static int ns16550_probe(struct device_d *dev) cdev->putc = ns16550_putc; cdev->getc = ns16550_getc; cdev->setbrg = ns16550_setbaudrate; + cdev->linux_console_name = devtype->linux_console_name; devtype->init_port(cdev); -- cgit v1.2.3