WIP FPC-III support
[linux/fpc-iii.git] / arch / arm / boot / compressed / debug.S
blobfac40a717fcf67b73ad73486971fc7a126ea407f
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #include <linux/linkage.h>
3 #include <asm/assembler.h>
5 #ifndef CONFIG_DEBUG_SEMIHOSTING
7 #include CONFIG_DEBUG_LL_INCLUDE
9 ENTRY(putc)
10         addruart r1, r2, r3
11 #ifdef CONFIG_DEBUG_UART_FLOW_CONTROL
12         waituartcts r3, r1
13 #endif
14         waituarttxrdy r3, r1
15         senduart r0, r1
16         busyuart r3, r1
17         mov      pc, lr
18 ENDPROC(putc)
20 #else
22 ENTRY(putc)
23         adr     r1, 1f
24         ldmia   r1, {r2, r3}
25         add     r2, r2, r1
26         ldr     r1, [r2, r3]
27         strb    r0, [r1]
28         mov     r0, #0x03               @ SYS_WRITEC
29    ARM( svc     #0x123456       )
30 #ifdef CONFIG_CPU_V7M
31  THUMB( bkpt    #0xab           )
32 #else
33  THUMB( svc     #0xab           )
34 #endif
35         mov     pc, lr
36         .align  2
37 1:      .word   _GLOBAL_OFFSET_TABLE_ - .
38         .word   semi_writec_buf(GOT)
39 ENDPROC(putc)
41         .bss
42         .global semi_writec_buf
43         .type   semi_writec_buf, %object
44 semi_writec_buf:
45         .space  4
46         .size   semi_writec_buf, 4
48 #endif