From fc30b5923e3eae1d7aa793107b311452cf26a3e7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E9=BB=84=E6=B6=9B?= Date: Fri, 10 Feb 2012 16:27:40 +0800 Subject: [PATCH] rk: move sram.c from mach-rk29 to plat-rk --- arch/arm/mach-rk29/Makefile | 2 +- arch/arm/mach-rk29/include/mach/sram.h | 41 +------------------------- arch/arm/plat-rk/Makefile | 1 + arch/arm/plat-rk/include/plat/sram.h | 40 +++++++++++++++++++++++++ arch/arm/{mach-rk29 => plat-rk}/sram.c | 0 5 files changed, 43 insertions(+), 41 deletions(-) create mode 100644 arch/arm/plat-rk/include/plat/sram.h rename arch/arm/{mach-rk29 => plat-rk}/sram.c (100%) diff --git a/arch/arm/mach-rk29/Makefile b/arch/arm/mach-rk29/Makefile index 7385fe3cd186..79f18f3c6968 100644 --- a/arch/arm/mach-rk29/Makefile +++ b/arch/arm/mach-rk29/Makefile @@ -1,4 +1,4 @@ -obj-y += timer.o io.o devices.o iomux.o clock.o rk29-pl330.o dma.o ddr.o sram.o memcpy_dma.o reset.o +obj-y += timer.o io.o devices.o iomux.o clock.o rk29-pl330.o dma.o ddr.o memcpy_dma.o reset.o obj-y += tests.o memtester.o obj-y += early_printk.o ifndef CONFIG_DEBUG_LL diff --git a/arch/arm/mach-rk29/include/mach/sram.h b/arch/arm/mach-rk29/include/mach/sram.h index 27d403c62e43..8fcb97883798 100644 --- a/arch/arm/mach-rk29/include/mach/sram.h +++ b/arch/arm/mach-rk29/include/mach/sram.h @@ -1,40 +1 @@ -/* - * 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 - -/* Tag variables with this */ -#define __sramdata __section(.sram.data) -/* Tag constants with this */ -#define __sramconst __section(.sram.rodata) -/* Tag functions inside SRAM called from outside SRAM with this */ -#define __sramfunc __attribute__((long_call)) __section(.sram.text) noinline -/* Tag function inside SRAM called from inside SRAM with this */ -#define __sramlocalfunc __section(.sram.text) - -void __init rk29_sram_init(void); - -static inline unsigned long ddr_save_sp(unsigned long new_sp) -{ - unsigned long old_sp; - - asm volatile ("mov %0, sp" : "=r" (old_sp)); - asm volatile ("mov sp, %0" :: "r" (new_sp)); - return old_sp; -} - -// save_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 - +#include diff --git a/arch/arm/plat-rk/Makefile b/arch/arm/plat-rk/Makefile index f78a8e5a60cb..675b57652170 100644 --- a/arch/arm/plat-rk/Makefile +++ b/arch/arm/plat-rk/Makefile @@ -3,3 +3,4 @@ obj-$(CONFIG_USB_GADGET) += usb_detect.o obj-$(CONFIG_RK29_VPU) += vpu_service.o obj-$(CONFIG_ARCH_RK30) += dma-pl330.o obj-y += mem_reserve.o +obj-y += sram.o diff --git a/arch/arm/plat-rk/include/plat/sram.h b/arch/arm/plat-rk/include/plat/sram.h new file mode 100644 index 000000000000..27d403c62e43 --- /dev/null +++ b/arch/arm/plat-rk/include/plat/sram.h @@ -0,0 +1,40 @@ +/* + * 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 + +/* Tag variables with this */ +#define __sramdata __section(.sram.data) +/* Tag constants with this */ +#define __sramconst __section(.sram.rodata) +/* Tag functions inside SRAM called from outside SRAM with this */ +#define __sramfunc __attribute__((long_call)) __section(.sram.text) noinline +/* Tag function inside SRAM called from inside SRAM with this */ +#define __sramlocalfunc __section(.sram.text) + +void __init rk29_sram_init(void); + +static inline unsigned long ddr_save_sp(unsigned long new_sp) +{ + unsigned long old_sp; + + asm volatile ("mov %0, sp" : "=r" (old_sp)); + asm volatile ("mov sp, %0" :: "r" (new_sp)); + return old_sp; +} + +// save_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 + diff --git a/arch/arm/mach-rk29/sram.c b/arch/arm/plat-rk/sram.c similarity index 100% rename from arch/arm/mach-rk29/sram.c rename to arch/arm/plat-rk/sram.c -- 2.34.1