diff options
Diffstat (limited to 'arch/powerpc/platforms/83xx/mpc8313_rdb.c')
-rw-r--r-- | arch/powerpc/platforms/83xx/mpc8313_rdb.c | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/83xx/mpc8313_rdb.c b/arch/powerpc/platforms/83xx/mpc8313_rdb.c new file mode 100644 index 000000000000..c3b98c34eb6b --- /dev/null +++ b/arch/powerpc/platforms/83xx/mpc8313_rdb.c | |||
@@ -0,0 +1,99 @@ | |||
1 | /* | ||
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 | ||
32 | unsigned long isa_io_base = 0; | ||
33 | unsigned long isa_mem_base = 0; | ||
34 | #endif | ||
35 | |||
36 | /* ************************************************************************ | ||
37 | * | ||
38 | * Setup the architecture | ||
39 | * | ||
40 | */ | ||
41 | static void __init mpc8313_rdb_setup_arch(void) | ||
42 | { | ||
43 | struct device_node *np; | ||
44 | |||
45 | if (ppc_md.progress) | ||
46 | ppc_md.progress("mpc8313_rdb_setup_arch()", 0); | ||
47 | |||
48 | #ifdef CONFIG_PCI | ||
49 | for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;) | ||
50 | add_bridge(np); | ||
51 | |||
52 | ppc_md.pci_exclude_device = mpc83xx_exclude_device; | ||
53 | #endif | ||
54 | } | ||
55 | |||
56 | void __init mpc8313_rdb_init_IRQ(void) | ||
57 | { | ||
58 | struct device_node *np; | ||
59 | |||
60 | np = of_find_node_by_type(NULL, "ipic"); | ||
61 | if (!np) | ||
62 | return; | ||
63 | |||
64 | ipic_init(np, 0); | ||
65 | |||
66 | /* Initialize the default interrupt mapping priorities, | ||
67 | * in case the boot rom changed something on us. | ||
68 | */ | ||
69 | ipic_set_default_priority(); | ||
70 | } | ||
71 | |||
72 | /* | ||
73 | * Called very early, MMU is off, device-tree isn't unflattened | ||
74 | */ | ||
75 | static int __init mpc8313_rdb_probe(void) | ||
76 | { | ||
77 | char *model = of_get_flat_dt_prop(of_get_flat_dt_root(), | ||
78 | "model", NULL); | ||
79 | if (model == NULL) | ||
80 | return 0; | ||
81 | if (strcmp(model, "MPC8313ERDB")) | ||
82 | return 0; | ||
83 | |||
84 | DBG("MPC8313 RDB found\n"); | ||
85 | |||
86 | return 1; | ||
87 | } | ||
88 | |||
89 | define_machine(mpc8313_rdb) { | ||
90 | .name = "MPC8313 RDB", | ||
91 | .probe = mpc8313_rdb_probe, | ||
92 | .setup_arch = mpc8313_rdb_setup_arch, | ||
93 | .init_IRQ = mpc8313_rdb_init_IRQ, | ||
94 | .get_irq = ipic_get_irq, | ||
95 | .restart = mpc83xx_restart, | ||
96 | .time_init = mpc83xx_time_init, | ||
97 | .calibrate_decr = generic_calibrate_decr, | ||
98 | .progress = udbg_progress, | ||
99 | }; | ||