aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/mti-malta/malta-memory.c
diff options
context:
space:
mode:
authorPaul Burton <paul.burton@imgtec.com>2014-07-14 07:37:39 -0400
committerRalf Baechle <ralf@linux-mips.org>2014-08-01 18:06:46 -0400
commit3a551e25df278709e4aa0f7f7bf9105f726d2fc3 (patch)
treea20f5aabcc2671946f250eddbaafc25be7326ca6 /arch/mips/mti-malta/malta-memory.c
parentab9988a3dafb8c94c2a19637fb00f7d1db799347 (diff)
MIPS: Malta: initialise MAARs
Initialise the MAARs such that speculation is enabled for all physical addresses outside of the I/O region. Signed-off-by: Paul Burton <paul.burton@imgtec.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/7333/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/mti-malta/malta-memory.c')
-rw-r--r--arch/mips/mti-malta/malta-memory.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/arch/mips/mti-malta/malta-memory.c b/arch/mips/mti-malta/malta-memory.c
index 6d9773096750..0c35dee0a215 100644
--- a/arch/mips/mti-malta/malta-memory.c
+++ b/arch/mips/mti-malta/malta-memory.c
@@ -16,6 +16,7 @@
16#include <linux/string.h> 16#include <linux/string.h>
17 17
18#include <asm/bootinfo.h> 18#include <asm/bootinfo.h>
19#include <asm/maar.h>
19#include <asm/sections.h> 20#include <asm/sections.h>
20#include <asm/fw/fw.h> 21#include <asm/fw/fw.h>
21 22
@@ -164,3 +165,28 @@ void __init prom_free_prom_memory(void)
164 addr, addr + boot_mem_map.map[i].size); 165 addr, addr + boot_mem_map.map[i].size);
165 } 166 }
166} 167}
168
169unsigned platform_maar_init(unsigned num_pairs)
170{
171 phys_addr_t mem_end = (physical_memsize & ~0xffffull) - 1;
172 struct maar_config cfg[] = {
173 /* DRAM preceding I/O */
174 { 0x00000000, 0x0fffffff, MIPS_MAAR_S },
175
176 /* DRAM following I/O */
177 { 0x20000000, mem_end, MIPS_MAAR_S },
178
179 /* DRAM alias in upper half of physical */
180 { 0x80000000, 0x80000000 + mem_end, MIPS_MAAR_S },
181 };
182 unsigned i, num_cfg = ARRAY_SIZE(cfg);
183
184 /* If DRAM fits before I/O, drop the region following it */
185 if (physical_memsize <= 0x10000000) {
186 num_cfg--;
187 for (i = 1; i < num_cfg; i++)
188 cfg[i] = cfg[i + 1];
189 }
190
191 return maar_config(cfg, num_cfg, num_pairs);
192}