[PPC] Fix cpm_dpram_addr returning phys mem instead of virt mem
authorJochen Friedrich <jochen@scram.de>
Mon, 24 Sep 2007 17:14:57 +0000 (19:14 +0200)
committerKumar Gala <galak@kernel.crashing.org>
Fri, 28 Sep 2007 15:25:32 +0000 (10:25 -0500)
cpm_dpram_addr returns physical memory of the DP RAM instead of
iomapped virtual memory. As there usually is a 1:1 MMU map of
the IMMR area, this is often not noticed. However, cpm_dpram_phys
assumes this iomapped virtual memory and returns garbage on the
1:1 mapped memory causing CPM1 uart console to fail.

This patch fixes the problem (copied from the powerpc tree).

Signed-off-by: Jochen Friedrich <jochen@scram.de>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
arch/ppc/8xx_io/commproc.c

index 7088428e1fe22e32e9abd27bbb015b5639123d6c..9da880be4dc0f408df58f39c1424b0eee31117f4 100644 (file)
@@ -459,7 +459,7 @@ EXPORT_SYMBOL(cpm_dpdump);
 
 void *cpm_dpram_addr(unsigned long offset)
 {
-       return ((immap_t *)IMAP_ADDR)->im_cpm.cp_dpmem + offset;
+       return (void *)(dpram_vbase + offset);
 }
 EXPORT_SYMBOL(cpm_dpram_addr);