Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Josh Boyer and committed by
Josh Boyer
658e8170 0ce49a39

+57 -9
+1 -1
arch/powerpc/boot/44x.h
··· 11 11 #define _PPC_BOOT_44X_H_ 12 12 13 13 void ebony_init(void *mac0, void *mac1); 14 - void bamboo_init(void); 14 + void bamboo_init(void *mac0, void *mac1); 15 15 16 16 #endif /* _PPC_BOOT_44X_H_ */
+2 -2
arch/powerpc/boot/Makefile
··· 49 49 src-plat := of.c cuboot-83xx.c cuboot-85xx.c holly.c \ 50 50 cuboot-ebony.c treeboot-ebony.c prpmc2800.c \ 51 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 53 src-boot := $(src-wlib) $(src-plat) empty.c 54 54 55 55 src-boot := $(addprefix $(obj)/, $(src-boot)) ··· 146 146 image-$(CONFIG_PPC_83xx) += cuImage.83xx 147 147 image-$(CONFIG_PPC_85xx) += cuImage.85xx 148 148 image-$(CONFIG_EBONY) += treeImage.ebony cuImage.ebony 149 - image-$(CONFIG_BAMBOO) += treeImage.bamboo 149 + image-$(CONFIG_BAMBOO) += treeImage.bamboo cuImage.bamboo 150 150 image-$(CONFIG_SEQUOIA) += cuImage.sequoia 151 151 image-$(CONFIG_WALNUT) += treeImage.walnut 152 152 endif
+5 -3
arch/powerpc/boot/bamboo.c
··· 24 24 #include "4xx.h" 25 25 #include "44x.h" 26 26 27 - extern char _dtb_start[]; 28 - extern char _dtb_end[]; 27 + static u8 *bamboo_mac0, *bamboo_mac1; 29 28 30 29 static void bamboo_fixups(void) 31 30 { ··· 33 34 ibm440ep_fixup_clocks(sysclk, 11059200); 34 35 ibm4xx_fixup_memsize(); 35 36 ibm4xx_quiesce_eth((u32 *)0xef600e00, (u32 *)0xef600f00); 37 + dt_fixup_mac_addresses(bamboo_mac0, bamboo_mac1); 36 38 } 37 39 38 - void bamboo_init(void) 40 + void bamboo_init(void *mac0, void *mac1) 39 41 { 40 42 platform_ops.fixups = bamboo_fixups; 41 43 platform_ops.exit = ibm44x_dbcr_reset; 44 + bamboo_mac0 = mac0; 45 + bamboo_mac1 = mac1; 42 46 ft_init(_dtb_start, 0, 32); 43 47 serial_console_init(); 44 48 }
+30
arch/powerpc/boot/cuboot-bamboo.c
··· 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 + }
+19 -3
arch/powerpc/boot/treeboot-bamboo.c
··· 12 12 #include "ops.h" 13 13 #include "stdio.h" 14 14 #include "44x.h" 15 - 16 - extern char _end[]; 15 + #include "stdlib.h" 17 16 18 17 BSS_STACK(4096); 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 + } 19 34 20 35 void platform_init(void) 21 36 { ··· 38 23 unsigned long avail_ram = end_of_ram - (unsigned long)_end; 39 24 40 25 simple_alloc_init(_end, avail_ram, 32, 64); 41 - bamboo_init(); 26 + read_pibs_mac(); 27 + bamboo_init((u8 *)&pibs_mac0, (u8 *)&pibs_mac1); 42 28 }