]> git.sur5r.net Git - u-boot/commitdiff
hikey: Add MMU tables
authorAlexander Graf <agraf@suse.de>
Fri, 4 Mar 2016 00:09:53 +0000 (01:09 +0100)
committerTom Rini <trini@konsulko.com>
Tue, 15 Mar 2016 19:13:09 +0000 (15:13 -0400)
The hikey runs with dcache disabled today. There really should be no reason
not to use caches on AArch64, so let's add MMU definitions and enable the
dcache.

Signed-off-by: Alexander Graf <agraf@suse.de>
board/hisilicon/hikey/hikey.c
include/configs/hikey.h

index c4ae40bfb4eec974b34491b29f0426ca32dd2610..1edc807bd397055ffdec8e0c0bcb8580d5d918f5 100644 (file)
@@ -19,6 +19,7 @@
 #include <asm/arch/periph.h>
 #include <asm/arch/pinmux.h>
 #include <asm/arch/hi6220.h>
+#include <asm/armv8/mmu.h>
 
 /*TODO drop this table in favour of device tree */
 static const struct hikey_gpio_platdata hi6220_gpio[] = {
@@ -87,6 +88,26 @@ U_BOOT_DEVICE(hikey_seriala) = {
        .platdata = &serial_platdata,
 };
 
+static struct mm_region hikey_mem_map[] = {
+       {
+               .base = 0x0UL,
+               .size = 0x80000000UL,
+               .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
+                        PTE_BLOCK_INNER_SHARE
+       }, {
+               .base = 0x80000000UL,
+               .size = 0x80000000UL,
+               .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
+                        PTE_BLOCK_NON_SHARE |
+                        PTE_BLOCK_PXN | PTE_BLOCK_UXN
+       }, {
+               /* List terminator */
+               0,
+       }
+};
+
+struct mm_region *mem_map = hikey_mem_map;
+
 #ifdef CONFIG_BOARD_EARLY_INIT_F
 int board_uart_init(void)
 {
index 993b8b1b9fb5a59babbafd2e62a2b94d0c2e915d..263c562915a3c0e7e29fce425bf925c0e39819ee 100644 (file)
@@ -21,8 +21,9 @@
 
 #define CONFIG_SUPPORT_RAW_INITRD
 
-/* Cache Definitions */
-#define CONFIG_SYS_DCACHE_OFF
+/* MMU Definitions */
+#define CONFIG_SYS_CACHELINE_SIZE      64
+#define CONFIG_SYS_FULL_VA
 
 #define CONFIG_IDENT_STRING            "hikey"