xref: /openbmc/linux/arch/powerpc/platforms/44x/fsp2.c (revision 6aa7de05)
1 /*
2  * FSP-2 board specific routines
3  *
4  * Based on earlier code:
5  *    Matt Porter <mporter@kernel.crashing.org>
6  *    Copyright 2002-2005 MontaVista Software Inc.
7  *
8  *    Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
9  *    Copyright (c) 2003-2005 Zultys Technologies
10  *
11  *    Rewritten and ported to the merged powerpc tree:
12  *    Copyright 2007 David Gibson <dwg@au1.ibm.com>, IBM Corporation.
13  *
14  * This program is free software; you can redistribute  it and/or modify it
15  * under  the terms of  the GNU General  Public License as published by the
16  * Free Software Foundation;  either version 2 of the  License, or (at your
17  * option) any later version.
18  */
19 
20 #include <linux/init.h>
21 #include <linux/of_platform.h>
22 #include <linux/rtc.h>
23 
24 #include <asm/machdep.h>
25 #include <asm/prom.h>
26 #include <asm/udbg.h>
27 #include <asm/time.h>
28 #include <asm/uic.h>
29 #include <asm/ppc4xx.h>
30 
31 static __initdata struct of_device_id fsp2_of_bus[] = {
32 	{ .compatible = "ibm,plb4", },
33 	{ .compatible = "ibm,plb6", },
34 	{ .compatible = "ibm,opb", },
35 	{},
36 };
37 
38 static int __init fsp2_device_probe(void)
39 {
40 	of_platform_bus_probe(NULL, fsp2_of_bus, NULL);
41 	return 0;
42 }
43 machine_device_initcall(fsp2, fsp2_device_probe);
44 
45 static int __init fsp2_probe(void)
46 {
47 	unsigned long root = of_get_flat_dt_root();
48 
49 	if (!of_flat_dt_is_compatible(root, "ibm,fsp2"))
50 		return 0;
51 	return 1;
52 }
53 
54 define_machine(fsp2) {
55 	.name			= "FSP-2",
56 	.probe			= fsp2_probe,
57 	.progress		= udbg_progress,
58 	.init_IRQ		= uic_init_tree,
59 	.get_irq		= uic_get_irq,
60 	.restart		= ppc4xx_reset_system,
61 	.calibrate_decr		= generic_calibrate_decr,
62 };
63