1 /*****************************************************************************
2 * Carsten Langgaard, carstenl@mips.com
3 * Copyright (C) 1999,2000 MIPS Technologies, Inc. All rights reserved.
4 * Copyright (C) 2003 ADMtek Incorporated.
5 * daniell@admtek.com.tw
6 * Copyright (C) 2005 Jeroen Vreeken (pe1rxq@amsat.org)
8 * ########################################################################
10 * This program is free software; you can distribute it and/or modify it
11 * under the terms of the GNU General Public License (Version 2) as
12 * published by the Free Software Foundation.
14 * This program is distributed in the hope it will be useful, but WITHOUT
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
23 * ########################################################################
25 *****************************************************************************/
27 #include <linux/autoconf.h>
28 #include <linux/init.h>
30 #include <linux/bootmem.h>
31 #include <linux/pfn.h>
32 #include <linux/string.h>
34 #include <asm/bootinfo.h>
36 #include <asm/sections.h>
38 #include <asm/mach-adm5120/adm5120_info.h>
39 #include <asm-mips/mips-boards/prom.h>
41 #define PFN_ALIGN(x) (((unsigned long)(x) + (PAGE_SIZE - 1)) & PAGE_MASK)
43 struct prom_pmemblock mdesc
[PROM_MAX_PMEMBLOCKS
];
45 struct prom_pmemblock
* __init
prom_getmdesc(void)
48 char cmdline
[CL_SIZE
], *ptr
;
50 memsize
= adm5120_memsize
;
51 /* Check the command line for a memsize directive that overrides
52 * the physical/default amount */
53 strcpy(cmdline
, arcs_cmdline
);
54 ptr
= strstr(cmdline
, "memsize=");
55 if (ptr
&& (ptr
!= cmdline
) && (*(ptr
- 1) != ' '))
56 ptr
= strstr(ptr
, " memsize=");
59 memsize
= memparse(ptr
+ 8, &ptr
);
61 memset(mdesc
, 0, sizeof(mdesc
));
62 mdesc
[0].type
= BOOT_MEM_RAM
;
63 mdesc
[0].base
= CPHYSADDR(PFN_ALIGN(&_end
));
64 mdesc
[0].size
= memsize
- mdesc
[0].base
;
69 void __init
prom_meminit(void)
71 struct prom_pmemblock
*p
;
78 unsigned long base
, size
;
82 add_memory_region(base
, size
, type
);
87 void __init
prom_free_prom_memory(void)
89 /* We do not have to prom memory to free */
This page took 0.045697 seconds and 5 git commands to generate.