summaryrefslogtreecommitdiffstats
path: root/board/armltd
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2011-11-09 06:16:37 +0000
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2011-11-10 15:27:22 +0100
commit1dc26801a3ef15ea2d32387c725293ecfcb08efa (patch)
treec93cad728b437675d3e4f06fc8400d7c24022416 /board/armltd
parent0a20e534e9a8a0ef1376e1fe81f426d343fe0ca2 (diff)
downloadblackbird-obmc-uboot-1dc26801a3ef15ea2d32387c725293ecfcb08efa.tar.gz
blackbird-obmc-uboot-1dc26801a3ef15ea2d32387c725293ecfcb08efa.zip
integrator: enable Vpp and disable flash protection
This enables Vpp and disables the flash protection on the Integrator when starting U-Boot. The integrator/AP has double protection mechanisms: this one and the EBI protection bit (patch earlier), the Integrator/CP has only one line of protection in these registers. Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'board/armltd')
-rw-r--r--board/armltd/integrator/integrator.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/board/armltd/integrator/integrator.c b/board/armltd/integrator/integrator.c
index dd83ca5c03..a507c093aa 100644
--- a/board/armltd/integrator/integrator.c
+++ b/board/armltd/integrator/integrator.c
@@ -37,6 +37,7 @@
#include <netdev.h>
#include <asm/io.h>
#include "arm-ebi.h"
+#include "integrator-sc.h"
DECLARE_GLOBAL_DATA_PTR;
@@ -76,7 +77,19 @@ extern void cm_remap(void);
cm_remap(); /* remaps writeable memory to 0x00000000 */
#endif
+#ifdef CONFIG_ARCH_CINTEGRATOR
/*
+ * Flash protection on the Integrator/CP is in a simple register
+ */
+ val = readl(CP_FLASHPROG);
+ val |= (CP_FLASHPROG_FLVPPEN | CP_FLASHPROG_FLWREN);
+ writel(val, CP_FLASHPROG);
+#else
+ /*
+ * The Integrator/AP has some special protection mechanisms
+ * for the external memories, first the External Bus Interface (EBI)
+ * then the system controller (SC).
+ *
* The system comes up with the flash memory non-writable and
* configuration locked. If we want U-Boot to be used for flash
* access we cannot have the flash memory locked.
@@ -88,6 +101,13 @@ extern void cm_remap(void);
writel(val, EBI_BASE + EBI_CSR1_REG);
writel(0, EBI_BASE + EBI_LOCK_REG);
+ /*
+ * Set up the system controller to remove write protection from
+ * the flash memory and enable Vpp
+ */
+ writel(SC_CTRL_FLASHVPP | SC_CTRL_FLASHWP, SC_CTRLS);
+#endif
+
icache_enable ();
return 0;
OpenPOWER on IntegriCloud