aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/44x
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/platforms/44x')
-rw-r--r--arch/powerpc/platforms/44x/Kconfig13
-rw-r--r--arch/powerpc/platforms/44x/Makefile1
-rw-r--r--arch/powerpc/platforms/44x/virtex.c2
-rw-r--r--arch/powerpc/platforms/44x/virtex_ml510.c29
-rw-r--r--arch/powerpc/platforms/44x/warp.c76
5 files changed, 79 insertions, 42 deletions
diff --git a/arch/powerpc/platforms/44x/Kconfig b/arch/powerpc/platforms/44x/Kconfig
index 0d83a6a0397d..90e3192611a4 100644
--- a/arch/powerpc/platforms/44x/Kconfig
+++ b/arch/powerpc/platforms/44x/Kconfig
@@ -156,7 +156,7 @@ config YOSEMITE
156# This option enables support for the IBM PPC440GX evaluation board. 156# This option enables support for the IBM PPC440GX evaluation board.
157 157
158config XILINX_VIRTEX440_GENERIC_BOARD 158config XILINX_VIRTEX440_GENERIC_BOARD
159 bool "Generic Xilinx Virtex 440 board" 159 bool "Generic Xilinx Virtex 5 FXT board support"
160 depends on 44x 160 depends on 44x
161 default n 161 default n
162 select XILINX_VIRTEX_5_FXT 162 select XILINX_VIRTEX_5_FXT
@@ -171,6 +171,17 @@ config XILINX_VIRTEX440_GENERIC_BOARD
171 Most Virtex 5 designs should use this unless it needs to do some 171 Most Virtex 5 designs should use this unless it needs to do some
172 special configuration at board probe time. 172 special configuration at board probe time.
173 173
174config XILINX_ML510
175 bool "Xilinx ML510 extra support"
176 depends on XILINX_VIRTEX440_GENERIC_BOARD
177 select PPC_PCI_CHOICE
178 select XILINX_PCI if PCI
179 select PPC_INDIRECT_PCI if PCI
180 select PPC_I8259 if PCI
181 help
182 This option enables extra support for features on the Xilinx ML510
183 board. The ML510 has a PCI bus with ALI south bridge.
184
174config PPC44x_SIMPLE 185config PPC44x_SIMPLE
175 bool "Simple PowerPC 44x board support" 186 bool "Simple PowerPC 44x board support"
176 depends on 44x 187 depends on 44x
diff --git a/arch/powerpc/platforms/44x/Makefile b/arch/powerpc/platforms/44x/Makefile
index 01f51daace13..ee6185aeaa3b 100644
--- a/arch/powerpc/platforms/44x/Makefile
+++ b/arch/powerpc/platforms/44x/Makefile
@@ -4,3 +4,4 @@ obj-$(CONFIG_EBONY) += ebony.o
4obj-$(CONFIG_SAM440EP) += sam440ep.o 4obj-$(CONFIG_SAM440EP) += sam440ep.o
5obj-$(CONFIG_WARP) += warp.o 5obj-$(CONFIG_WARP) += warp.o
6obj-$(CONFIG_XILINX_VIRTEX_5_FXT) += virtex.o 6obj-$(CONFIG_XILINX_VIRTEX_5_FXT) += virtex.o
7obj-$(CONFIG_XILINX_ML510) += virtex_ml510.o
diff --git a/arch/powerpc/platforms/44x/virtex.c b/arch/powerpc/platforms/44x/virtex.c
index 68637faf70ae..cf96ccaa760c 100644
--- a/arch/powerpc/platforms/44x/virtex.c
+++ b/arch/powerpc/platforms/44x/virtex.c
@@ -16,6 +16,7 @@
16#include <asm/prom.h> 16#include <asm/prom.h>
17#include <asm/time.h> 17#include <asm/time.h>
18#include <asm/xilinx_intc.h> 18#include <asm/xilinx_intc.h>
19#include <asm/xilinx_pci.h>
19#include <asm/reg.h> 20#include <asm/reg.h>
20#include <asm/ppc4xx.h> 21#include <asm/ppc4xx.h>
21#include "44x.h" 22#include "44x.h"
@@ -53,6 +54,7 @@ static int __init virtex_probe(void)
53define_machine(virtex) { 54define_machine(virtex) {
54 .name = "Xilinx Virtex440", 55 .name = "Xilinx Virtex440",
55 .probe = virtex_probe, 56 .probe = virtex_probe,
57 .setup_arch = xilinx_pci_init,
56 .init_IRQ = xilinx_intc_init_tree, 58 .init_IRQ = xilinx_intc_init_tree,
57 .get_irq = xilinx_intc_get_irq, 59 .get_irq = xilinx_intc_get_irq,
58 .calibrate_decr = generic_calibrate_decr, 60 .calibrate_decr = generic_calibrate_decr,
diff --git a/arch/powerpc/platforms/44x/virtex_ml510.c b/arch/powerpc/platforms/44x/virtex_ml510.c
new file mode 100644
index 000000000000..ba4a6e388a46
--- /dev/null
+++ b/arch/powerpc/platforms/44x/virtex_ml510.c
@@ -0,0 +1,29 @@
1#include <asm/i8259.h>
2#include <linux/pci.h>
3#include "44x.h"
4
5/**
6 * ml510_ail_quirk
7 */
8static void __devinit ml510_ali_quirk(struct pci_dev *dev)
9{
10 /* Enable the IDE controller */
11 pci_write_config_byte(dev, 0x58, 0x4c);
12 /* Assign irq 14 to the primary ide channel */
13 pci_write_config_byte(dev, 0x44, 0x0d);
14 /* Assign irq 15 to the secondary ide channel */
15 pci_write_config_byte(dev, 0x75, 0x0f);
16 /* Set the ide controller in native mode */
17 pci_write_config_byte(dev, 0x09, 0xff);
18
19 /* INTB = disabled, INTA = disabled */
20 pci_write_config_byte(dev, 0x48, 0x00);
21 /* INTD = disabled, INTC = disabled */
22 pci_write_config_byte(dev, 0x4a, 0x00);
23 /* Audio = INT7, Modem = disabled. */
24 pci_write_config_byte(dev, 0x4b, 0x60);
25 /* USB = INT7 */
26 pci_write_config_byte(dev, 0x74, 0x06);
27}
28DECLARE_PCI_FIXUP_EARLY(0x10b9, 0x1533, ml510_ali_quirk);
29
diff --git a/arch/powerpc/platforms/44x/warp.c b/arch/powerpc/platforms/44x/warp.c
index 960edf89be51..c5118802a281 100644
--- a/arch/powerpc/platforms/44x/warp.c
+++ b/arch/powerpc/platforms/44x/warp.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * PIKA Warp(tm) board specific routines 2 * PIKA Warp(tm) board specific routines
3 * 3 *
4 * Copyright (c) 2008 PIKA Technologies 4 * Copyright (c) 2008-2009 PIKA Technologies
5 * Sean MacLennan <smaclennan@pikatech.com> 5 * Sean MacLennan <smaclennan@pikatech.com>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify it 7 * This program is free software; you can redistribute it and/or modify it
@@ -15,6 +15,7 @@
15#include <linux/i2c.h> 15#include <linux/i2c.h>
16#include <linux/interrupt.h> 16#include <linux/interrupt.h>
17#include <linux/delay.h> 17#include <linux/delay.h>
18#include <linux/of_gpio.h>
18 19
19#include <asm/machdep.h> 20#include <asm/machdep.h>
20#include <asm/prom.h> 21#include <asm/prom.h>
@@ -23,6 +24,7 @@
23#include <asm/uic.h> 24#include <asm/uic.h>
24#include <asm/ppc4xx.h> 25#include <asm/ppc4xx.h>
25 26
27
26static __initdata struct of_device_id warp_of_bus[] = { 28static __initdata struct of_device_id warp_of_bus[] = {
27 { .compatible = "ibm,plb4", }, 29 { .compatible = "ibm,plb4", },
28 { .compatible = "ibm,opb", }, 30 { .compatible = "ibm,opb", },
@@ -55,6 +57,8 @@ define_machine(warp) {
55}; 57};
56 58
57 59
60static u32 post_info;
61
58/* I am not sure this is the best place for this... */ 62/* I am not sure this is the best place for this... */
59static int __init warp_post_info(void) 63static int __init warp_post_info(void)
60{ 64{
@@ -77,21 +81,21 @@ static int __init warp_post_info(void)
77 81
78 iounmap(fpga); 82 iounmap(fpga);
79 83
80 if (post1 || post2) 84 if (post1 || post2) {
81 printk(KERN_INFO "Warp POST %08x %08x\n", post1, post2); 85 printk(KERN_INFO "Warp POST %08x %08x\n", post1, post2);
82 else 86 post_info = 1;
87 } else
83 printk(KERN_INFO "Warp POST OK\n"); 88 printk(KERN_INFO "Warp POST OK\n");
84 89
85 return 0; 90 return 0;
86} 91}
87machine_late_initcall(warp, warp_post_info);
88 92
89 93
90#ifdef CONFIG_SENSORS_AD7414 94#ifdef CONFIG_SENSORS_AD7414
91 95
92static LIST_HEAD(dtm_shutdown_list); 96static LIST_HEAD(dtm_shutdown_list);
93static void __iomem *dtm_fpga; 97static void __iomem *dtm_fpga;
94static void __iomem *gpio_base; 98static unsigned green_led, red_led;
95 99
96 100
97struct dtm_shutdown { 101struct dtm_shutdown {
@@ -134,14 +138,17 @@ int pika_dtm_unregister_shutdown(void (*func)(void *arg), void *arg)
134static irqreturn_t temp_isr(int irq, void *context) 138static irqreturn_t temp_isr(int irq, void *context)
135{ 139{
136 struct dtm_shutdown *shutdown; 140 struct dtm_shutdown *shutdown;
141 int value = 1;
137 142
138 local_irq_disable(); 143 local_irq_disable();
139 144
145 gpio_set_value(green_led, 0);
146
140 /* Run through the shutdown list. */ 147 /* Run through the shutdown list. */
141 list_for_each_entry(shutdown, &dtm_shutdown_list, list) 148 list_for_each_entry(shutdown, &dtm_shutdown_list, list)
142 shutdown->func(shutdown->arg); 149 shutdown->func(shutdown->arg);
143 150
144 printk(KERN_EMERG "\n\nCritical Temperature Shutdown\n"); 151 printk(KERN_EMERG "\n\nCritical Temperature Shutdown\n\n");
145 152
146 while (1) { 153 while (1) {
147 if (dtm_fpga) { 154 if (dtm_fpga) {
@@ -149,52 +156,34 @@ static irqreturn_t temp_isr(int irq, void *context)
149 out_be32(dtm_fpga + 0x14, reset); 156 out_be32(dtm_fpga + 0x14, reset);
150 } 157 }
151 158
152 if (gpio_base) { 159 gpio_set_value(red_led, value);
153 unsigned leds = in_be32(gpio_base); 160 value ^= 1;
154
155 /* green off, red toggle */
156 leds &= ~0x80000000;
157 leds ^= 0x40000000;
158
159 out_be32(gpio_base, leds);
160 }
161
162 mdelay(500); 161 mdelay(500);
163 } 162 }
164} 163}
165 164
166static int pika_setup_leds(void) 165static int pika_setup_leds(void)
167{ 166{
168 struct device_node *np; 167 struct device_node *np, *child;
169 const u32 *gpios;
170 int len;
171 168
172 np = of_find_compatible_node(NULL, NULL, "linux,gpio-led"); 169 np = of_find_compatible_node(NULL, NULL, "gpio-leds");
173 if (!np) { 170 if (!np) {
174 printk(KERN_ERR __FILE__ ": Unable to find gpio-led\n"); 171 printk(KERN_ERR __FILE__ ": Unable to find leds\n");
175 return -ENOENT;
176 }
177
178 gpios = of_get_property(np, "gpios", &len);
179 of_node_put(np);
180 if (!gpios || len < 4) {
181 printk(KERN_ERR __FILE__
182 ": Unable to get gpios property (%d)\n", len);
183 return -ENOENT; 172 return -ENOENT;
184 } 173 }
185 174
186 np = of_find_node_by_phandle(gpios[0]); 175 for_each_child_of_node(np, child)
187 if (!np) { 176 if (strcmp(child->name, "green") == 0) {
188 printk(KERN_ERR __FILE__ ": Unable to find gpio\n"); 177 green_led = of_get_gpio(child, 0);
189 return -ENOENT; 178 /* Turn back on the green LED */
190 } 179 gpio_set_value(green_led, 1);
180 } else if (strcmp(child->name, "red") == 0) {
181 red_led = of_get_gpio(child, 0);
182 /* Set based on post */
183 gpio_set_value(red_led, post_info);
184 }
191 185
192 gpio_base = of_iomap(np, 0);
193 of_node_put(np); 186 of_node_put(np);
194 if (!gpio_base) {
195 printk(KERN_ERR __FILE__ ": Unable to map gpio");
196 return -ENOMEM;
197 }
198 187
199 return 0; 188 return 0;
200} 189}
@@ -270,10 +259,10 @@ static int pika_dtm_thread(void __iomem *fpga)
270 } 259 }
271 260
272found_it: 261found_it:
273 i2c_put_adapter(adap);
274
275 pika_setup_critical_temp(client); 262 pika_setup_critical_temp(client);
276 263
264 i2c_put_adapter(adap);
265
277 printk(KERN_INFO "PIKA DTM thread running.\n"); 266 printk(KERN_INFO "PIKA DTM thread running.\n");
278 267
279 while (!kthread_should_stop()) { 268 while (!kthread_should_stop()) {
@@ -311,6 +300,9 @@ static int __init pika_dtm_start(void)
311 if (dtm_fpga == NULL) 300 if (dtm_fpga == NULL)
312 return -ENOENT; 301 return -ENOENT;
313 302
303 /* Must get post info before thread starts. */
304 warp_post_info();
305
314 dtm_thread = kthread_run(pika_dtm_thread, dtm_fpga, "pika-dtm"); 306 dtm_thread = kthread_run(pika_dtm_thread, dtm_fpga, "pika-dtm");
315 if (IS_ERR(dtm_thread)) { 307 if (IS_ERR(dtm_thread)) {
316 iounmap(dtm_fpga); 308 iounmap(dtm_fpga);
@@ -333,6 +325,8 @@ int pika_dtm_unregister_shutdown(void (*func)(void *arg), void *arg)
333 return 0; 325 return 0;
334} 326}
335 327
328machine_late_initcall(warp, warp_post_info);
329
336#endif 330#endif
337 331
338EXPORT_SYMBOL(pika_dtm_register_shutdown); 332EXPORT_SYMBOL(pika_dtm_register_shutdown);