This removes a lot of cruft from the architecture code for reserving 2M of memory for the voice core. It now uses dma_alloc_coherent to get this memory from the vmmc driver, when it is initialised. Now this memory will only be allocated when it is actually needed.
This patch was tested with the tapidemo package and two analog phones. Signed-off-by: Ithamar R. Adema <[email protected]> --- package/ifx-vmmc/patches-2.6.33/100-ifxmips.patch | 30 ++++++++++++++++-- .../files-2.6.33/arch/mips/ifxmips/common/prom.c | 31 -------------------- .../mips/include/asm/mach-ifxmips/ifxmips_prom.h | 2 - 3 files changed, 26 insertions(+), 37 deletions(-) diff --git a/package/ifx-vmmc/patches-2.6.33/100-ifxmips.patch b/package/ifx-vmmc/patches-2.6.33/100-ifxmips.patch index 6a4cc8d..5d3d1c6 100644 --- a/package/ifx-vmmc/patches-2.6.33/100-ifxmips.patch +++ b/package/ifx-vmmc/patches-2.6.33/100-ifxmips.patch @@ -351,7 +351,7 @@ timer = TIMER1A; --- a/src/mps/drv_mps_vmmc_danube.c +++ b/src/mps/drv_mps_vmmc_danube.c -@@ -32,9 +32,22 @@ +@@ -32,9 +32,20 @@ #include "ifxos_select.h" #include "ifxos_interrupt.h" @@ -363,12 +363,10 @@ +# include <asm/mach-ifxmips/ifxmips_irq.h> +# include <asm/mach-ifxmips/ifxmips_gptu.h> +# include <asm/mach-ifxmips/ifxmips_prom.h> ++# include <linux/dma-mapping.h> + +# define IFX_RCU_RST_REQ IFXMIPS_RCU_RST +# define IFX_RCU_RST_REQ_CPU1 IFXMIPS_RCU_RST_CPU1 -+ -+# define ifx_get_cp1_base prom_get_cp1_base -+# define ifx_get_cp1_size prom_get_cp1_size +#else +# include <asm/ifx/ifx_regs.h> +# include <asm/ifx_vpe.h> @@ -377,6 +375,30 @@ #include "drv_mps_vmmc.h" #include "drv_mps_vmmc_dbg.h" +@@ -72,6 +71,23 @@ volatile IFX_uint32_t *danube_cp1_base; + /* Local function definition */ + /* ============================= */ + ++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,28)) ++IFX_uint32_t ifx_get_cp1_size(IFX_void_t) ++{ ++ return 2; ++} ++ ++IFX_uint32_t *ifx_get_cp1_base(IFX_void_t) ++{ ++ if (!danube_cp1_base) { ++ dma_addr_t dma; ++ danube_cp1_base = dma_alloc_coherent(NULL, ifx_get_cp1_size()<<20, &dma, GFP_ATOMIC); ++ } ++ ++ return (IFX_uint32_t*)danube_cp1_base; ++} ++#endif ++ + /****************************************************************************** + * DANUBE Specific Routines + ******************************************************************************/ @@ -119,6 +132,15 @@ IFX_int32_t ifx_mps_download_firmware (m } diff --git a/target/linux/ifxmips/files-2.6.33/arch/mips/ifxmips/common/prom.c b/target/linux/ifxmips/files-2.6.33/arch/mips/ifxmips/common/prom.c index e6a4a09..aef002c 100644 --- a/target/linux/ifxmips/files-2.6.33/arch/mips/ifxmips/common/prom.c +++ b/target/linux/ifxmips/files-2.6.33/arch/mips/ifxmips/common/prom.c @@ -9,10 +9,6 @@ #include <ifxmips.h> #include <ifxmips_prom.h> -/* for voice cpu (MIPS24K) */ -unsigned int *prom_cp1_base; -unsigned int prom_cp1_size = 0; - /* for Multithreading (APRP) on MIPS34K */ unsigned long physical_memsize; @@ -21,21 +17,6 @@ prom_free_prom_memory(void) { } -unsigned int* -prom_get_cp1_base(void) -{ - return prom_cp1_base; -} -EXPORT_SYMBOL(prom_get_cp1_base); - -unsigned int -prom_get_cp1_size(void) -{ - /* return size im MB */ - return prom_cp1_size>>20; -} -EXPORT_SYMBOL(prom_get_cp1_size); - extern unsigned char ifxmips_ethaddr[6]; int cmdline_mac = 0; @@ -115,18 +96,6 @@ static void __init prom_init_cmdline(void) } memsize *= 1024 * 1024; - /* only on Twinpass/Danube a second CPU is used for Voice */ - if ((cpu_data[0].cputype == CPU_24K) && (prom_cp1_size)) - { -#define CP1_SIZE 2 << 20 - prom_cp1_size = CP1_SIZE; - memsize -= prom_cp1_size; - prom_cp1_base = (unsigned int *)KSEG1ADDR(memsize); - - early_printf("Using %dMB Ram and reserving %dMB for cp1\n", - memsize>>20, prom_cp1_size>>20); - } - add_memory_region(0x00000000, memsize, BOOT_MEM_RAM); } diff --git a/target/linux/ifxmips/files-2.6.33/arch/mips/include/asm/mach-ifxmips/ifxmips_prom.h b/target/linux/ifxmips/files-2.6.33/arch/mips/include/asm/mach-ifxmips/ifxmips_prom.h index 71012be..6e4b597 100644 --- a/target/linux/ifxmips/files-2.6.33/arch/mips/include/asm/mach-ifxmips/ifxmips_prom.h +++ b/target/linux/ifxmips/files-2.6.33/arch/mips/include/asm/mach-ifxmips/ifxmips_prom.h @@ -19,8 +19,6 @@ #define _IFXPROM_H__ extern void early_printf(const char *fmt, ...); -extern u32 *prom_get_cp1_base(void); -extern u32 prom_get_cp1_size(void); extern int ifxmips_has_brn_block(void); #endif -- 1.7.0.4 _______________________________________________ openwrt-devel mailing list [email protected] https://lists.openwrt.org/mailman/listinfo/openwrt-devel
