diff options
author | Josh Boyer <jwboyer@linux.vnet.ibm.com> | 2007-09-14 14:54:11 -0400 |
---|---|---|
committer | Josh Boyer <jwboyer@gmail.com> | 2007-09-19 22:13:16 -0400 |
commit | 658e81701970a82d33f46241f20be416ebd5e930 (patch) | |
tree | 3390a85f111ee99c666dacb0573c455fe0ac2cf5 /arch/powerpc | |
parent | 0ce49a3945474fc942ec37c0c0efece60f592f80 (diff) |
[POWERPC] cuimage for Bamboo board
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>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/boot/44x.h | 2 | ||||
-rw-r--r-- | arch/powerpc/boot/Makefile | 4 | ||||
-rw-r--r-- | arch/powerpc/boot/bamboo.c | 8 | ||||
-rw-r--r-- | arch/powerpc/boot/cuboot-bamboo.c | 30 | ||||
-rw-r--r-- | arch/powerpc/boot/treeboot-bamboo.c | 22 |
5 files changed, 57 insertions, 9 deletions
diff --git a/arch/powerpc/boot/44x.h b/arch/powerpc/boot/44x.h index ad33dcc95ae5..02563443788a 100644 --- a/arch/powerpc/boot/44x.h +++ b/arch/powerpc/boot/44x.h | |||
@@ -11,6 +11,6 @@ | |||
11 | #define _PPC_BOOT_44X_H_ | 11 | #define _PPC_BOOT_44X_H_ |
12 | 12 | ||
13 | void ebony_init(void *mac0, void *mac1); | 13 | void ebony_init(void *mac0, void *mac1); |
14 | void bamboo_init(void); | 14 | void bamboo_init(void *mac0, void *mac1); |
15 | 15 | ||
16 | #endif /* _PPC_BOOT_44X_H_ */ | 16 | #endif /* _PPC_BOOT_44X_H_ */ |
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile index cffef147e042..c1582b62911c 100644 --- a/arch/powerpc/boot/Makefile +++ b/arch/powerpc/boot/Makefile | |||
@@ -49,7 +49,7 @@ src-wlib := string.S crt0.S stdio.c main.c flatdevtree.c flatdevtree_misc.c \ | |||
49 | src-plat := of.c cuboot-83xx.c cuboot-85xx.c holly.c \ | 49 | src-plat := of.c cuboot-83xx.c cuboot-85xx.c holly.c \ |
50 | cuboot-ebony.c treeboot-ebony.c prpmc2800.c \ | 50 | cuboot-ebony.c treeboot-ebony.c prpmc2800.c \ |
51 | ps3-head.S ps3-hvcall.S ps3.c treeboot-bamboo.c cuboot-8xx.c \ | 51 | ps3-head.S ps3-hvcall.S ps3.c treeboot-bamboo.c cuboot-8xx.c \ |
52 | cuboot-pq2.c cuboot-sequoia.c treeboot-walnut.c | 52 | cuboot-pq2.c cuboot-sequoia.c treeboot-walnut.c cuboot-bamboo.c |
53 | src-boot := $(src-wlib) $(src-plat) empty.c | 53 | src-boot := $(src-wlib) $(src-plat) empty.c |
54 | 54 | ||
55 | src-boot := $(addprefix $(obj)/, $(src-boot)) | 55 | src-boot := $(addprefix $(obj)/, $(src-boot)) |
@@ -146,7 +146,7 @@ image-$(CONFIG_8260) += cuImage.pq2 | |||
146 | image-$(CONFIG_PPC_83xx) += cuImage.83xx | 146 | image-$(CONFIG_PPC_83xx) += cuImage.83xx |
147 | image-$(CONFIG_PPC_85xx) += cuImage.85xx | 147 | image-$(CONFIG_PPC_85xx) += cuImage.85xx |
148 | image-$(CONFIG_EBONY) += treeImage.ebony cuImage.ebony | 148 | image-$(CONFIG_EBONY) += treeImage.ebony cuImage.ebony |
149 | image-$(CONFIG_BAMBOO) += treeImage.bamboo | 149 | image-$(CONFIG_BAMBOO) += treeImage.bamboo cuImage.bamboo |
150 | image-$(CONFIG_SEQUOIA) += cuImage.sequoia | 150 | image-$(CONFIG_SEQUOIA) += cuImage.sequoia |
151 | image-$(CONFIG_WALNUT) += treeImage.walnut | 151 | image-$(CONFIG_WALNUT) += treeImage.walnut |
152 | endif | 152 | endif |
diff --git a/arch/powerpc/boot/bamboo.c b/arch/powerpc/boot/bamboo.c index bc097694b445..f61fcdab1c7c 100644 --- a/arch/powerpc/boot/bamboo.c +++ b/arch/powerpc/boot/bamboo.c | |||
@@ -24,8 +24,7 @@ | |||
24 | #include "4xx.h" | 24 | #include "4xx.h" |
25 | #include "44x.h" | 25 | #include "44x.h" |
26 | 26 | ||
27 | extern char _dtb_start[]; | 27 | static u8 *bamboo_mac0, *bamboo_mac1; |
28 | extern char _dtb_end[]; | ||
29 | 28 | ||
30 | static void bamboo_fixups(void) | 29 | static void bamboo_fixups(void) |
31 | { | 30 | { |
@@ -34,12 +33,15 @@ static void bamboo_fixups(void) | |||
34 | ibm440ep_fixup_clocks(sysclk, 11059200); | 33 | ibm440ep_fixup_clocks(sysclk, 11059200); |
35 | ibm4xx_fixup_memsize(); | 34 | ibm4xx_fixup_memsize(); |
36 | ibm4xx_quiesce_eth((u32 *)0xef600e00, (u32 *)0xef600f00); | 35 | ibm4xx_quiesce_eth((u32 *)0xef600e00, (u32 *)0xef600f00); |
36 | dt_fixup_mac_addresses(bamboo_mac0, bamboo_mac1); | ||
37 | } | 37 | } |
38 | 38 | ||
39 | void bamboo_init(void) | 39 | void bamboo_init(void *mac0, void *mac1) |
40 | { | 40 | { |
41 | platform_ops.fixups = bamboo_fixups; | 41 | platform_ops.fixups = bamboo_fixups; |
42 | platform_ops.exit = ibm44x_dbcr_reset; | 42 | platform_ops.exit = ibm44x_dbcr_reset; |
43 | bamboo_mac0 = mac0; | ||
44 | bamboo_mac1 = mac1; | ||
43 | ft_init(_dtb_start, 0, 32); | 45 | ft_init(_dtb_start, 0, 32); |
44 | serial_console_init(); | 46 | serial_console_init(); |
45 | } | 47 | } |
diff --git a/arch/powerpc/boot/cuboot-bamboo.c b/arch/powerpc/boot/cuboot-bamboo.c new file mode 100644 index 000000000000..900c7ff2b7e9 --- /dev/null +++ b/arch/powerpc/boot/cuboot-bamboo.c | |||
@@ -0,0 +1,30 @@ | |||
1 | /* | ||
2 | * Old U-boot compatibility for Bamboo | ||
3 | * | ||
4 | * Author: Josh Boyer <jwboyer@linux.vnet.ibm.com> | ||
5 | * | ||
6 | * Copyright 2007 IBM Corporation | ||
7 | * | ||
8 | * Based on cuboot-ebony.c | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify it | ||
11 | * under the terms of the GNU General Public License version 2 as published | ||
12 | * by the Free Software Foundation. | ||
13 | */ | ||
14 | |||
15 | #include "ops.h" | ||
16 | #include "stdio.h" | ||
17 | #include "44x.h" | ||
18 | #include "cuboot.h" | ||
19 | |||
20 | #define TARGET_44x | ||
21 | #include "ppcboot.h" | ||
22 | |||
23 | static bd_t bd; | ||
24 | |||
25 | void platform_init(unsigned long r3, unsigned long r4, unsigned long r5, | ||
26 | unsigned long r6, unsigned long r7) | ||
27 | { | ||
28 | CUBOOT_INIT(); | ||
29 | bamboo_init(&bd.bi_enetaddr, &bd.bi_enet1addr); | ||
30 | } | ||
diff --git a/arch/powerpc/boot/treeboot-bamboo.c b/arch/powerpc/boot/treeboot-bamboo.c index 1f1fe5aaac12..9eee48fc7114 100644 --- a/arch/powerpc/boot/treeboot-bamboo.c +++ b/arch/powerpc/boot/treeboot-bamboo.c | |||
@@ -12,16 +12,32 @@ | |||
12 | #include "ops.h" | 12 | #include "ops.h" |
13 | #include "stdio.h" | 13 | #include "stdio.h" |
14 | #include "44x.h" | 14 | #include "44x.h" |
15 | 15 | #include "stdlib.h" | |
16 | extern char _end[]; | ||
17 | 16 | ||
18 | BSS_STACK(4096); | 17 | BSS_STACK(4096); |
19 | 18 | ||
19 | #define PIBS_MAC0 0xfffc0400 | ||
20 | #define PIBS_MAC1 0xfffc0500 | ||
21 | char pibs_mac0[6]; | ||
22 | char pibs_mac1[6]; | ||
23 | |||
24 | static void read_pibs_mac(void) | ||
25 | { | ||
26 | unsigned long long mac64; | ||
27 | |||
28 | mac64 = strtoull((char *)PIBS_MAC0, 0, 16); | ||
29 | memcpy(&pibs_mac0, (char *)&mac64+2, 6); | ||
30 | |||
31 | mac64 = strtoull((char *)PIBS_MAC1, 0, 16); | ||
32 | memcpy(&pibs_mac1, (char *)&mac64+2, 6); | ||
33 | } | ||
34 | |||
20 | void platform_init(void) | 35 | void platform_init(void) |
21 | { | 36 | { |
22 | unsigned long end_of_ram = 0x8000000; | 37 | unsigned long end_of_ram = 0x8000000; |
23 | unsigned long avail_ram = end_of_ram - (unsigned long)_end; | 38 | unsigned long avail_ram = end_of_ram - (unsigned long)_end; |
24 | 39 | ||
25 | simple_alloc_init(_end, avail_ram, 32, 64); | 40 | simple_alloc_init(_end, avail_ram, 32, 64); |
26 | bamboo_init(); | 41 | read_pibs_mac(); |
42 | bamboo_init((u8 *)&pibs_mac0, (u8 *)&pibs_mac1); | ||
27 | } | 43 | } |