arm: use addruart macro to establish debug mappings

Since we can get both physical and virtual addresses from the addruart
macro, we can use this to establish the debug mappings.

In the case of CONFIG_DEBUG_ICEDCC, we don't need any mappings, but
may still need to setup r7 correctly.

Incorporating ASM changes from Nicolas Pitre <npitre@fluxnic.net>.

Signed-off-by: Jeremy Kerr <jeremy.kerr@canonical.com>
Tested-by: Kevin Hilman <khilman@deeprootsystems.com>

authored by Jeremy Kerr and committed by Nicolas Pitre c293393f 0ea12930

+19 -4
+19 -4
arch/arm/kernel/head.S
··· 22 22 #include <asm/thread_info.h> 23 23 #include <asm/system.h> 24 24 25 + #ifdef CONFIG_DEBUG_LL 26 + #include <mach/debug-macro.S> 27 + #endif 28 + 25 29 #if (PHYS_OFFSET & 0x001fffff) 26 30 #error "PHYS_OFFSET must be at an even 2MiB boundary!" 27 31 #endif ··· 208 204 str r6, [r0] 209 205 210 206 #ifdef CONFIG_DEBUG_LL 211 - ldr r7, [r10, #PROCINFO_IO_MMUFLAGS] @ io_mmuflags 207 + #ifndef CONFIG_DEBUG_ICEDCC 212 208 /* 213 209 * Map in IO space for serial debugging. 214 210 * This allows debug messages to be output 215 211 * via a serial console before paging_init. 216 212 */ 217 - ldr r3, [r8, #MACHINFO_PGOFFIO] 213 + addruart r7, r3 214 + 215 + mov r3, r3, lsr #20 216 + mov r3, r3, lsl #2 217 + 218 218 add r0, r4, r3 219 219 rsb r3, r3, #0x4000 @ PTRS_PER_PGD*sizeof(long) 220 220 cmp r3, #0x0800 @ limit to 512MB 221 221 movhi r3, #0x0800 222 222 add r6, r0, r3 223 - ldr r3, [r8, #MACHINFO_PHYSIO] 224 - orr r3, r3, r7 223 + mov r3, r7, lsr #20 224 + ldr r7, [r10, #PROCINFO_IO_MMUFLAGS] @ io_mmuflags 225 + orr r3, r7, r3, lsl #20 225 226 1: str r3, [r0], #4 226 227 add r3, r3, #1 << 20 227 228 teq r0, r6 228 229 bne 1b 230 + 231 + #else /* CONFIG_DEBUG_ICEDCC */ 232 + /* we don't need any serial debugging mappings for ICEDCC */ 233 + ldr r7, [r10, #PROCINFO_IO_MMUFLAGS] @ io_mmuflags 234 + #endif /* !CONFIG_DEBUG_ICEDCC */ 235 + 229 236 #if defined(CONFIG_ARCH_NETWINDER) || defined(CONFIG_ARCH_CATS) 230 237 /* 231 238 * If we're using the NetWinder or CATS, we also need to map