From 8e4bff4cab0ddac6060645b0715210484d02ff40 Mon Sep 17 00:00:00 2001 From: Yuval Adam <_@yuv.al> Date: Wed, 30 Aug 2017 08:25:59 +0000 Subject: Initial file dump from open source release --- include/soc/sprd/debug-macro.S | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 include/soc/sprd/debug-macro.S (limited to 'include/soc/sprd/debug-macro.S') diff --git a/include/soc/sprd/debug-macro.S b/include/soc/sprd/debug-macro.S new file mode 100644 index 00000000..d7394ea9 --- /dev/null +++ b/include/soc/sprd/debug-macro.S @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2012 Spreadtrum Communications Inc. + * + * This software is licensed under the terms of the GNU General Public + * License version 2, as published by the Free Software Foundation, and + * may be copied, distributed, and modified under those terms. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include "hardware.h" + + .macro addruart,rp, rv, tmp + ldr \rp, =LL_DEBUG_UART_PHYS + ldr \rv, =LL_DEBUG_UART_BASE + .endm + + .macro senduart,rd,rx + and \rd,\rd,#0xFF + str \rd, [\rx, #0x00] + .endm + + .macro waituart,rd,rx + @ wait for TX_READY +1: ldr \rd, [\rx, #0x0C] + mov \rd,\rd,lsr #8 + and \rd,\rd,#0xFF + teq \rd, #0x00 + bne 1b + .endm + + .macro busyuart,rd,rx + @ wait for TX_READY +2: ldr \rd, [\rx, #0x0C] + mov \rd,\rd,lsr #8 + and \rd,\rd,#0xFF + teq \rd, #0x00 + bne 2b + .endm -- cgit v1.3.1