Pull bugzilla-9345 into release branch
[pandora-kernel.git] / arch / powerpc / platforms / 44x / ebony.c
1 /*
2  * Ebony board specific routines
3  *
4  * Matt Porter <mporter@kernel.crashing.org>
5  * Copyright 2002-2005 MontaVista Software Inc.
6  *
7  * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
8  * Copyright (c) 2003-2005 Zultys Technologies
9  *
10  * Rewritten and ported to the merged powerpc tree:
11  * Copyright 2007 David Gibson <dwg@au1.ibm.com>, IBM Corporation.
12  *
13  * This program is free software; you can redistribute  it and/or modify it
14  * under  the terms of  the GNU General  Public License as published by the
15  * Free Software Foundation;  either version 2 of the  License, or (at your
16  * option) any later version.
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
28 #include "44x.h"
29
30 static struct of_device_id ebony_of_bus[] = {
31         { .compatible = "ibm,plb4", },
32         { .compatible = "ibm,opb", },
33         { .compatible = "ibm,ebc", },
34         {},
35 };
36
37 static int __init ebony_device_probe(void)
38 {
39         if (!machine_is(ebony))
40                 return 0;
41
42         of_platform_bus_probe(NULL, ebony_of_bus, NULL);
43
44         return 0;
45 }
46 device_initcall(ebony_device_probe);
47
48 /*
49  * Called very early, MMU is off, device-tree isn't unflattened
50  */
51 static int __init ebony_probe(void)
52 {
53         unsigned long root = of_get_flat_dt_root();
54
55         if (!of_flat_dt_is_compatible(root, "ibm,ebony"))
56                 return 0;
57
58         return 1;
59 }
60
61 define_machine(ebony) {
62         .name                   = "Ebony",
63         .probe                  = ebony_probe,
64         .progress               = udbg_progress,
65         .init_IRQ               = uic_init_tree,
66         .get_irq                = uic_get_irq,
67         .restart                = ppc44x_reset_system,
68         .calibrate_decr         = generic_calibrate_decr,
69 };