2 * MPC8544 DS Board Setup
4 * Author Xianghua Xiao (x.xiao@freescale.com)
5 * Copyright 2007 Freescale Semiconductor Inc.
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
13 #include <linux/stddef.h>
14 #include <linux/kernel.h>
15 #include <linux/kdev_t.h>
16 #include <linux/delay.h>
17 #include <linux/seq_file.h>
19 #include <asm/system.h>
21 #include <asm/machdep.h>
22 #include <asm/mpc85xx.h>
23 #include <mm/mmu_decl.h>
27 #include <asm/i8259.h>
29 #include <sysdev/fsl_soc.h>
35 #define DBG(fmt, args...) printk(KERN_ERR "%s: " fmt, __FUNCTION__, ## args)
37 #define DBG(fmt, args...)
41 void __init mpc8544_ds_pic_init(void)
45 struct device_node *np = NULL;
46 #ifdef CONFIG_PPC_I8259
47 struct device_node *cascade_node = NULL;
51 np = of_find_node_by_type(np, "open-pic");
54 printk(KERN_ERR "Could not find open-pic node\n");
58 if (of_address_to_resource(np, 0, &r)) {
59 printk(KERN_ERR "Failed to map mpic register space\n");
64 mpic = mpic_alloc(np, r.start,
65 MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
71 #ifdef CONFIG_PPC_I8259
72 /* Initialize the i8259 controller */
73 for_each_node_by_type(np, "interrupt-controller")
74 if (of_device_is_compatible(np, "chrp,iic")) {
79 if (cascade_node == NULL) {
80 printk(KERN_DEBUG "Could not find i8259 PIC\n");
84 cascade_irq = irq_of_parse_and_map(cascade_node, 0);
85 if (cascade_irq == NO_IRQ) {
86 printk(KERN_ERR "Failed to map cascade interrupt\n");
90 DBG("mpc8544ds: cascade mapped to irq %d\n", cascade_irq);
92 i8259_init(cascade_node, 0);
93 of_node_put(cascade_node);
95 set_irq_chained_handler(cascade_irq, mpc8544_8259_cascade);
96 #endif /* CONFIG_PPC_I8259 */
101 * Setup the architecture
103 static void __init mpc8544_ds_setup_arch(void)
106 ppc_md.progress("mpc8544_ds_setup_arch()", 0);
108 printk("MPC8544 DS board from Freescale Semiconductor\n");
113 * Called very early, device-tree isn't unflattened
115 static int __init mpc8544_ds_probe(void)
117 unsigned long root = of_get_flat_dt_root();
119 return of_flat_dt_is_compatible(root, "MPC8544DS");
122 define_machine(mpc8544_ds) {
123 .name = "MPC8544 DS",
124 .probe = mpc8544_ds_probe,
125 .setup_arch = mpc8544_ds_setup_arch,
126 .init_IRQ = mpc8544_ds_pic_init,
127 .get_irq = mpic_get_irq,
128 .restart = mpc85xx_restart,
129 .calibrate_decr = generic_calibrate_decr,
130 .progress = udbg_progress,