rk30: add sram support
author黄涛 <huangtao@rock-chips.com>
Fri, 10 Feb 2012 08:30:54 +0000 (16:30 +0800)
committer黄涛 <huangtao@rock-chips.com>
Fri, 10 Feb 2012 08:41:10 +0000 (16:41 +0800)
arch/arm/kernel/vmlinux.lds.S
arch/arm/mach-rk30/common.c
arch/arm/mach-rk30/include/mach/memory.h
arch/arm/plat-rk/include/plat/sram.h
arch/arm/plat-rk/sram.c

index caed3d42a6db924b51cd079427e8b06ef607606b..29aef560359f99fac49f14987de9cf884a362a13 100644 (file)
@@ -259,7 +259,7 @@ SECTIONS
                __tcm_end = .;
        }
 #endif
-#ifdef CONFIG_ARCH_RK29
+#ifdef CONFIG_PLAT_RK
         /*
         * We align everything to a page boundary so we can
         * free it after init has commenced and SRAM contents have
index 40ae1613fb6bb13b868476ce9b894e8d1aef78e1..1b4d2bcd3e52d280f153818f82ca483e77e613de 100755 (executable)
@@ -6,6 +6,7 @@
 #include <asm/hardware/gic.h>
 #include <asm/mach/arch.h>
 
+#include <plat/sram.h>
 #include <mach/board.h>
 #include <mach/gpio.h>
 #include <mach/iomux.h>
@@ -22,6 +23,7 @@ void __init rk30_map_io(void)
 {
         rk30_map_common_io();
        rk29_setup_early_printk();
+       rk29_sram_init();
        rk30_clock_init();
        rk30_iomux_init();
 }
index 79cd2e017b521712c15b277601765a8ece3091ba..c30244efe8d5949fbb5ca6acd11331906698d12e 100644 (file)
@@ -4,6 +4,14 @@
 /*
  * Physical DRAM offset.
  */
-#define PLAT_PHYS_OFFSET               UL(0x60000000)
+#define PLAT_PHYS_OFFSET       UL(0x60000000)
+
+/*
+ * SRAM memory whereabouts
+ */
+#define SRAM_CODE_OFFSET       0xFEF00100
+#define SRAM_CODE_END          0xFEF02FFF
+#define SRAM_DATA_OFFSET       0xFEF03000
+#define SRAM_DATA_END          0xFEF03FFF
 
 #endif
index 27d403c62e4397ec416565d3edb980f4e68073d0..198780cea592c0796fa9ca4027b92f3e1b643821 100644 (file)
@@ -1,15 +1,7 @@
-/*
- * Copyright (C) 2008-2009 ST-Ericsson AB
- * License terms: GNU General Public License (GPL) version 2
- * TCM memory handling for ARM systems
- *
- * Author: Linus Walleij <linus.walleij@stericsson.com>
- * Author: Rickard Andersson <rickard.andersson@stericsson.com>
- */
-
-#ifndef __ARCH_ARM_MACH_RK29_SRAM_H
-#define __ARCH_ARM_MACH_RK29_SRAM_H
-#ifdef CONFIG_ARCH_RK29
+#ifndef __PLAT_SRAM_H
+#define __PLAT_SRAM_H
+
+#ifdef CONFIG_PLAT_RK
 
 /* Tag variables with this */
 #define __sramdata __section(.sram.data)
@@ -35,6 +27,6 @@ static inline unsigned long ddr_save_sp(unsigned long new_sp)
 #define DDR_SAVE_SP(save_sp)           do { save_sp = ddr_save_sp((SRAM_DATA_END&(~7))); } while (0)
 #define DDR_RESTORE_SP(save_sp)                do { ddr_save_sp(save_sp); } while (0)
 
-#endif
+#endif /* CONFIG_PLAT_RK */
 #endif
 
index c2785926e07b6f4f547f38e7d360291921af9fb1..9a91843f40ea7af9e9fa665d2d1d61c154fa0461 100644 (file)
@@ -14,7 +14,6 @@
 #include <asm/tlbflush.h>
 #include <asm/cacheflush.h>
 #include <mach/memory.h>
-#include <mach/rk29_iomap.h>
 
 
 /* SRAM section definitions from the linker */
@@ -23,7 +22,7 @@ extern char __sram_data_start, __ssram_data, __esram_data;
 
 static struct map_desc sram_code_iomap[] __initdata = {
        {
-               .virtual        = SRAM_CODE_OFFSET,
+               .virtual        = SRAM_CODE_OFFSET & PAGE_MASK,
                .pfn            = __phys_to_pfn(0x0),
                .length         =  1024*1024,
                .type           =  MT_MEMORY