4 * Copyright (C) 2007 OpenWrt.org
6 * Based on arch/mips/mm/init.c
7 * Copyright (C) 1994 - 2000 Ralf Baechle
8 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
9 * Kevin D. Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com
10 * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved.
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 #include <linux/bootmem.h>
27 #include <linux/init.h>
29 #include <linux/module.h>
30 #include <linux/pfn.h>
31 #include <linux/proc_fs.h>
32 #include <linux/string.h>
33 #include <linux/swap.h>
35 #include <asm/bootinfo.h>
37 #include <asm/sections.h>
39 #include <asm/mips-boards/prom.h>
41 static int __init
memsize(void)
43 u32 size
= (64 << 20);
44 volatile u32
*addr
= (u32
*)KSEG1ADDR(0x14000000 + size
- 4);
45 u32
*kernel_end
= (u32
*)KSEG1ADDR(CPHYSADDR((u32
)&_end
));
47 while (addr
> kernel_end
) {
55 if (*addr
!= (u32
)addr
)
58 } while (size
< (64 << 20));
63 void __init
prom_meminit(void)
67 pages
= memsize() >> PAGE_SHIFT
;
68 add_memory_region(ARCH_PFN_OFFSET
<< PAGE_SHIFT
, pages
<<
69 PAGE_SHIFT
, BOOT_MEM_RAM
);
72 void __init
prom_free_prom_memory(void)
This page took 0.071131 seconds and 5 git commands to generate.