summaryrefslogtreecommitdiff
path: root/board/freescale/mx53_evk
diff options
context:
space:
mode:
authorTerry Lv <r65388@freescale.com>2010-03-18 18:43:28 +0800
committerTerry Lv <r65388@freescale.com>2010-03-19 11:16:53 +0800
commit8df54067b614e6debb4a4c4a89dd108c70b42e71 (patch)
treea7c5823b8b80081c2a8bb28192e3a765c6db8b32 /board/freescale/mx53_evk
parent762d994929deb79569986bda8e4d7b56e06d14f0 (diff)
downloadu-boot-imx-8df54067b614e6debb4a4c4a89dd108c70b42e71.zip
u-boot-imx-8df54067b614e6debb4a4c4a89dd108c70b42e71.tar.gz
u-boot-imx-8df54067b614e6debb4a4c4a89dd108c70b42e71.tar.bz2
ENGR00121731: Add mmu, l1cache, l2cache support for mx53
Add mmu, l1cache, l2cache support for mx53. Signed-off-by: Terry Lv <r65388@freescale.com>
Diffstat (limited to 'board/freescale/mx53_evk')
-rw-r--r--board/freescale/mx53_evk/mx53_evk.c74
1 files changed, 74 insertions, 0 deletions
diff --git a/board/freescale/mx53_evk/mx53_evk.c b/board/freescale/mx53_evk/mx53_evk.c
index 1acfcc8..fd8587e 100644
--- a/board/freescale/mx53_evk/mx53_evk.c
+++ b/board/freescale/mx53_evk/mx53_evk.c
@@ -39,6 +39,11 @@
#include <fsl_esdhc.h>
#endif
+#ifdef CONFIG_ARCH_MMU
+#include <asm/mmu.h>
+#include <asm/arch/mmu.h>
+#endif
+
DECLARE_GLOBAL_DATA_PTR;
static u32 system_rev;
@@ -93,6 +98,75 @@ inline int is_soc_rev(int rev)
return (system_rev & 0xFF) - rev;
}
+#ifdef CONFIG_ARCH_MMU
+void board_mmu_init(void)
+{
+ unsigned long ttb_base = PHYS_SDRAM_1 + 0x4000;
+ unsigned long i;
+
+ /*
+ * Set the TTB register
+ */
+ asm volatile ("mcr p15,0,%0,c2,c0,0" : : "r"(ttb_base) /*:*/);
+
+ /*
+ * Set the Domain Access Control Register
+ */
+ i = ARM_ACCESS_DACR_DEFAULT;
+ asm volatile ("mcr p15,0,%0,c3,c0,0" : : "r"(i) /*:*/);
+
+ /*
+ * First clear all TT entries - ie Set them to Faulting
+ */
+ memset((void *)ttb_base, 0, ARM_FIRST_LEVEL_PAGE_TABLE_SIZE);
+ /* Actual Virtual Size Attributes Function */
+ /* Base Base MB cached? buffered? access permissions */
+ /* xxx00000 xxx00000 */
+ X_ARM_MMU_SECTION(0x000, 0x000, 0x10,
+ ARM_UNCACHEABLE, ARM_UNBUFFERABLE,
+ ARM_ACCESS_PERM_RW_RW); /* ROM, 16M */
+ X_ARM_MMU_SECTION(0x070, 0x070, 0x010,
+ ARM_UNCACHEABLE, ARM_UNBUFFERABLE,
+ ARM_ACCESS_PERM_RW_RW); /* IRAM */
+ X_ARM_MMU_SECTION(0x100, 0x100, 0x040,
+ ARM_UNCACHEABLE, ARM_UNBUFFERABLE,
+ ARM_ACCESS_PERM_RW_RW); /* SATA */
+ X_ARM_MMU_SECTION(0x180, 0x180, 0x100,
+ ARM_UNCACHEABLE, ARM_UNBUFFERABLE,
+ ARM_ACCESS_PERM_RW_RW); /* IPUv3M */
+ X_ARM_MMU_SECTION(0x200, 0x200, 0x200,
+ ARM_UNCACHEABLE, ARM_UNBUFFERABLE,
+ ARM_ACCESS_PERM_RW_RW); /* GPU */
+ X_ARM_MMU_SECTION(0x400, 0x400, 0x300,
+ ARM_UNCACHEABLE, ARM_UNBUFFERABLE,
+ ARM_ACCESS_PERM_RW_RW); /* periperals */
+ X_ARM_MMU_SECTION(0x700, 0x700, 0x400,
+ ARM_CACHEABLE, ARM_BUFFERABLE,
+ ARM_ACCESS_PERM_RW_RW); /* CSD0 1G */
+ X_ARM_MMU_SECTION(0x700, 0xB00, 0x400,
+ ARM_UNCACHEABLE, ARM_UNBUFFERABLE,
+ ARM_ACCESS_PERM_RW_RW); /* CSD0 1G */
+ X_ARM_MMU_SECTION(0xF00, 0xF00, 0x100,
+ ARM_UNCACHEABLE, ARM_UNBUFFERABLE,
+ ARM_ACCESS_PERM_RW_RW); /* CS1 EIM control*/
+ X_ARM_MMU_SECTION(0xF7F, 0xF7F, 0x040,
+ ARM_UNCACHEABLE, ARM_UNBUFFERABLE,
+ ARM_ACCESS_PERM_RW_RW); /* NAND Flash buffer */
+ X_ARM_MMU_SECTION(0xF80, 0xF80, 0x001,
+ ARM_UNCACHEABLE, ARM_UNBUFFERABLE,
+ ARM_ACCESS_PERM_RW_RW); /* iRam */
+
+ /* Workaround for arm errata #709718 */
+ /* Setup PRRR so device is always mapped to non-shared */
+ asm volatile ("mrc p15, 0, %0, c10, c2, 0" : "=r"(i) : /*:*/);
+ i &= (~(3 << 0x10));
+ asm volatile ("mcr p15, 0, %0, c10, c2, 0" : : "r"(i) /*:*/);
+
+ /* Enable MMU */
+ MMU_ON();
+}
+#endif
+
int dram_init(void)
{
gd->bd->bi_dram[0].start = PHYS_SDRAM_1;