|
28 | 28 | #if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K) || defined(CONFIG_CPU_V7) |
29 | 29 | .macro loadsp, rb, tmp1, tmp2 |
30 | 30 | .endm |
31 | | - .macro writeb, ch, rb |
| 31 | + .macro writeb, ch, rb, tmp |
32 | 32 | mcr p14, 0, \ch, c0, c5, 0 |
33 | 33 | .endm |
34 | 34 | #elif defined(CONFIG_CPU_XSCALE) |
35 | 35 | .macro loadsp, rb, tmp1, tmp2 |
36 | 36 | .endm |
37 | | - .macro writeb, ch, rb |
| 37 | + .macro writeb, ch, rb, tmp |
38 | 38 | mcr p14, 0, \ch, c8, c0, 0 |
39 | 39 | .endm |
40 | 40 | #else |
41 | 41 | .macro loadsp, rb, tmp1, tmp2 |
42 | 42 | .endm |
43 | | - .macro writeb, ch, rb |
| 43 | + .macro writeb, ch, rb, tmp |
44 | 44 | mcr p14, 0, \ch, c1, c0, 0 |
45 | 45 | .endm |
46 | 46 | #endif |
|
49 | 49 |
|
50 | 50 | #include CONFIG_DEBUG_LL_INCLUDE |
51 | 51 |
|
52 | | - .macro writeb, ch, rb |
| 52 | + .macro writeb, ch, rb, tmp |
| 53 | +#ifdef CONFIG_DEBUG_UART_FLOW_CONTROL |
| 54 | + waituartcts \tmp, \rb |
| 55 | +#endif |
| 56 | + waituarttxrdy \tmp, \rb |
53 | 57 | senduart \ch, \rb |
| 58 | + busyuart \tmp, \rb |
54 | 59 | .endm |
55 | 60 |
|
56 | 61 | #if defined(CONFIG_ARCH_SA1100) |
|
81 | 86 | bl phex |
82 | 87 | .endm |
83 | 88 |
|
84 | | - .macro debug_reloc_start |
85 | | -#ifdef DEBUG |
86 | | - kputc #'\n' |
87 | | - kphex r6, 8 /* processor id */ |
88 | | - kputc #':' |
89 | | - kphex r7, 8 /* architecture id */ |
90 | | -#ifdef CONFIG_CPU_CP15 |
91 | | - kputc #':' |
92 | | - mrc p15, 0, r0, c1, c0 |
93 | | - kphex r0, 8 /* control reg */ |
94 | | -#endif |
95 | | - kputc #'\n' |
96 | | - kphex r5, 8 /* decompressed kernel start */ |
97 | | - kputc #'-' |
98 | | - kphex r9, 8 /* decompressed kernel end */ |
99 | | - kputc #'>' |
100 | | - kphex r4, 8 /* kernel execution address */ |
101 | | - kputc #'\n' |
102 | | -#endif |
103 | | - .endm |
104 | | - |
105 | | - .macro debug_reloc_end |
106 | | -#ifdef DEBUG |
107 | | - kphex r5, 8 /* end of kernel */ |
108 | | - kputc #'\n' |
109 | | - mov r0, r4 |
110 | | - bl memdump /* dump 256 bytes at start of kernel */ |
111 | | -#endif |
112 | | - .endm |
113 | | - |
114 | 89 | /* |
115 | 90 | * Debug kernel copy by printing the memory addresses involved |
116 | 91 | */ |
117 | 92 | .macro dbgkc, begin, end, cbegin, cend |
118 | 93 | #ifdef DEBUG |
119 | | - kputc #'\n' |
120 | 94 | kputc #'C' |
121 | 95 | kputc #':' |
122 | 96 | kputc #'0' |
|
136 | 110 | kputc #'x' |
137 | 111 | kphex \cend, 8 /* End of kernel copy */ |
138 | 112 | kputc #'\n' |
139 | | - kputc #'\r' |
| 113 | +#endif |
| 114 | + .endm |
| 115 | + |
| 116 | + /* |
| 117 | + * Debug print of the final appended DTB location |
| 118 | + */ |
| 119 | + .macro dbgadtb, begin, end |
| 120 | +#ifdef DEBUG |
| 121 | + kputc #'D' |
| 122 | + kputc #'T' |
| 123 | + kputc #'B' |
| 124 | + kputc #':' |
| 125 | + kputc #'0' |
| 126 | + kputc #'x' |
| 127 | + kphex \begin, 8 /* Start of appended DTB */ |
| 128 | + kputc #' ' |
| 129 | + kputc #'(' |
| 130 | + kputc #'0' |
| 131 | + kputc #'x' |
| 132 | + kphex \end, 8 /* End of appended DTB */ |
| 133 | + kputc #')' |
| 134 | + kputc #'\n' |
140 | 135 | #endif |
141 | 136 | .endm |
142 | 137 |
|
@@ -303,7 +298,7 @@ restart: adr r0, LC1 |
303 | 298 |
|
304 | 299 | #ifndef CONFIG_ZBOOT_ROM |
305 | 300 | /* malloc space is above the relocated stack (64k max) */ |
306 | | - add r10, sp, #0x10000 |
| 301 | + add r10, sp, #MALLOC_SIZE |
307 | 302 | #else |
308 | 303 | /* |
309 | 304 | * With ZBOOT_ROM the bss/stack is non relocatable, |
@@ -357,6 +352,7 @@ restart: adr r0, LC1 |
357 | 352 | mov r5, r5, ror #8 |
358 | 353 | eor r5, r5, r1, lsr #8 |
359 | 354 | #endif |
| 355 | + dbgadtb r6, r5 |
360 | 356 | /* 50% DTB growth should be good enough */ |
361 | 357 | add r5, r5, r5, lsr #1 |
362 | 358 | /* preserve 64-bit alignment */ |
@@ -614,7 +610,7 @@ not_relocated: mov r0, #0 |
614 | 610 | */ |
615 | 611 | mov r0, r4 |
616 | 612 | mov r1, sp @ malloc space above stack |
617 | | - add r2, sp, #0x10000 @ 64k max |
| 613 | + add r2, sp, #MALLOC_SIZE @ 64k max |
618 | 614 | mov r3, r7 |
619 | 615 | bl decompress_kernel |
620 | 616 |
|
@@ -1356,7 +1352,7 @@ puts: loadsp r3, r2, r1 |
1356 | 1352 | 1: ldrb r2, [r0], #1 |
1357 | 1353 | teq r2, #0 |
1358 | 1354 | moveq pc, lr |
1359 | | -2: writeb r2, r3 |
| 1355 | +2: writeb r2, r3, r1 |
1360 | 1356 | mov r1, #0x00020000 |
1361 | 1357 | 3: subs r1, r1, #1 |
1362 | 1358 | bne 3b |
|
0 commit comments