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>
13 #include <sysdev/cpm2_pic.h>
17 static const struct of_device_id mpc85xx_common_ids
[] __initconst
= {
19 { .compatible
= "soc", },
20 { .compatible
= "simple-bus", },
22 { .name
= "localbus", },
23 { .compatible
= "gianfar", },
24 { .compatible
= "fsl,qe", },
25 { .compatible
= "fsl,cpm2", },
26 { .compatible
= "fsl,srio", },
27 /* So that the DMA channel nodes can be probed individually: */
28 { .compatible
= "fsl,eloplus-dma", },
29 /* For the PMC driver */
30 { .compatible
= "fsl,mpc8548-guts", },
31 /* Probably unnecessary? */
32 { .compatible
= "gpio-leds", },
33 /* For all PCI controllers */
34 { .compatible
= "fsl,mpc8540-pci", },
35 { .compatible
= "fsl,mpc8548-pcie", },
36 { .compatible
= "fsl,p1022-pcie", },
37 { .compatible
= "fsl,p1010-pcie", },
38 { .compatible
= "fsl,p1023-pcie", },
39 { .compatible
= "fsl,p4080-pcie", },
40 { .compatible
= "fsl,qoriq-pcie-v2.4", },
41 { .compatible
= "fsl,qoriq-pcie-v2.3", },
42 { .compatible
= "fsl,qoriq-pcie-v2.2", },
43 { .compatible
= "fsl,fman", },
47 int __init
mpc85xx_common_publish_devices(void)
49 return of_platform_bus_probe(NULL
, mpc85xx_common_ids
, NULL
);
52 static void cpm2_cascade(struct irq_desc
*desc
)
54 struct irq_chip
*chip
= irq_desc_get_chip(desc
);
57 while ((cascade_irq
= cpm2_get_irq()) >= 0)
58 generic_handle_irq(cascade_irq
);
60 chip
->irq_eoi(&desc
->irq_data
);
64 void __init
mpc85xx_cpm2_pic_init(void)
66 struct device_node
*np
;
70 np
= of_find_compatible_node(NULL
, NULL
, "fsl,cpm2-pic");
72 printk(KERN_ERR
"PIC init: can not find fsl,cpm2-pic node\n");
75 irq
= irq_of_parse_and_map(np
, 0);
78 printk(KERN_ERR
"PIC init: got no IRQ for cpm cascade\n");
84 irq_set_chained_handler(irq
, cpm2_cascade
);
88 #ifdef CONFIG_QUICC_ENGINE
89 void __init
mpc85xx_qe_init(void)
91 struct device_node
*np
;
93 np
= of_find_compatible_node(NULL
, NULL
, "fsl,qe");
95 np
= of_find_node_by_name(NULL
, "qe");
97 pr_err("%s: Could not find Quicc Engine node\n",
103 if (!of_device_is_available(np
)) {
113 void __init
mpc85xx_qe_par_io_init(void)
115 struct device_node
*np
;
117 np
= of_find_node_by_name(NULL
, "par_io");
119 struct device_node
*ucc
;
124 for_each_node_by_name(ucc
, "ucc")
125 par_io_of_config(ucc
);