blob: c35099af340e868f9ba7416a7e57b082bcd08fe3 [file] [log] [blame]
Michael Ellermance21b3c2007-07-20 21:39:28 +02001/*
2 * Copyright 2007, Michael Ellerman, IBM Corporation.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 */
9
10
11#include <linux/interrupt.h>
12#include <linux/irq.h>
13#include <linux/kernel.h>
14#include <linux/pci.h>
15#include <linux/msi.h>
Michael Ellermane4347df2008-01-25 16:59:14 +110016#include <linux/of_platform.h>
Michael Ellerman72cac212008-05-23 14:21:30 +100017#include <linux/debugfs.h>
Tejun Heo5a0e3ad2010-03-24 17:04:11 +090018#include <linux/slab.h>
Michael Ellermance21b3c2007-07-20 21:39:28 +020019
20#include <asm/dcr.h>
21#include <asm/machdep.h>
22#include <asm/prom.h>
23
24
25/*
26 * MSIC registers, specified as offsets from dcr_base
27 */
28#define MSIC_CTRL_REG 0x0
29
30/* Base Address registers specify FIFO location in BE memory */
31#define MSIC_BASE_ADDR_HI_REG 0x3
32#define MSIC_BASE_ADDR_LO_REG 0x4
33
34/* Hold the read/write offsets into the FIFO */
35#define MSIC_READ_OFFSET_REG 0x5
36#define MSIC_WRITE_OFFSET_REG 0x6
37
38
39/* MSIC control register flags */
40#define MSIC_CTRL_ENABLE 0x0001
41#define MSIC_CTRL_FIFO_FULL_ENABLE 0x0002
42#define MSIC_CTRL_IRQ_ENABLE 0x0008
43#define MSIC_CTRL_FULL_STOP_ENABLE 0x0010
44
45/*
46 * The MSIC can be configured to use a FIFO of 32KB, 64KB, 128KB or 256KB.
47 * Currently we're using a 64KB FIFO size.
48 */
49#define MSIC_FIFO_SIZE_SHIFT 16
50#define MSIC_FIFO_SIZE_BYTES (1 << MSIC_FIFO_SIZE_SHIFT)
51
52/*
53 * To configure the FIFO size as (1 << n) bytes, we write (n - 15) into bits
54 * 8-9 of the MSIC control reg.
55 */
56#define MSIC_CTRL_FIFO_SIZE (((MSIC_FIFO_SIZE_SHIFT - 15) << 8) & 0x300)
57
58/*
59 * We need to mask the read/write offsets to make sure they stay within
60 * the bounds of the FIFO. Also they should always be 16-byte aligned.
61 */
62#define MSIC_FIFO_SIZE_MASK ((MSIC_FIFO_SIZE_BYTES - 1) & ~0xFu)
63
64/* Each entry in the FIFO is 16 bytes, the first 4 bytes hold the irq # */
65#define MSIC_FIFO_ENTRY_SIZE 0x10
66
67
68struct axon_msic {
Michael Ellermance21b3c2007-07-20 21:39:28 +020069 struct irq_host *irq_host;
Michael Ellermande4c9282008-01-25 16:59:14 +110070 __le32 *fifo_virt;
71 dma_addr_t fifo_phys;
Michael Ellermance21b3c2007-07-20 21:39:28 +020072 dcr_host_t dcr_host;
Michael Ellermance21b3c2007-07-20 21:39:28 +020073 u32 read_offset;
Michael Ellerman72cac212008-05-23 14:21:30 +100074#ifdef DEBUG
75 u32 __iomem *trigger;
76#endif
Michael Ellermance21b3c2007-07-20 21:39:28 +020077};
78
Michael Ellerman72cac212008-05-23 14:21:30 +100079#ifdef DEBUG
80void axon_msi_debug_setup(struct device_node *dn, struct axon_msic *msic);
81#else
82static inline void axon_msi_debug_setup(struct device_node *dn,
83 struct axon_msic *msic) { }
84#endif
85
86
Michael Ellermance21b3c2007-07-20 21:39:28 +020087static void msic_dcr_write(struct axon_msic *msic, unsigned int dcr_n, u32 val)
88{
Michael Ellerman33875f02009-06-17 18:13:53 +000089 pr_devel("axon_msi: dcr_write(0x%x, 0x%x)\n", val, dcr_n);
Michael Ellermance21b3c2007-07-20 21:39:28 +020090
Michael Ellerman83f34df2007-10-15 19:34:36 +100091 dcr_write(msic->dcr_host, dcr_n, val);
Michael Ellermance21b3c2007-07-20 21:39:28 +020092}
93
Michael Ellermance21b3c2007-07-20 21:39:28 +020094static void axon_msi_cascade(unsigned int irq, struct irq_desc *desc)
95{
96 struct axon_msic *msic = get_irq_data(irq);
97 u32 write_offset, msi;
98 int idx;
Arnd Bergmannd015fe92008-11-28 09:51:22 +000099 int retry = 0;
Michael Ellermance21b3c2007-07-20 21:39:28 +0200100
Michael Ellerman2843e7f2007-10-15 19:34:38 +1000101 write_offset = dcr_read(msic->dcr_host, MSIC_WRITE_OFFSET_REG);
Michael Ellerman33875f02009-06-17 18:13:53 +0000102 pr_devel("axon_msi: original write_offset 0x%x\n", write_offset);
Michael Ellermance21b3c2007-07-20 21:39:28 +0200103
104 /* write_offset doesn't wrap properly, so we have to mask it */
105 write_offset &= MSIC_FIFO_SIZE_MASK;
106
Arnd Bergmannd015fe92008-11-28 09:51:22 +0000107 while (msic->read_offset != write_offset && retry < 100) {
Michael Ellermance21b3c2007-07-20 21:39:28 +0200108 idx = msic->read_offset / sizeof(__le32);
Michael Ellermande4c9282008-01-25 16:59:14 +1100109 msi = le32_to_cpu(msic->fifo_virt[idx]);
Michael Ellermance21b3c2007-07-20 21:39:28 +0200110 msi &= 0xFFFF;
111
Michael Ellerman33875f02009-06-17 18:13:53 +0000112 pr_devel("axon_msi: woff %x roff %x msi %x\n",
Michael Ellermance21b3c2007-07-20 21:39:28 +0200113 write_offset, msic->read_offset, msi);
114
Arnd Bergmannd015fe92008-11-28 09:51:22 +0000115 if (msi < NR_IRQS && irq_map[msi].host == msic->irq_host) {
116 generic_handle_irq(msi);
117 msic->fifo_virt[idx] = cpu_to_le32(0xffffffff);
118 } else {
119 /*
120 * Reading the MSIC_WRITE_OFFSET_REG does not
121 * reliably flush the outstanding DMA to the
122 * FIFO buffer. Here we were reading stale
123 * data, so we need to retry.
124 */
125 udelay(1);
126 retry++;
Michael Ellerman33875f02009-06-17 18:13:53 +0000127 pr_devel("axon_msi: invalid irq 0x%x!\n", msi);
Arnd Bergmannd015fe92008-11-28 09:51:22 +0000128 continue;
129 }
130
131 if (retry) {
Michael Ellerman33875f02009-06-17 18:13:53 +0000132 pr_devel("axon_msi: late irq 0x%x, retry %d\n",
Arnd Bergmannd015fe92008-11-28 09:51:22 +0000133 msi, retry);
134 retry = 0;
135 }
136
Michael Ellermance21b3c2007-07-20 21:39:28 +0200137 msic->read_offset += MSIC_FIFO_ENTRY_SIZE;
138 msic->read_offset &= MSIC_FIFO_SIZE_MASK;
Arnd Bergmannd015fe92008-11-28 09:51:22 +0000139 }
Michael Ellermance21b3c2007-07-20 21:39:28 +0200140
Arnd Bergmannd015fe92008-11-28 09:51:22 +0000141 if (retry) {
142 printk(KERN_WARNING "axon_msi: irq timed out\n");
143
144 msic->read_offset += MSIC_FIFO_ENTRY_SIZE;
145 msic->read_offset &= MSIC_FIFO_SIZE_MASK;
Michael Ellermance21b3c2007-07-20 21:39:28 +0200146 }
147
148 desc->chip->eoi(irq);
149}
150
151static struct axon_msic *find_msi_translator(struct pci_dev *dev)
152{
153 struct irq_host *irq_host;
154 struct device_node *dn, *tmp;
155 const phandle *ph;
156 struct axon_msic *msic = NULL;
157
Michael Ellermandb220b22007-09-17 16:03:45 +1000158 dn = of_node_get(pci_device_to_OF_node(dev));
Michael Ellermance21b3c2007-07-20 21:39:28 +0200159 if (!dn) {
160 dev_dbg(&dev->dev, "axon_msi: no pci_dn found\n");
161 return NULL;
162 }
163
Michael Ellerman988479e2008-04-24 12:08:54 +1000164 for (; dn; dn = of_get_next_parent(dn)) {
Michael Ellermance21b3c2007-07-20 21:39:28 +0200165 ph = of_get_property(dn, "msi-translator", NULL);
166 if (ph)
167 break;
168 }
169
170 if (!ph) {
171 dev_dbg(&dev->dev,
172 "axon_msi: no msi-translator property found\n");
173 goto out_error;
174 }
175
176 tmp = dn;
177 dn = of_find_node_by_phandle(*ph);
Stephen Rothwellc6d01172008-02-05 13:13:15 +1100178 of_node_put(tmp);
Michael Ellermance21b3c2007-07-20 21:39:28 +0200179 if (!dn) {
180 dev_dbg(&dev->dev,
181 "axon_msi: msi-translator doesn't point to a node\n");
182 goto out_error;
183 }
184
185 irq_host = irq_find_host(dn);
186 if (!irq_host) {
187 dev_dbg(&dev->dev, "axon_msi: no irq_host found for node %s\n",
188 dn->full_name);
189 goto out_error;
190 }
191
192 msic = irq_host->host_data;
193
194out_error:
195 of_node_put(dn);
Michael Ellermance21b3c2007-07-20 21:39:28 +0200196
197 return msic;
198}
199
200static int axon_msi_check_device(struct pci_dev *dev, int nvec, int type)
201{
202 if (!find_msi_translator(dev))
203 return -ENODEV;
204
205 return 0;
206}
207
208static int setup_msi_msg_address(struct pci_dev *dev, struct msi_msg *msg)
209{
Michael Ellerman988479e2008-04-24 12:08:54 +1000210 struct device_node *dn;
Michael Ellermance21b3c2007-07-20 21:39:28 +0200211 struct msi_desc *entry;
212 int len;
213 const u32 *prop;
214
Michael Ellermandb220b22007-09-17 16:03:45 +1000215 dn = of_node_get(pci_device_to_OF_node(dev));
Michael Ellermance21b3c2007-07-20 21:39:28 +0200216 if (!dn) {
217 dev_dbg(&dev->dev, "axon_msi: no pci_dn found\n");
218 return -ENODEV;
219 }
220
221 entry = list_first_entry(&dev->msi_list, struct msi_desc, list);
222
Michael Ellerman988479e2008-04-24 12:08:54 +1000223 for (; dn; dn = of_get_next_parent(dn)) {
Michael Ellermance21b3c2007-07-20 21:39:28 +0200224 if (entry->msi_attrib.is_64) {
225 prop = of_get_property(dn, "msi-address-64", &len);
226 if (prop)
227 break;
228 }
229
230 prop = of_get_property(dn, "msi-address-32", &len);
231 if (prop)
232 break;
233 }
234
235 if (!prop) {
236 dev_dbg(&dev->dev,
237 "axon_msi: no msi-address-(32|64) properties found\n");
238 return -ENOENT;
239 }
240
241 switch (len) {
242 case 8:
243 msg->address_hi = prop[0];
244 msg->address_lo = prop[1];
245 break;
246 case 4:
247 msg->address_hi = 0;
248 msg->address_lo = prop[0];
249 break;
250 default:
251 dev_dbg(&dev->dev,
252 "axon_msi: malformed msi-address-(32|64) property\n");
253 of_node_put(dn);
254 return -EINVAL;
255 }
256
257 of_node_put(dn);
258
259 return 0;
260}
261
262static int axon_msi_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
263{
264 unsigned int virq, rc;
265 struct msi_desc *entry;
266 struct msi_msg msg;
267 struct axon_msic *msic;
268
269 msic = find_msi_translator(dev);
270 if (!msic)
271 return -ENODEV;
272
273 rc = setup_msi_msg_address(dev, &msg);
274 if (rc)
275 return rc;
276
277 /* We rely on being able to stash a virq in a u16 */
278 BUILD_BUG_ON(NR_IRQS > 65536);
279
280 list_for_each_entry(entry, &dev->msi_list, list) {
281 virq = irq_create_direct_mapping(msic->irq_host);
282 if (virq == NO_IRQ) {
283 dev_warn(&dev->dev,
284 "axon_msi: virq allocation failed!\n");
285 return -1;
286 }
287 dev_dbg(&dev->dev, "axon_msi: allocated virq 0x%x\n", virq);
288
289 set_irq_msi(virq, entry);
290 msg.data = virq;
291 write_msi_msg(virq, &msg);
292 }
293
294 return 0;
295}
296
297static void axon_msi_teardown_msi_irqs(struct pci_dev *dev)
298{
299 struct msi_desc *entry;
300
301 dev_dbg(&dev->dev, "axon_msi: tearing down msi irqs\n");
302
303 list_for_each_entry(entry, &dev->msi_list, list) {
304 if (entry->irq == NO_IRQ)
305 continue;
306
307 set_irq_msi(entry->irq, NULL);
308 irq_dispose_mapping(entry->irq);
309 }
310}
311
312static struct irq_chip msic_irq_chip = {
Thomas Gleixner1c9db522010-09-28 16:46:51 +0200313 .irq_mask = mask_msi_irq,
314 .irq_unmask = unmask_msi_irq,
315 .irq_shutdown = mask_msi_irq,
Thomas Gleixnerb27df672009-11-18 23:44:21 +0000316 .name = "AXON-MSI",
Michael Ellermance21b3c2007-07-20 21:39:28 +0200317};
318
319static int msic_host_map(struct irq_host *h, unsigned int virq,
320 irq_hw_number_t hw)
321{
322 set_irq_chip_and_handler(virq, &msic_irq_chip, handle_simple_irq);
323
324 return 0;
325}
326
Michael Ellermance21b3c2007-07-20 21:39:28 +0200327static struct irq_host_ops msic_host_ops = {
Michael Ellermance21b3c2007-07-20 21:39:28 +0200328 .map = msic_host_map,
329};
330
Grant Likely00006122011-02-22 19:59:54 -0700331static void axon_msi_shutdown(struct platform_device *device)
Michael Ellermance21b3c2007-07-20 21:39:28 +0200332{
Michael Ellerman86c27652009-06-10 19:06:34 +0000333 struct axon_msic *msic = dev_get_drvdata(&device->dev);
Michael Ellermance21b3c2007-07-20 21:39:28 +0200334 u32 tmp;
335
Michael Ellerman33875f02009-06-17 18:13:53 +0000336 pr_devel("axon_msi: disabling %s\n",
Michael Ellermane4347df2008-01-25 16:59:14 +1100337 msic->irq_host->of_node->full_name);
338 tmp = dcr_read(msic->dcr_host, MSIC_CTRL_REG);
339 tmp &= ~MSIC_CTRL_ENABLE & ~MSIC_CTRL_IRQ_ENABLE;
340 msic_dcr_write(msic, MSIC_CTRL_REG, tmp);
Michael Ellermance21b3c2007-07-20 21:39:28 +0200341}
342
Grant Likely00006122011-02-22 19:59:54 -0700343static int axon_msi_probe(struct platform_device *device)
Michael Ellermance21b3c2007-07-20 21:39:28 +0200344{
Grant Likely61c7a082010-04-13 16:12:29 -0700345 struct device_node *dn = device->dev.of_node;
Michael Ellermance21b3c2007-07-20 21:39:28 +0200346 struct axon_msic *msic;
347 unsigned int virq;
Michael Ellerman4acb88962007-09-17 16:05:02 +1000348 int dcr_base, dcr_len;
Michael Ellermance21b3c2007-07-20 21:39:28 +0200349
Michael Ellerman33875f02009-06-17 18:13:53 +0000350 pr_devel("axon_msi: setting up dn %s\n", dn->full_name);
Michael Ellermance21b3c2007-07-20 21:39:28 +0200351
352 msic = kzalloc(sizeof(struct axon_msic), GFP_KERNEL);
353 if (!msic) {
354 printk(KERN_ERR "axon_msi: couldn't allocate msic for %s\n",
355 dn->full_name);
356 goto out;
357 }
358
Michael Ellerman4acb88962007-09-17 16:05:02 +1000359 dcr_base = dcr_resource_start(dn, 0);
Michael Ellermance21b3c2007-07-20 21:39:28 +0200360 dcr_len = dcr_resource_len(dn, 0);
361
Michael Ellerman4acb88962007-09-17 16:05:02 +1000362 if (dcr_base == 0 || dcr_len == 0) {
Michael Ellermance21b3c2007-07-20 21:39:28 +0200363 printk(KERN_ERR
364 "axon_msi: couldn't parse dcr properties on %s\n",
365 dn->full_name);
Michael Ellermanaee7a282009-10-12 14:29:40 +0000366 goto out_free_msic;
Michael Ellermance21b3c2007-07-20 21:39:28 +0200367 }
368
Michael Ellerman4acb88962007-09-17 16:05:02 +1000369 msic->dcr_host = dcr_map(dn, dcr_base, dcr_len);
Michael Ellermance21b3c2007-07-20 21:39:28 +0200370 if (!DCR_MAP_OK(msic->dcr_host)) {
371 printk(KERN_ERR "axon_msi: dcr_map failed for %s\n",
372 dn->full_name);
373 goto out_free_msic;
374 }
375
Michael Ellermande4c9282008-01-25 16:59:14 +1100376 msic->fifo_virt = dma_alloc_coherent(&device->dev, MSIC_FIFO_SIZE_BYTES,
377 &msic->fifo_phys, GFP_KERNEL);
378 if (!msic->fifo_virt) {
Michael Ellermance21b3c2007-07-20 21:39:28 +0200379 printk(KERN_ERR "axon_msi: couldn't allocate fifo for %s\n",
380 dn->full_name);
381 goto out_free_msic;
382 }
383
Michael Ellerman997526d2008-05-26 12:12:30 +1000384 virq = irq_of_parse_and_map(dn, 0);
385 if (virq == NO_IRQ) {
386 printk(KERN_ERR "axon_msi: irq parse and map failed for %s\n",
387 dn->full_name);
388 goto out_free_fifo;
389 }
Arnd Bergmannd015fe92008-11-28 09:51:22 +0000390 memset(msic->fifo_virt, 0xff, MSIC_FIFO_SIZE_BYTES);
Michael Ellerman997526d2008-05-26 12:12:30 +1000391
Michael Ellerman19fc65b2008-05-26 12:12:32 +1000392 msic->irq_host = irq_alloc_host(dn, IRQ_HOST_MAP_NOMAP,
Michael Ellerman52964f82007-08-28 18:47:54 +1000393 NR_IRQS, &msic_host_ops, 0);
Michael Ellermance21b3c2007-07-20 21:39:28 +0200394 if (!msic->irq_host) {
395 printk(KERN_ERR "axon_msi: couldn't allocate irq_host for %s\n",
396 dn->full_name);
397 goto out_free_fifo;
398 }
399
400 msic->irq_host->host_data = msic;
401
Michael Ellermance21b3c2007-07-20 21:39:28 +0200402 set_irq_data(virq, msic);
403 set_irq_chained_handler(virq, axon_msi_cascade);
Michael Ellerman33875f02009-06-17 18:13:53 +0000404 pr_devel("axon_msi: irq 0x%x setup for axon_msi\n", virq);
Michael Ellermance21b3c2007-07-20 21:39:28 +0200405
406 /* Enable the MSIC hardware */
Michael Ellermande4c9282008-01-25 16:59:14 +1100407 msic_dcr_write(msic, MSIC_BASE_ADDR_HI_REG, msic->fifo_phys >> 32);
Michael Ellermance21b3c2007-07-20 21:39:28 +0200408 msic_dcr_write(msic, MSIC_BASE_ADDR_LO_REG,
Michael Ellermande4c9282008-01-25 16:59:14 +1100409 msic->fifo_phys & 0xFFFFFFFF);
Michael Ellermance21b3c2007-07-20 21:39:28 +0200410 msic_dcr_write(msic, MSIC_CTRL_REG,
411 MSIC_CTRL_IRQ_ENABLE | MSIC_CTRL_ENABLE |
412 MSIC_CTRL_FIFO_SIZE);
413
Arnd Bergmann23e0e8a2008-12-12 09:19:50 +0000414 msic->read_offset = dcr_read(msic->dcr_host, MSIC_WRITE_OFFSET_REG)
415 & MSIC_FIFO_SIZE_MASK;
416
Michael Ellerman86c27652009-06-10 19:06:34 +0000417 dev_set_drvdata(&device->dev, msic);
Michael Ellermane4347df2008-01-25 16:59:14 +1100418
419 ppc_md.setup_msi_irqs = axon_msi_setup_msi_irqs;
420 ppc_md.teardown_msi_irqs = axon_msi_teardown_msi_irqs;
421 ppc_md.msi_check_device = axon_msi_check_device;
Michael Ellermance21b3c2007-07-20 21:39:28 +0200422
Michael Ellerman72cac212008-05-23 14:21:30 +1000423 axon_msi_debug_setup(dn, msic);
424
Michael Ellermance21b3c2007-07-20 21:39:28 +0200425 printk(KERN_DEBUG "axon_msi: setup MSIC on %s\n", dn->full_name);
426
427 return 0;
428
Michael Ellermance21b3c2007-07-20 21:39:28 +0200429out_free_fifo:
Michael Ellermande4c9282008-01-25 16:59:14 +1100430 dma_free_coherent(&device->dev, MSIC_FIFO_SIZE_BYTES, msic->fifo_virt,
431 msic->fifo_phys);
Michael Ellermance21b3c2007-07-20 21:39:28 +0200432out_free_msic:
433 kfree(msic);
434out:
435
436 return -1;
437}
438
Michael Ellermane4347df2008-01-25 16:59:14 +1100439static const struct of_device_id axon_msi_device_id[] = {
440 {
441 .compatible = "ibm,axon-msic"
442 },
443 {}
444};
445
Grant Likely00006122011-02-22 19:59:54 -0700446static struct platform_driver axon_msi_driver = {
Michael Ellermane4347df2008-01-25 16:59:14 +1100447 .probe = axon_msi_probe,
448 .shutdown = axon_msi_shutdown,
Grant Likely40182942010-04-13 16:13:02 -0700449 .driver = {
450 .name = "axon-msi",
451 .owner = THIS_MODULE,
452 .of_match_table = axon_msi_device_id,
Michael Ellermane4347df2008-01-25 16:59:14 +1100453 },
454};
455
456static int __init axon_msi_init(void)
Michael Ellermance21b3c2007-07-20 21:39:28 +0200457{
Grant Likely00006122011-02-22 19:59:54 -0700458 return platform_driver_register(&axon_msi_driver);
Michael Ellermance21b3c2007-07-20 21:39:28 +0200459}
Michael Ellermane4347df2008-01-25 16:59:14 +1100460subsys_initcall(axon_msi_init);
Michael Ellerman72cac212008-05-23 14:21:30 +1000461
462
463#ifdef DEBUG
464static int msic_set(void *data, u64 val)
465{
466 struct axon_msic *msic = data;
467 out_le32(msic->trigger, val);
468 return 0;
469}
470
471static int msic_get(void *data, u64 *val)
472{
473 *val = 0;
474 return 0;
475}
476
477DEFINE_SIMPLE_ATTRIBUTE(fops_msic, msic_get, msic_set, "%llu\n");
478
479void axon_msi_debug_setup(struct device_node *dn, struct axon_msic *msic)
480{
481 char name[8];
482 u64 addr;
483
484 addr = of_translate_address(dn, of_get_property(dn, "reg", NULL));
485 if (addr == OF_BAD_ADDR) {
Michael Ellerman33875f02009-06-17 18:13:53 +0000486 pr_devel("axon_msi: couldn't translate reg property\n");
Michael Ellerman72cac212008-05-23 14:21:30 +1000487 return;
488 }
489
490 msic->trigger = ioremap(addr, 0x4);
491 if (!msic->trigger) {
Michael Ellerman33875f02009-06-17 18:13:53 +0000492 pr_devel("axon_msi: ioremap failed\n");
Michael Ellerman72cac212008-05-23 14:21:30 +1000493 return;
494 }
495
496 snprintf(name, sizeof(name), "msic_%d", of_node_to_nid(dn));
497
498 if (!debugfs_create_file(name, 0600, powerpc_debugfs_root,
499 msic, &fops_msic)) {
Michael Ellerman33875f02009-06-17 18:13:53 +0000500 pr_devel("axon_msi: debugfs_create_file failed!\n");
Michael Ellerman72cac212008-05-23 14:21:30 +1000501 return;
502 }
503}
504#endif /* DEBUG */