[POWERPC] 83xx: USB platform code rework
[linux-2.6/x86.git] / arch / powerpc / platforms / 83xx / mpc8313_rdb.c
blob3edfe170a03b3881f282b847057d29c046756d49
1 /*
2 * arch/powerpc/platforms/83xx/mpc8313_rdb.c
4 * Description: MPC8313x RDB board specific routines.
5 * This file is based on mpc834x_sys.c
6 * Author: Lo Wlison <r43300@freescale.com>
8 * Copyright (C) Freescale Semiconductor, Inc. 2006. All rights reserved.
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
16 #include <linux/pci.h>
18 #include <asm/time.h>
19 #include <asm/ipic.h>
20 #include <asm/udbg.h>
22 #include "mpc83xx.h"
24 #undef DEBUG
25 #ifdef DEBUG
26 #define DBG(fmt...) udbg_printf(fmt)
27 #else
28 #define DBG(fmt...)
29 #endif
31 /* ************************************************************************
33 * Setup the architecture
36 static void __init mpc8313_rdb_setup_arch(void)
38 #ifdef CONFIG_PCI
39 struct device_node *np;
40 #endif
42 if (ppc_md.progress)
43 ppc_md.progress("mpc8313_rdb_setup_arch()", 0);
45 #ifdef CONFIG_PCI
46 for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
47 mpc83xx_add_bridge(np);
49 ppc_md.pci_exclude_device = mpc83xx_exclude_device;
50 #endif
51 mpc831x_usb_cfg();
54 void __init mpc8313_rdb_init_IRQ(void)
56 struct device_node *np;
58 np = of_find_node_by_type(NULL, "ipic");
59 if (!np)
60 return;
62 ipic_init(np, 0);
64 /* Initialize the default interrupt mapping priorities,
65 * in case the boot rom changed something on us.
67 ipic_set_default_priority();
71 * Called very early, MMU is off, device-tree isn't unflattened
73 static int __init mpc8313_rdb_probe(void)
75 unsigned long root = of_get_flat_dt_root();
77 return of_flat_dt_is_compatible(root, "MPC8313ERDB");
80 define_machine(mpc8313_rdb) {
81 .name = "MPC8313 RDB",
82 .probe = mpc8313_rdb_probe,
83 .setup_arch = mpc8313_rdb_setup_arch,
84 .init_IRQ = mpc8313_rdb_init_IRQ,
85 .get_irq = ipic_get_irq,
86 .restart = mpc83xx_restart,
87 .time_init = mpc83xx_time_init,
88 .calibrate_decr = generic_calibrate_decr,
89 .progress = udbg_progress,