summaryrefslogtreecommitdiffstats
path: root/arch/ppc/boot
diff options
context:
space:
mode:
authorMark A. Greer <mgreer@mvista.com>2005-09-03 15:55:57 -0700
committerLinus Torvalds <torvalds@evo.osdl.org>2005-09-05 00:06:01 -0700
commitf54bef9e9c84c8dc656c55dc96c1da7b6d1c53d8 (patch)
treede93df49c67ebf63aeca64941a201365440e9551 /arch/ppc/boot
parentf4c6cc8d1e2305796f7fdad52d83b88cea4d2276 (diff)
downloadtalos-obmc-linux-f54bef9e9c84c8dc656c55dc96c1da7b6d1c53d8.tar.gz
talos-obmc-linux-f54bef9e9c84c8dc656c55dc96c1da7b6d1c53d8.zip
[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 ef08e86c9b25..26860300fa09 100644
--- a/arch/ppc/boot/simple/misc-cpci690.c
+++ b/arch/ppc/boot/simple/misc-cpci690.c
@@ -12,16 +12,56 @@
*/
#include <linux/types.h>
+#include <asm/io.h>
#include <platforms/cpci690.h>
+#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;
}
OpenPOWER on IntegriCloud