Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 367239
b: refs/heads/master
c: e53f2f4
h: refs/heads/master
i:
  367237: 72c6c5c
  367235: 706ea13
  367231: 1ead25a
v: v3
  • Loading branch information
Anup Patel authored and Catalin Marinas committed Mar 20, 2013
1 parent 98cddf1 commit 7130d46
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0492f72508184d451101564e235b0c32edf9acd3
refs/heads/master: e53f2f4b570d85c7208dfc97de54db1296b88207
23 changes: 23 additions & 0 deletions trunk/arch/arm64/kernel/early_printk.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <linux/io.h>

#include <linux/amba/serial.h>
#include <linux/serial_reg.h>

static void __iomem *early_base;
static void (*printch)(char ch);
Expand Down Expand Up @@ -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);
Expand All @@ -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, },
{}
};

Expand Down

0 comments on commit 7130d46

Please sign in to comment.