2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
6 * PROM library functions for acquiring/using memory descriptors given to
9 * Copyright (C) 1999,2000,2012 MIPS Technologies, Inc.
10 * All rights reserved.
11 * Authors: Carsten Langgaard <carstenl@mips.com>
12 * Steven J. Hill <sjhill@mips.com>
14 #include <linux/init.h>
15 #include <linux/bootmem.h>
16 #include <linux/string.h>
18 #include <asm/bootinfo.h>
21 #include <asm/sections.h>
22 #include <asm/fw/fw.h>
24 /* determined physical memory size, not overridden by command line args */
25 unsigned long physical_memsize
= 0L;
27 static void free_init_pages_eva_malta(void *begin
, void *end
)
29 free_init_pages("unused kernel", __pa_symbol((unsigned long *)begin
),
30 __pa_symbol((unsigned long *)end
));
33 void __init
fw_meminit(void)
35 bool eva
= config_enabled(CONFIG_EVA
);
37 free_init_pages_eva
= eva
? free_init_pages_eva_malta
: NULL
;
40 void __init
prom_free_prom_memory(void)
45 for (i
= 0; i
< boot_mem_map
.nr_map
; i
++) {
46 if (boot_mem_map
.map
[i
].type
!= BOOT_MEM_ROM_DATA
)
49 addr
= boot_mem_map
.map
[i
].addr
;
50 free_init_pages("YAMON memory",
51 addr
, addr
+ boot_mem_map
.map
[i
].size
);
55 phys_addr_t
mips_cdmm_phys_base(void)
57 /* This address is "typically unused" */