Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MIPS: JZ4770: Workaround for corrupted DMA transfers

We have seen MMC DMA transfers read corrupted data from SDRAM when
a burst interval ends at physical address 0x10000000. To avoid this
problem, we remove the final page of low memory from the memory map.
  • Loading branch information...
commit 69106c17a401ed897a71b1cd6f5d60d7ea3a6c13 1 parent ee48ba8
@mthuurne mthuurne authored
Showing with 29 additions and 0 deletions.
  1. +22 −0 arch/mips/jz4770/setup.c
  2. +7 −0 arch/mips/kernel/setup.c
View
22 arch/mips/jz4770/setup.c
@@ -40,6 +40,7 @@
#include <asm/reboot.h>
#include <asm/pgtable.h>
#include <asm/time.h>
+#include <asm/page.h>
#include <asm/mach-jz4770/jz4770cpm.h>
#include <asm/mach-jz4770/jz4770dmac.h>
@@ -190,3 +191,24 @@ void __init plat_mem_setup(void)
#endif
}
+/*
+ * We have seen MMC DMA transfers read corrupted data from SDRAM when a burst
+ * interval ends at physical address 0x10000000. To avoid this problem, we
+ * remove the final page of low memory from the memory map.
+ */
+void __init jz4770_reserve_unsafe_for_dma(void)
+{
+ int i;
+ for (i = 0; i < boot_mem_map.nr_map; i++) {
+ struct boot_mem_map_entry *entry = boot_mem_map.map + i;
+
+ if (entry->type != BOOT_MEM_RAM)
+ continue;
+
+ if (entry->addr + entry->size != 0x10000000)
+ continue;
+
+ entry->size -= PAGE_SIZE;
+ break;
+ }
+}
View
7 arch/mips/kernel/setup.c
@@ -640,6 +640,13 @@ static void __init arch_mem_init(char **cmdline_p)
parse_early_param();
+#ifdef CONFIG_MACH_JZ4770
+ {
+ extern void __init jz4770_reserve_unsafe_for_dma(void);
+ jz4770_reserve_unsafe_for_dma();
+ }
+#endif
+
if (usermem) {
pr_info("User-defined physical RAM map:\n");
print_memory_map();
Please sign in to comment.
Something went wrong with that request. Please try again.