[POWERPC] cuimage for Bamboo board
authorJosh Boyer <jwboyer@linux.vnet.ibm.com>
Fri, 14 Sep 2007 18:54:11 +0000 (04:54 +1000)
committerJosh Boyer <jwboyer@gmail.com>
Thu, 20 Sep 2007 02:13:16 +0000 (21:13 -0500)
Add a cuboot wrapper for the Bamboo board.  Additionally, we enable MAC
address fixups for both cuboot and treeboot.

This also removes some obsoleted linker declarations that have been
moved into ops.h

Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
arch/powerpc/boot/44x.h
arch/powerpc/boot/Makefile
arch/powerpc/boot/bamboo.c
arch/powerpc/boot/cuboot-bamboo.c [new file with mode: 0644]
arch/powerpc/boot/treeboot-bamboo.c

index ad33dcc95ae5dee948fef3aba2098be25999f333..02563443788afd09e187b6c8f9bdb8badc40bd98 100644 (file)
@@ -11,6 +11,6 @@
 #define _PPC_BOOT_44X_H_
 
 void ebony_init(void *mac0, void *mac1);
-void bamboo_init(void);
+void bamboo_init(void *mac0, void *mac1);
 
 #endif /* _PPC_BOOT_44X_H_ */
index cffef147e042a4be6af6a72a0315b611e6be6f87..c1582b62911c6843d46f3f1b1eb4dce3779dc6ea 100644 (file)
@@ -49,7 +49,7 @@ src-wlib := string.S crt0.S stdio.c main.c flatdevtree.c flatdevtree_misc.c \
 src-plat := of.c cuboot-83xx.c cuboot-85xx.c holly.c \
                cuboot-ebony.c treeboot-ebony.c prpmc2800.c \
                ps3-head.S ps3-hvcall.S ps3.c treeboot-bamboo.c cuboot-8xx.c \
-               cuboot-pq2.c cuboot-sequoia.c treeboot-walnut.c
+               cuboot-pq2.c cuboot-sequoia.c treeboot-walnut.c cuboot-bamboo.c
 src-boot := $(src-wlib) $(src-plat) empty.c
 
 src-boot := $(addprefix $(obj)/, $(src-boot))
@@ -146,7 +146,7 @@ image-$(CONFIG_8260)                        += cuImage.pq2
 image-$(CONFIG_PPC_83xx)               += cuImage.83xx
 image-$(CONFIG_PPC_85xx)               += cuImage.85xx
 image-$(CONFIG_EBONY)                  += treeImage.ebony cuImage.ebony
-image-$(CONFIG_BAMBOO)                 += treeImage.bamboo
+image-$(CONFIG_BAMBOO)                 += treeImage.bamboo cuImage.bamboo
 image-$(CONFIG_SEQUOIA)                        += cuImage.sequoia
 image-$(CONFIG_WALNUT)                 += treeImage.walnut
 endif
index bc097694b445574bc1274be1556dddee59a511c7..f61fcdab1c7c59bf0f649f1e0e434a06431b6612 100644 (file)
@@ -24,8 +24,7 @@
 #include "4xx.h"
 #include "44x.h"
 
-extern char _dtb_start[];
-extern char _dtb_end[];
+static u8 *bamboo_mac0, *bamboo_mac1;
 
 static void bamboo_fixups(void)
 {
@@ -34,12 +33,15 @@ static void bamboo_fixups(void)
        ibm440ep_fixup_clocks(sysclk, 11059200);
        ibm4xx_fixup_memsize();
        ibm4xx_quiesce_eth((u32 *)0xef600e00, (u32 *)0xef600f00);
+       dt_fixup_mac_addresses(bamboo_mac0, bamboo_mac1);
 }
 
-void bamboo_init(void)
+void bamboo_init(void *mac0, void *mac1)
 {
        platform_ops.fixups = bamboo_fixups;
        platform_ops.exit = ibm44x_dbcr_reset;
+       bamboo_mac0 = mac0;
+       bamboo_mac1 = mac1;
        ft_init(_dtb_start, 0, 32);
        serial_console_init();
 }
diff --git a/arch/powerpc/boot/cuboot-bamboo.c b/arch/powerpc/boot/cuboot-bamboo.c
new file mode 100644 (file)
index 0000000..900c7ff
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Old U-boot compatibility for Bamboo
+ *
+ * Author: Josh Boyer <jwboyer@linux.vnet.ibm.com>
+ *
+ * Copyright 2007 IBM Corporation
+ *
+ * Based on cuboot-ebony.c
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation.
+ */
+
+#include "ops.h"
+#include "stdio.h"
+#include "44x.h"
+#include "cuboot.h"
+
+#define TARGET_44x
+#include "ppcboot.h"
+
+static bd_t bd;
+
+void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
+               unsigned long r6, unsigned long r7)
+{
+       CUBOOT_INIT();
+       bamboo_init(&bd.bi_enetaddr, &bd.bi_enet1addr);
+}
index 1f1fe5aaac126a43a642fa36da19e5bced225aca..9eee48fc7114daff3e2ea241ed61a1ca1d89e6fc 100644 (file)
 #include "ops.h"
 #include "stdio.h"
 #include "44x.h"
-
-extern char _end[];
+#include "stdlib.h"
 
 BSS_STACK(4096);
 
+#define PIBS_MAC0 0xfffc0400
+#define PIBS_MAC1 0xfffc0500
+char pibs_mac0[6];
+char pibs_mac1[6];
+
+static void read_pibs_mac(void)
+{
+       unsigned long long mac64;
+
+       mac64 = strtoull((char *)PIBS_MAC0, 0, 16);
+       memcpy(&pibs_mac0, (char *)&mac64+2, 6);
+
+       mac64 = strtoull((char *)PIBS_MAC1, 0, 16);
+       memcpy(&pibs_mac1, (char *)&mac64+2, 6);
+}
+
 void platform_init(void)
 {
        unsigned long end_of_ram = 0x8000000;
        unsigned long avail_ram = end_of_ram - (unsigned long)_end;
 
        simple_alloc_init(_end, avail_ram, 32, 64);
-       bamboo_init();
+       read_pibs_mac();
+       bamboo_init((u8 *)&pibs_mac0, (u8 *)&pibs_mac1);
 }