ARM: CSR: mapping early DEBUG_LL uart
authorBarry Song <bs14@csr.com>
Fri, 8 Jul 2011 09:40:13 +0000 (02:40 -0700)
committerBarry Song <21cnbao@gmail.com>
Fri, 8 Jul 2011 23:20:51 +0000 (07:20 +0800)
Signed-off-by: Barry Song <baohua.song@csr.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
arch/arm/mach-prima2/Makefile
arch/arm/mach-prima2/common.h
arch/arm/mach-prima2/lluart.c [new file with mode: 0644]
arch/arm/mach-prima2/prima2.c

index d44f7ae..f2fba66 100644 (file)
@@ -3,3 +3,4 @@ obj-y += irq.o
 obj-y += clock.o
 obj-y += rstc.o
 obj-y += prima2.o
+obj-$(CONFIG_DEBUG_LL) += lluart.o
index fa4a3b5..83e5d21 100644 (file)
@@ -17,4 +17,10 @@ extern struct sys_timer sirfsoc_timer;
 extern void __init sirfsoc_of_irq_init(void);
 extern void __init sirfsoc_of_clk_init(void);
 
+#ifndef CONFIG_DEBUG_LL
+static inline void sirfsoc_map_lluart(void)  {}
+#else
+extern void __init sirfsoc_map_lluart(void);
+#endif
+
 #endif
diff --git a/arch/arm/mach-prima2/lluart.c b/arch/arm/mach-prima2/lluart.c
new file mode 100644 (file)
index 0000000..a89f9b3
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * Static memory mapping for DEBUG_LL
+ *
+ * Copyright (c) 2011 Cambridge Silicon Radio Limited, a CSR plc group company.
+ *
+ * Licensed under GPLv2 or later.
+ */
+
+#include <linux/kernel.h>
+#include <asm/page.h>
+#include <asm/mach/map.h>
+#include <mach/map.h>
+#include <mach/uart.h>
+
+void __init sirfsoc_map_lluart(void)
+{
+       struct map_desc sirfsoc_lluart_map = {
+               .virtual        = SIRFSOC_UART1_VA_BASE,
+               .pfn            = __phys_to_pfn(SIRFSOC_UART1_PA_BASE),
+               .length         = SIRFSOC_UART1_SIZE,
+               .type           = MT_DEVICE,
+       };
+
+       iotable_init(&sirfsoc_lluart_map, 1);
+}
index c26947d..f57124b 100644 (file)
@@ -33,6 +33,7 @@ MACHINE_START(PRIMA2_EVB, "prima2cb")
        /* Maintainer: Barry Song <baohua.song@csr.com> */
        .boot_params    = 0x00000100,
        .init_early     = sirfsoc_of_clk_init,
+       .map_io         = sirfsoc_map_lluart,
        .init_irq       = sirfsoc_of_irq_init,
        .timer          = &sirfsoc_timer,
        .init_machine   = sirfsoc_mach_init,