blob: 96970ac887ee267dc2826f607298df6cf930e36c [file] [log] [blame]
Kim Phillipsb3590492007-02-07 22:19:12 -06001/*
2 * arch/powerpc/platforms/83xx/mpc8313_rdb.c
3 *
4 * Description: MPC8313x RDB board specific routines.
5 * This file is based on mpc834x_sys.c
6 * Author: Lo Wlison <r43300@freescale.com>
7 *
8 * Copyright (C) Freescale Semiconductor, Inc. 2006. All rights reserved.
9 *
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.
14 */
15
16#include <linux/pci.h>
17
18#include <asm/time.h>
19#include <asm/ipic.h>
20#include <asm/udbg.h>
21
22#include "mpc83xx.h"
23
24#undef DEBUG
25#ifdef DEBUG
26#define DBG(fmt...) udbg_printf(fmt)
27#else
28#define DBG(fmt...)
29#endif
30
31#ifndef CONFIG_PCI
32unsigned long isa_io_base = 0;
33unsigned long isa_mem_base = 0;
34#endif
35
36/* ************************************************************************
37 *
38 * Setup the architecture
39 *
40 */
41static void __init mpc8313_rdb_setup_arch(void)
42{
Li Yangb38d06d2007-05-10 11:14:57 +080043#ifdef CONFIG_PCI
Kim Phillipsb3590492007-02-07 22:19:12 -060044 struct device_node *np;
Li Yangb38d06d2007-05-10 11:14:57 +080045#endif
Kim Phillipsb3590492007-02-07 22:19:12 -060046
47 if (ppc_md.progress)
48 ppc_md.progress("mpc8313_rdb_setup_arch()", 0);
49
50#ifdef CONFIG_PCI
51 for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
52 add_bridge(np);
53
54 ppc_md.pci_exclude_device = mpc83xx_exclude_device;
55#endif
56}
57
58void __init mpc8313_rdb_init_IRQ(void)
59{
60 struct device_node *np;
61
62 np = of_find_node_by_type(NULL, "ipic");
63 if (!np)
64 return;
65
66 ipic_init(np, 0);
67
68 /* Initialize the default interrupt mapping priorities,
69 * in case the boot rom changed something on us.
70 */
71 ipic_set_default_priority();
72}
73
74/*
75 * Called very early, MMU is off, device-tree isn't unflattened
76 */
77static int __init mpc8313_rdb_probe(void)
78{
Kumar Gala336c3c22007-02-17 09:10:44 -060079 unsigned long root = of_get_flat_dt_root();
Kim Phillipsb3590492007-02-07 22:19:12 -060080
Kumar Gala336c3c22007-02-17 09:10:44 -060081 return of_flat_dt_is_compatible(root, "MPC8313ERDB");
Kim Phillipsb3590492007-02-07 22:19:12 -060082}
83
84define_machine(mpc8313_rdb) {
85 .name = "MPC8313 RDB",
86 .probe = mpc8313_rdb_probe,
87 .setup_arch = mpc8313_rdb_setup_arch,
88 .init_IRQ = mpc8313_rdb_init_IRQ,
89 .get_irq = ipic_get_irq,
90 .restart = mpc83xx_restart,
91 .time_init = mpc83xx_time_init,
92 .calibrate_decr = generic_calibrate_decr,
93 .progress = udbg_progress,
94};