summaryrefslogtreecommitdiff
path: root/include/soc/sprd/debug-macro.S
diff options
context:
space:
mode:
Diffstat (limited to 'include/soc/sprd/debug-macro.S')
-rw-r--r--include/soc/sprd/debug-macro.S42
1 files changed, 42 insertions, 0 deletions
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