diff options
Diffstat (limited to 'arch/arm/mach-tegra/delay.S')
-rw-r--r-- | arch/arm/mach-tegra/delay.S | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/delay.S b/arch/arm/mach-tegra/delay.S new file mode 100644 index 00000000000..76bfafa76eb --- /dev/null +++ b/arch/arm/mach-tegra/delay.S | |||
@@ -0,0 +1,52 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-tegra/delay.S | ||
3 | * | ||
4 | * Copyright (C) 2010 Google, Inc. | ||
5 | * | ||
6 | * Author: | ||
7 | * Colin Cross <ccross@google.com> | ||
8 | * | ||
9 | * This software is licensed under the terms of the GNU General Public | ||
10 | * License version 2, as published by the Free Software Foundation, and | ||
11 | * may be copied, distributed, and modified under those terms. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | */ | ||
19 | |||
20 | #include <linux/linkage.h> | ||
21 | #include <asm/assembler.h> | ||
22 | #include <mach/iomap.h> | ||
23 | #include <mach/io.h> | ||
24 | |||
25 | #include "asm_macros.h" | ||
26 | |||
27 | .text | ||
28 | |||
29 | ENTRY(__udelay) | ||
30 | ENTRY(__const_udelay) | ||
31 | mov32 r3, (IO_PPSB_VIRT + TEGRA_TMRUS_BASE - IO_PPSB_PHYS) | ||
32 | ldr r1, [r3] | ||
33 | |||
34 | /* r0 - usecs to wait | ||
35 | * r1 - initial value of the counter | ||
36 | */ | ||
37 | loop: | ||
38 | ldr r2, [r3] | ||
39 | sub r2, r2, r1 | ||
40 | cmp r2, r0 | ||
41 | bls loop | ||
42 | mov pc, lr | ||
43 | ENDPROC(__const_udelay) | ||
44 | ENDPROC(__udelay) | ||
45 | |||
46 | |||
47 | @ Delay routine | ||
48 | ENTRY(__delay) | ||
49 | subs r0, r0, #1 | ||
50 | bhi __delay | ||
51 | mov pc, lr | ||
52 | ENDPROC(__delay) | ||