summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Stein <alexander.stein@systec-electronic.com>2010-09-13 08:26:39 +0200
committerReinhard Meyer <u-boot@emk-elektronik.de>2010-10-05 16:58:57 +0200
commitc8f6d84d10d324e0b0462e09629f210b046e1018 (patch)
tree7bc6edf5e06a0cdc0049eb29f1b104ad8df35532
parent125637c57265de980bd0d8e7d35f4b9c3d5264e1 (diff)
downloadtalos-obmc-uboot-c8f6d84d10d324e0b0462e09629f210b046e1018.tar.gz
talos-obmc-uboot-c8f6d84d10d324e0b0462e09629f210b046e1018.zip
at91: Add arch_preboot_os which disables PIT in a faster way
When disabled the PIT runs until it reaches the CPIV value. The Linux PIT driver stops the PIT and waits until it stopped. This can take over 100ms. Simply stopping in u-boot isn't sufficient as the PIT will still be running when Linux is waiting until it stopped. So, we stop it in u-boot by setting the compare value to a value slightly greater than the current running counter to make the PIT stopped in short time. Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
-rw-r--r--arch/arm/cpu/arm926ejs/at91/cpu.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/arm/cpu/arm926ejs/at91/cpu.c b/arch/arm/cpu/arm926ejs/at91/cpu.c
index 087fe95179..5e30f1dccc 100644
--- a/arch/arm/cpu/arm926ejs/at91/cpu.c
+++ b/arch/arm/cpu/arm926ejs/at91/cpu.c
@@ -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)
{
OpenPOWER on IntegriCloud