]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blob - arch/powerpc/platforms/40x/walnut.c
aea97017a7d4779194c1e17d796676817807f814
[linux-2.6-omap-h63xx.git] / arch / powerpc / platforms / 40x / walnut.c
1 /*
2  * Architecture- / platform-specific boot-time initialization code for
3  * IBM PowerPC 4xx based boards. Adapted from original
4  * code by Gary Thomas, Cort Dougan <cort@fsmlabs.com>, and Dan Malek
5  * <dan@net4x.com>.
6  *
7  * Copyright(c) 1999-2000 Grant Erickson <grant@lcse.umn.edu>
8  *
9  * Rewritten and ported to the merged powerpc tree:
10  * Copyright 2007 IBM Corporation
11  * Josh Boyer <jwboyer@linux.vnet.ibm.com>
12  *
13  * 2002 (c) MontaVista, Software, Inc.  This file is licensed under
14  * the terms of the GNU General Public License version 2.  This program
15  * is licensed "as is" without any warranty of any kind, whether express
16  * or implied.
17  */
18
19 #include <linux/init.h>
20 #include <linux/of_platform.h>
21
22 #include <asm/machdep.h>
23 #include <asm/prom.h>
24 #include <asm/udbg.h>
25 #include <asm/time.h>
26 #include <asm/uic.h>
27 #include <asm/pci-bridge.h>
28
29 static struct of_device_id walnut_of_bus[] = {
30         { .compatible = "ibm,plb3", },
31         { .compatible = "ibm,opb", },
32         { .compatible = "ibm,ebc", },
33         {},
34 };
35
36 static int __init walnut_device_probe(void)
37 {
38         if (!machine_is(walnut))
39                 return 0;
40
41         /* FIXME: do bus probe here */
42         of_platform_bus_probe(NULL, walnut_of_bus, NULL);
43
44         return 0;
45 }
46 device_initcall(walnut_device_probe);
47
48 static int __init walnut_probe(void)
49 {
50         unsigned long root = of_get_flat_dt_root();
51
52         if (!of_flat_dt_is_compatible(root, "ibm,walnut"))
53                 return 0;
54
55         ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
56
57         return 1;
58 }
59
60 define_machine(walnut) {
61         .name                   = "Walnut",
62         .probe                  = walnut_probe,
63         .progress               = udbg_progress,
64         .init_IRQ               = uic_init_tree,
65         .get_irq                = uic_get_irq,
66         .calibrate_decr = generic_calibrate_decr,
67 };