change source file mode to 0644 instead of 0755
[profile/mobile/platform/kernel/u-boot-tm1.git] / arch / arm / cpu / armv7 / sc8810 / debug-macro.S
1 /* linux/arch/arm/mach-sc8800g/include/mach/debug-macro.S
2  *
3  * Copyright (C) 2010 Spreadtrum
4  *
5  * This software is licensed under the terms of the GNU General Public
6  * License version 2, as published by the Free Software Foundation, and
7  * may be copied, distributed, and modified under those terms.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  */
15
16 #include <asm/arch/sc8810_reg_base.h>
17
18 .globl addruart
19 addruart:
20         @ see if the MMU is enabled and select appropriate base address
21         mrc     p15, 0, r3, c1, c0
22         tst     r3, #1
23         @ldreq  \rx, =SPRD_SERIAL1_PHYS
24         ldrne   r3, =ARM_UART1_BASE
25         mov pc,lr
26
27 .globl senduart 
28 senduart:
29         and     r1,r1,#0xFF
30         str     r1, [r3, #0x00]
31         mov pc,lr
32
33 .globl waituart 
34 waituart:
35         @ wait for TX_READY
36 1:      ldr     r2, [r3, #0x0C]
37         mov     r2,r2,lsr #8
38         and     r2,r2,#0xFF
39         teq     r2, #0x00
40         bne     1b
41         mov pc,lr       
42
43 .globl busyuart 
44 busyuart:
45         @ wait for TX_READY
46 2:      ldr     r2, [r3, #0x0C]
47         mov     r2,r2,lsr #8
48         and     r2,r2,#0xFF
49         teq     r2, #0x00
50         bne     2b
51         mov pc,lr