[PATCH] ARM: 2745/1: Fix IXP4xx debug macros

Patch from Deepak Saxena

Current IXP4xx debug macros do not work in the small window between
the MMU being enabled and the call to map_io() b/c the standard
peripheral mapping is not properly setup for use with the low-level
debug code. This patch creates a new section-aligned mapping for the
UART specifically for use with the debug macros.

Signed-off-by: Deepak Saxena
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

authored by Deepak Saxena and committed by Russell King 5932ae3f c4982887

+19
+8
arch/arm/mach-ixp4xx/common.c
··· 141 .physical = IXP4XX_PCI_CFG_BASE_PHYS, 142 .length = IXP4XX_PCI_CFG_REGION_SIZE, 143 .type = MT_DEVICE 144 } 145 }; 146 147 void __init ixp4xx_map_io(void)
··· 141 .physical = IXP4XX_PCI_CFG_BASE_PHYS, 142 .length = IXP4XX_PCI_CFG_REGION_SIZE, 143 .type = MT_DEVICE 144 + }, 145 + #ifdef CONFIG_DEBUG_LL 146 + { /* Debug UART mapping */ 147 + .virtual = IXP4XX_DEBUG_UART_BASE_VIRT, 148 + .physical = IXP4XX_DEBUG_UART_BASE_PHYS, 149 + .length = IXP4XX_DEBUG_UART_REGION_SIZE, 150 + .type = MT_DEVICE 151 } 152 + #endif 153 }; 154 155 void __init ixp4xx_map_io(void)
+1
include/asm-arm/arch-ixp4xx/debug-macro.S
··· 14 mrc p15, 0, \rx, c1, c0 15 tst \rx, #1 @ MMU enabled? 16 moveq \rx, #0xc8000000 17 movne \rx, #0xff000000 18 add \rx,\rx,#3 @ Uart regs are at off set of 3 if 19 @ byte writes used - Big Endian.
··· 14 mrc p15, 0, \rx, c1, c0 15 tst \rx, #1 @ MMU enabled? 16 moveq \rx, #0xc8000000 17 + orrne \rx, \rx, #0x00b00000 18 movne \rx, #0xff000000 19 add \rx,\rx,#3 @ Uart regs are at off set of 3 if 20 @ byte writes used - Big Endian.
+10
include/asm-arm/arch-ixp4xx/ixp4xx-regs.h
··· 69 #define IXP4XX_PERIPHERAL_BASE_VIRT (0xFFBF2000) 70 #define IXP4XX_PERIPHERAL_REGION_SIZE (0x0000C000) 71 72 #define IXP4XX_EXP_CS0_OFFSET 0x00 73 #define IXP4XX_EXP_CS1_OFFSET 0x04 74 #define IXP4XX_EXP_CS2_OFFSET 0x08
··· 69 #define IXP4XX_PERIPHERAL_BASE_VIRT (0xFFBF2000) 70 #define IXP4XX_PERIPHERAL_REGION_SIZE (0x0000C000) 71 72 + /* 73 + * Debug UART 74 + * 75 + * This is basically a remap of UART1 into a region that is section 76 + * aligned so that it * can be used with the low-level debug code. 77 + */ 78 + #define IXP4XX_DEBUG_UART_BASE_PHYS (0xC8000000) 79 + #define IXP4XX_DEBUG_UART_BASE_VIRT (0xffb00000) 80 + #define IXP4XX_DEBUG_UART_REGION_SIZE (0x00001000) 81 + 82 #define IXP4XX_EXP_CS0_OFFSET 0x00 83 #define IXP4XX_EXP_CS1_OFFSET 0x04 84 #define IXP4XX_EXP_CS2_OFFSET 0x08