diff options
author | Grant C. Likely <grant.likely@secretlab.ca> | 2006-01-19 03:13:37 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-02-07 06:36:01 -0500 |
commit | 909aeca664dd1fe55111dc4ec25c1bebe91674a2 (patch) | |
tree | b1b0737582e2348d2b5c728db6b280df90bc5df1 /arch/ppc | |
parent | b58b5aa51c78079fa4f652cd42e7b496a1d5411a (diff) |
[PATCH] powerpc: Add support for Xilinx ML403 reference design
Includes fix for Xilinx silicon errata 213
Signed-off-by: Grant C. Likely <grant.likely@secretlab.ca>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/ppc')
-rw-r--r-- | arch/ppc/boot/simple/Makefile | 1 | ||||
-rw-r--r-- | arch/ppc/boot/simple/embed_config.c | 4 | ||||
-rw-r--r-- | arch/ppc/boot/simple/head.S | 7 | ||||
-rw-r--r-- | arch/ppc/platforms/4xx/Kconfig | 13 | ||||
-rw-r--r-- | arch/ppc/platforms/4xx/Makefile | 2 | ||||
-rw-r--r-- | arch/ppc/platforms/4xx/xilinx_ml403.c | 177 | ||||
-rw-r--r-- | arch/ppc/platforms/4xx/xilinx_ml403.h | 49 | ||||
-rw-r--r-- | arch/ppc/platforms/4xx/xparameters/xparameters.h | 2 |
8 files changed, 251 insertions, 4 deletions
diff --git a/arch/ppc/boot/simple/Makefile b/arch/ppc/boot/simple/Makefile index 9533f8de238f..28be01b99c44 100644 --- a/arch/ppc/boot/simple/Makefile +++ b/arch/ppc/boot/simple/Makefile | |||
@@ -192,6 +192,7 @@ boot-$(CONFIG_8xx) += embed_config.o | |||
192 | boot-$(CONFIG_8260) += embed_config.o | 192 | boot-$(CONFIG_8260) += embed_config.o |
193 | boot-$(CONFIG_EP405) += embed_config.o | 193 | boot-$(CONFIG_EP405) += embed_config.o |
194 | boot-$(CONFIG_XILINX_ML300) += embed_config.o | 194 | boot-$(CONFIG_XILINX_ML300) += embed_config.o |
195 | boot-$(CONFIG_XILINX_ML403) += embed_config.o | ||
195 | boot-$(CONFIG_BSEIP) += iic.o | 196 | boot-$(CONFIG_BSEIP) += iic.o |
196 | boot-$(CONFIG_MBX) += iic.o pci.o qspan_pci.o | 197 | boot-$(CONFIG_MBX) += iic.o pci.o qspan_pci.o |
197 | boot-$(CONFIG_MV64X60) += misc-mv64x60.o | 198 | boot-$(CONFIG_MV64X60) += misc-mv64x60.o |
diff --git a/arch/ppc/boot/simple/embed_config.c b/arch/ppc/boot/simple/embed_config.c index df24202073bf..3a51b1062940 100644 --- a/arch/ppc/boot/simple/embed_config.c +++ b/arch/ppc/boot/simple/embed_config.c | |||
@@ -745,7 +745,7 @@ embed_config(bd_t **bdp) | |||
745 | } | 745 | } |
746 | #endif /* WILLOW */ | 746 | #endif /* WILLOW */ |
747 | 747 | ||
748 | #ifdef CONFIG_XILINX_ML300 | 748 | #if defined(CONFIG_XILINX_ML300) || defined(CONFIG_XILINX_ML403) |
749 | void | 749 | void |
750 | embed_config(bd_t ** bdp) | 750 | embed_config(bd_t ** bdp) |
751 | { | 751 | { |
@@ -782,7 +782,7 @@ embed_config(bd_t ** bdp) | |||
782 | timebase_period_ns = 1000000000 / bd->bi_tbfreq; | 782 | timebase_period_ns = 1000000000 / bd->bi_tbfreq; |
783 | /* see bi_tbfreq definition in arch/ppc/platforms/4xx/xilinx_ml300.h */ | 783 | /* see bi_tbfreq definition in arch/ppc/platforms/4xx/xilinx_ml300.h */ |
784 | } | 784 | } |
785 | #endif /* CONFIG_XILINX_ML300 */ | 785 | #endif /* CONFIG_XILINX_ML300 || CONFIG_XILINX_ML403 */ |
786 | 786 | ||
787 | #ifdef CONFIG_IBM_OPENBIOS | 787 | #ifdef CONFIG_IBM_OPENBIOS |
788 | /* This could possibly work for all treeboot roms. | 788 | /* This could possibly work for all treeboot roms. |
diff --git a/arch/ppc/boot/simple/head.S b/arch/ppc/boot/simple/head.S index 5e4adc298bf9..119b9dc89587 100644 --- a/arch/ppc/boot/simple/head.S +++ b/arch/ppc/boot/simple/head.S | |||
@@ -65,6 +65,13 @@ start_: | |||
65 | */ | 65 | */ |
66 | #endif | 66 | #endif |
67 | 67 | ||
68 | #if defined(CONFIG_XILINX_VIRTEX_4_FX) | ||
69 | /* PPC errata 213: only for Virtex-4 FX */ | ||
70 | mfccr0 0 | ||
71 | oris 0,0,0x50000000@h | ||
72 | mtccr0 0 | ||
73 | #endif | ||
74 | |||
68 | mflr r3 /* Save our actual starting address. */ | 75 | mflr r3 /* Save our actual starting address. */ |
69 | 76 | ||
70 | /* The following functions we call must not modify r3 or r4..... | 77 | /* The following functions we call must not modify r3 or r4..... |
diff --git a/arch/ppc/platforms/4xx/Kconfig b/arch/ppc/platforms/4xx/Kconfig index 057c7c2ab99d..174ddbc9758b 100644 --- a/arch/ppc/platforms/4xx/Kconfig +++ b/arch/ppc/platforms/4xx/Kconfig | |||
@@ -57,6 +57,10 @@ config XILINX_ML300 | |||
57 | help | 57 | help |
58 | This option enables support for the Xilinx ML300 evaluation board. | 58 | This option enables support for the Xilinx ML300 evaluation board. |
59 | 59 | ||
60 | config XILINX_ML403 | ||
61 | bool "Xilinx-ML403" | ||
62 | help | ||
63 | This option enables support for the Xilinx ML403 evaluation board. | ||
60 | endchoice | 64 | endchoice |
61 | 65 | ||
62 | choice | 66 | choice |
@@ -208,9 +212,14 @@ config XILINX_VIRTEX_II_PRO | |||
208 | depends on XILINX_ML300 | 212 | depends on XILINX_ML300 |
209 | default y | 213 | default y |
210 | 214 | ||
215 | config XILINX_VIRTEX_4_FX | ||
216 | bool | ||
217 | depends on XILINX_ML403 | ||
218 | default y | ||
219 | |||
211 | config XILINX_VIRTEX | 220 | config XILINX_VIRTEX |
212 | bool | 221 | bool |
213 | depends on XILINX_VIRTEX_II_PRO | 222 | depends on XILINX_VIRTEX_II_PRO || XILINX_VIRTEX_4_FX |
214 | default y | 223 | default y |
215 | 224 | ||
216 | config STB03xxx | 225 | config STB03xxx |
@@ -220,7 +229,7 @@ config STB03xxx | |||
220 | 229 | ||
221 | config EMBEDDEDBOOT | 230 | config EMBEDDEDBOOT |
222 | bool | 231 | bool |
223 | depends on EP405 || XILINX_ML300 | 232 | depends on EP405 || XILINX_ML300 || XILINX_ML403 |
224 | default y | 233 | default y |
225 | 234 | ||
226 | config IBM_OPENBIOS | 235 | config IBM_OPENBIOS |
diff --git a/arch/ppc/platforms/4xx/Makefile b/arch/ppc/platforms/4xx/Makefile index be4163c8afe7..a04a0d0a0f5c 100644 --- a/arch/ppc/platforms/4xx/Makefile +++ b/arch/ppc/platforms/4xx/Makefile | |||
@@ -14,6 +14,7 @@ obj-$(CONFIG_REDWOOD_6) += redwood6.o | |||
14 | obj-$(CONFIG_SYCAMORE) += sycamore.o | 14 | obj-$(CONFIG_SYCAMORE) += sycamore.o |
15 | obj-$(CONFIG_WALNUT) += walnut.o | 15 | obj-$(CONFIG_WALNUT) += walnut.o |
16 | obj-$(CONFIG_XILINX_ML300) += xilinx_ml300.o | 16 | obj-$(CONFIG_XILINX_ML300) += xilinx_ml300.o |
17 | obj-$(CONFIG_XILINX_ML403) += xilinx_ml403.o | ||
17 | 18 | ||
18 | obj-$(CONFIG_405GP) += ibm405gp.o | 19 | obj-$(CONFIG_405GP) += ibm405gp.o |
19 | obj-$(CONFIG_REDWOOD_5) += ibmstb4.o | 20 | obj-$(CONFIG_REDWOOD_5) += ibmstb4.o |
@@ -27,3 +28,4 @@ obj-$(CONFIG_440SPE) += ppc440spe.o | |||
27 | obj-$(CONFIG_405EP) += ibm405ep.o | 28 | obj-$(CONFIG_405EP) += ibm405ep.o |
28 | obj-$(CONFIG_405GPR) += ibm405gpr.o | 29 | obj-$(CONFIG_405GPR) += ibm405gpr.o |
29 | obj-$(CONFIG_XILINX_VIRTEX) += virtex.o | 30 | obj-$(CONFIG_XILINX_VIRTEX) += virtex.o |
31 | |||
diff --git a/arch/ppc/platforms/4xx/xilinx_ml403.c b/arch/ppc/platforms/4xx/xilinx_ml403.c new file mode 100644 index 000000000000..4c0c7e4c1114 --- /dev/null +++ b/arch/ppc/platforms/4xx/xilinx_ml403.c | |||
@@ -0,0 +1,177 @@ | |||
1 | /* | ||
2 | * arch/ppc/platforms/4xx/xilinx_ml403.c | ||
3 | * | ||
4 | * Xilinx ML403 evaluation board initialization | ||
5 | * | ||
6 | * Author: Grant Likely <grant.likely@secretlab.ca> | ||
7 | * | ||
8 | * 2005 (c) Secret Lab Technologies Ltd. | ||
9 | * 2002-2004 (c) MontaVista Software, Inc. | ||
10 | * | ||
11 | * This file is licensed under the terms of the GNU General Public License | ||
12 | * version 2. This program is licensed "as is" without any warranty of any | ||
13 | * kind, whether express or implied. | ||
14 | */ | ||
15 | |||
16 | #include <linux/config.h> | ||
17 | #include <linux/init.h> | ||
18 | #include <linux/irq.h> | ||
19 | #include <linux/tty.h> | ||
20 | #include <linux/serial.h> | ||
21 | #include <linux/serial_core.h> | ||
22 | #include <linux/serial_8250.h> | ||
23 | #include <linux/serialP.h> | ||
24 | #include <asm/io.h> | ||
25 | #include <asm/machdep.h> | ||
26 | #include <asm/ppc_sys.h> | ||
27 | |||
28 | #include <syslib/gen550.h> | ||
29 | #include <platforms/4xx/xparameters/xparameters.h> | ||
30 | |||
31 | /* | ||
32 | * As an overview of how the following functions (platform_init, | ||
33 | * ml403_map_io, ml403_setup_arch and ml403_init_IRQ) fit into the | ||
34 | * kernel startup procedure, here's a call tree: | ||
35 | * | ||
36 | * start_here arch/ppc/kernel/head_4xx.S | ||
37 | * early_init arch/ppc/kernel/setup.c | ||
38 | * machine_init arch/ppc/kernel/setup.c | ||
39 | * platform_init this file | ||
40 | * ppc4xx_init arch/ppc/syslib/ppc4xx_setup.c | ||
41 | * parse_bootinfo | ||
42 | * find_bootinfo | ||
43 | * "setup some default ppc_md pointers" | ||
44 | * MMU_init arch/ppc/mm/init.c | ||
45 | * *ppc_md.setup_io_mappings == ml403_map_io this file | ||
46 | * ppc4xx_map_io arch/ppc/syslib/ppc4xx_setup.c | ||
47 | * start_kernel init/main.c | ||
48 | * setup_arch arch/ppc/kernel/setup.c | ||
49 | * #if defined(CONFIG_KGDB) | ||
50 | * *ppc_md.kgdb_map_scc() == gen550_kgdb_map_scc | ||
51 | * #endif | ||
52 | * *ppc_md.setup_arch == ml403_setup_arch this file | ||
53 | * ppc4xx_setup_arch arch/ppc/syslib/ppc4xx_setup.c | ||
54 | * ppc4xx_find_bridges arch/ppc/syslib/ppc405_pci.c | ||
55 | * init_IRQ arch/ppc/kernel/irq.c | ||
56 | * *ppc_md.init_IRQ == ml403_init_IRQ this file | ||
57 | * ppc4xx_init_IRQ arch/ppc/syslib/ppc4xx_setup.c | ||
58 | * ppc4xx_pic_init arch/ppc/syslib/xilinx_pic.c | ||
59 | */ | ||
60 | |||
61 | /* Board specifications structures */ | ||
62 | struct ppc_sys_spec *cur_ppc_sys_spec; | ||
63 | struct ppc_sys_spec ppc_sys_specs[] = { | ||
64 | { | ||
65 | /* Only one entry, always assume the same design */ | ||
66 | .ppc_sys_name = "Xilinx ML403 Reference Design", | ||
67 | .mask = 0x00000000, | ||
68 | .value = 0x00000000, | ||
69 | .num_devices = 1, | ||
70 | .device_list = (enum ppc_sys_devices[]) | ||
71 | { | ||
72 | VIRTEX_UART, | ||
73 | }, | ||
74 | }, | ||
75 | }; | ||
76 | |||
77 | #if defined(XPAR_POWER_0_POWERDOWN_BASEADDR) | ||
78 | |||
79 | static volatile unsigned *powerdown_base = | ||
80 | (volatile unsigned *) XPAR_POWER_0_POWERDOWN_BASEADDR; | ||
81 | |||
82 | static void | ||
83 | xilinx_power_off(void) | ||
84 | { | ||
85 | local_irq_disable(); | ||
86 | out_be32(powerdown_base, XPAR_POWER_0_POWERDOWN_VALUE); | ||
87 | while (1) ; | ||
88 | } | ||
89 | #endif | ||
90 | |||
91 | void __init | ||
92 | ml403_map_io(void) | ||
93 | { | ||
94 | ppc4xx_map_io(); | ||
95 | |||
96 | #if defined(XPAR_POWER_0_POWERDOWN_BASEADDR) | ||
97 | powerdown_base = ioremap((unsigned long) powerdown_base, | ||
98 | XPAR_POWER_0_POWERDOWN_HIGHADDR - | ||
99 | XPAR_POWER_0_POWERDOWN_BASEADDR + 1); | ||
100 | #endif | ||
101 | } | ||
102 | |||
103 | /* Early serial support functions */ | ||
104 | static void __init | ||
105 | ml403_early_serial_init(int num, struct plat_serial8250_port *pdata) | ||
106 | { | ||
107 | #if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB) | ||
108 | struct uart_port serial_req; | ||
109 | |||
110 | memset(&serial_req, 0, sizeof(serial_req)); | ||
111 | serial_req.mapbase = pdata->mapbase; | ||
112 | serial_req.membase = pdata->membase; | ||
113 | serial_req.irq = pdata->irq; | ||
114 | serial_req.uartclk = pdata->uartclk; | ||
115 | serial_req.regshift = pdata->regshift; | ||
116 | serial_req.iotype = pdata->iotype; | ||
117 | serial_req.flags = pdata->flags; | ||
118 | gen550_init(num, &serial_req); | ||
119 | #endif | ||
120 | } | ||
121 | |||
122 | void __init | ||
123 | ml403_early_serial_map(void) | ||
124 | { | ||
125 | #ifdef CONFIG_SERIAL_8250 | ||
126 | struct plat_serial8250_port *pdata; | ||
127 | int i = 0; | ||
128 | |||
129 | pdata = (struct plat_serial8250_port *) ppc_sys_get_pdata(VIRTEX_UART); | ||
130 | while(pdata && pdata->flags) | ||
131 | { | ||
132 | pdata->membase = ioremap(pdata->mapbase, 0x100); | ||
133 | ml403_early_serial_init(i, pdata); | ||
134 | pdata++; | ||
135 | i++; | ||
136 | } | ||
137 | #endif /* CONFIG_SERIAL_8250 */ | ||
138 | } | ||
139 | |||
140 | void __init | ||
141 | ml403_setup_arch(void) | ||
142 | { | ||
143 | ml403_early_serial_map(); | ||
144 | ppc4xx_setup_arch(); /* calls ppc4xx_find_bridges() */ | ||
145 | |||
146 | /* Identify the system */ | ||
147 | printk(KERN_INFO "Xilinx ML403 Reference System (Virtex-4 FX)\n"); | ||
148 | } | ||
149 | |||
150 | /* Called after board_setup_irq from ppc4xx_init_IRQ(). */ | ||
151 | void __init | ||
152 | ml403_init_irq(void) | ||
153 | { | ||
154 | ppc4xx_init_IRQ(); | ||
155 | } | ||
156 | |||
157 | void __init | ||
158 | platform_init(unsigned long r3, unsigned long r4, unsigned long r5, | ||
159 | unsigned long r6, unsigned long r7) | ||
160 | { | ||
161 | ppc4xx_init(r3, r4, r5, r6, r7); | ||
162 | |||
163 | identify_ppc_sys_by_id(mfspr(SPRN_PVR)); | ||
164 | |||
165 | ppc_md.setup_arch = ml403_setup_arch; | ||
166 | ppc_md.setup_io_mappings = ml403_map_io; | ||
167 | ppc_md.init_IRQ = ml403_init_irq; | ||
168 | |||
169 | #if defined(XPAR_POWER_0_POWERDOWN_BASEADDR) | ||
170 | ppc_md.power_off = xilinx_power_off; | ||
171 | #endif | ||
172 | |||
173 | #ifdef CONFIG_KGDB | ||
174 | ppc_md.early_serial_map = ml403_early_serial_map; | ||
175 | #endif | ||
176 | } | ||
177 | |||
diff --git a/arch/ppc/platforms/4xx/xilinx_ml403.h b/arch/ppc/platforms/4xx/xilinx_ml403.h new file mode 100644 index 000000000000..473596959902 --- /dev/null +++ b/arch/ppc/platforms/4xx/xilinx_ml403.h | |||
@@ -0,0 +1,49 @@ | |||
1 | /* | ||
2 | * arch/ppc/platforms/4xx/xilinx_ml403.h | ||
3 | * | ||
4 | * Include file that defines the Xilinx ML403 reference design | ||
5 | * | ||
6 | * Author: Grant Likely <grant.likely@secretlab.ca> | ||
7 | * | ||
8 | * 2005 (c) Secret Lab Technologies Ltd. | ||
9 | * 2002-2004 (c) MontaVista Software, Inc. | ||
10 | * | ||
11 | * This file is licensed under the terms of the GNU General Public License | ||
12 | * version 2. This program is licensed "as is" without any warranty of any | ||
13 | * kind, whether express or implied. | ||
14 | */ | ||
15 | |||
16 | #ifdef __KERNEL__ | ||
17 | #ifndef __ASM_XILINX_ML403_H__ | ||
18 | #define __ASM_XILINX_ML403_H__ | ||
19 | |||
20 | /* ML403 has a Xilinx Virtex-4 FPGA with a PPC405 hard core */ | ||
21 | #include <platforms/4xx/virtex.h> | ||
22 | |||
23 | #ifndef __ASSEMBLY__ | ||
24 | |||
25 | #include <linux/types.h> | ||
26 | |||
27 | typedef struct board_info { | ||
28 | unsigned int bi_memsize; /* DRAM installed, in bytes */ | ||
29 | unsigned char bi_enetaddr[6]; /* Local Ethernet MAC address */ | ||
30 | unsigned int bi_intfreq; /* Processor speed, in Hz */ | ||
31 | unsigned int bi_busfreq; /* PLB Bus speed, in Hz */ | ||
32 | unsigned int bi_pci_busfreq; /* PCI Bus speed, in Hz */ | ||
33 | } bd_t; | ||
34 | |||
35 | /* Some 4xx parts use a different timebase frequency from the internal clock. | ||
36 | */ | ||
37 | #define bi_tbfreq bi_intfreq | ||
38 | |||
39 | #endif /* !__ASSEMBLY__ */ | ||
40 | |||
41 | /* We don't need anything mapped. Size of zero will accomplish that. */ | ||
42 | #define PPC4xx_ONB_IO_PADDR 0u | ||
43 | #define PPC4xx_ONB_IO_VADDR 0u | ||
44 | #define PPC4xx_ONB_IO_SIZE 0u | ||
45 | |||
46 | #define PPC4xx_MACHINE_NAME "Xilinx ML403 Reference Design" | ||
47 | |||
48 | #endif /* __ASM_XILINX_ML403_H__ */ | ||
49 | #endif /* __KERNEL__ */ | ||
diff --git a/arch/ppc/platforms/4xx/xparameters/xparameters.h b/arch/ppc/platforms/4xx/xparameters/xparameters.h index 7b7304379dd2..4cf21f256356 100644 --- a/arch/ppc/platforms/4xx/xparameters/xparameters.h +++ b/arch/ppc/platforms/4xx/xparameters/xparameters.h | |||
@@ -16,6 +16,8 @@ | |||
16 | 16 | ||
17 | #if defined(CONFIG_XILINX_ML300) | 17 | #if defined(CONFIG_XILINX_ML300) |
18 | #include "xparameters_ml300.h" | 18 | #include "xparameters_ml300.h" |
19 | #elif defined(CONFIG_XILINX_ML403) | ||
20 | #include "xparameters_ml403.h" | ||
19 | #else | 21 | #else |
20 | /* Add other board xparameter includes here before the #else */ | 22 | /* Add other board xparameter includes here before the #else */ |
21 | #error No xparameters_*.h file included | 23 | #error No xparameters_*.h file included |