From f54bef9e9c84c8dc656c55dc96c1da7b6d1c53d8 Mon Sep 17 00:00:00 2001 From: "Mark A. Greer" Date: Sat, 3 Sep 2005 15:55:57 -0700 Subject: [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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- arch/ppc/boot/simple/misc-cpci690.c | 42 ++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) (limited to 'arch/ppc/boot') diff --git a/arch/ppc/boot/simple/misc-cpci690.c b/arch/ppc/boot/simple/misc-cpci690.c index ef08e86c9b25..26860300fa09 100644 --- a/arch/ppc/boot/simple/misc-cpci690.c +++ b/arch/ppc/boot/simple/misc-cpci690.c @@ -12,16 +12,56 @@ */ #include +#include #include +#define KB (1024UL) +#define MB (1024UL*KB) +#define GB (1024UL*MB) + extern u32 mv64x60_console_baud; extern u32 mv64x60_mpsc_clk_src; extern u32 mv64x60_mpsc_clk_freq; +u32 mag = 0xffff; + +unsigned long +get_mem_size(void) +{ + u32 size; + + switch (in_8(((void __iomem *)CPCI690_BR_BASE + CPCI690_BR_MEM_CTLR)) + & 0x07) { + case 0x01: + size = 256*MB; + break; + case 0x02: + size = 512*MB; + break; + case 0x03: + size = 768*MB; + break; + case 0x04: + size = 1*GB; + break; + case 0x05: + size = 1*GB + 512*MB; + break; + case 0x06: + size = 2*GB; + break; + default: + size = 0; + } + + return size; +} + void mv64x60_board_init(void __iomem *old_base, void __iomem *new_base) { mv64x60_console_baud = CPCI690_MPSC_BAUD; mv64x60_mpsc_clk_src = CPCI690_MPSC_CLK_SRC; - mv64x60_mpsc_clk_freq = CPCI690_BUS_FREQ; + mv64x60_mpsc_clk_freq = + (get_mem_size() >= (1*GB)) ? 100000000 : 133333333; } -- cgit v1.2.1