瀏覽代碼

[MIPS] Malta: Handle byteswapping hardare bug in big endian mode.

The SOC-it system controller running in big endian mode might forget
byteswapping when DMAing to the last word of physical memory. Fixed by
ignoring the last page of memory.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

Elizabeth Oldham 19 年之前
父節點
當前提交
734996820f
共有 1 個文件被更改,包括 9 次插入0 次删除
  1. 9 0
      arch/mips/mips-boards/generic/memory.c

+ 9 - 0
arch/mips/mips-boards/generic/memory.c

@@ -76,6 +76,15 @@ struct prom_pmemblock * __init prom_getmdesc(void)
 			memsize = simple_strtol(memsize_str, NULL, 0);
 		}
 	}
+
+#ifdef CONFIG_CPU_BIG_ENDIAN
+	/*
+	 * SOC-it swaps, or perhaps doesn't swap, when DMA'ing the last
+	 * word of physical memory
+	 */
+	memsize -= PAGE_SIZE;
+#endif
+
 	memset(mdesc, 0, sizeof(mdesc));
 
 	mdesc[0].type = yamon_dontuse;