[PATCH 10/16] pcm043: Add MMU support

Sascha Hauer s.hauer at pengutronix.de
Wed Dec 9 04:03:35 EST 2009


Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 arch/arm/mach-imx/Kconfig |    1 +
 board/pcm043/pcm043.c     |   26 ++++++++++++++++++++++++++
 2 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index 672e04f..17f2ad1 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -221,6 +221,7 @@ config MACH_FREESCALE_MX35_3STACK
 config MACH_PCM043
         bool "phyCORE-i.MX35"
         select HAS_CFI
+	select HAVE_MMU
         select MACH_HAS_LOWLEVEL_INIT
         help
           Say Y here if you are using Phytec's phyCORE-i.MX35 (pcm043) equipped
diff --git a/board/pcm043/pcm043.c b/board/pcm043/pcm043.c
index 88b4113..cbd910a 100644
--- a/board/pcm043/pcm043.c
+++ b/board/pcm043/pcm043.c
@@ -39,6 +39,7 @@
 #include <mach/imx-nand.h>
 #include <fec.h>
 #include <fb.h>
+#include <asm/mmu.h>
 #include <mach/imx-ipu-fb.h>
 #include <mach/imx-pll.h>
 #include <mach/iomux-mx35.h>
@@ -143,10 +144,35 @@ static struct device_d imx_ipu_fb_dev = {
 	.platform_data	= &ipu_fb_data,
 };
 
+#ifdef CONFIG_MMU
+static void pcm043_mmu_init(void)
+{
+	mmu_init();
+
+	arm_create_section(0x80000000, 0x80000000, 128, PMD_SECT_DEF_CACHED);
+	arm_create_section(0x90000000, 0x80000000, 128, PMD_SECT_DEF_UNCACHED);
+
+	setup_dma_coherent(0x10000000);
+
+#if TEXT_BASE & (0x100000 - 1)
+#warning cannot create vector section. Adjust TEXT_BASE to a 1M boundary
+#else
+	arm_create_section(0x0,        TEXT_BASE,   1, PMD_SECT_DEF_UNCACHED);
+#endif
+	mmu_enable();
+}
+#else
+static void pcm043_mmu_init(void)
+{
+}
+#endif
+
 static int imx35_devices_init(void)
 {
 	uint32_t reg;
 
+	pcm043_mmu_init();
+
 	/* CS0: Nor Flash */
 	writel(0x0000cf03, CSCR_U(0));
 	writel(0x10000d03, CSCR_L(0));
-- 
1.6.5.2





More information about the u-boot-v2 mailing list