aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/mti-malta/malta-memory.c
diff options
context:
space:
mode:
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}