From 7130d46972edf135727f2310fa15170fe77cc02a Mon Sep 17 00:00:00 2001 From: Anup Patel Date: Fri, 1 Mar 2013 08:41:47 +0000 Subject: [PATCH] --- yaml --- r: 367239 b: refs/heads/master c: e53f2f4b570d85c7208dfc97de54db1296b88207 h: refs/heads/master i: 367237: 72c6c5c7333120f0e403e8ec71ba38846bd1748d 367235: 706ea13ea0313289fa3108da7188a70a3817de29 367231: 1ead25a46d93cab4ef6b064c9092d957d4777488 v: v3 --- [refs] | 2 +- trunk/arch/arm64/kernel/early_printk.c | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 5d7aa602cc15..197347377476 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 0492f72508184d451101564e235b0c32edf9acd3 +refs/heads/master: e53f2f4b570d85c7208dfc97de54db1296b88207 diff --git a/trunk/arch/arm64/kernel/early_printk.c b/trunk/arch/arm64/kernel/early_printk.c index 0bb7436c57dc..ac974f48a7a2 100644 --- a/trunk/arch/arm64/kernel/early_printk.c +++ b/trunk/arch/arm64/kernel/early_printk.c @@ -24,6 +24,7 @@ #include #include +#include static void __iomem *early_base; static void (*printch)(char ch); @@ -51,6 +52,26 @@ static void smh_printch(char ch) : : "r" (&ch) : "x0", "x1", "memory"); } +/* + * 8250/16550 (8-bit aligned registers) single character TX. + */ +static void uart8250_8bit_printch(char ch) +{ + while (!(readb_relaxed(early_base + UART_LSR) & UART_LSR_THRE)) + ; + writeb_relaxed(ch, early_base + UART_TX); +} + +/* + * 8250/16550 (32-bit aligned registers) single character TX. + */ +static void uart8250_32bit_printch(char ch) +{ + while (!(readl_relaxed(early_base + (UART_LSR << 2)) & UART_LSR_THRE)) + ; + writel_relaxed(ch, early_base + (UART_TX << 2)); +} + struct earlycon_match { const char *name; void (*printch)(char ch); @@ -59,6 +80,8 @@ struct earlycon_match { static const struct earlycon_match earlycon_match[] __initconst = { { .name = "pl011", .printch = pl011_printch, }, { .name = "smh", .printch = smh_printch, }, + { .name = "uart8250-8bit", .printch = uart8250_8bit_printch, }, + { .name = "uart8250-32bit", .printch = uart8250_32bit_printch, }, {} };