diff options
author | Kumar Gala <galak@kernel.crashing.org> | 2008-01-24 00:42:44 -0500 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2008-01-27 15:10:36 -0500 |
commit | 77e03a2241fe9a15749b2b30196fc14637310959 (patch) | |
tree | 10052bf98bc8da56a7ed71dc133359b4915317d4 /arch/powerpc/platforms | |
parent | 7858f7477e3d9311240b93d4f320a8d57faa3c70 (diff) |
[POWERPC] 85xx: Port STX GP3 board over from arch/ppc
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms')
-rw-r--r-- | arch/powerpc/platforms/85xx/Kconfig | 12 | ||||
-rw-r--r-- | arch/powerpc/platforms/85xx/Makefile | 1 | ||||
-rw-r--r-- | arch/powerpc/platforms/85xx/stx_gp3.c | 187 |
3 files changed, 198 insertions, 2 deletions
diff --git a/arch/powerpc/platforms/85xx/Kconfig b/arch/powerpc/platforms/85xx/Kconfig index 7748a3a426db..26f9cd52e9f3 100644 --- a/arch/powerpc/platforms/85xx/Kconfig +++ b/arch/powerpc/platforms/85xx/Kconfig | |||
@@ -38,6 +38,14 @@ config MPC85xx_DS | |||
38 | help | 38 | help |
39 | This option enables support for the MPC85xx DS (MPC8544 DS) board | 39 | This option enables support for the MPC85xx DS (MPC8544 DS) board |
40 | 40 | ||
41 | config STX_GP3 | ||
42 | bool "Silicon Turnkey Express GP3" | ||
43 | help | ||
44 | This option enables support for the Silicon Turnkey Express GP3 | ||
45 | board. | ||
46 | select DEFAULT_UIMAGE | ||
47 | select PPC_CPM_NEW_BINDING | ||
48 | |||
41 | endchoice | 49 | endchoice |
42 | 50 | ||
43 | config MPC8540 | 51 | config MPC8540 |
@@ -49,7 +57,7 @@ config MPC8540 | |||
49 | config MPC8560 | 57 | config MPC8560 |
50 | bool | 58 | bool |
51 | select CPM2 | 59 | select CPM2 |
52 | default y if MPC8560_ADS | 60 | default y if MPC8560_ADS || STX_GP3 |
53 | 61 | ||
54 | config MPC85xx | 62 | config MPC85xx |
55 | bool | 63 | bool |
@@ -59,4 +67,4 @@ config MPC85xx | |||
59 | select FSL_PCI if PCI | 67 | select FSL_PCI if PCI |
60 | select SERIAL_8250_SHARE_IRQ if SERIAL_8250 | 68 | select SERIAL_8250_SHARE_IRQ if SERIAL_8250 |
61 | default y if MPC8540_ADS || MPC85xx_CDS || MPC8560_ADS \ | 69 | default y if MPC8540_ADS || MPC85xx_CDS || MPC8560_ADS \ |
62 | || MPC85xx_MDS || MPC85xx_DS | 70 | || MPC85xx_MDS || MPC85xx_DS || STX_GP3 |
diff --git a/arch/powerpc/platforms/85xx/Makefile b/arch/powerpc/platforms/85xx/Makefile index 5eca92023ec8..bf7d2e1c07e7 100644 --- a/arch/powerpc/platforms/85xx/Makefile +++ b/arch/powerpc/platforms/85xx/Makefile | |||
@@ -6,3 +6,4 @@ obj-$(CONFIG_MPC8560_ADS) += mpc85xx_ads.o | |||
6 | obj-$(CONFIG_MPC85xx_CDS) += mpc85xx_cds.o | 6 | obj-$(CONFIG_MPC85xx_CDS) += mpc85xx_cds.o |
7 | obj-$(CONFIG_MPC85xx_DS) += mpc85xx_ds.o | 7 | obj-$(CONFIG_MPC85xx_DS) += mpc85xx_ds.o |
8 | obj-$(CONFIG_MPC85xx_MDS) += mpc85xx_mds.o | 8 | obj-$(CONFIG_MPC85xx_MDS) += mpc85xx_mds.o |
9 | obj-$(CONFIG_STX_GP3) += stx_gp3.o | ||
diff --git a/arch/powerpc/platforms/85xx/stx_gp3.c b/arch/powerpc/platforms/85xx/stx_gp3.c new file mode 100644 index 000000000000..0b20c170c4d2 --- /dev/null +++ b/arch/powerpc/platforms/85xx/stx_gp3.c | |||
@@ -0,0 +1,187 @@ | |||
1 | /* | ||
2 | * Based on MPC8560 ADS and arch/ppc stx_gp3 ports | ||
3 | * | ||
4 | * Maintained by Kumar Gala (see MAINTAINERS for contact information) | ||
5 | * | ||
6 | * Copyright 2008 Freescale Semiconductor Inc. | ||
7 | * | ||
8 | * Dan Malek <dan@embeddededge.com> | ||
9 | * Copyright 2004 Embedded Edge, LLC | ||
10 | * | ||
11 | * Copied from mpc8560_ads.c | ||
12 | * Copyright 2002, 2003 Motorola Inc. | ||
13 | * | ||
14 | * Ported to 2.6, Matt Porter <mporter@kernel.crashing.org> | ||
15 | * Copyright 2004-2005 MontaVista Software, Inc. | ||
16 | * | ||
17 | * This program is free software; you can redistribute it and/or modify it | ||
18 | * under the terms of the GNU General Public License as published by the | ||
19 | * Free Software Foundation; either version 2 of the License, or (at your | ||
20 | * option) any later version. | ||
21 | */ | ||
22 | |||
23 | #include <linux/stddef.h> | ||
24 | #include <linux/kernel.h> | ||
25 | #include <linux/pci.h> | ||
26 | #include <linux/kdev_t.h> | ||
27 | #include <linux/delay.h> | ||
28 | #include <linux/seq_file.h> | ||
29 | #include <linux/of_platform.h> | ||
30 | |||
31 | #include <asm/system.h> | ||
32 | #include <asm/time.h> | ||
33 | #include <asm/machdep.h> | ||
34 | #include <asm/pci-bridge.h> | ||
35 | #include <asm/mpic.h> | ||
36 | #include <asm/prom.h> | ||
37 | #include <mm/mmu_decl.h> | ||
38 | #include <asm/udbg.h> | ||
39 | |||
40 | #include <sysdev/fsl_soc.h> | ||
41 | #include <sysdev/fsl_pci.h> | ||
42 | |||
43 | #ifdef CONFIG_CPM2 | ||
44 | #include <asm/cpm2.h> | ||
45 | #include <sysdev/cpm2_pic.h> | ||
46 | |||
47 | static void cpm2_cascade(unsigned int irq, struct irq_desc *desc) | ||
48 | { | ||
49 | int cascade_irq; | ||
50 | |||
51 | while ((cascade_irq = cpm2_get_irq()) >= 0) | ||
52 | generic_handle_irq(cascade_irq); | ||
53 | |||
54 | desc->chip->eoi(irq); | ||
55 | } | ||
56 | #endif /* CONFIG_CPM2 */ | ||
57 | |||
58 | static void __init stx_gp3_pic_init(void) | ||
59 | { | ||
60 | struct mpic *mpic; | ||
61 | struct resource r; | ||
62 | struct device_node *np; | ||
63 | #ifdef CONFIG_CPM2 | ||
64 | int irq; | ||
65 | #endif | ||
66 | |||
67 | np = of_find_node_by_type(NULL, "open-pic"); | ||
68 | if (!np) { | ||
69 | printk(KERN_ERR "Could not find open-pic node\n"); | ||
70 | return; | ||
71 | } | ||
72 | |||
73 | if (of_address_to_resource(np, 0, &r)) { | ||
74 | printk(KERN_ERR "Could not map mpic register space\n"); | ||
75 | of_node_put(np); | ||
76 | return; | ||
77 | } | ||
78 | |||
79 | mpic = mpic_alloc(np, r.start, | ||
80 | MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, | ||
81 | 0, 256, " OpenPIC "); | ||
82 | BUG_ON(mpic == NULL); | ||
83 | of_node_put(np); | ||
84 | |||
85 | mpic_init(mpic); | ||
86 | |||
87 | #ifdef CONFIG_CPM2 | ||
88 | /* Setup CPM2 PIC */ | ||
89 | np = of_find_compatible_node(NULL, NULL, "fsl,cpm2-pic"); | ||
90 | if (np == NULL) { | ||
91 | printk(KERN_ERR "PIC init: can not find fsl,cpm2-pic node\n"); | ||
92 | return; | ||
93 | } | ||
94 | irq = irq_of_parse_and_map(np, 0); | ||
95 | |||
96 | if (irq == NO_IRQ) { | ||
97 | of_node_put(np); | ||
98 | printk(KERN_ERR "PIC init: got no IRQ for cpm cascade\n"); | ||
99 | return; | ||
100 | } | ||
101 | |||
102 | cpm2_pic_init(np); | ||
103 | of_node_put(np); | ||
104 | set_irq_chained_handler(irq, cpm2_cascade); | ||
105 | #endif | ||
106 | } | ||
107 | |||
108 | /* | ||
109 | * Setup the architecture | ||
110 | */ | ||
111 | static void __init stx_gp3_setup_arch(void) | ||
112 | { | ||
113 | #ifdef CONFIG_PCI | ||
114 | struct device_node *np; | ||
115 | #endif | ||
116 | |||
117 | if (ppc_md.progress) | ||
118 | ppc_md.progress("stx_gp3_setup_arch()", 0); | ||
119 | |||
120 | #ifdef CONFIG_CPM2 | ||
121 | cpm2_reset(); | ||
122 | #endif | ||
123 | |||
124 | #ifdef CONFIG_PCI | ||
125 | for_each_compatible_node(np, "pci", "fsl,mpc8540-pci") | ||
126 | fsl_add_bridge(np, 1); | ||
127 | #endif | ||
128 | } | ||
129 | |||
130 | static void stx_gp3_show_cpuinfo(struct seq_file *m) | ||
131 | { | ||
132 | uint pvid, svid, phid1; | ||
133 | uint memsize = total_memory; | ||
134 | |||
135 | pvid = mfspr(SPRN_PVR); | ||
136 | svid = mfspr(SPRN_SVR); | ||
137 | |||
138 | seq_printf(m, "Vendor\t\t: RPC Electronics STx \n"); | ||
139 | seq_printf(m, "PVR\t\t: 0x%x\n", pvid); | ||
140 | seq_printf(m, "SVR\t\t: 0x%x\n", svid); | ||
141 | |||
142 | /* Display cpu Pll setting */ | ||
143 | phid1 = mfspr(SPRN_HID1); | ||
144 | seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f)); | ||
145 | |||
146 | /* Display the amount of memory */ | ||
147 | seq_printf(m, "Memory\t\t: %d MB\n", memsize / (1024 * 1024)); | ||
148 | } | ||
149 | |||
150 | static struct of_device_id __initdata of_bus_ids[] = { | ||
151 | { .name = "soc", }, | ||
152 | { .type = "soc", }, | ||
153 | { .name = "cpm", }, | ||
154 | { .name = "localbus", }, | ||
155 | { .compatible = "simple-bus", }, | ||
156 | {}, | ||
157 | }; | ||
158 | |||
159 | static int __init declare_of_platform_devices(void) | ||
160 | { | ||
161 | of_platform_bus_probe(NULL, of_bus_ids, NULL); | ||
162 | |||
163 | return 0; | ||
164 | } | ||
165 | machine_device_initcall(stx_gp3, declare_of_platform_devices); | ||
166 | |||
167 | /* | ||
168 | * Called very early, device-tree isn't unflattened | ||
169 | */ | ||
170 | static int __init stx_gp3_probe(void) | ||
171 | { | ||
172 | unsigned long root = of_get_flat_dt_root(); | ||
173 | |||
174 | return of_flat_dt_is_compatible(root, "stx,gp3-8560"); | ||
175 | } | ||
176 | |||
177 | define_machine(stx_gp3) { | ||
178 | .name = "STX GP3", | ||
179 | .probe = stx_gp3_probe, | ||
180 | .setup_arch = stx_gp3_setup_arch, | ||
181 | .init_IRQ = stx_gp3_pic_init, | ||
182 | .show_cpuinfo = stx_gp3_show_cpuinfo, | ||
183 | .get_irq = mpic_get_irq, | ||
184 | .restart = fsl_rstcr_restart, | ||
185 | .calibrate_decr = generic_calibrate_decr, | ||
186 | .progress = udbg_progress, | ||
187 | }; | ||