[linux-yocto] [PATCH 11/15] axxia: Fixed earlyprintk
Charlie Paul
cpaul.windriver at gmail.com
Mon Jan 20 09:56:18 PST 2014
From: Anders Berg <anders.berg at lsi.com>
Add static mapping of the UART registers for CONFIG_DEBUG_LL. Also depends on
commit 8f704b6 to fix a bug with LPAE and static mappings.
Signed-off-by: Anders Berg <anders.berg at lsi.com>
---
arch/arm/Kconfig.debug | 4 ++++
arch/arm/mach-axxia/axxia.c | 13 ++++++++++++
arch/arm/mach-axxia/include/mach/debug-macro.S | 24 ++++-------------------
arch/arm/mach-axxia/include/mach/hardware.h | 25 +++++++++++++++++++++++-
4 files changed, 45 insertions(+), 21 deletions(-)
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index 1d41908..2fcac9f5f 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -89,6 +89,10 @@ choice
bool "Kernel low-level debugging on 9263 and 9g45"
depends on HAVE_AT91_DBGU1
+ config DEBUG_LL_AXXIA_UART0
+ bool "Kernel low-level debugging via UART0"
+ depends on ARCH_AXXIA
+
config DEBUG_BCM2835
bool "Kernel low-level debugging on BCM2835 PL011 UART"
depends on ARCH_BCM2835
diff --git a/arch/arm/mach-axxia/axxia.c b/arch/arm/mach-axxia/axxia.c
index 9646672..55549fa 100644
--- a/arch/arm/mach-axxia/axxia.c
+++ b/arch/arm/mach-axxia/axxia.c
@@ -46,6 +46,7 @@
#include <asm/mach/map.h>
#include <asm/mach/time.h>
#include <asm/hardware/cache-l2x0.h>
+#include <mach/hardware.h>
#include <mach/timers.h>
#include <mach/axxia-gic.h>
#include <linux/irqchip/arm-gic.h>
@@ -62,8 +63,20 @@ static const char *axxia_dt_match[] __initconst = {
static void __iomem *ssp_base;
+static struct map_desc axxia_static_mappings[] __initdata = {
+#ifdef CONFIG_DEBUG_LL
+ {
+ .virtual = AXXIA_DEBUG_UART_VIRT,
+ .pfn = __phys_to_pfn(AXXIA_DEBUG_UART_PHYS),
+ .length = SZ_4K,
+ .type = MT_DEVICE
+ },
+#endif
+};
+
void __init axxia_dt_map_io(void)
{
+ iotable_init(axxia_static_mappings, ARRAY_SIZE(axxia_static_mappings));
}
void __init axxia_dt_init_early(void)
diff --git a/arch/arm/mach-axxia/include/mach/debug-macro.S b/arch/arm/mach-axxia/include/mach/debug-macro.S
index 83d6670..1a28f4a 100644
--- a/arch/arm/mach-axxia/include/mach/debug-macro.S
+++ b/arch/arm/mach-axxia/include/mach/debug-macro.S
@@ -1,37 +1,21 @@
-/* arch/arm/mach-realview/include/mach/debug-macro.S
+/* arch/arm/mach-axxia/include/mach/debug-macro.S
*
* Debugging macro include header
*
- * Copyright (C) 1994-1999 Russell King
- * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
-/*
- * -- NOTE --
- *
-*/
+#include <mach/hardware.h>
#if !defined(CONFIG_ARM_LPAE)
#error "Axxia Peripherals Are Only Accessible Using the LPAE!"
#endif
-#define UART0_PHYSICAL_ADDRESS 0x0000002010080000ULL
-#define UART1_PHYSICAL_ADDRESS 0x0000002010081000ULL
-#define UART2_PHYSICAL_ADDRESS 0x0000002010082000ULL
-#define UART3_PHYSICAL_ADDRESS 0x0000002010083000ULL
-
-#define UART0_VIRTUAL_ADDRESS 0xf0080000
-#define UART1_VIRTUAL_ADDRESS 0xf0081000
-#define UART2_VIRTUAL_ADDRESS 0xf0082000
-#define UART3_VIRTUAL_ADDRESS 0xf0083000
-
.macro addruart, rp, rv, tmp
- ldr \rp, =0x10080000
- ldr \rv, =0xf0080000
+ ldr \rp, =(AXXIA_DEBUG_UART_PHYS & 0xffffffff)
+ ldr \rv, =AXXIA_DEBUG_UART_VIRT
.endm
#include <asm/hardware/debug-pl01x.S>
diff --git a/arch/arm/mach-axxia/include/mach/hardware.h b/arch/arm/mach-axxia/include/mach/hardware.h
index 40a8c17..2f3686e 100644
--- a/arch/arm/mach-axxia/include/mach/hardware.h
+++ b/arch/arm/mach-axxia/include/mach/hardware.h
@@ -1 +1,24 @@
-/* empty */
+/*
+ * arch/arm/mach-axxia/include/mach/hardware.h
+ *
+ * Copyright (c) 2013 LSI Corporation
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ */
+#ifndef __MACH_HARDWARE_H
+#define __MACH_HARDWARE_H
+
+#define AXXIA_UART0_PHYS 0x2010080000
+#define AXXIA_UART1_PHYS 0x2010081000
+#define AXXIA_UART2_PHYS 0x2010082000
+#define AXXIA_UART3_PHYS 0x2010083000
+
+#ifdef CONFIG_DEBUG_LL_AXXIA_UART0
+#define AXXIA_DEBUG_UART_VIRT 0xf0080000
+#define AXXIA_DEBUG_UART_PHYS AXXIA_UART0_PHYS
+#endif
+
+#endif
--
1.7.9.5
More information about the linux-yocto
mailing list