aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/85xx
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/platforms/85xx')
-rw-r--r--arch/powerpc/platforms/85xx/Kconfig13
-rw-r--r--arch/powerpc/platforms/85xx/Makefile1
-rw-r--r--arch/powerpc/platforms/85xx/ksi8560.c257
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_ads.c2
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_ds.c15
5 files changed, 279 insertions, 9 deletions
diff --git a/arch/powerpc/platforms/85xx/Kconfig b/arch/powerpc/platforms/85xx/Kconfig
index 7e76ddbd5821..7ff29d53dc2d 100644
--- a/arch/powerpc/platforms/85xx/Kconfig
+++ b/arch/powerpc/platforms/85xx/Kconfig
@@ -19,7 +19,6 @@ config MPC8540_ADS
19config MPC8560_ADS 19config MPC8560_ADS
20 bool "Freescale MPC8560 ADS" 20 bool "Freescale MPC8560 ADS"
21 select DEFAULT_UIMAGE 21 select DEFAULT_UIMAGE
22 select PPC_CPM_NEW_BINDING
23 select CPM2 22 select CPM2
24 help 23 help
25 This option enables support for the MPC 8560 ADS board 24 This option enables support for the MPC 8560 ADS board
@@ -46,6 +45,12 @@ config MPC85xx_DS
46 help 45 help
47 This option enables support for the MPC85xx DS (MPC8544 DS) board 46 This option enables support for the MPC85xx DS (MPC8544 DS) board
48 47
48config KSI8560
49 bool "Emerson KSI8560"
50 select DEFAULT_UIMAGE
51 help
52 This option enables support for the Emerson KSI8560 board
53
49config STX_GP3 54config STX_GP3
50 bool "Silicon Turnkey Express GP3" 55 bool "Silicon Turnkey Express GP3"
51 help 56 help
@@ -53,14 +58,12 @@ config STX_GP3
53 board. 58 board.
54 select CPM2 59 select CPM2
55 select DEFAULT_UIMAGE 60 select DEFAULT_UIMAGE
56 select PPC_CPM_NEW_BINDING
57 61
58config TQM8540 62config TQM8540
59 bool "TQ Components TQM8540" 63 bool "TQ Components TQM8540"
60 help 64 help
61 This option enables support for the TQ Components TQM8540 board. 65 This option enables support for the TQ Components TQM8540 board.
62 select DEFAULT_UIMAGE 66 select DEFAULT_UIMAGE
63 select PPC_CPM_NEW_BINDING
64 select TQM85xx 67 select TQM85xx
65 68
66config TQM8541 69config TQM8541
@@ -68,7 +71,6 @@ config TQM8541
68 help 71 help
69 This option enables support for the TQ Components TQM8541 board. 72 This option enables support for the TQ Components TQM8541 board.
70 select DEFAULT_UIMAGE 73 select DEFAULT_UIMAGE
71 select PPC_CPM_NEW_BINDING
72 select TQM85xx 74 select TQM85xx
73 select CPM2 75 select CPM2
74 76
@@ -77,7 +79,6 @@ config TQM8555
77 help 79 help
78 This option enables support for the TQ Components TQM8555 board. 80 This option enables support for the TQ Components TQM8555 board.
79 select DEFAULT_UIMAGE 81 select DEFAULT_UIMAGE
80 select PPC_CPM_NEW_BINDING
81 select TQM85xx 82 select TQM85xx
82 select CPM2 83 select CPM2
83 84
@@ -86,7 +87,6 @@ config TQM8560
86 help 87 help
87 This option enables support for the TQ Components TQM8560 board. 88 This option enables support for the TQ Components TQM8560 board.
88 select DEFAULT_UIMAGE 89 select DEFAULT_UIMAGE
89 select PPC_CPM_NEW_BINDING
90 select TQM85xx 90 select TQM85xx
91 select CPM2 91 select CPM2
92 92
@@ -99,7 +99,6 @@ config SBC8548
99config SBC8560 99config SBC8560
100 bool "Wind River SBC8560" 100 bool "Wind River SBC8560"
101 select DEFAULT_UIMAGE 101 select DEFAULT_UIMAGE
102 select PPC_CPM_NEW_BINDING if CPM2
103 help 102 help
104 This option enables support for the Wind River SBC8560 board 103 This option enables support for the Wind River SBC8560 board
105 104
diff --git a/arch/powerpc/platforms/85xx/Makefile b/arch/powerpc/platforms/85xx/Makefile
index cb7af4ebd75f..6cea185f62b2 100644
--- a/arch/powerpc/platforms/85xx/Makefile
+++ b/arch/powerpc/platforms/85xx/Makefile
@@ -10,3 +10,4 @@ obj-$(CONFIG_STX_GP3) += stx_gp3.o
10obj-$(CONFIG_TQM85xx) += tqm85xx.o 10obj-$(CONFIG_TQM85xx) += tqm85xx.o
11obj-$(CONFIG_SBC8560) += sbc8560.o 11obj-$(CONFIG_SBC8560) += sbc8560.o
12obj-$(CONFIG_SBC8548) += sbc8548.o 12obj-$(CONFIG_SBC8548) += sbc8548.o
13obj-$(CONFIG_KSI8560) += ksi8560.o
diff --git a/arch/powerpc/platforms/85xx/ksi8560.c b/arch/powerpc/platforms/85xx/ksi8560.c
new file mode 100644
index 000000000000..2145adeb220c
--- /dev/null
+++ b/arch/powerpc/platforms/85xx/ksi8560.c
@@ -0,0 +1,257 @@
1/*
2 * Board setup routines for the Emerson KSI8560
3 *
4 * Author: Alexandr Smirnov <asmirnov@ru.mvista.com>
5 *
6 * Based on mpc85xx_ads.c maintained by Kumar Gala
7 *
8 * 2008 (c) MontaVista, Software, Inc. This file is licensed under
9 * the terms of the GNU General Public License version 2. This program
10 * is licensed "as is" without any warranty of any kind, whether express
11 * or implied.
12 *
13 */
14
15#include <linux/stddef.h>
16#include <linux/kernel.h>
17#include <linux/pci.h>
18#include <linux/kdev_t.h>
19#include <linux/delay.h>
20#include <linux/seq_file.h>
21#include <linux/of_platform.h>
22
23#include <asm/system.h>
24#include <asm/time.h>
25#include <asm/machdep.h>
26#include <asm/pci-bridge.h>
27#include <asm/mpic.h>
28#include <mm/mmu_decl.h>
29#include <asm/udbg.h>
30#include <asm/prom.h>
31
32#include <sysdev/fsl_soc.h>
33#include <sysdev/fsl_pci.h>
34
35#include <asm/cpm2.h>
36#include <sysdev/cpm2_pic.h>
37
38
39#define KSI8560_CPLD_HVR 0x04 /* Hardware Version Register */
40#define KSI8560_CPLD_PVR 0x08 /* PLD Version Register */
41#define KSI8560_CPLD_RCR1 0x30 /* Reset Command Register 1 */
42
43#define KSI8560_CPLD_RCR1_CPUHR 0x80 /* CPU Hard Reset */
44
45static void __iomem *cpld_base = NULL;
46
47static void machine_restart(char *cmd)
48{
49 if (cpld_base)
50 out_8(cpld_base + KSI8560_CPLD_RCR1, KSI8560_CPLD_RCR1_CPUHR);
51 else
52 printk(KERN_ERR "Can't find CPLD base, hang forever\n");
53
54 for (;;);
55}
56
57static void cpm2_cascade(unsigned int irq, struct irq_desc *desc)
58{
59 int cascade_irq;
60
61 while ((cascade_irq = cpm2_get_irq()) >= 0)
62 generic_handle_irq(cascade_irq);
63
64 desc->chip->eoi(irq);
65}
66
67static void __init ksi8560_pic_init(void)
68{
69 struct mpic *mpic;
70 struct resource r;
71 struct device_node *np;
72#ifdef CONFIG_CPM2
73 int irq;
74#endif
75
76 np = of_find_node_by_type(NULL, "open-pic");
77
78 if (np == NULL) {
79 printk(KERN_ERR "Could not find open-pic node\n");
80 return;
81 }
82
83 if (of_address_to_resource(np, 0, &r)) {
84 printk(KERN_ERR "Could not map mpic register space\n");
85 of_node_put(np);
86 return;
87 }
88
89 mpic = mpic_alloc(np, r.start,
90 MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
91 0, 256, " OpenPIC ");
92 BUG_ON(mpic == NULL);
93 of_node_put(np);
94
95 mpic_init(mpic);
96
97#ifdef CONFIG_CPM2
98 /* Setup CPM2 PIC */
99 np = of_find_compatible_node(NULL, NULL, "fsl,cpm2-pic");
100 if (np == NULL) {
101 printk(KERN_ERR "PIC init: can not find fsl,cpm2-pic node\n");
102 return;
103 }
104 irq = irq_of_parse_and_map(np, 0);
105
106 cpm2_pic_init(np);
107 of_node_put(np);
108 set_irq_chained_handler(irq, cpm2_cascade);
109
110 setup_irq(0, NULL);
111#endif
112}
113
114#ifdef CONFIG_CPM2
115/*
116 * Setup I/O ports
117 */
118struct cpm_pin {
119 int port, pin, flags;
120};
121
122static struct cpm_pin __initdata ksi8560_pins[] = {
123 /* SCC1 */
124 {3, 29, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
125 {3, 30, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
126 {3, 31, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
127
128 /* SCC2 */
129 {3, 26, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
130 {3, 27, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
131 {3, 28, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
132
133 /* FCC1 */
134 {0, 14, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
135 {0, 15, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
136 {0, 16, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
137 {0, 17, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
138 {0, 18, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
139 {0, 19, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
140 {0, 20, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
141 {0, 21, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
142 {0, 26, CPM_PIN_INPUT | CPM_PIN_SECONDARY},
143 {0, 27, CPM_PIN_INPUT | CPM_PIN_SECONDARY},
144 {0, 28, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
145 {0, 29, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
146 {0, 30, CPM_PIN_INPUT | CPM_PIN_SECONDARY},
147 {0, 31, CPM_PIN_INPUT | CPM_PIN_SECONDARY},
148 {2, 23, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, /* CLK9 */
149 {2, 22, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, /* CLK10 */
150
151};
152
153static void __init init_ioports(void)
154{
155 int i;
156
157 for (i = 0; i < ARRAY_SIZE(ksi8560_pins); i++) {
158 struct cpm_pin *pin = &ksi8560_pins[i];
159 cpm2_set_pin(pin->port, pin->pin, pin->flags);
160 }
161
162 cpm2_clk_setup(CPM_CLK_SCC1, CPM_BRG1, CPM_CLK_RX);
163 cpm2_clk_setup(CPM_CLK_SCC1, CPM_BRG1, CPM_CLK_TX);
164 cpm2_clk_setup(CPM_CLK_SCC2, CPM_BRG2, CPM_CLK_RX);
165 cpm2_clk_setup(CPM_CLK_SCC2, CPM_BRG2, CPM_CLK_TX);
166 cpm2_clk_setup(CPM_CLK_FCC1, CPM_CLK9, CPM_CLK_RX);
167 cpm2_clk_setup(CPM_CLK_FCC1, CPM_CLK10, CPM_CLK_TX);
168}
169#endif
170
171/*
172 * Setup the architecture
173 */
174static void __init ksi8560_setup_arch(void)
175{
176 struct device_node *cpld;
177
178 cpld = of_find_compatible_node(NULL, NULL, "emerson,KSI8560-cpld");
179 if (cpld)
180 cpld_base = of_iomap(cpld, 0);
181 else
182 printk(KERN_ERR "Can't find CPLD in device tree\n");
183
184 if (ppc_md.progress)
185 ppc_md.progress("ksi8560_setup_arch()", 0);
186
187#ifdef CONFIG_CPM2
188 cpm2_reset();
189 init_ioports();
190#endif
191}
192
193static void ksi8560_show_cpuinfo(struct seq_file *m)
194{
195 uint pvid, svid, phid1;
196 uint memsize = total_memory;
197
198 pvid = mfspr(SPRN_PVR);
199 svid = mfspr(SPRN_SVR);
200
201 seq_printf(m, "Vendor\t\t: Emerson Network Power\n");
202 seq_printf(m, "Board\t\t: KSI8560\n");
203
204 if (cpld_base) {
205 seq_printf(m, "Hardware rev\t: %d\n",
206 in_8(cpld_base + KSI8560_CPLD_HVR));
207 seq_printf(m, "CPLD rev\t: %d\n",
208 in_8(cpld_base + KSI8560_CPLD_PVR));
209 } else
210 seq_printf(m, "Unknown Hardware and CPLD revs\n");
211
212 seq_printf(m, "PVR\t\t: 0x%x\n", pvid);
213 seq_printf(m, "SVR\t\t: 0x%x\n", svid);
214
215 /* Display cpu Pll setting */
216 phid1 = mfspr(SPRN_HID1);
217 seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));
218
219 /* Display the amount of memory */
220 seq_printf(m, "Memory\t\t: %d MB\n", memsize / (1024 * 1024));
221}
222
223static struct of_device_id __initdata of_bus_ids[] = {
224 { .type = "soc", },
225 { .name = "cpm", },
226 { .name = "localbus", },
227 {},
228};
229
230static int __init declare_of_platform_devices(void)
231{
232 of_platform_bus_probe(NULL, of_bus_ids, NULL);
233
234 return 0;
235}
236machine_device_initcall(ksi8560, declare_of_platform_devices);
237
238/*
239 * Called very early, device-tree isn't unflattened
240 */
241static int __init ksi8560_probe(void)
242{
243 unsigned long root = of_get_flat_dt_root();
244
245 return of_flat_dt_is_compatible(root, "emerson,KSI8560");
246}
247
248define_machine(ksi8560) {
249 .name = "KSI8560",
250 .probe = ksi8560_probe,
251 .setup_arch = ksi8560_setup_arch,
252 .init_IRQ = ksi8560_pic_init,
253 .show_cpuinfo = ksi8560_show_cpuinfo,
254 .get_irq = mpic_get_irq,
255 .restart = machine_restart,
256 .calibrate_decr = generic_calibrate_decr,
257};
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ads.c b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
index 4e0305096114..3582c841844b 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_ads.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
@@ -165,7 +165,7 @@ static void __init init_ioports(void)
165 int i; 165 int i;
166 166
167 for (i = 0; i < ARRAY_SIZE(mpc8560_ads_pins); i++) { 167 for (i = 0; i < ARRAY_SIZE(mpc8560_ads_pins); i++) {
168 struct cpm_pin *pin = &mpc8560_ads_pins[i]; 168 const struct cpm_pin *pin = &mpc8560_ads_pins[i];
169 cpm2_set_pin(pin->port, pin->pin, pin->flags); 169 cpm2_set_pin(pin->port, pin->pin, pin->flags);
170 } 170 }
171 171
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ds.c b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
index bdb3d0b38cd2..dfd8b4ad9b28 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_ds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
@@ -19,6 +19,7 @@
19#include <linux/delay.h> 19#include <linux/delay.h>
20#include <linux/seq_file.h> 20#include <linux/seq_file.h>
21#include <linux/interrupt.h> 21#include <linux/interrupt.h>
22#include <linux/of_platform.h>
22 23
23#include <asm/system.h> 24#include <asm/system.h>
24#include <asm/time.h> 25#include <asm/time.h>
@@ -36,7 +37,7 @@
36#undef DEBUG 37#undef DEBUG
37 38
38#ifdef DEBUG 39#ifdef DEBUG
39#define DBG(fmt, args...) printk(KERN_ERR "%s: " fmt, __FUNCTION__, ## args) 40#define DBG(fmt, args...) printk(KERN_ERR "%s: " fmt, __func__, ## args)
40#else 41#else
41#define DBG(fmt, args...) 42#define DBG(fmt, args...)
42#endif 43#endif
@@ -183,6 +184,18 @@ static int __init mpc8544_ds_probe(void)
183 } 184 }
184} 185}
185 186
187static struct of_device_id mpc85xxds_ids[] = {
188 { .type = "soc", },
189 { .compatible = "soc", },
190 {},
191};
192
193static int __init mpc85xxds_publish_devices(void)
194{
195 return of_platform_bus_probe(NULL, mpc85xxds_ids, NULL);
196}
197machine_device_initcall(mpc8544_ds, mpc85xxds_publish_devices);
198
186/* 199/*
187 * Called very early, device-tree isn't unflattened 200 * Called very early, device-tree isn't unflattened
188 */ 201 */