Skip to content

Commit c293393

Browse files
Jeremy Kerrnpitre
authored andcommitted
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 <[email protected]>. Signed-off-by: Jeremy Kerr <[email protected]> Tested-by: Kevin Hilman <[email protected]>
1 parent 0ea1293 commit c293393

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

arch/arm/kernel/head.S

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
#include <asm/thread_info.h>
2323
#include <asm/system.h>
2424

25+
#ifdef CONFIG_DEBUG_LL
26+
#include <mach/debug-macro.S>
27+
#endif
28+
2529
#if (PHYS_OFFSET & 0x001fffff)
2630
#error "PHYS_OFFSET must be at an even 2MiB boundary!"
2731
#endif
@@ -204,24 +208,35 @@ __create_page_tables:
204208
str r6, [r0]
205209

206210
#ifdef CONFIG_DEBUG_LL
207-
ldr r7, [r10, #PROCINFO_IO_MMUFLAGS] @ io_mmuflags
211+
#ifndef CONFIG_DEBUG_ICEDCC
208212
/*
209213
* Map in IO space for serial debugging.
210214
* This allows debug messages to be output
211215
* via a serial console before paging_init.
212216
*/
213-
ldr r3, [r8, #MACHINFO_PGOFFIO]
217+
addruart r7, r3
218+
219+
mov r3, r3, lsr #20
220+
mov r3, r3, lsl #2
221+
214222
add r0, r4, r3
215223
rsb r3, r3, #0x4000 @ PTRS_PER_PGD*sizeof(long)
216224
cmp r3, #0x0800 @ limit to 512MB
217225
movhi r3, #0x0800
218226
add r6, r0, r3
219-
ldr r3, [r8, #MACHINFO_PHYSIO]
220-
orr r3, r3, r7
227+
mov r3, r7, lsr #20
228+
ldr r7, [r10, #PROCINFO_IO_MMUFLAGS] @ io_mmuflags
229+
orr r3, r7, r3, lsl #20
221230
1: str r3, [r0], #4
222231
add r3, r3, #1 << 20
223232
teq r0, r6
224233
bne 1b
234+
235+
#else /* CONFIG_DEBUG_ICEDCC */
236+
/* we don't need any serial debugging mappings for ICEDCC */
237+
ldr r7, [r10, #PROCINFO_IO_MMUFLAGS] @ io_mmuflags
238+
#endif /* !CONFIG_DEBUG_ICEDCC */
239+
225240
#if defined(CONFIG_ARCH_NETWINDER) || defined(CONFIG_ARCH_CATS)
226241
/*
227242
* If we're using the NetWinder or CATS, we also need to map

0 commit comments

Comments
 (0)