linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] serial: 8250_early: Add earlycon for BCM2835 aux uart
@ 2020-01-26 12:33 matthias.bgg
       [not found] ` <20200126131238.c65zj3wo3srafa7z@wunner.de>
  0 siblings, 1 reply; 6+ messages in thread
From: matthias.bgg @ 2020-01-26 12:33 UTC (permalink / raw)
  To: gregkh, jslaby, nsaenzjulienne
  Cc: Matthias Brugger, Scott Branden, Ray Jui, linux-kernel,
	Stephen Boyd, Florian Fainelli, bcm-kernel-feedback-list,
	linux-rpi-kernel, linux-serial, matthias.bgg, linux-arm-kernel

From: Matthias Brugger <mbrugger@suse.com>

Define the OF early console for BCM2835 aux UART, which can be enabled
by passing "earlycon" on the boot command line. This UART is found on
BCM283x and BCM27xx SoCs, a.k.a. Raspberry Pi in its variants.

Signed-off-by: Matthias Brugger <mbrugger@suse.com>

---

 drivers/tty/serial/8250/8250_bcm2835aux.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/drivers/tty/serial/8250/8250_bcm2835aux.c b/drivers/tty/serial/8250/8250_bcm2835aux.c
index 8ce700c1a7fc..6769cea2964a 100644
--- a/drivers/tty/serial/8250/8250_bcm2835aux.c
+++ b/drivers/tty/serial/8250/8250_bcm2835aux.c
@@ -135,6 +135,24 @@ static struct platform_driver bcm2835aux_serial_driver = {
 };
 module_platform_driver(bcm2835aux_serial_driver);
 
+#ifdef CONFIG_SERIAL_8250_CONSOLE
+
+static int __init early_bcm2835aux_setup(struct earlycon_device *device,
+					const char *options)
+{
+	if (!device->port.membase)
+		return -ENODEV;
+
+	device->port.iotype = UPIO_MEM32;
+	device->port.regshift = 2;
+
+	return early_serial8250_setup(device, NULL);
+}
+
+OF_EARLYCON_DECLARE(bcm2835aux, "brcm,bcm2835-aux-uart",
+		    early_bcm2835aux_setup);
+#endif
+
 MODULE_DESCRIPTION("BCM2835 auxiliar UART driver");
 MODULE_AUTHOR("Martin Sperl <kernel@martin.sperl.org>");
 MODULE_LICENSE("GPL v2");
-- 
2.24.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-02-12 15:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20200128141958.vwbxoqglt5gw4xj5@wunner.de>
2020-01-30 16:11 ` [PATCH] serial: 8250_early: Add earlycon for BCM2835 aux uart Nicolas Saenz Julienne
     [not found]   ` <20200131152414.73tgwsfhzgu4apkx@wunner.de>
2020-02-03 19:10     ` Nicolas Saenz Julienne
     [not found]       ` <20200212132834.c63354wynhmrg6hz@wunner.de>
2020-02-12 15:18         ` Matthias Brugger
2020-01-26 12:33 matthias.bgg
     [not found] ` <20200126131238.c65zj3wo3srafa7z@wunner.de>
2020-01-26 20:20   ` Matthias Brugger
2020-01-28 12:42     ` Nicolas Saenz Julienne

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).