From 7a0a7dc69d9b8cb921ee49b1b3b477e2eff2de3d Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E9=BB=84=E6=B6=9B?= Date: Fri, 10 Feb 2012 16:30:54 +0800 Subject: [PATCH] rk30: add sram support --- arch/arm/kernel/vmlinux.lds.S | 2 +- arch/arm/mach-rk30/common.c | 2 ++ arch/arm/mach-rk30/include/mach/memory.h | 10 +++++++++- arch/arm/plat-rk/include/plat/sram.h | 18 +++++------------- arch/arm/plat-rk/sram.c | 3 +-- 5 files changed, 18 insertions(+), 17 deletions(-) diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S index caed3d42a6db..29aef560359f 100644 --- a/arch/arm/kernel/vmlinux.lds.S +++ b/arch/arm/kernel/vmlinux.lds.S @@ -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 diff --git a/arch/arm/mach-rk30/common.c b/arch/arm/mach-rk30/common.c index 40ae1613fb6b..1b4d2bcd3e52 100755 --- a/arch/arm/mach-rk30/common.c +++ b/arch/arm/mach-rk30/common.c @@ -6,6 +6,7 @@ #include #include +#include #include #include #include @@ -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(); } diff --git a/arch/arm/mach-rk30/include/mach/memory.h b/arch/arm/mach-rk30/include/mach/memory.h index 79cd2e017b52..c30244efe8d5 100644 --- a/arch/arm/mach-rk30/include/mach/memory.h +++ b/arch/arm/mach-rk30/include/mach/memory.h @@ -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 diff --git a/arch/arm/plat-rk/include/plat/sram.h b/arch/arm/plat-rk/include/plat/sram.h index 27d403c62e43..198780cea592 100644 --- a/arch/arm/plat-rk/include/plat/sram.h +++ b/arch/arm/plat-rk/include/plat/sram.h @@ -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 - * Author: Rickard Andersson - */ - -#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 diff --git a/arch/arm/plat-rk/sram.c b/arch/arm/plat-rk/sram.c index c2785926e07b..9a91843f40ea 100644 --- a/arch/arm/plat-rk/sram.c +++ b/arch/arm/plat-rk/sram.c @@ -14,7 +14,6 @@ #include #include #include -#include /* 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 -- 2.34.1