diff options
Diffstat (limited to 'arch/arm/plat-omap/devices.c')
-rw-r--r-- | arch/arm/plat-omap/devices.c | 111 |
1 files changed, 73 insertions, 38 deletions
diff --git a/arch/arm/plat-omap/devices.c b/arch/arm/plat-omap/devices.c index ea28f98..d8add7e7 100644 --- a/arch/arm/plat-omap/devices.c +++ b/arch/arm/plat-omap/devices.c @@ -16,17 +16,21 @@ #include <linux/io.h> #include <linux/slab.h> #include <linux/memblock.h> +#include <linux/err.h> #include <mach/hardware.h> #include <asm/mach-types.h> #include <asm/mach/map.h> +#include <plat/omap_hwmod.h> +#include <plat/omap_device.h> #include <plat/tc.h> #include <plat/board.h> #include <plat/mmc.h> #include <mach/gpio.h> #include <plat/menelaus.h> #include <plat/mcbsp.h> +#include <plat/remoteproc.h> #include <plat/omap44xx.h> /*-------------------------------------------------------------------------*/ @@ -74,41 +78,6 @@ void omap_mcbsp_register_board_cfg(struct resource *res, int res_count, /*-------------------------------------------------------------------------*/ -#if defined(CONFIG_SND_OMAP_SOC_MCPDM) || \ - defined(CONFIG_SND_OMAP_SOC_MCPDM_MODULE) - -static struct resource mcpdm_resources[] = { - { - .name = "mcpdm_mem", - .start = OMAP44XX_MCPDM_BASE, - .end = OMAP44XX_MCPDM_BASE + SZ_4K, - .flags = IORESOURCE_MEM, - }, - { - .name = "mcpdm_irq", - .start = OMAP44XX_IRQ_MCPDM, - .end = OMAP44XX_IRQ_MCPDM, - .flags = IORESOURCE_IRQ, - }, -}; - -static struct platform_device omap_mcpdm_device = { - .name = "omap-mcpdm", - .id = -1, - .num_resources = ARRAY_SIZE(mcpdm_resources), - .resource = mcpdm_resources, -}; - -static void omap_init_mcpdm(void) -{ - (void) platform_device_register(&omap_mcpdm_device); -} -#else -static inline void omap_init_mcpdm(void) {} -#endif - -/*-------------------------------------------------------------------------*/ - #if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) || \ defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE) @@ -190,8 +159,6 @@ static void omap_init_rng(void) static inline void omap_init_rng(void) {} #endif -/*-------------------------------------------------------------------------*/ - /* Numbering for the SPI-capable controllers when used for SPI: * spi = 1 * uwire = 2 @@ -237,6 +204,7 @@ static inline void omap_init_uwire(void) {} #if defined(CONFIG_TIDSPBRIDGE) || defined(CONFIG_TIDSPBRIDGE_MODULE) static phys_addr_t omap_dsp_phys_mempool_base; +static phys_addr_t omap_dsp_phys_mempool_size; void __init omap_dsp_reserve_sdram_memblock(void) { @@ -256,6 +224,7 @@ void __init omap_dsp_reserve_sdram_memblock(void) memblock_remove(paddr, size); omap_dsp_phys_mempool_base = paddr; + omap_dsp_phys_mempool_size = size; } phys_addr_t omap_dsp_get_mempool_base(void) @@ -263,6 +232,73 @@ phys_addr_t omap_dsp_get_mempool_base(void) return omap_dsp_phys_mempool_base; } EXPORT_SYMBOL(omap_dsp_get_mempool_base); + +phys_addr_t omap_dsp_get_mempool_size(void) +{ + return omap_dsp_phys_mempool_size; +} +EXPORT_SYMBOL(omap_dsp_get_mempool_size); +#endif + +#if defined(CONFIG_OMAP_REMOTE_PROC) +static phys_addr_t omap_ipu_phys_mempool_base; +static u32 omap_ipu_phys_mempool_size; +static phys_addr_t omap_ipu_phys_st_mempool_base; +static u32 omap_ipu_phys_st_mempool_size; + +void __init omap_ipu_reserve_sdram_memblock(void) +{ + /* currently handles only ipu. dsp will be handled later...*/ + u32 size = CONFIG_OMAP_REMOTEPROC_MEMPOOL_SIZE; + phys_addr_t paddr; + + if (!size) + return; + + paddr = memblock_alloc(size, SZ_1M); + if (!paddr) { + pr_err("%s: failed to reserve %x bytes\n", + __func__, size); + return; + } + memblock_free(paddr, size); + memblock_remove(paddr, size); + + omap_ipu_phys_mempool_base = paddr; + omap_ipu_phys_mempool_size = size; +} + +void __init omap_ipu_set_static_mempool(u32 start, u32 size) +{ + omap_ipu_phys_st_mempool_base = start; + omap_ipu_phys_st_mempool_size = size; +} + +phys_addr_t omap_ipu_get_mempool_base(enum omap_rproc_mempool_type type) +{ + switch (type) { + case OMAP_RPROC_MEMPOOL_STATIC: + return omap_ipu_phys_st_mempool_base; + case OMAP_RPROC_MEMPOOL_DYNAMIC: + return omap_ipu_phys_mempool_base; + default: + return 0; + } +} +EXPORT_SYMBOL(omap_ipu_get_mempool_base); + +u32 omap_ipu_get_mempool_size(enum omap_rproc_mempool_type type) +{ + switch (type) { + case OMAP_RPROC_MEMPOOL_STATIC: + return omap_ipu_phys_st_mempool_size; + case OMAP_RPROC_MEMPOOL_DYNAMIC: + return omap_ipu_phys_mempool_size; + default: + return 0; + } +} +EXPORT_SYMBOL(omap_ipu_get_mempool_size); #endif /* @@ -291,7 +327,6 @@ static int __init omap_init_devices(void) * in alphabetical order so they're easier to sort through. */ omap_init_rng(); - omap_init_mcpdm(); omap_init_uwire(); return 0; } |