-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
-/*
- * 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
-
-/* 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 <plat/sram.h>
+++ /dev/null
-/*
- * License terms: GNU General Public License (GPL) version 2
- */
-#include <linux/init.h>
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/stddef.h>
-#include <linux/ioport.h>
-#include <linux/genalloc.h>
-#include <linux/string.h> /* memcpy */
-#include <asm/page.h> /* PAGE_SHIFT */
-#include <asm/cputype.h>
-#include <asm/mach/map.h>
-#include <asm/tlbflush.h>
-#include <asm/cacheflush.h>
-#include <mach/memory.h>
-#include <mach/rk29_iomap.h>
-
-
-/* SRAM section definitions from the linker */
-extern char __sram_code_start, __ssram_code_text, __esram_code_text;
-extern char __sram_data_start, __ssram_data, __esram_data;
-
-static struct map_desc sram_code_iomap[] __initdata = {
- {
- .virtual = SRAM_CODE_OFFSET,
- .pfn = __phys_to_pfn(0x0),
- .length = 1024*1024,
- .type = MT_MEMORY
- }
-};
-
-int __init rk29_sram_init(void)
-{
- char *start;
- char *end;
- char *ram;
-
- iotable_init(sram_code_iomap, 1);
-
- /*
- * Normally devicemaps_init() would flush caches and tlb after
- * mdesc->map_io(), but since we're called from map_io(), we
- * must do it here.
- */
- local_flush_tlb_all();
- flush_cache_all();
-
- memset((char *)SRAM_CODE_OFFSET,0x0,(SRAM_CODE_END - SRAM_CODE_OFFSET + 1));
- memset((char *)SRAM_DATA_OFFSET,0x0,(SRAM_DATA_END - SRAM_DATA_OFFSET + 1));
-
- /* Copy code from RAM to SRAM CODE */
- start = &__ssram_code_text;
- end = &__esram_code_text;
- ram = &__sram_code_start;
- memcpy(start, ram, (end-start));
- flush_icache_range((unsigned long) start, (unsigned long) end);
-
- printk("CPU SRAM: copied sram code from %p to %p - %p\n", ram, start, end);
-
- /* Copy data from RAM to SRAM DATA */
- start = &__ssram_data;
- end = &__esram_data;
- ram = &__sram_data_start;
- memcpy(start, ram, (end-start));
-
- printk("CPU SRAM: copied sram data from %p to %p - %p\n", ram,start, end);
-
- return 0;
-}
obj-$(CONFIG_RK29_VPU) += vpu_service.o
obj-$(CONFIG_ARCH_RK30) += dma-pl330.o
obj-y += mem_reserve.o
+obj-y += sram.o
--- /dev/null
+/*
+ * 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
+
+/* 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
+
--- /dev/null
+/*
+ * License terms: GNU General Public License (GPL) version 2
+ */
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/stddef.h>
+#include <linux/ioport.h>
+#include <linux/genalloc.h>
+#include <linux/string.h> /* memcpy */
+#include <asm/page.h> /* PAGE_SHIFT */
+#include <asm/cputype.h>
+#include <asm/mach/map.h>
+#include <asm/tlbflush.h>
+#include <asm/cacheflush.h>
+#include <mach/memory.h>
+#include <mach/rk29_iomap.h>
+
+
+/* SRAM section definitions from the linker */
+extern char __sram_code_start, __ssram_code_text, __esram_code_text;
+extern char __sram_data_start, __ssram_data, __esram_data;
+
+static struct map_desc sram_code_iomap[] __initdata = {
+ {
+ .virtual = SRAM_CODE_OFFSET,
+ .pfn = __phys_to_pfn(0x0),
+ .length = 1024*1024,
+ .type = MT_MEMORY
+ }
+};
+
+int __init rk29_sram_init(void)
+{
+ char *start;
+ char *end;
+ char *ram;
+
+ iotable_init(sram_code_iomap, 1);
+
+ /*
+ * Normally devicemaps_init() would flush caches and tlb after
+ * mdesc->map_io(), but since we're called from map_io(), we
+ * must do it here.
+ */
+ local_flush_tlb_all();
+ flush_cache_all();
+
+ memset((char *)SRAM_CODE_OFFSET,0x0,(SRAM_CODE_END - SRAM_CODE_OFFSET + 1));
+ memset((char *)SRAM_DATA_OFFSET,0x0,(SRAM_DATA_END - SRAM_DATA_OFFSET + 1));
+
+ /* Copy code from RAM to SRAM CODE */
+ start = &__ssram_code_text;
+ end = &__esram_code_text;
+ ram = &__sram_code_start;
+ memcpy(start, ram, (end-start));
+ flush_icache_range((unsigned long) start, (unsigned long) end);
+
+ printk("CPU SRAM: copied sram code from %p to %p - %p\n", ram, start, end);
+
+ /* Copy data from RAM to SRAM DATA */
+ start = &__ssram_data;
+ end = &__esram_data;
+ ram = &__sram_data_start;
+ memcpy(start, ram, (end-start));
+
+ printk("CPU SRAM: copied sram data from %p to %p - %p\n", ram,start, end);
+
+ return 0;
+}