aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm64/kernel
diff options
context:
space:
mode:
authorMarc Zyngier <Marc.Zyngier@arm.com>2013-02-27 13:06:00 -0500
committerCatalin Marinas <catalin.marinas@arm.com>2013-03-20 12:46:42 -0400
commit0492f72508184d451101564e235b0c32edf9acd3 (patch)
treeb14e17c7985fdf92bfb31092fa2c28cbcde8d20a /arch/arm64/kernel
parentd9c1951f400942bbdb41e75a73d151e4a9d5469e (diff)
arm64: early_printk: add support for FastModel console output
Enable early_printk to use the FastModel semihosting to output the early kernel messages. Works both for host and guest kernels. To use this feature, pass "early_printk=smh" to the kernel. Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm64/kernel')
-rw-r--r--arch/arm64/kernel/early_printk.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/arm64/kernel/early_printk.c b/arch/arm64/kernel/early_printk.c
index 7e320a2edb9b..0bb7436c57dc 100644
--- a/arch/arm64/kernel/early_printk.c
+++ b/arch/arm64/kernel/early_printk.c
@@ -40,6 +40,17 @@ static void pl011_printch(char ch)
40 ; 40 ;
41} 41}
42 42
43/*
44 * Semihosting-based debug console
45 */
46static void smh_printch(char ch)
47{
48 asm volatile("mov x1, %0\n"
49 "mov x0, #3\n"
50 "hlt 0xf000\n"
51 : : "r" (&ch) : "x0", "x1", "memory");
52}
53
43struct earlycon_match { 54struct earlycon_match {
44 const char *name; 55 const char *name;
45 void (*printch)(char ch); 56 void (*printch)(char ch);
@@ -47,6 +58,7 @@ struct earlycon_match {
47 58
48static const struct earlycon_match earlycon_match[] __initconst = { 59static const struct earlycon_match earlycon_match[] __initconst = {
49 { .name = "pl011", .printch = pl011_printch, }, 60 { .name = "pl011", .printch = pl011_printch, },
61 { .name = "smh", .printch = smh_printch, },
50 {} 62 {}
51}; 63};
52 64