xref: /linux/arch/arm/include/debug/sti.S (revision d0034a7a4ac7fae708146ac0059b9c47a1543f0d)
1d2912cb1SThomas Gleixner/* SPDX-License-Identifier: GPL-2.0-only */
25026aecfSSrinivas Kandagatla/*
35026aecfSSrinivas Kandagatla * arch/arm/include/debug/sti.S
45026aecfSSrinivas Kandagatla *
55026aecfSSrinivas Kandagatla * Debugging macro include header
65026aecfSSrinivas Kandagatla * Copyright (C) 2013 STMicroelectronics (R&D) Limited.
75026aecfSSrinivas Kandagatla */
85026aecfSSrinivas Kandagatla
95026aecfSSrinivas Kandagatla#define ASC_TX_BUF_OFF  0x04
105026aecfSSrinivas Kandagatla#define ASC_CTRL_OFF    0x0c
115026aecfSSrinivas Kandagatla#define ASC_STA_OFF     0x14
125026aecfSSrinivas Kandagatla
135026aecfSSrinivas Kandagatla#define ASC_STA_TX_FULL         (1<<9)
145026aecfSSrinivas Kandagatla#define ASC_STA_TX_EMPTY        (1<<1)
155026aecfSSrinivas Kandagatla
165026aecfSSrinivas Kandagatla
175026aecfSSrinivas Kandagatla		.macro	addruart, rp, rv, tmp
18*9ca4efecSAlain VOLMAT		ldr	\rp,      =CONFIG_DEBUG_UART_PHYS	@ physical base
19*9ca4efecSAlain VOLMAT		ldr	\rv,      =CONFIG_DEBUG_UART_VIRT	@ virt base
205026aecfSSrinivas Kandagatla		.endm
215026aecfSSrinivas Kandagatla
225026aecfSSrinivas Kandagatla                .macro  senduart,rd,rx
235026aecfSSrinivas Kandagatla                strb    \rd, [\rx, #ASC_TX_BUF_OFF]
245026aecfSSrinivas Kandagatla                .endm
255026aecfSSrinivas Kandagatla
262c50a570SLinus Walleij		.macro	waituartcts,rd,rx
272c50a570SLinus Walleij		.endm
282c50a570SLinus Walleij
292c50a570SLinus Walleij                .macro  waituarttxrdy,rd,rx
305026aecfSSrinivas Kandagatla1001:           ldr     \rd, [\rx, #ASC_STA_OFF]
315026aecfSSrinivas Kandagatla                tst     \rd, #ASC_STA_TX_FULL
325026aecfSSrinivas Kandagatla                bne     1001b
335026aecfSSrinivas Kandagatla                .endm
345026aecfSSrinivas Kandagatla
355026aecfSSrinivas Kandagatla                .macro  busyuart,rd,rx
365026aecfSSrinivas Kandagatla1001:           ldr     \rd, [\rx, #ASC_STA_OFF]
375026aecfSSrinivas Kandagatla                tst     \rd, #ASC_STA_TX_EMPTY
385026aecfSSrinivas Kandagatla                beq     1001b
395026aecfSSrinivas Kandagatla                .endm
40