summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/mach-mpc85xx/include/mach/early_udelay.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/mach-mpc85xx/include/mach/early_udelay.h')
-rw-r--r--arch/powerpc/mach-mpc85xx/include/mach/early_udelay.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/arch/powerpc/mach-mpc85xx/include/mach/early_udelay.h b/arch/powerpc/mach-mpc85xx/include/mach/early_udelay.h
new file mode 100644
index 0000000000..12020dd96d
--- /dev/null
+++ b/arch/powerpc/mach-mpc85xx/include/mach/early_udelay.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2012 GE Intelligent Platforms, Inc.
+ *
+ * Copyright (C) 2009 Matthias Kaehlcke <matthias@kaehlcke.net>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * 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 <common.h>
+
+/* early_udelay: delay execution before timers are initialized
+ *
+ * "usecs * 100" gives a time of around 1 second on a 1Ghz CPU.
+ */
+static inline void early_udelay(unsigned long usecs)
+{
+ uint64_t start;
+ uint32_t loops = usecs * 100;
+
+ start = get_ticks();
+
+ while ((get_ticks() - start) < loops)
+ ;
+}