]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - arch/arm/cpu/arm926ejs/at91/cpu.c
at91: Add arch_preboot_os which disables PIT in a faster way
[karo-tx-uboot.git] / arch / arm / cpu / arm926ejs / at91 / cpu.c
index 087fe95179ee9f008f361eaa81f909a784a1ddc6..5e30f1dccc41496e47bf71d0c42f7dad7ab6f696 100644 (file)
@@ -27,6 +27,7 @@
 
 #include <asm/arch/hardware.h>
 #include <asm/arch/at91_pmc.h>
+#include <asm/arch/at91_pit.h>
 #include <asm/arch/at91_gpbr.h>
 #include <asm/arch/clk.h>
 #include <asm/arch/io.h>
@@ -40,6 +41,21 @@ int arch_cpu_init(void)
        return at91_clock_init(CONFIG_SYS_AT91_MAIN_CLOCK);
 }
 
+void arch_preboot_os(void)
+{
+       ulong cpiv;
+       at91_pit_t *pit = (at91_pit_t *) AT91_PIT_BASE;
+
+       cpiv = AT91_PIT_MR_PIV_MASK(readl(&pit->piir));
+
+       /*
+        * Disable PITC
+        * Add 0x1000 to current counter to stop it faster
+        * without waiting for wrapping back to 0
+        */
+       writel(cpiv + 0x1000, &pit->mr);
+}
+
 #if defined(CONFIG_DISPLAY_CPUINFO)
 int print_cpuinfo(void)
 {