summaryrefslogtreecommitdiff
path: root/arch/arm/cpu/armv8/cpu.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2017-01-10 08:19:21 -0500
committerTom Rini <trini@konsulko.com>2017-01-10 08:19:21 -0500
commit0b8404332ed08799ca0630e4cc868df039f206e3 (patch)
treec5d4e2c1f963b5716ae9dd7024dce5341feb6856 /arch/arm/cpu/armv8/cpu.c
parenta705ebc81b7f91bbd0ef7c634284208342901149 (diff)
parenteb77f5c9f69ef6c8cb39643b7b7107ef7bff5305 (diff)
downloadu-boot-imx-0b8404332ed08799ca0630e4cc868df039f206e3.zip
u-boot-imx-0b8404332ed08799ca0630e4cc868df039f206e3.tar.gz
u-boot-imx-0b8404332ed08799ca0630e4cc868df039f206e3.tar.bz2
Merge branch 'master' of git://git.denx.de/u-boot-sunxi
Diffstat (limited to 'arch/arm/cpu/armv8/cpu.c')
-rw-r--r--arch/arm/cpu/armv8/cpu.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/arm/cpu/armv8/cpu.c b/arch/arm/cpu/armv8/cpu.c
index 5dcb5e2..28a27f7 100644
--- a/arch/arm/cpu/armv8/cpu.c
+++ b/arch/arm/cpu/armv8/cpu.c
@@ -17,6 +17,20 @@
#include <asm/secure.h>
#include <linux/compiler.h>
+/*
+ * sdelay() - simple spin loop.
+ *
+ * Will delay execution by roughly (@loops * 2) cycles.
+ * This is necessary to be used before timers are accessible.
+ *
+ * A value of "0" will results in 2^64 loops.
+ */
+void sdelay(unsigned long loops)
+{
+ __asm__ volatile ("1:\n" "subs %0, %0, #1\n"
+ "b.ne 1b" : "=r" (loops) : "0"(loops) : "cc");
+}
+
int cleanup_before_linux(void)
{
/*