@@ -37,7 +37,6 @@
#include <plat/fpga.h>
#include <plat/serial.h>
#include <plat/vram.h>
-#include <plat/dsp.h>
#include <plat/clock.h>
@@ -84,11 +83,49 @@ const void *omap_get_var_config(u16 tag, size_t *len)
}
EXPORT_SYMBOL(omap_get_var_config);
-void __init omap_reserve(void)
+#if defined(CONFIG_TIDSPBRIDGE) || defined(CONFIG_TIDSPBRIDGE_MODULE)
+
+static phys_addr_t omap_dsp_mempool_base;
+
+static void __init omap_dsp_reserve_mem(struct meminfo *mi)
+{
+ phys_addr_t size = CONFIG_TIDSPBRIDGE_MEMPOOL_SIZE;
+ phys_addr_t addr = ~0;
+ int i;
+
+ if (!size)
+ return;
+
+ for (i = mi->nr_banks - 1; i >= 0; i--)
+ if (mi->bank[i].size >= size) {
+ mi->bank[i].size -= size;
+ addr = mi->bank[i].start + mi->bank[i].size;
+ break;
+ }
+
+ if (addr == ~0) {
+ pr_err("%s: failed to reserve 0x%x bytes\n",
+ __func__, size);
+ return;
+ }
+
+ omap_dsp_mempool_base = addr;
+}
+
+phys_addr_t omap_dsp_get_mempool_base(void)
+{
+ return omap_dsp_mempool_base;
+}
+EXPORT_SYMBOL(omap_dsp_get_mempool_base);
+#else
+static inline void omap_dsp_reserve_mem(struct meminfo *mi) { }
+#endif
+
+void __init omap_reserve(struct meminfo *mi)
{
omapfb_reserve_sdram_memblock();
omap_vram_reserve_sdram_memblock();
- omap_dsp_reserve_sdram_memblock();
+ omap_dsp_reserve_mem(mi);
}
/*
@@ -15,7 +15,6 @@
#include <linux/platform_device.h>
#include <linux/io.h>
#include <linux/slab.h>
-#include <linux/memblock.h>
#include <mach/hardware.h>
#include <asm/mach-types.h>
@@ -273,35 +272,6 @@ static void omap_init_wdt(void)
static inline void omap_init_wdt(void) {}
#endif
-#if defined(CONFIG_TIDSPBRIDGE) || defined(CONFIG_TIDSPBRIDGE_MODULE)
-
-static phys_addr_t omap_dsp_phys_mempool_base;
-
-void __init omap_dsp_reserve_sdram_memblock(void)
-{
- phys_addr_t size = CONFIG_TIDSPBRIDGE_MEMPOOL_SIZE;
- phys_addr_t paddr;
-
- if (!size)
- return;
-
- paddr = __memblock_alloc_base(size, SZ_1M, MEMBLOCK_REAL_LIMIT);
- if (!paddr) {
- pr_err("%s: failed to reserve %x bytes\n",
- __func__, size);
- return;
- }
-
- omap_dsp_phys_mempool_base = paddr;
-}
-
-phys_addr_t omap_dsp_get_mempool_base(void)
-{
- return omap_dsp_phys_mempool_base;
-}
-EXPORT_SYMBOL(omap_dsp_get_mempool_base);
-#endif
-
/*
* This gets called after board-specific INIT_MACHINE, and initializes most
* on-chip peripherals accessible on this board (except for few like USB):
@@ -30,11 +30,12 @@
#include <plat/i2c.h>
struct sys_timer;
+struct meminfo;
extern void omap_map_common_io(void);
extern struct sys_timer omap_timer;
-extern void omap_reserve(void);
+extern void omap_reserve(struct meminfo *mi);
/*
* IO bases for various OMAP processors
@@ -22,10 +22,4 @@ struct omap_dsp_platform_data {
phys_addr_t phys_mempool_size;
};
-#if defined(CONFIG_TIDSPBRIDGE) || defined(CONFIG_TIDSPBRIDGE_MODULE)
-extern void omap_dsp_reserve_sdram_memblock(void);
-#else
-static inline void omap_dsp_reserve_sdram_memblock(void) { }
-#endif
-
#endif