xref: /openbmc/linux/arch/arm/boot/compressed/debug.S (revision 4df24fef)
1b2441318SGreg Kroah-Hartman/* SPDX-License-Identifier: GPL-2.0 */
23b4af9bcSShawn Guo#include <linux/linkage.h>
33b4af9bcSShawn Guo#include <asm/assembler.h>
43b4af9bcSShawn Guo
527523679SNicolas Pitre#ifndef CONFIG_DEBUG_SEMIHOSTING
627523679SNicolas Pitre
73b4af9bcSShawn Guo#include CONFIG_DEBUG_LL_INCLUDE
83b4af9bcSShawn Guo
93b4af9bcSShawn GuoENTRY(putc)
103b4af9bcSShawn Guo	addruart r1, r2, r3
114df24fefSLinus Walleij#ifdef CONFIG_DEBUG_UART_FLOW_CONTROL
122c50a570SLinus Walleij	waituartcts r3, r1
134df24fefSLinus Walleij#endif
142c50a570SLinus Walleij	waituarttxrdy r3, r1
153b4af9bcSShawn Guo	senduart r0, r1
163b4af9bcSShawn Guo	busyuart r3, r1
173b4af9bcSShawn Guo	mov	 pc, lr
183b4af9bcSShawn GuoENDPROC(putc)
1927523679SNicolas Pitre
2027523679SNicolas Pitre#else
2127523679SNicolas Pitre
2227523679SNicolas PitreENTRY(putc)
2327523679SNicolas Pitre	adr	r1, 1f
2427523679SNicolas Pitre	ldmia	r1, {r2, r3}
2527523679SNicolas Pitre	add	r2, r2, r1
2627523679SNicolas Pitre	ldr	r1, [r2, r3]
2727523679SNicolas Pitre	strb	r0, [r1]
2827523679SNicolas Pitre	mov	r0, #0x03		@ SYS_WRITEC
2927523679SNicolas Pitre   ARM(	svc	#0x123456	)
30ee3eaee6SNicolas Pitre#ifdef CONFIG_CPU_V7M
31ee3eaee6SNicolas Pitre THUMB(	bkpt	#0xab		)
32ee3eaee6SNicolas Pitre#else
3327523679SNicolas Pitre THUMB(	svc	#0xab		)
34ee3eaee6SNicolas Pitre#endif
3527523679SNicolas Pitre	mov	pc, lr
3627523679SNicolas Pitre	.align	2
3727523679SNicolas Pitre1:	.word	_GLOBAL_OFFSET_TABLE_ - .
3827523679SNicolas Pitre	.word	semi_writec_buf(GOT)
3927523679SNicolas PitreENDPROC(putc)
4027523679SNicolas Pitre
4127523679SNicolas Pitre	.bss
4227523679SNicolas Pitre	.global	semi_writec_buf
4327523679SNicolas Pitre	.type   semi_writec_buf, %object
4427523679SNicolas Pitresemi_writec_buf:
4527523679SNicolas Pitre	.space	4
4627523679SNicolas Pitre	.size	semi_writec_buf, 4
4727523679SNicolas Pitre
4827523679SNicolas Pitre#endif
49