aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/plat-omap/include/plat/sram.h
diff options
context:
space:
mode:
authorJean Pihet <j-pihet@ti.com>2011-01-19 14:03:52 -0800
committerDave Martin <dave.martin@linaro.org>2011-02-23 12:25:08 +0000
commit4cdc84b1e7579ee7a5992351804b46453d6ffab2 (patch)
treead8d6db328ceb3bd14c08c672d5c6bc6640c76a5 /arch/arm/plat-omap/include/plat/sram.h
parentb9dee26e9fb1987f7aab0fc49cb62f6ce629799a (diff)
omap: use fncpy to copy the PM code functions to SRAM
The new fncpy API is better suited for copying some code to SRAM at runtime. This patch changes the ad-hoc code to the more generic fncpy API. Tested OK on OMAP3 in low power modes (RET/OFF) using omap2plus_defconfig with !CONFIG_THUMB2_KERNEL. Compile tested on OMAP1/2 using omap1_defconfig. Signed-off-by: Jean Pihet <j-pihet@ti.com> Acked-by: Kevin Hilman <khilman@ti.com> Tested-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'arch/arm/plat-omap/include/plat/sram.h')
-rw-r--r--arch/arm/plat-omap/include/plat/sram.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/arch/arm/plat-omap/include/plat/sram.h b/arch/arm/plat-omap/include/plat/sram.h
index 9967d5e855c..d673f2c55f9 100644
--- a/arch/arm/plat-omap/include/plat/sram.h
+++ b/arch/arm/plat-omap/include/plat/sram.h
@@ -12,7 +12,19 @@
#define __ARCH_ARM_OMAP_SRAM_H
#ifndef __ASSEMBLY__
-extern void * omap_sram_push(void * start, unsigned long size);
+#include <asm/fncpy.h>
+
+extern void *omap_sram_push_address(unsigned long size);
+
+/* Macro to push a function to the internal SRAM, using the fncpy API */
+#define omap_sram_push(funcp, size) ({ \
+ typeof(&funcp) _res = NULL; \
+ void *_sram_address = omap_sram_push_address(size); \
+ if (_sram_address) \
+ _res = fncpy(_sram_address, &funcp, size); \
+ _res; \
+})
+
extern void omap_sram_reprogram_clock(u32 dpllctl, u32 ckctl);
extern void omap2_sram_ddr_init(u32 *slow_dll_ctrl, u32 fast_dll_ctrl,