index f500fc34d06595254fb8688cb7c633a7807c113d..45584162b2fc4224bb168425d5d716c749a6e8ed 100644 (file)
#define __ARCH_ARM_OMAP_SRAM_H
#ifndef __ASSEMBLY__
+#include <linux/slab.h>
+#include <linux/genalloc.h>
#include <asm/fncpy.h>
-extern void *omap_sram_push_address(unsigned long size);
+extern struct gen_pool *omap_gen_pool;
-/* 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; \
+/*
+ * Note that fncpy requires the SRAM address to be aligned to an 8-byte
+ * boundary, so the min_alloc_order for the pool is set appropriately.
+ */
+#define omap_sram_push(funcp, size) ({ \
+ typeof(&(funcp)) _res; \
+ size_t _sz = size; \
+ void *_sram = (void *) gen_pool_alloc(omap_gen_pool, _sz); \
+ _res = (_sram ? fncpy(_sram, &(funcp), _sz) : NULL); \
+ if (!_res) \
+ pr_err("Not enough space in SRAM\n"); \
+ _res; \
})
extern void omap_sram_reprogram_clock(u32 dpllctl, u32 ckctl);
extern unsigned long omap3_sram_configure_core_dpll_sz;
#ifdef CONFIG_PM
+extern void am33xx_push_sram_idle(void);
extern void omap_push_sram_idle(void);
#else
+static inline void am33xx_push_sram_idle(void) {}
static inline void omap_push_sram_idle(void) {}
#endif /* CONFIG_PM */
*/
#define OMAP2_SRAM_PA 0x40200000
#define OMAP3_SRAM_PA 0x40200000
+#ifdef CONFIG_OMAP4_ERRATA_I688
+#define OMAP4_SRAM_PA 0x40304000
+#define OMAP4_SRAM_VA 0xfe404000
+#else
#define OMAP4_SRAM_PA 0x40300000
-
+#endif
+#define AM33XX_SRAM_PA 0x40300000
#endif