diff mbox

[12/14] sh: Fix the offset from P1SEG/P2SEG where we map RAM

Message ID ceec8c0d3e37a6042300c17491aed8f0dff9a5b9.1254861984.git.matt@console-pimps.org (mailing list archive)
State Accepted
Headers show

Commit Message

Matt Fleming Oct. 6, 2009, 9:22 p.m. UTC
None
diff mbox

Patch

diff --git a/arch/sh/mm/pmb.c b/arch/sh/mm/pmb.c
index f13a18c..8c39777 100644
--- a/arch/sh/mm/pmb.c
+++ b/arch/sh/mm/pmb.c
@@ -268,7 +268,7 @@  static void __pmb_unmap(struct pmb_entry *pmbe)
 int __uses_jump_to_uncached pmb_init(void)
 {
 	unsigned int i;
-	long size;
+	long size, ret;
 
 	jump_to_uncached();
 
@@ -280,12 +280,13 @@  int __uses_jump_to_uncached pmb_init(void)
 	 *	P1 - provides a cached window onto physical memory
 	 *	P2 - provides an uncached window onto physical memory
 	 */
-	size = pmb_remap(P2SEG, __MEMORY_START, __MEMORY_SIZE,
-			 PMB_WT | PMB_UB);
-	BUG_ON(size != __MEMORY_SIZE);
+	size = __MEMORY_START + __MEMORY_SIZE;
 
-	size = pmb_remap(P1SEG, __MEMORY_START, __MEMORY_SIZE, PMB_C);
-	BUG_ON(size != __MEMORY_SIZE);
+	ret = pmb_remap(P1SEG, 0x00000000, size, PMB_C);
+	BUG_ON(ret != size);
+
+	ret = pmb_remap(P2SEG, 0x00000000, size, PMB_WT | PMB_UB);
+	BUG_ON(ret != size);
 
 	ctrl_outl(0, PMB_IRMCR);