X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Fppc%2Fboot%2Fsimple%2Fmisc-cpci690.c;h=26860300fa090e9302570811475afad8ab768dc2;hb=987b0145d94eecf292d8b301228356f44611ab7c;hp=ef08e86c9b25d398ddb2144bbeadcf4f2c4cd660;hpb=f7ed79d23a47594e7834d66a8f14449796d4f3e6;p=linux-2.6.git diff --git a/arch/ppc/boot/simple/misc-cpci690.c b/arch/ppc/boot/simple/misc-cpci690.c index ef08e86c9..26860300f 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; }