summaryrefslogtreecommitdiff
path: root/arch/arm/cpu/armv7/omap-common/hwinit-common.c
diff options
context:
space:
mode:
authorR Sricharan <r.sricharan@ti.com>2013-03-04 20:04:45 +0000
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2013-03-28 09:10:58 +0100
commitde63ac278cbaaa387da3efaf0b21b819c2b0c496 (patch)
tree0fd5fac28bf5733062dee5a14881508569f4d709 /arch/arm/cpu/armv7/omap-common/hwinit-common.c
parent96fdbec2f96c9e11758c8742409069eeef841722 (diff)
downloadu-boot-imx-de63ac278cbaaa387da3efaf0b21b819c2b0c496.zip
u-boot-imx-de63ac278cbaaa387da3efaf0b21b819c2b0c496.tar.gz
u-boot-imx-de63ac278cbaaa387da3efaf0b21b819c2b0c496.tar.bz2
ARM: mmu: Set domain permissions to client access
The 'XN' execute never bit is set in the pagetables. This will prevent speculative prefetches to non executable regions. But the domain permissions are set as master in the DACR register. So the pagetable attribute for 'XN' is not effective. Change the permissions to client. This fixes lot of speculative prefetch aborts seen on OMAP5 secure devices. Signed-off-by: R Sricharan <r.sricharan@ti.com> Tested-by: Vincent Stehle <v-stehle@ti.com> Cc: Vincent Stehle <v-stehle@ti.com> Cc: Tom Rini <trini@ti.com> Cc: Albert ARIBAUD <albert.u.boot@aribaud.net>
Diffstat (limited to 'arch/arm/cpu/armv7/omap-common/hwinit-common.c')
-rw-r--r--arch/arm/cpu/armv7/omap-common/hwinit-common.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/arch/arm/cpu/armv7/omap-common/hwinit-common.c b/arch/arm/cpu/armv7/omap-common/hwinit-common.c
index 05ff2e8..70d16a8 100644
--- a/arch/arm/cpu/armv7/omap-common/hwinit-common.c
+++ b/arch/arm/cpu/armv7/omap-common/hwinit-common.c
@@ -34,6 +34,12 @@
#include <asm/emif.h>
#include <asm/omap_common.h>
#include <linux/compiler.h>
+#include <asm/cache.h>
+#include <asm/system.h>
+
+#define ARMV7_DCACHE_WRITEBACK 0xe
+#define ARMV7_DOMAIN_CLIENT 1
+#define ARMV7_DOMAIN_MASK (0x3 << 0)
DECLARE_GLOBAL_DATA_PTR;
@@ -269,4 +275,33 @@ void enable_caches(void)
/* Enable D-cache. I-cache is already enabled in start.S */
dcache_enable();
}
+
+void dram_bank_mmu_setup(int bank)
+{
+ bd_t *bd = gd->bd;
+ int i;
+
+ u32 start = bd->bi_dram[bank].start >> 20;
+ u32 size = bd->bi_dram[bank].size >> 20;
+ u32 end = start + size;
+
+ debug("%s: bank: %d\n", __func__, bank);
+ for (i = start; i < end; i++)
+ set_section_dcache(i, ARMV7_DCACHE_WRITEBACK);
+
+}
+
+void arm_init_domains(void)
+{
+ u32 reg;
+
+ reg = get_dacr();
+ /*
+ * Set DOMAIN to client access so that all permissions
+ * set in pagetables are validated by the mmu.
+ */
+ reg &= ~ARMV7_DOMAIN_MASK;
+ reg |= ARMV7_DOMAIN_CLIENT;
+ set_dacr(reg);
+}
#endif