xref: /openbmc/linux/arch/arm/include/debug/sti.S (revision 9659281c)
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * arch/arm/include/debug/sti.S
4 *
5 * Debugging macro include header
6 * Copyright (C) 2013 STMicroelectronics (R&D) Limited.
7 */
8
9#define ASC_TX_BUF_OFF  0x04
10#define ASC_CTRL_OFF    0x0c
11#define ASC_STA_OFF     0x14
12
13#define ASC_STA_TX_FULL         (1<<9)
14#define ASC_STA_TX_EMPTY        (1<<1)
15
16
17		.macro	addruart, rp, rv, tmp
18		ldr	\rp,      =CONFIG_DEBUG_UART_PHYS	@ physical base
19		ldr	\rv,      =CONFIG_DEBUG_UART_VIRT	@ virt base
20		.endm
21
22                .macro  senduart,rd,rx
23                strb    \rd, [\rx, #ASC_TX_BUF_OFF]
24                .endm
25
26		.macro	waituartcts,rd,rx
27		.endm
28
29                .macro  waituarttxrdy,rd,rx
301001:           ldr     \rd, [\rx, #ASC_STA_OFF]
31                tst     \rd, #ASC_STA_TX_FULL
32                bne     1001b
33                .endm
34
35                .macro  busyuart,rd,rx
361001:           ldr     \rd, [\rx, #ASC_STA_OFF]
37                tst     \rd, #ASC_STA_TX_EMPTY
38                beq     1001b
39                .endm
40