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

[PATCH] ppc32: cleanup AMCC PPC40x eval boards to support U-Boot

Cleanup PPC40x eval boards (bubinga, walnut and sycamore) to support U-Boot
as bootloader. The OpenBIOS bd_info struct is not used in the kernel
anymore (only U-Boot now).

uImage (U-Boot) tested on walnut, sycamore and bubinga
zImage (OpenBIOS) tested on sycamore, bubinga and ebony

Signed-off-by: Stefan Roese <sr@denx.de>
Signed-off-by: Matt Porter <mporter@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Matt Porter and committed by
Linus Torvalds
3e9e7c1d 90eb2665

+237 -146
+20 -1
arch/ppc/boot/simple/Makefile
··· 67 67 entrypoint-$(CONFIG_BAMBOO) := 0x01000000 68 68 extra.o-$(CONFIG_BAMBOO) := pibs.o 69 69 70 + zimage-$(CONFIG_BUBINGA) := zImage-TREE 71 + zimageinitrd-$(CONFIG_BUBINGA) := zImage.initrd-TREE 72 + end-$(CONFIG_BUBINGA) := bubinga 73 + entrypoint-$(CONFIG_BUBINGA) := 0x01000000 74 + extra.o-$(CONFIG_BUBINGA) := openbios.o 75 + 70 76 zimage-$(CONFIG_EBONY) := zImage-TREE 71 77 zimageinitrd-$(CONFIG_EBONY) := zImage.initrd-TREE 72 78 end-$(CONFIG_EBONY) := ebony ··· 96 90 end-$(CONFIG_OCOTEA) := ocotea 97 91 entrypoint-$(CONFIG_OCOTEA) := 0x01000000 98 92 extra.o-$(CONFIG_OCOTEA) := pibs.o 93 + 94 + zimage-$(CONFIG_SYCAMORE) := zImage-TREE 95 + zimageinitrd-$(CONFIG_SYCAMORE) := zImage.initrd-TREE 96 + end-$(CONFIG_SYCAMORE) := sycamore 97 + entrypoint-$(CONFIG_SYCAMORE) := 0x01000000 98 + extra.o-$(CONFIG_SYCAMORE) := openbios.o 99 + 100 + zimage-$(CONFIG_WALNUT) := zImage-TREE 101 + zimageinitrd-$(CONFIG_WALNUT) := zImage.initrd-TREE 102 + end-$(CONFIG_WALNUT) := walnut 103 + entrypoint-$(CONFIG_WALNUT) := 0x01000000 104 + extra.o-$(CONFIG_WALNUT) := openbios.o 99 105 100 106 extra.o-$(CONFIG_EV64260) := misc-ev64260.o 101 107 end-$(CONFIG_EV64260) := ev64260 ··· 186 168 187 169 # head.o and relocate.o must be at the start. 188 170 boot-y := head.o relocate.o $(extra.o-y) $(misc-y) 189 - boot-$(CONFIG_40x) += embed_config.o 171 + boot-$(CONFIG_REDWOOD_5) += embed_config.o 172 + boot-$(CONFIG_REDWOOD_6) += embed_config.o 190 173 boot-$(CONFIG_8xx) += embed_config.o 191 174 boot-$(CONFIG_8260) += embed_config.o 192 175 boot-$(CONFIG_BSEIP) += iic.o
+13 -3
arch/ppc/boot/simple/misc.c
··· 23 23 #include <asm/page.h> 24 24 #include <asm/mmu.h> 25 25 #include <asm/bootinfo.h> 26 - #ifdef CONFIG_44x 26 + #ifdef CONFIG_4xx 27 27 #include <asm/ibm4xx.h> 28 28 #endif 29 29 #include <asm/reg.h> ··· 88 88 return 0; 89 89 } 90 90 91 + #if defined(CONFIG_40x) 92 + #define PPC4xx_EMAC0_MR0 EMAC0_BASE 93 + #endif 94 + 95 + #if defined(CONFIG_44x) && defined(PPC44x_EMAC0_MR0) 96 + #define PPC4xx_EMAC0_MR0 PPC44x_EMAC0_MR0 97 + #endif 98 + 91 99 struct bi_record * 92 100 decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum) 93 101 { ··· 111 103 com_port = serial_init(0, NULL); 112 104 #endif 113 105 114 - #if defined(CONFIG_44x) && defined(PPC44x_EMAC0_MR0) 106 + #if defined(PPC4xx_EMAC0_MR0) 115 107 /* Reset MAL */ 116 108 mtdcr(DCRN_MALCR(DCRN_MAL_BASE), MALCR_MMSR); 117 109 /* Wait for reset */ 118 110 while (mfdcr(DCRN_MALCR(DCRN_MAL_BASE)) & MALCR_MMSR) {}; 119 111 /* Reset EMAC */ 120 - *(volatile unsigned long *)PPC44x_EMAC0_MR0 = 0x20000000; 112 + *(volatile unsigned long *)PPC4xx_EMAC0_MR0 = 0x20000000; 121 113 __asm__ __volatile__("eieio"); 122 114 #endif 123 115 ··· 172 164 puts(" "); puthex((unsigned long)(&__ramdisk_end));puts("\n"); 173 165 } 174 166 167 + #ifndef CONFIG_40x /* don't overwrite the 40x image located at 0x00400000! */ 175 168 avail_ram = (char *)0x00400000; 169 + #endif 176 170 end_avail = (char *)0x00800000; 177 171 puts("avail ram: "); puthex((unsigned long)avail_ram); puts(" "); 178 172 puthex((unsigned long)end_avail); puts("\n");
+100 -6
arch/ppc/boot/simple/openbios.c
··· 1 1 /* 2 2 * arch/ppc/boot/simple/openbios.c 3 3 * 4 - * 2005 (c) SYSGO AG - g.jaeger@sysgo.com 4 + * Copyright (c) 2005 DENX Software Engineering 5 + * Stefan Roese <sr@denx.de> 6 + * 7 + * Based on original work by 8 + * 2005 (c) SYSGO AG - g.jaeger@sysgo.com 9 + * 5 10 * This file is licensed under the terms of the GNU General Public 6 11 * License version 2. This program is licensed "as is" without 7 12 * any warranty of any kind, whether express or implied. 8 13 * 9 - * Derived from arch/ppc/boot/simple/pibs.c (from MontaVista) 10 14 */ 11 15 12 16 #include <linux/types.h> 13 17 #include <linux/config.h> 14 18 #include <linux/string.h> 15 19 #include <asm/ppcboot.h> 16 - #include <platforms/4xx/ebony.h> 20 + #include <asm/ibm4xx.h> 21 + #include <asm/reg.h> 22 + #ifdef CONFIG_40x 23 + #include <asm/io.h> 24 + #endif 25 + 26 + #if defined(CONFIG_BUBINGA) 27 + #define BOARD_INFO_VECTOR 0xFFF80B50 /* openbios 1.19 moved this vector down - armin */ 28 + #else 29 + #define BOARD_INFO_VECTOR 0xFFFE0B50 30 + #endif 31 + 32 + #ifdef CONFIG_40x 33 + /* Supply a default Ethernet address for those eval boards that don't 34 + * ship with one. This is an address from the MBX board I have, so 35 + * it is unlikely you will find it on your network. 36 + */ 37 + static ushort def_enet_addr[] = { 0x0800, 0x3e26, 0x1559 }; 38 + 39 + extern unsigned long timebase_period_ns; 40 + #endif /* CONFIG_40x */ 17 41 18 42 extern unsigned long decompress_kernel(unsigned long load_addr, int num_words, 19 43 unsigned long cksum); ··· 47 23 bd_t hold_resid_buf __attribute__ ((__section__ (".data.boot"))); 48 24 bd_t *hold_residual = &hold_resid_buf; 49 25 26 + typedef struct openbios_board_info { 27 + unsigned char bi_s_version[4]; /* Version of this structure */ 28 + unsigned char bi_r_version[30]; /* Version of the IBM ROM */ 29 + unsigned int bi_memsize; /* DRAM installed, in bytes */ 30 + #ifdef CONFIG_405EP 31 + unsigned char bi_enetaddr[2][6]; /* Local Ethernet MAC address */ 32 + #else /* CONFIG_405EP */ 33 + unsigned char bi_enetaddr[6]; /* Local Ethernet MAC address */ 34 + #endif /* CONFIG_405EP */ 35 + unsigned char bi_pci_enetaddr[6]; /* PCI Ethernet MAC address */ 36 + unsigned int bi_intfreq; /* Processor speed, in Hz */ 37 + unsigned int bi_busfreq; /* PLB Bus speed, in Hz */ 38 + unsigned int bi_pci_busfreq; /* PCI Bus speed, in Hz */ 39 + #ifdef CONFIG_405EP 40 + unsigned int bi_opb_busfreq; /* OPB Bus speed, in Hz */ 41 + unsigned int bi_pllouta_freq; /* PLL OUTA speed, in Hz */ 42 + #endif /* CONFIG_405EP */ 43 + } openbios_bd_t; 44 + 50 45 void * 51 46 load_kernel(unsigned long load_addr, int num_words, unsigned long cksum, 52 47 void *ign1, void *ign2) 53 48 { 54 - decompress_kernel(load_addr, num_words, cksum); 49 + #ifdef CONFIG_40x 50 + openbios_bd_t *openbios_bd = NULL; 51 + openbios_bd_t *(*get_board_info)(void) = 52 + (openbios_bd_t *(*)(void))(*(unsigned long *)BOARD_INFO_VECTOR); 55 53 54 + /* 55 + * On 40x platforms we not only need the MAC-addresses, but also the 56 + * clocks and memsize. Now try to get all values using the OpenBIOS 57 + * "get_board_info()" callback. 58 + */ 59 + if ((openbios_bd = get_board_info()) != NULL) { 60 + /* 61 + * Copy bd_info from OpenBIOS struct into U-Boot struct 62 + * used by kernel 63 + */ 64 + hold_residual->bi_memsize = openbios_bd->bi_memsize; 65 + hold_residual->bi_intfreq = openbios_bd->bi_intfreq; 66 + hold_residual->bi_busfreq = openbios_bd->bi_busfreq; 67 + hold_residual->bi_pci_busfreq = openbios_bd->bi_pci_busfreq; 68 + memcpy(hold_residual->bi_pci_enetaddr, openbios_bd->bi_pci_enetaddr, 6); 69 + #ifdef CONFIG_405EP 70 + memcpy(hold_residual->bi_enetaddr, openbios_bd->bi_enetaddr[0], 6); 71 + memcpy(hold_residual->bi_enet1addr, openbios_bd->bi_enetaddr[1], 6); 72 + hold_residual->bi_opbfreq = openbios_bd->bi_opb_busfreq; 73 + hold_residual->bi_procfreq = openbios_bd->bi_pllouta_freq; 74 + #else /* CONFIG_405EP */ 75 + memcpy(hold_residual->bi_enetaddr, openbios_bd->bi_enetaddr, 6); 76 + #endif /* CONFIG_405EP */ 77 + } else { 78 + /* Hmmm...better try to stuff some defaults. 79 + */ 80 + hold_residual->bi_memsize = 16 * 1024 * 1024; 81 + hold_residual->bi_intfreq = 200000000; 82 + hold_residual->bi_busfreq = 100000000; 83 + hold_residual->bi_pci_busfreq = 66666666; 84 + 85 + /* 86 + * Only supply one mac-address in this fallback 87 + */ 88 + memcpy(hold_residual->bi_enetaddr, (void *)def_enet_addr, 6); 89 + #ifdef CONFIG_405EP 90 + hold_residual->bi_opbfreq = 50000000; 91 + hold_residual->bi_procfreq = 200000000; 92 + #endif /* CONFIG_405EP */ 93 + } 94 + 95 + timebase_period_ns = 1000000000 / hold_residual->bi_intfreq; 96 + #endif /* CONFIG_40x */ 97 + 98 + #ifdef CONFIG_440GP 56 99 /* simply copy the MAC addresses */ 57 - memcpy(hold_residual->bi_enetaddr, (char *)EBONY_OPENBIOS_MAC_BASE, 6); 58 - memcpy(hold_residual->bi_enet1addr, (char *)(EBONY_OPENBIOS_MAC_BASE+EBONY_OPENBIOS_MAC_OFFSET), 6); 100 + memcpy(hold_residual->bi_enetaddr, (char *)OPENBIOS_MAC_BASE, 6); 101 + memcpy(hold_residual->bi_enet1addr, (char *)(OPENBIOS_MAC_BASE+OPENBIOS_MAC_OFFSET), 6); 102 + #endif /* CONFIG_440GP */ 103 + 104 + decompress_kernel(load_addr, num_words, cksum); 59 105 60 106 return (void *)hold_residual; 61 107 }
+1 -1
arch/ppc/platforms/4xx/Kconfig
··· 225 225 226 226 config IBM_OPENBIOS 227 227 bool 228 - depends on ASH || BUBINGA || REDWOOD_5 || REDWOOD_6 || SYCAMORE || WALNUT 228 + depends on ASH || REDWOOD_5 || REDWOOD_6 229 229 default y 230 230 231 231 config PPC4xx_DMA
+1 -1
arch/ppc/platforms/4xx/bubinga.c
··· 89 89 * by 16. 90 90 */ 91 91 uart_div = (mfdcr(DCRN_CPC0_UCR_BASE) & DCRN_CPC0_UCR_U0DIV); 92 - uart_clock = __res.bi_pllouta_freq / uart_div; 92 + uart_clock = __res.bi_procfreq / uart_div; 93 93 94 94 /* Setup serial port access */ 95 95 memset(&port, 0, sizeof(port));
+26 -38
arch/ppc/platforms/4xx/bubinga.h
··· 1 1 /* 2 - * Support for IBM PPC 405EP evaluation board (Bubinga). 2 + * arch/ppc/platforms/4xx/bubinga.h 3 3 * 4 - * Author: SAW (IBM), derived from walnut.h. 5 - * Maintained by MontaVista Software <source@mvista.com> 4 + * Bubinga board definitions 6 5 * 7 - * 2003 (c) MontaVista Softare Inc. This file is licensed under the 8 - * terms of the GNU General Public License version 2. This program is 9 - * licensed "as is" without any warranty of any kind, whether express 10 - * or implied. 6 + * Copyright (c) 2005 DENX Software Engineering 7 + * Stefan Roese <sr@denx.de> 8 + * 9 + * Based on original work by 10 + * SAW (IBM) 11 + * 2003 (c) MontaVista Softare Inc. 12 + * 13 + * This program is free software; you can redistribute it and/or modify it 14 + * under the terms of the GNU General Public License as published by the 15 + * Free Software Foundation; either version 2 of the License, or (at your 16 + * option) any later version. 17 + * 11 18 */ 12 19 13 20 #ifdef __KERNEL__ 14 21 #ifndef __BUBINGA_H__ 15 22 #define __BUBINGA_H__ 16 23 17 - /* 405EP */ 24 + #include <linux/config.h> 18 25 #include <platforms/4xx/ibm405ep.h> 19 - 20 - #ifndef __ASSEMBLY__ 21 - /* 22 - * Data structure defining board information maintained by the boot 23 - * ROM on IBM's evaluation board. An effort has been made to 24 - * keep the field names consistent with the 8xx 'bd_t' board info 25 - * structures. 26 - */ 27 - 28 - typedef struct board_info { 29 - unsigned char bi_s_version[4]; /* Version of this structure */ 30 - unsigned char bi_r_version[30]; /* Version of the IBM ROM */ 31 - unsigned int bi_memsize; /* DRAM installed, in bytes */ 32 - unsigned char bi_enetaddr[2][6]; /* Local Ethernet MAC address */ unsigned char bi_pci_enetaddr[6]; /* PCI Ethernet MAC address */ 33 - unsigned int bi_intfreq; /* Processor speed, in Hz */ 34 - unsigned int bi_busfreq; /* PLB Bus speed, in Hz */ 35 - unsigned int bi_pci_busfreq; /* PCI Bus speed, in Hz */ 36 - unsigned int bi_opb_busfreq; /* OPB Bus speed, in Hz */ 37 - unsigned int bi_pllouta_freq; /* PLL OUTA speed, in Hz */ 38 - } bd_t; 39 - 40 - /* Some 4xx parts use a different timebase frequency from the internal clock. 41 - */ 42 - #define bi_tbfreq bi_intfreq 43 - 26 + #include <asm/ppcboot.h> 44 27 45 28 /* Memory map for the Bubinga board. 46 29 * Generic 4xx plus RTC. 47 30 */ 48 31 49 - extern void *bubinga_rtc_base; 50 32 #define BUBINGA_RTC_PADDR ((uint)0xf0000000) 51 33 #define BUBINGA_RTC_VADDR BUBINGA_RTC_PADDR 52 34 #define BUBINGA_RTC_SIZE ((uint)8*1024) ··· 40 58 * for typical configurations at various CPU speeds. 41 59 * The base baud is calculated as (FWDA / EXT UART DIV / 16) 42 60 */ 43 - #define BASE_BAUD 0 61 + #define BASE_BAUD 0 44 62 45 - #define BUBINGA_FPGA_BASE 0xF0300000 63 + /* Flash */ 64 + #define PPC40x_FPGA_BASE 0xF0300000 65 + #define PPC40x_FPGA_REG_OFFS 1 /* offset to flash map reg */ 66 + #define PPC40x_FLASH_ONBD_N(x) (x & 0x02) 67 + #define PPC40x_FLASH_SRAM_SEL(x) (x & 0x01) 68 + #define PPC40x_FLASH_LOW 0xFFF00000 69 + #define PPC40x_FLASH_HIGH 0xFFF80000 70 + #define PPC40x_FLASH_SIZE 0x80000 46 71 47 - #define PPC4xx_MACHINE_NAME "IBM Bubinga" 72 + #define PPC4xx_MACHINE_NAME "IBM Bubinga" 48 73 49 - #endif /* !__ASSEMBLY__ */ 50 74 #endif /* __BUBINGA_H__ */ 51 75 #endif /* __KERNEL__ */
+2 -2
arch/ppc/platforms/4xx/ebony.h
··· 24 24 #define PPC44x_EMAC0_MR0 0xE0000800 25 25 26 26 /* Where to find the MAC info */ 27 - #define EBONY_OPENBIOS_MAC_BASE 0xfffffe0c 28 - #define EBONY_OPENBIOS_MAC_OFFSET 0x0c 27 + #define OPENBIOS_MAC_BASE 0xfffffe0c 28 + #define OPENBIOS_MAC_OFFSET 0x0c 29 29 30 30 /* Default clock rates for Rev. B and Rev. C silicon */ 31 31 #define EBONY_440GP_RB_SYSCLK 33000000
+2 -5
arch/ppc/platforms/4xx/sycamore.c
··· 88 88 void __init 89 89 sycamore_setup_arch(void) 90 90 { 91 - #define SYCAMORE_PS2_BASE 0xF0100000 92 - #define SYCAMORE_FPGA_BASE 0xF0300000 93 - 94 91 void *fpga_brdc; 95 92 unsigned char fpga_brdc_data; 96 93 void *fpga_enable; ··· 97 100 98 101 ppc4xx_setup_arch(); 99 102 100 - ibm_ocp_set_emac(0, 1); 103 + ibm_ocp_set_emac(0, 0); 101 104 102 105 kb_data = ioremap(SYCAMORE_PS2_BASE, 8); 103 106 if (!kb_data) { ··· 108 111 109 112 kb_cs = kb_data + 1; 110 113 111 - fpga_status = ioremap(SYCAMORE_FPGA_BASE, 8); 114 + fpga_status = ioremap(PPC40x_FPGA_BASE, 8); 112 115 if (!fpga_status) { 113 116 printk(KERN_CRIT 114 117 "sycamore_setup_arch() fpga_status ioremap failed\n");
+26 -41
arch/ppc/platforms/4xx/sycamore.h
··· 1 1 /* 2 2 * arch/ppc/platforms/4xx/sycamore.h 3 3 * 4 - * Macros, definitions, and data structures specific to the IBM PowerPC 5 - * 405GPr "Sycamore" evaluation board. 4 + * Sycamore board definitions 6 5 * 7 - * Author: Armin Kuster <akuster@mvista.com> 6 + * Copyright (c) 2005 DENX Software Engineering 7 + * Stefan Roese <sr@denx.de> 8 8 * 9 - * 2000 (c) MontaVista, Software, Inc. This file is licensed under 10 - * the terms of the GNU General Public License version 2. This program 11 - * is licensed "as is" without any warranty of any kind, whether express 12 - * or implied. 9 + * Based on original work by 10 + * Armin Kuster <akuster@mvista.com> 11 + * 2000 (c) MontaVista, Software, Inc. 12 + * 13 + * This program is free software; you can redistribute it and/or modify it 14 + * under the terms of the GNU General Public License as published by the 15 + * Free Software Foundation; either version 2 of the License, or (at your 16 + * option) any later version. 17 + * 13 18 */ 14 19 15 20 #ifdef __KERNEL__ 16 21 #ifndef __ASM_SYCAMORE_H__ 17 22 #define __ASM_SYCAMORE_H__ 18 23 24 + #include <linux/config.h> 19 25 #include <platforms/4xx/ibm405gpr.h> 26 + #include <asm/ppcboot.h> 20 27 21 - #ifndef __ASSEMBLY__ 22 - /* 23 - * Data structure defining board information maintained by the boot 24 - * ROM on IBM's "Sycamore" evaluation board. An effort has been made to 25 - * keep the field names consistent with the 8xx 'bd_t' board info 26 - * structures. 27 - */ 28 - 29 - typedef struct board_info { 30 - unsigned char bi_s_version[4]; /* Version of this structure */ 31 - unsigned char bi_r_version[30]; /* Version of the IBM ROM */ 32 - unsigned int bi_memsize; /* DRAM installed, in bytes */ 33 - unsigned char bi_enetaddr[6]; /* Local Ethernet MAC address */ 34 - unsigned char bi_pci_enetaddr[6]; /* PCI Ethernet MAC address */ 35 - unsigned int bi_intfreq; /* Processor speed, in Hz */ 36 - unsigned int bi_busfreq; /* PLB Bus speed, in Hz */ 37 - unsigned int bi_pci_busfreq; /* PCI Bus speed, in Hz */ 38 - } bd_t; 39 - 40 - /* Some 4xx parts use a different timebase frequency from the internal clock. 41 - */ 42 - #define bi_tbfreq bi_intfreq 43 - 44 - 45 - /* Memory map for the IBM "Sycamore" 405GP evaluation board. 28 + /* Memory map for the IBM "Sycamore" 405GPr evaluation board. 46 29 * Generic 4xx plus RTC. 47 30 */ 48 31 49 - extern void *sycamore_rtc_base; 50 32 #define SYCAMORE_RTC_PADDR ((uint)0xf0000000) 51 33 #define SYCAMORE_RTC_VADDR SYCAMORE_RTC_PADDR 52 - #define SYCAMORE_RTC_SIZE ((uint)8*1024) 34 + #define SYCAMORE_RTC_SIZE ((uint)8*1024) 53 35 54 - #ifdef CONFIG_PPC405GP_INTERNAL_CLOCK 55 - #define BASE_BAUD 201600 56 - #else 57 36 #define BASE_BAUD 691200 58 - #endif 59 37 60 - #define SYCAMORE_PS2_BASE 0xF0100000 61 - #define SYCAMORE_FPGA_BASE 0xF0300000 38 + #define SYCAMORE_PS2_BASE 0xF0100000 39 + 40 + /* Flash */ 41 + #define PPC40x_FPGA_BASE 0xF0300000 42 + #define PPC40x_FPGA_REG_OFFS 5 /* offset to flash map reg */ 43 + #define PPC40x_FLASH_ONBD_N(x) (x & 0x02) 44 + #define PPC40x_FLASH_SRAM_SEL(x) (x & 0x01) 45 + #define PPC40x_FLASH_LOW 0xFFF00000 46 + #define PPC40x_FLASH_HIGH 0xFFF80000 47 + #define PPC40x_FLASH_SIZE 0x80000 62 48 63 49 #define PPC4xx_MACHINE_NAME "IBM Sycamore" 64 50 65 - #endif /* !__ASSEMBLY__ */ 66 51 #endif /* __ASM_SYCAMORE_H__ */ 67 52 #endif /* __KERNEL__ */
+1 -1
arch/ppc/platforms/4xx/walnut.c
··· 90 90 91 91 kb_cs = kb_data + 1; 92 92 93 - fpga_status = ioremap(WALNUT_FPGA_BASE, 8); 93 + fpga_status = ioremap(PPC40x_FPGA_BASE, 8); 94 94 if (!fpga_status) { 95 95 printk(KERN_CRIT 96 96 "walnut_setup_arch() fpga_status ioremap failed\n");
+25 -42
arch/ppc/platforms/4xx/walnut.h
··· 1 1 /* 2 2 * arch/ppc/platforms/4xx/walnut.h 3 3 * 4 - * Macros, definitions, and data structures specific to the IBM PowerPC 5 - * 405GP "Walnut" evaluation board. 4 + * Walnut board definitions 6 5 * 7 - * Authors: Grant Erickson <grant@lcse.umn.edu>, Frank Rowand 8 - * <frank_rowand@mvista.com>, Debbie Chu <debbie_chu@mvista.com> or 9 - * source@mvista.com 6 + * Copyright (c) 2005 DENX Software Engineering 7 + * Stefan Roese <sr@denx.de> 10 8 * 11 - * Copyright (c) 1999 Grant Erickson <grant@lcse.umn.edu> 9 + * Based on original work by 10 + * Copyright (c) 1999 Grant Erickson <grant@lcse.umn.edu> 11 + * Frank Rowand <frank_rowand@mvista.com> 12 + * Debbie Chu <debbie_chu@mvista.com> 13 + * 2000 (c) MontaVista, Software, Inc. 12 14 * 13 - * 2000 (c) MontaVista, Software, Inc. This file is licensed under 14 - * the terms of the GNU General Public License version 2. This program 15 - * is licensed "as is" without any warranty of any kind, whether express 16 - * or implied. 15 + * This program is free software; you can redistribute it and/or modify it 16 + * under the terms of the GNU General Public License as published by the 17 + * Free Software Foundation; either version 2 of the License, or (at your 18 + * option) any later version. 19 + * 17 20 */ 18 21 19 22 #ifdef __KERNEL__ 20 23 #ifndef __ASM_WALNUT_H__ 21 24 #define __ASM_WALNUT_H__ 22 25 23 - /* We have a 405GP core */ 26 + #include <linux/config.h> 24 27 #include <platforms/4xx/ibm405gp.h> 25 - 26 - #ifndef __ASSEMBLY__ 27 - /* 28 - * Data structure defining board information maintained by the boot 29 - * ROM on IBM's "Walnut" evaluation board. An effort has been made to 30 - * keep the field names consistent with the 8xx 'bd_t' board info 31 - * structures. 32 - */ 33 - 34 - typedef struct board_info { 35 - unsigned char bi_s_version[4]; /* Version of this structure */ 36 - unsigned char bi_r_version[30]; /* Version of the IBM ROM */ 37 - unsigned int bi_memsize; /* DRAM installed, in bytes */ 38 - unsigned char bi_enetaddr[6]; /* Local Ethernet MAC address */ 39 - unsigned char bi_pci_enetaddr[6]; /* PCI Ethernet MAC address */ 40 - unsigned int bi_intfreq; /* Processor speed, in Hz */ 41 - unsigned int bi_busfreq; /* PLB Bus speed, in Hz */ 42 - unsigned int bi_pci_busfreq; /* PCI Bus speed, in Hz */ 43 - } bd_t; 44 - 45 - /* Some 4xx parts use a different timebase frequency from the internal clock. 46 - */ 47 - #define bi_tbfreq bi_intfreq 48 - 28 + #include <asm/ppcboot.h> 49 29 50 30 /* Memory map for the IBM "Walnut" 405GP evaluation board. 51 31 * Generic 4xx plus RTC. 52 32 */ 53 33 54 - extern void *walnut_rtc_base; 55 34 #define WALNUT_RTC_PADDR ((uint)0xf0000000) 56 35 #define WALNUT_RTC_VADDR WALNUT_RTC_PADDR 57 36 #define WALNUT_RTC_SIZE ((uint)8*1024) 58 37 59 - #ifdef CONFIG_PPC405GP_INTERNAL_CLOCK 60 - #define BASE_BAUD 201600 61 - #else 62 38 #define BASE_BAUD 691200 63 - #endif 64 39 65 40 #define WALNUT_PS2_BASE 0xF0100000 66 - #define WALNUT_FPGA_BASE 0xF0300000 41 + 42 + /* Flash */ 43 + #define PPC40x_FPGA_BASE 0xF0300000 44 + #define PPC40x_FPGA_REG_OFFS 5 /* offset to flash map reg */ 45 + #define PPC40x_FLASH_ONBD_N(x) (x & 0x02) 46 + #define PPC40x_FLASH_SRAM_SEL(x) (x & 0x01) 47 + #define PPC40x_FLASH_LOW 0xFFF00000 48 + #define PPC40x_FLASH_HIGH 0xFFF80000 49 + #define PPC40x_FLASH_SIZE 0x80000 50 + #define WALNUT_FPGA_BASE PPC40x_FPGA_BASE 67 51 68 52 #define PPC4xx_MACHINE_NAME "IBM Walnut" 69 53 70 - #endif /* !__ASSEMBLY__ */ 71 54 #endif /* __ASM_WALNUT_H__ */ 72 55 #endif /* __KERNEL__ */
+16 -3
include/asm-ppc/ibm_ocp.h
··· 131 131 /* Copy MAC addresses to EMAC additions */ 132 132 for (i=start; i<=end; i++) { 133 133 def = ocp_get_one_device(OCP_VENDOR_IBM, OCP_FUNC_EMAC, i); 134 - memcpy(((struct ocp_func_emac_data *)def->additions)->mac_addr, 135 - &__res.bi_enetaddr[i], 136 - 6); 134 + if (i == 0) 135 + memcpy(((struct ocp_func_emac_data *)def->additions)->mac_addr, 136 + __res.bi_enetaddr, 6); 137 + #if defined(CONFIG_405EP) || defined(CONFIG_44x) 138 + else if (i == 1) 139 + memcpy(((struct ocp_func_emac_data *)def->additions)->mac_addr, 140 + __res.bi_enet1addr, 6); 141 + #endif 142 + #if defined(CONFIG_440GX) 143 + else if (i == 2) 144 + memcpy(((struct ocp_func_emac_data *)def->additions)->mac_addr, 145 + __res.bi_enet2addr, 6); 146 + else if (i == 3) 147 + memcpy(((struct ocp_func_emac_data *)def->additions)->mac_addr, 148 + __res.bi_enet3addr, 6); 149 + #endif 137 150 } 138 151 } 139 152 #endif
+4 -2
include/asm-ppc/ppcboot.h
··· 73 73 #if defined(CONFIG_HYMOD) 74 74 hymod_conf_t bi_hymod_conf; /* hymod configuration information */ 75 75 #endif 76 - #if defined(CONFIG_EVB64260) || defined(CONFIG_44x) || defined(CONFIG_85xx) ||\ 77 - defined(CONFIG_83xx) 76 + #if defined(CONFIG_EVB64260) || defined(CONFIG_405EP) || defined(CONFIG_44x) || \ 77 + defined(CONFIG_85xx) || defined(CONFIG_83xx) 78 78 /* second onboard ethernet port */ 79 79 unsigned char bi_enet1addr[6]; 80 80 #endif ··· 95 95 int bi_phymode[4]; /* phy mode */ 96 96 #endif 97 97 } bd_t; 98 + 99 + #define bi_tbfreq bi_intfreq 98 100 99 101 #endif /* __ASSEMBLY__ */ 100 102 #endif /* __ASM_PPCBOOT_H__ */