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