aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/sysdev/cpm2.c
diff options
context:
space:
mode:
authorScott Wood <scottwood@freescale.com>2008-04-10 16:45:02 -0400
committerKumar Gala <galak@kernel.crashing.org>2008-04-17 02:01:40 -0400
commit3dd82a1ea72438a545634b3ef90c53313d2caffa (patch)
tree3c45e2973499935be638784a64698ef0a3a12196 /arch/powerpc/sysdev/cpm2.c
parent632395e19c9268bb15a5022b8e0c6b645a1937d7 (diff)
[POWERPC] CPM: Always use new binding.
The kconfig entry can go away once arch/ppc and references to the config in drivers are removed. Signed-off-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/sysdev/cpm2.c')
-rw-r--r--arch/powerpc/sysdev/cpm2.c97
1 files changed, 0 insertions, 97 deletions
diff --git a/arch/powerpc/sysdev/cpm2.c b/arch/powerpc/sysdev/cpm2.c
index 4ab3f1f5a7c3..5a6c5dfc53ef 100644
--- a/arch/powerpc/sysdev/cpm2.c
+++ b/arch/powerpc/sysdev/cpm2.c
@@ -46,10 +46,6 @@
46 46
47#include <sysdev/fsl_soc.h> 47#include <sysdev/fsl_soc.h>
48 48
49#ifndef CONFIG_PPC_CPM_NEW_BINDING
50static void cpm2_dpinit(void);
51#endif
52
53cpm_cpm2_t __iomem *cpmp; /* Pointer to comm processor space */ 49cpm_cpm2_t __iomem *cpmp; /* Pointer to comm processor space */
54 50
55/* We allocate this here because it is used almost exclusively for 51/* We allocate this here because it is used almost exclusively for
@@ -71,11 +67,7 @@ void __init cpm2_reset(void)
71 67
72 /* Reclaim the DP memory for our use. 68 /* Reclaim the DP memory for our use.
73 */ 69 */
74#ifdef CONFIG_PPC_CPM_NEW_BINDING
75 cpm_muram_init(); 70 cpm_muram_init();
76#else
77 cpm2_dpinit();
78#endif
79 71
80 /* Tell everyone where the comm processor resides. 72 /* Tell everyone where the comm processor resides.
81 */ 73 */
@@ -353,95 +345,6 @@ int cpm2_smc_clk_setup(enum cpm_clk_target target, int clock)
353 return ret; 345 return ret;
354} 346}
355 347
356#ifndef CONFIG_PPC_CPM_NEW_BINDING
357/*
358 * dpalloc / dpfree bits.
359 */
360static spinlock_t cpm_dpmem_lock;
361/* 16 blocks should be enough to satisfy all requests
362 * until the memory subsystem goes up... */
363static rh_block_t cpm_boot_dpmem_rh_block[16];
364static rh_info_t cpm_dpmem_info;
365static u8 __iomem *im_dprambase;
366
367static void cpm2_dpinit(void)
368{
369 spin_lock_init(&cpm_dpmem_lock);
370
371 /* initialize the info header */
372 rh_init(&cpm_dpmem_info, 1,
373 sizeof(cpm_boot_dpmem_rh_block) /
374 sizeof(cpm_boot_dpmem_rh_block[0]),
375 cpm_boot_dpmem_rh_block);
376
377 im_dprambase = cpm2_immr;
378
379 /* Attach the usable dpmem area */
380 /* XXX: This is actually crap. CPM_DATAONLY_BASE and
381 * CPM_DATAONLY_SIZE is only a subset of the available dpram. It
382 * varies with the processor and the microcode patches activated.
383 * But the following should be at least safe.
384 */
385 rh_attach_region(&cpm_dpmem_info, CPM_DATAONLY_BASE, CPM_DATAONLY_SIZE);
386}
387
388/* This function returns an index into the DPRAM area.
389 */
390unsigned long cpm_dpalloc(uint size, uint align)
391{
392 unsigned long start;
393 unsigned long flags;
394
395 spin_lock_irqsave(&cpm_dpmem_lock, flags);
396 cpm_dpmem_info.alignment = align;
397 start = rh_alloc(&cpm_dpmem_info, size, "commproc");
398 spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
399
400 return (uint)start;
401}
402EXPORT_SYMBOL(cpm_dpalloc);
403
404int cpm_dpfree(unsigned long offset)
405{
406 int ret;
407 unsigned long flags;
408
409 spin_lock_irqsave(&cpm_dpmem_lock, flags);
410 ret = rh_free(&cpm_dpmem_info, offset);
411 spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
412
413 return ret;
414}
415EXPORT_SYMBOL(cpm_dpfree);
416
417/* not sure if this is ever needed */
418unsigned long cpm_dpalloc_fixed(unsigned long offset, uint size, uint align)
419{
420 unsigned long start;
421 unsigned long flags;
422
423 spin_lock_irqsave(&cpm_dpmem_lock, flags);
424 cpm_dpmem_info.alignment = align;
425 start = rh_alloc_fixed(&cpm_dpmem_info, offset, size, "commproc");
426 spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
427
428 return start;
429}
430EXPORT_SYMBOL(cpm_dpalloc_fixed);
431
432void cpm_dpdump(void)
433{
434 rh_dump(&cpm_dpmem_info);
435}
436EXPORT_SYMBOL(cpm_dpdump);
437
438void *cpm_dpram_addr(unsigned long offset)
439{
440 return (void *)(im_dprambase + offset);
441}
442EXPORT_SYMBOL(cpm_dpram_addr);
443#endif /* !CONFIG_PPC_CPM_NEW_BINDING */
444
445struct cpm2_ioports { 348struct cpm2_ioports {
446 u32 dir, par, sor, odr, dat; 349 u32 dir, par, sor, odr, dat;
447 u32 res[3]; 350 u32 res[3];