powerpc: Move mpc83xx_add_bridge to fsl_pci.c
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / arch / powerpc / platforms / 83xx / mpc837x_rdb.c
blobda030afa2e2cd92039c82fe34f890cfb46f132c4
1 /*
2 * arch/powerpc/platforms/83xx/mpc837x_rdb.c
4 * Copyright (C) 2007 Freescale Semicondutor, Inc. All rights reserved.
6 * MPC837x RDB board specific routines
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
14 #include <linux/pci.h>
15 #include <linux/of_platform.h>
17 #include <asm/time.h>
18 #include <asm/ipic.h>
19 #include <asm/udbg.h>
20 #include <sysdev/fsl_pci.h>
22 #include "mpc83xx.h"
24 extern int mpc837x_usb_cfg(void);
26 /* ************************************************************************
28 * Setup the architecture
31 static void __init mpc837x_rdb_setup_arch(void)
33 #ifdef CONFIG_PCI
34 struct device_node *np;
35 #endif
37 if (ppc_md.progress)
38 ppc_md.progress("mpc837x_rdb_setup_arch()", 0);
40 #ifdef CONFIG_PCI
41 for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")
42 mpc83xx_add_bridge(np);
43 #endif
44 mpc837x_usb_cfg();
47 static struct of_device_id mpc837x_ids[] = {
48 { .type = "soc", },
49 { .compatible = "soc", },
50 { .compatible = "simple-bus", },
51 {},
54 static int __init mpc837x_declare_of_platform_devices(void)
56 /* Publish of_device */
57 of_platform_bus_probe(NULL, mpc837x_ids, NULL);
59 return 0;
61 machine_device_initcall(mpc837x_rdb, mpc837x_declare_of_platform_devices);
63 static void __init mpc837x_rdb_init_IRQ(void)
65 struct device_node *np;
67 np = of_find_compatible_node(NULL, NULL, "fsl,ipic");
68 if (!np)
69 return;
71 ipic_init(np, 0);
73 /* Initialize the default interrupt mapping priorities,
74 * in case the boot rom changed something on us.
76 ipic_set_default_priority();
80 * Called very early, MMU is off, device-tree isn't unflattened
82 static int __init mpc837x_rdb_probe(void)
84 unsigned long root = of_get_flat_dt_root();
86 return of_flat_dt_is_compatible(root, "fsl,mpc8377rdb") ||
87 of_flat_dt_is_compatible(root, "fsl,mpc8378rdb") ||
88 of_flat_dt_is_compatible(root, "fsl,mpc8379rdb");
91 define_machine(mpc837x_rdb) {
92 .name = "MPC837x RDB",
93 .probe = mpc837x_rdb_probe,
94 .setup_arch = mpc837x_rdb_setup_arch,
95 .init_IRQ = mpc837x_rdb_init_IRQ,
96 .get_irq = ipic_get_irq,
97 .restart = mpc83xx_restart,
98 .time_init = mpc83xx_time_init,
99 .calibrate_decr = generic_calibrate_decr,
100 .progress = udbg_progress,