summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/delay.S
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2010-04-25 00:29:45 -0700
committerDan Willemsen <dwillemsen@nvidia.com>2013-09-14 00:46:52 -0700
commit8523ee721610308700e47e7614715c6dacf4efee (patch)
treed0385a23b33be39dde54814ab2388477f5c0c83a /arch/arm/mach-tegra/delay.S
parentd28c3f9fbd4960fd8f295dadcd4b0ce841aad750 (diff)
[ARM] tegra: Add arch-specific udelay using TMRUS
Change-Id: If075117642a725ee2ee24a622068274e588a5bc1 Signed-off-by: Colin Cross <ccross@android.com> [DW: switch to arm_delay_ops] Signed-off-by: Dan Willemsen <dwillemsen@nvidia.com> Rebase-Id: R61619f9d184d01949aff3e3325d44fb215000867
Diffstat (limited to 'arch/arm/mach-tegra/delay.S')
-rw-r--r--arch/arm/mach-tegra/delay.S50
1 files changed, 50 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/delay.S b/arch/arm/mach-tegra/delay.S
new file mode 100644
index 000000000000..7caa0c9ce3be
--- /dev/null
+++ b/arch/arm/mach-tegra/delay.S
@@ -0,0 +1,50 @@
+/*
+ * arch/arm/mach-tegra/delay.S
+ *
+ * Copyright (C) 2010 Google, Inc.
+ *
+ * Author:
+ * Colin Cross <ccross@google.com>
+ *
+ * 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 <linux/linkage.h>
+#include <asm/assembler.h>
+
+#include "iomap.h"
+
+ .text
+
+ENTRY(__tegra_udelay)
+ENTRY(__tegra_const_udelay)
+ ldr r3, =(IO_PPSB_VIRT + TEGRA_TMRUS_BASE - IO_PPSB_PHYS)
+ ldr r1, [r3]
+
+/* r0 - usecs to wait
+ * r1 - initial value of the counter
+ */
+loop:
+ ldr r2, [r3]
+ sub r2, r2, r1
+ cmp r2, r0
+ bls loop
+ mov pc, lr
+ENDPROC(__tegra_const_udelay)
+ENDPROC(__tegra_udelay)
+
+
+@ Delay routine
+ENTRY(__tegra_delay)
+ subs r0, r0, #1
+ bhi __tegra_delay
+ mov pc, lr
+ENDPROC(__tegra_delay)