From: Anders Berg <anders.b...@lsi.com> Add static mapping of the UART registers for CONFIG_DEBUG_LL. Also depends on commit 2f409a to fix a bug with LPAE and static mappings.
Signed-off-by: Anders Berg <anders.b...@lsi.com> --- arch/arm/Kconfig.debug | 9 +++++++++ arch/arm/mach-axxia/axxia.c | 13 ++++++++++++ arch/arm/mach-axxia/include/mach/debug-macro.S | 16 ++++----------- arch/arm/mach-axxia/include/mach/hardware.h | 25 +++++++++++++++++++++++- 4 files changed, 50 insertions(+), 13 deletions(-) diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug index 85348a0..762903c 100644 --- a/arch/arm/Kconfig.debug +++ b/arch/arm/Kconfig.debug @@ -89,6 +89,15 @@ choice bool "Kernel low-level debugging on 9263 and 9g45" depends on HAVE_AT91_DBGU1 + config AXXIA_DEBUG_LL_UART0 + bool "Kernel low-level debugging via UART0" + depends on ARCH_AXXIA + help + This enables the low-level debugging via the UART0 + and should be used + with the + AXXIA hardware + config DEBUG_CLPS711X_UART1 bool "Kernel low-level debugging messages via UART1" depends on ARCH_CLPS711X diff --git a/arch/arm/mach-axxia/axxia.c b/arch/arm/mach-axxia/axxia.c index df63dbd..7b725ef 100644 --- a/arch/arm/mach-axxia/axxia.c +++ b/arch/arm/mach-axxia/axxia.c @@ -46,6 +46,7 @@ #include <asm/mach/time.h> #include <asm/hardware/cache-l2x0.h> #include <asm/hardware/gic.h> +#include <mach/hardware.h> #include <mach/timers.h> #include <mach/axxia-gic.h> #include "axxia.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..3a3755b 100644 --- a/arch/arm/mach-axxia/include/mach/debug-macro.S +++ b/arch/arm/mach-axxia/include/mach/debug-macro.S @@ -10,6 +10,8 @@ * published by the Free Software Foundation. */ +#include <mach/hardware.h> + /* * -- NOTE -- * @@ -19,19 +21,9 @@ #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..ce3790f 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_AXXIA_DEBUG_LL_UART0 +#define AXXIA_DEBUG_UART_VIRT 0xf0080000 +#define AXXIA_DEBUG_UART_PHYS AXXIA_UART0_PHYS +#endif + +#endif -- 1.7.9.5 -- _______________________________________________ linux-yocto mailing list linux-yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/linux-yocto