2 * Routines common to most mpc85xx-based boards.
4 * This is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
9 #include <linux/of_irq.h>
10 #include <linux/of_platform.h>
12 #include <sysdev/cpm2_pic.h>
16 static struct of_device_id __initdata mpc85xx_common_ids
[] = {
18 { .compatible
= "soc", },
19 { .compatible
= "simple-bus", },
21 { .name
= "localbus", },
22 { .compatible
= "gianfar", },
23 { .compatible
= "fsl,qe", },
24 { .compatible
= "fsl,cpm2", },
25 { .compatible
= "fsl,srio", },
26 /* So that the DMA channel nodes can be probed individually: */
27 { .compatible
= "fsl,eloplus-dma", },
28 /* For the PMC driver */
29 { .compatible
= "fsl,mpc8548-guts", },
30 /* Probably unnecessary? */
31 { .compatible
= "gpio-leds", },
32 /* For all PCI controllers */
33 { .compatible
= "fsl,mpc8540-pci", },
34 { .compatible
= "fsl,mpc8548-pcie", },
35 { .compatible
= "fsl,p1022-pcie", },
36 { .compatible
= "fsl,p1010-pcie", },
37 { .compatible
= "fsl,p1023-pcie", },
38 { .compatible
= "fsl,p4080-pcie", },
39 { .compatible
= "fsl,qoriq-pcie-v2.4", },
40 { .compatible
= "fsl,qoriq-pcie-v2.3", },
41 { .compatible
= "fsl,qoriq-pcie-v2.2", },
45 int __init
mpc85xx_common_publish_devices(void)
47 return of_platform_bus_probe(NULL
, mpc85xx_common_ids
, NULL
);
50 static void cpm2_cascade(unsigned int irq
, struct irq_desc
*desc
)
52 struct irq_chip
*chip
= irq_desc_get_chip(desc
);
55 while ((cascade_irq
= cpm2_get_irq()) >= 0)
56 generic_handle_irq(cascade_irq
);
58 chip
->irq_eoi(&desc
->irq_data
);
62 void __init
mpc85xx_cpm2_pic_init(void)
64 struct device_node
*np
;
68 np
= of_find_compatible_node(NULL
, NULL
, "fsl,cpm2-pic");
70 printk(KERN_ERR
"PIC init: can not find fsl,cpm2-pic node\n");
73 irq
= irq_of_parse_and_map(np
, 0);
76 printk(KERN_ERR
"PIC init: got no IRQ for cpm cascade\n");
82 irq_set_chained_handler(irq
, cpm2_cascade
);