blob: 8c75cf6c238395a2c4e4abe550777b4f125a0353 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * arch/ppc/boot/common/cpc700_memory.c
3 *
4 * Find memory based upon settings in the CPC700 bridge
5 *
6 * Author: Dan Cox
7 *
8 * 2001-2002 (c) MontaVista, Software, Inc. This file is licensed under
9 * the terms of the GNU General Public License version 2. This program
10 * is licensed "as is" without any warranty of any kind, whether express
11 * or implied.
12 */
13
14#include <asm/types.h>
15#include <asm/io.h>
16#include "cpc700.h"
17
18unsigned long
19cpc700_get_mem_size(void)
20{
21 int i;
22 unsigned long len, amt;
23
24 /* Start at MB1EA, since MB0EA will most likely be the ending address
25 for ROM space. */
26 for(len = 0, i = CPC700_MB1EA; i <= CPC700_MB4EA; i+=4) {
27 amt = cpc700_read_memreg(i);
28 if (amt == 0)
29 break;
30 len = amt;
31 }
32
33 return len;
34}
35
36