aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ppc/boot
diff options
context:
space:
mode:
authorMark A. Greer <mgreer@mvista.com>2005-09-03 18:55:57 -0400
committerLinus Torvalds <torvalds@evo.osdl.org>2005-09-05 03:06:01 -0400
commitf54bef9e9c84c8dc656c55dc96c1da7b6d1c53d8 (patch)
treede93df49c67ebf63aeca64941a201365440e9551 /arch/ppc/boot
parentf4c6cc8d1e2305796f7fdad52d83b88cea4d2276 (diff)
[PATCH] ppc32: cpci690 updates
Update the cpci690 platform code: - pass mem size in from bootwrapper via bi_rec - some minor fixups Signed-off-by: Mark A. Greer <mgreer@mvista.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/ppc/boot')
-rw-r--r--arch/ppc/boot/simple/misc-cpci690.c42
1 files changed, 41 insertions, 1 deletions
diff --git a/arch/ppc/boot/simple/misc-cpci690.c b/arch/ppc/boot/simple/misc-cpci690.c
index ef08e86c9b2..26860300fa0 100644
--- a/arch/ppc/boot/simple/misc-cpci690.c
+++ b/arch/ppc/boot/simple/misc-cpci690.c
@@ -12,16 +12,56 @@
12 */ 12 */
13 13
14#include <linux/types.h> 14#include <linux/types.h>
15#include <asm/io.h>
15#include <platforms/cpci690.h> 16#include <platforms/cpci690.h>
16 17
18#define KB (1024UL)
19#define MB (1024UL*KB)
20#define GB (1024UL*MB)
21
17extern u32 mv64x60_console_baud; 22extern u32 mv64x60_console_baud;
18extern u32 mv64x60_mpsc_clk_src; 23extern u32 mv64x60_mpsc_clk_src;
19extern u32 mv64x60_mpsc_clk_freq; 24extern u32 mv64x60_mpsc_clk_freq;
20 25
26u32 mag = 0xffff;
27
28unsigned long
29get_mem_size(void)
30{
31 u32 size;
32
33 switch (in_8(((void __iomem *)CPCI690_BR_BASE + CPCI690_BR_MEM_CTLR))
34 & 0x07) {
35 case 0x01:
36 size = 256*MB;
37 break;
38 case 0x02:
39 size = 512*MB;
40 break;
41 case 0x03:
42 size = 768*MB;
43 break;
44 case 0x04:
45 size = 1*GB;
46 break;
47 case 0x05:
48 size = 1*GB + 512*MB;
49 break;
50 case 0x06:
51 size = 2*GB;
52 break;
53 default:
54 size = 0;
55 }
56
57 return size;
58}
59
21void 60void
22mv64x60_board_init(void __iomem *old_base, void __iomem *new_base) 61mv64x60_board_init(void __iomem *old_base, void __iomem *new_base)
23{ 62{
24 mv64x60_console_baud = CPCI690_MPSC_BAUD; 63 mv64x60_console_baud = CPCI690_MPSC_BAUD;
25 mv64x60_mpsc_clk_src = CPCI690_MPSC_CLK_SRC; 64 mv64x60_mpsc_clk_src = CPCI690_MPSC_CLK_SRC;
26 mv64x60_mpsc_clk_freq = CPCI690_BUS_FREQ; 65 mv64x60_mpsc_clk_freq =
66 (get_mem_size() >= (1*GB)) ? 100000000 : 133333333;
27} 67}