Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1660173
| From | Paul Cercueil <paul@crapouillou.net> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 13/15] MIPS: JZ4770: Workaround for corrupted DMA transfers |
| Date | 2017-06-07 22:10 +0200 |
| Message-ID | <tPPrd-2PB-49@gated-at.bofh.it> (permalink) |
| References | <tPPrb-2PB-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Maarten ter Huurne <maarten@treewalker.org>
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.
Signed-off-by: Maarten ter Huurne <maarten@treewalker.org>
---
arch/mips/jz4740/setup.c | 24 ++++++++++++++++++++++++
arch/mips/kernel/setup.c | 8 ++++++++
2 files changed, 32 insertions(+)
diff --git a/arch/mips/jz4740/setup.c b/arch/mips/jz4740/setup.c
index afd84ee966e8..6948b133a15d 100644
--- a/arch/mips/jz4740/setup.c
+++ b/arch/mips/jz4740/setup.c
@@ -23,6 +23,7 @@
#include <asm/bootinfo.h>
#include <asm/mips_machine.h>
+#include <asm/page.h>
#include <asm/prom.h>
#include <asm/mach-jz4740/base.h>
@@ -102,6 +103,29 @@ void __init arch_init_irq(void)
irqchip_init();
}
+/*
+ * 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;
+ }
+}
+
static int __init jz4740_machine_setup(void)
{
mips_machine_setup();
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index 89785600fde4..cccfd7ba89fe 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -838,6 +838,14 @@ static void __init arch_mem_init(char **cmdline_p)
parse_early_param();
+#ifdef CONFIG_MACH_JZ4770
+ if (current_cpu_type() == CPU_JZRISC &&
+ mips_machtype == MACH_INGENIC_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();
--
2.11.0
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 00/15] Ingenic JZ4770 and GCW Zero patchset Paul Cercueil <paul@crapouillou.net> - 2017-06-07 22:10 +0200
[PATCH 03/15] clk: ingenic: Add code to enable/disable PLLs Paul Cercueil <paul@crapouillou.net> - 2017-06-07 22:10 +0200
[PATCH 14/15] devicetree/bindings: Add GCW vendor prefix Paul Cercueil <paul@crapouillou.net> - 2017-06-07 22:10 +0200
Re: [PATCH 14/15] devicetree/bindings: Add GCW vendor prefix Rob Herring <robh@kernel.org> - 2017-06-09 16:30 +0200
[PATCH 11/15] MIPS: ingenic: Initial JZ4770 support Paul Cercueil <paul@crapouillou.net> - 2017-06-07 22:10 +0200
[PATCH 08/15] MIPS: ingenic: Use common cmdline handling code Paul Cercueil <paul@crapouillou.net> - 2017-06-07 22:10 +0200
[PATCH 01/15] clk: ingenic: Fix recalc_rate for clocks with fixed divider Paul Cercueil <paul@crapouillou.net> - 2017-06-07 22:10 +0200
[PATCH 07/15] MIPS: Setup boot_command_line before plat_mem_setup Paul Cercueil <paul@crapouillou.net> - 2017-06-07 22:10 +0200
[PATCH 13/15] MIPS: JZ4770: Workaround for corrupted DMA transfers Paul Cercueil <paul@crapouillou.net> - 2017-06-07 22:10 +0200
[PATCH 04/15] clk: Add Ingenic jz4770 CGU driver Paul Cercueil <paul@crapouillou.net> - 2017-06-07 22:10 +0200
Re: [PATCH 04/15] clk: Add Ingenic jz4770 CGU driver Stephen Boyd <sboyd@codeaurora.org> - 2017-06-07 23:00 +0200
Re: [PATCH 04/15] clk: Add Ingenic jz4770 CGU driver Maarten ter Huurne <maarten@treewalker.org> - 2017-06-08 11:00 +0200
Re: [PATCH 04/15] clk: Add Ingenic jz4770 CGU driver Paul Cercueil <paul@crapouillou.net> - 2017-06-08 23:20 +0200
[PATCH 09/15] MIPS: platform: add machtype IDs for more Ingenic SoCs Paul Cercueil <paul@crapouillou.net> - 2017-06-07 22:10 +0200
csiph-web