blob: 335df91fbee58e9e0430fe54649d3810ff70ae85 [file] [log] [blame]
Josh Boyer545c0692007-09-07 07:51:24 -05001/*
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>
Jon Loeligered08aff2007-11-07 05:13:04 +110020#include <linux/of_platform.h>
Josh Boyerfde9d162008-02-06 07:04:58 -060021#include <linux/rtc.h>
Jon Loeligered08aff2007-11-07 05:13:04 +110022
Josh Boyer545c0692007-09-07 07:51:24 -050023#include <asm/machdep.h>
24#include <asm/prom.h>
25#include <asm/udbg.h>
26#include <asm/time.h>
27#include <asm/uic.h>
Benjamin Herrenschmidt25c24f32007-12-21 15:39:37 +110028#include <asm/pci-bridge.h>
Stefan Roese93173ce2008-03-28 01:43:31 +110029#include <asm/ppc4xx.h>
Josh Boyer545c0692007-09-07 07:51:24 -050030
Josh Boyer8cb34d22007-12-24 08:40:31 -060031static __initdata struct of_device_id walnut_of_bus[] = {
Josh Boyer545c0692007-09-07 07:51:24 -050032 { .compatible = "ibm,plb3", },
33 { .compatible = "ibm,opb", },
34 { .compatible = "ibm,ebc", },
35 {},
36};
37
38static int __init walnut_device_probe(void)
39{
Josh Boyer545c0692007-09-07 07:51:24 -050040 of_platform_bus_probe(NULL, walnut_of_bus, NULL);
David Gibson22258fa2008-01-11 14:25:34 +110041 of_instantiate_rtc();
Josh Boyer545c0692007-09-07 07:51:24 -050042
43 return 0;
44}
Josh Boyer3f8c5c32007-12-24 10:42:02 -060045machine_device_initcall(walnut, walnut_device_probe);
Josh Boyer545c0692007-09-07 07:51:24 -050046
47static int __init walnut_probe(void)
48{
49 unsigned long root = of_get_flat_dt_root();
50
51 if (!of_flat_dt_is_compatible(root, "ibm,walnut"))
52 return 0;
53
Benjamin Herrenschmidt25c24f32007-12-21 15:39:37 +110054 ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
55
Josh Boyer545c0692007-09-07 07:51:24 -050056 return 1;
57}
58
Josh Boyer545c0692007-09-07 07:51:24 -050059define_machine(walnut) {
60 .name = "Walnut",
61 .probe = walnut_probe,
Josh Boyer545c0692007-09-07 07:51:24 -050062 .progress = udbg_progress,
63 .init_IRQ = uic_init_tree,
64 .get_irq = uic_get_irq,
Stefan Roese93173ce2008-03-28 01:43:31 +110065 .restart = ppc4xx_reset_system,
66 .calibrate_decr = generic_calibrate_decr,
Josh Boyer545c0692007-09-07 07:51:24 -050067};