public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] arm64: add support for uart earlyprintk
@ 2013-02-28 11:01 Anup Patel
  2013-02-28 11:34 ` Marc Zyngier
  2013-02-28 14:03 ` Rob Herring
  0 siblings, 2 replies; 12+ messages in thread
From: Anup Patel @ 2013-02-28 11:01 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Anup Patel <apatel@apm.com>
---
 arch/arm64/kernel/early_printk.c |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/arch/arm64/kernel/early_printk.c b/arch/arm64/kernel/early_printk.c
index 7e320a2..62953ed 100644
--- a/arch/arm64/kernel/early_printk.c
+++ b/arch/arm64/kernel/early_printk.c
@@ -29,6 +29,21 @@ static void __iomem *early_base;
 static void (*printch)(char ch);
 
 /*
+ * UART (8250/16550) single character TX.
+ */
+static void uart_printch(char ch)
+{
+#define UART_LSR 	0x14
+#define UART_TX 	0x0
+
+	while (!(readl_relaxed(early_base + UART_LSR) & 0x20))
+		;
+	writeb_relaxed(ch, early_base + UART_TX);
+	while (!(readl_relaxed(early_base + UART_LSR) & 0x20))
+		;
+}
+
+/*
  * PL011 single character TX.
  */
 static void pl011_printch(char ch)
@@ -47,6 +62,7 @@ struct earlycon_match {
 
 static const struct earlycon_match earlycon_match[] __initconst = {
 	{ .name = "pl011", .printch = pl011_printch, },
+	{ .name = "uart", .printch = uart_printch, },
 	{}
 };
 
-- 
1.7.9.5

CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, 
is for the sole use of the intended recipient(s) and contains information
that is confidential and proprietary to Applied Micro Circuits Corporation or its subsidiaries. 
It is to be used solely for the purpose of furthering the parties' business relationship. 
All unauthorized review, use, disclosure or distribution is prohibited. 
If you are not the intended recipient, please contact the sender by reply e-mail 
and destroy all copies of the original message.

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

end of thread, other threads:[~2013-02-28 16:58 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-28 11:01 [PATCH] arm64: add support for uart earlyprintk Anup Patel
2013-02-28 11:34 ` Marc Zyngier
2013-02-28 12:10   ` Catalin Marinas
2013-02-28 12:52     ` Marc Zyngier
2013-02-28 14:06       ` Anup Patel
2013-02-28 15:31         ` Catalin Marinas
2013-02-28 16:54           ` Anup Patel
2013-02-28 13:56   ` Anup Patel
2013-02-28 14:03 ` Rob Herring
2013-02-28 14:11   ` Anup Patel
2013-02-28 15:02     ` Rob Herring
2013-02-28 16:58       ` Anup Patel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox