2 * PPC440SP/PPC440SPe system library
4 * Matt Porter <mporter@kernel.crashing.org>
5 * Copyright 2002-2005 MontaVista Software Inc.
7 * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
8 * Copyright (c) 2003, 2004 Zultys Technologies
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
16 #include <linux/config.h>
17 #include <linux/types.h>
18 #include <linux/serial.h>
20 #include <asm/param.h>
21 #include <asm/ibm44x.h>
23 #include <asm/machdep.h>
25 #include <asm/ppc4xx_pic.h>
28 * Read the 440SP memory controller to get size of system memory.
30 unsigned long __init
ibm440sp_find_end_of_memory(void)
35 /* Read two bank sizes and sum */
36 for (i
=0; i
< MQ0_NUM_BANKS
; i
++)
37 switch (mfdcr(DCRN_MQ0_BS0BAS
+ i
) & MQ0_CONFIG_SIZE_MASK
) {
38 case MQ0_CONFIG_SIZE_8M
:
39 mem_size
+= PPC44x_MEM_SIZE_8M
;
41 case MQ0_CONFIG_SIZE_16M
:
42 mem_size
+= PPC44x_MEM_SIZE_16M
;
44 case MQ0_CONFIG_SIZE_32M
:
45 mem_size
+= PPC44x_MEM_SIZE_32M
;
47 case MQ0_CONFIG_SIZE_64M
:
48 mem_size
+= PPC44x_MEM_SIZE_64M
;
50 case MQ0_CONFIG_SIZE_128M
:
51 mem_size
+= PPC44x_MEM_SIZE_128M
;
53 case MQ0_CONFIG_SIZE_256M
:
54 mem_size
+= PPC44x_MEM_SIZE_256M
;
56 case MQ0_CONFIG_SIZE_512M
:
57 mem_size
+= PPC44x_MEM_SIZE_512M
;
59 case MQ0_CONFIG_SIZE_1G
:
60 mem_size
+= PPC44x_MEM_SIZE_1G
;
62 case MQ0_CONFIG_SIZE_2G
:
63 mem_size
+= PPC44x_MEM_SIZE_2G
;