Merge branch 'linus' into core/generic-dma-coherent
[pandora-kernel.git] / arch / powerpc / sysdev / cpm_common.c
index 165981c..e4b7296 100644 (file)
@@ -37,7 +37,7 @@ static void udbg_putc_cpm(char c)
        u8 __iomem *txbuf = (u8 __iomem __force *)in_be32(&cpm_udbg_txdesc[1]);
 
        if (c == '\n')
-               udbg_putc('\r');
+               udbg_putc_cpm('\r');
 
        while (in_be32(&cpm_udbg_txdesc[0]) & 0x80000000)
                ;
@@ -53,12 +53,10 @@ void __init udbg_init_cpm(void)
                setbat(1, 0xf0000000, 0xf0000000, 1024*1024, _PAGE_IO);
 #endif
                udbg_putc = udbg_putc_cpm;
-               udbg_putc('X');
        }
 }
 #endif
 
-#ifdef CONFIG_PPC_CPM_NEW_BINDING
 static spinlock_t cpm_muram_lock;
 static rh_block_t cpm_boot_muram_rh_block[16];
 static rh_info_t cpm_muram_info;
@@ -86,9 +84,13 @@ int __init cpm_muram_init(void)
 
        np = of_find_compatible_node(NULL, NULL, "fsl,cpm-muram-data");
        if (!np) {
-               printk(KERN_ERR "Cannot find CPM muram data node");
-               ret = -ENODEV;
-               goto out;
+               /* try legacy bindings */
+               np = of_find_node_by_name(NULL, "data-only");
+               if (!np) {
+                       printk(KERN_ERR "Cannot find CPM muram data node");
+                       ret = -ENODEV;
+                       goto out;
+               }
        }
 
        muram_pbase = of_translate_address(np, zero);
@@ -190,6 +192,12 @@ void __iomem *cpm_muram_addr(unsigned long offset)
 }
 EXPORT_SYMBOL(cpm_muram_addr);
 
+unsigned long cpm_muram_offset(void __iomem *addr)
+{
+       return addr - (void __iomem *)muram_vbase;
+}
+EXPORT_SYMBOL(cpm_muram_offset);
+
 /**
  * cpm_muram_dma - turn a muram virtual address into a DMA address
  * @offset: virtual address from cpm_muram_addr() to convert
@@ -199,5 +207,3 @@ dma_addr_t cpm_muram_dma(void __iomem *addr)
        return muram_pbase + ((u8 __iomem *)addr - muram_vbase);
 }
 EXPORT_SYMBOL(cpm_muram_dma);
-
-#endif /* CONFIG_PPC_CPM_NEW_BINDING */