aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/sysdev/cpm_common.c
diff options
context:
space:
mode:
authorAnton Vorontsov <avorontsov@ru.mvista.com>2008-05-23 12:39:06 -0400
committerKumar Gala <galak@kernel.crashing.org>2008-06-10 12:11:21 -0400
commit5093bb965a163fe288c3e5db0275165f86c895c2 (patch)
tree77af9fbf28f45e277443be5abffb85feacc0097c /arch/powerpc/sysdev/cpm_common.c
parentb13e930906b313d787f4dd07fe78b74a3a8c22c4 (diff)
powerpc/QE: switch to the cpm_muram implementation
This is very trivial patch. We're transitioning to the cpm_muram_* calls. That's it. Less trivial changes: - BD_SC_* defines were defined in the cpm.h and qe.h, so to avoid redefines we remove BD_SC from the qe.h and use cpm.h along with cpm_muram_* prototypes; - qe_muram_dump was unused and thus removed; - added some code to the cpm_common.c to support legacy QE bindings (data-only node name). - For convenience, define qe_* calls to cpm_*. So drivers need not to be changed. Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/sysdev/cpm_common.c')
-rw-r--r--arch/powerpc/sysdev/cpm_common.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/arch/powerpc/sysdev/cpm_common.c b/arch/powerpc/sysdev/cpm_common.c
index cb7df2dce44f..9b75d164bdf9 100644
--- a/arch/powerpc/sysdev/cpm_common.c
+++ b/arch/powerpc/sysdev/cpm_common.c
@@ -85,9 +85,13 @@ int __init cpm_muram_init(void)
85 85
86 np = of_find_compatible_node(NULL, NULL, "fsl,cpm-muram-data"); 86 np = of_find_compatible_node(NULL, NULL, "fsl,cpm-muram-data");
87 if (!np) { 87 if (!np) {
88 printk(KERN_ERR "Cannot find CPM muram data node"); 88 /* try legacy bindings */
89 ret = -ENODEV; 89 np = of_find_node_by_name(NULL, "data-only");
90 goto out; 90 if (!np) {
91 printk(KERN_ERR "Cannot find CPM muram data node");
92 ret = -ENODEV;
93 goto out;
94 }
91 } 95 }
92 96
93 muram_pbase = of_translate_address(np, zero); 97 muram_pbase = of_translate_address(np, zero);
@@ -189,6 +193,12 @@ void __iomem *cpm_muram_addr(unsigned long offset)
189} 193}
190EXPORT_SYMBOL(cpm_muram_addr); 194EXPORT_SYMBOL(cpm_muram_addr);
191 195
196unsigned long cpm_muram_offset(void __iomem *addr)
197{
198 return addr - (void __iomem *)muram_vbase;
199}
200EXPORT_SYMBOL(cpm_muram_offset);
201
192/** 202/**
193 * cpm_muram_dma - turn a muram virtual address into a DMA address 203 * cpm_muram_dma - turn a muram virtual address into a DMA address
194 * @offset: virtual address from cpm_muram_addr() to convert 204 * @offset: virtual address from cpm_muram_addr() to convert