1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*
3 * Copyright (C) 2014 Alexander Shiyan <shc_work@mail.ru>
4 */
5
6#ifndef CONFIG_DEBUG_CLPS711X_UART2
7#define CLPS711X_UART_PADDR	(0x80000000 + 0x0000)
8#define CLPS711X_UART_VADDR	(0xfeff4000 + 0x0000)
9#else
10#define CLPS711X_UART_PADDR	(0x80000000 + 0x1000)
11#define CLPS711X_UART_VADDR	(0xfeff4000 + 0x1000)
12#endif
13
14#define SYSFLG		(0x0140)
15#define SYSFLG_UBUSY	(1 << 11)
16#define UARTDR		(0x0480)
17
18	.macro	addruart, rp, rv, tmp
19	ldr	\rv, =CLPS711X_UART_VADDR
20	ldr	\rp, =CLPS711X_UART_PADDR
21	.endm
22
23	.macro	waituartcts,rd,rx
24	.endm
25
26	.macro	waituarttxrdy,rd,rx
27	.endm
28
29	.macro	senduart,rd,rx
30	str	\rd, [\rx, #UARTDR]
31	.endm
32
33	.macro	busyuart,rd,rx
341001:	ldr	\rd, [\rx, #SYSFLG]
35	tst	\rd, #SYSFLG_UBUSY
36	bne	1001b
37	.endm
38