diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
commit | 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch) | |
tree | 0bba044c4ce775e45a88a51686b5d9f90697ea9d /arch/ppc/syslib/ibm440sp_common.c |
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.
Let it rip!
Diffstat (limited to 'arch/ppc/syslib/ibm440sp_common.c')
-rw-r--r-- | arch/ppc/syslib/ibm440sp_common.c | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/arch/ppc/syslib/ibm440sp_common.c b/arch/ppc/syslib/ibm440sp_common.c new file mode 100644 index 000000000000..417d4cff77a0 --- /dev/null +++ b/arch/ppc/syslib/ibm440sp_common.c | |||
@@ -0,0 +1,71 @@ | |||
1 | /* | ||
2 | * arch/ppc/syslib/ibm440sp_common.c | ||
3 | * | ||
4 | * PPC440SP system library | ||
5 | * | ||
6 | * Matt Porter <mporter@kernel.crashing.org> | ||
7 | * Copyright 2002-2005 MontaVista Software Inc. | ||
8 | * | ||
9 | * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net> | ||
10 | * Copyright (c) 2003, 2004 Zultys Technologies | ||
11 | * | ||
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. | ||
16 | * | ||
17 | */ | ||
18 | #include <linux/config.h> | ||
19 | #include <linux/types.h> | ||
20 | #include <linux/serial.h> | ||
21 | |||
22 | #include <asm/param.h> | ||
23 | #include <asm/ibm44x.h> | ||
24 | #include <asm/mmu.h> | ||
25 | #include <asm/machdep.h> | ||
26 | #include <asm/time.h> | ||
27 | #include <asm/ppc4xx_pic.h> | ||
28 | |||
29 | /* | ||
30 | * Read the 440SP memory controller to get size of system memory. | ||
31 | */ | ||
32 | unsigned long __init ibm440sp_find_end_of_memory(void) | ||
33 | { | ||
34 | u32 i; | ||
35 | u32 mem_size = 0; | ||
36 | |||
37 | /* Read two bank sizes and sum */ | ||
38 | for (i=0; i<2; 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; | ||
42 | break; | ||
43 | case MQ0_CONFIG_SIZE_16M: | ||
44 | mem_size += PPC44x_MEM_SIZE_16M; | ||
45 | break; | ||
46 | case MQ0_CONFIG_SIZE_32M: | ||
47 | mem_size += PPC44x_MEM_SIZE_32M; | ||
48 | break; | ||
49 | case MQ0_CONFIG_SIZE_64M: | ||
50 | mem_size += PPC44x_MEM_SIZE_64M; | ||
51 | break; | ||
52 | case MQ0_CONFIG_SIZE_128M: | ||
53 | mem_size += PPC44x_MEM_SIZE_128M; | ||
54 | break; | ||
55 | case MQ0_CONFIG_SIZE_256M: | ||
56 | mem_size += PPC44x_MEM_SIZE_256M; | ||
57 | break; | ||
58 | case MQ0_CONFIG_SIZE_512M: | ||
59 | mem_size += PPC44x_MEM_SIZE_512M; | ||
60 | break; | ||
61 | case MQ0_CONFIG_SIZE_1G: | ||
62 | mem_size += PPC44x_MEM_SIZE_1G; | ||
63 | break; | ||
64 | case MQ0_CONFIG_SIZE_2G: | ||
65 | mem_size += PPC44x_MEM_SIZE_2G; | ||
66 | break; | ||
67 | default: | ||
68 | break; | ||
69 | } | ||
70 | return mem_size; | ||
71 | } | ||