2 * MPC85xx RDB Board Setup
4 * Copyright 2009,2012-2013 Freescale Semiconductor Inc.
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
12 #include <linux/stddef.h>
13 #include <linux/kernel.h>
14 #include <linux/pci.h>
15 #include <linux/kdev_t.h>
16 #include <linux/delay.h>
17 #include <linux/seq_file.h>
18 #include <linux/interrupt.h>
19 #include <linux/of_platform.h>
22 #include <asm/machdep.h>
23 #include <asm/pci-bridge.h>
24 #include <mm/mmu_decl.h>
29 #include <asm/qe_ic.h>
30 #include <asm/fsl_guts.h>
32 #include <sysdev/fsl_soc.h>
33 #include <sysdev/fsl_pci.h>
41 #define DBG(fmt, args...) printk(KERN_ERR "%s: " fmt, __func__, ## args)
43 #define DBG(fmt, args...)
47 void __init
mpc85xx_rdb_pic_init(void)
50 unsigned long root
= of_get_flat_dt_root();
52 #ifdef CONFIG_QUICC_ENGINE
53 struct device_node
*np
;
56 if (of_flat_dt_is_compatible(root
, "fsl,MPC85XXRDB-CAMP")) {
57 mpic
= mpic_alloc(NULL
, 0, MPIC_NO_RESET
|
62 mpic
= mpic_alloc(NULL
, 0,
71 #ifdef CONFIG_QUICC_ENGINE
72 np
= of_find_compatible_node(NULL
, NULL
, "fsl,qe-ic");
74 qe_ic_init(np
, 0, qe_ic_cascade_low_mpic
,
75 qe_ic_cascade_high_mpic
);
79 pr_err("%s: Could not find qe-ic node\n", __func__
);
85 * Setup the architecture
87 static void __init
mpc85xx_rdb_setup_arch(void)
89 #ifdef CONFIG_QUICC_ENGINE
90 struct device_node
*np
;
94 ppc_md
.progress("mpc85xx_rdb_setup_arch()", 0);
98 fsl_pci_assign_primary();
100 #ifdef CONFIG_QUICC_ENGINE
102 #if defined(CONFIG_UCC_GETH) || defined(CONFIG_SERIAL_QE)
103 if (machine_is(p1025_rdb
)) {
105 struct ccsr_guts __iomem
*guts
;
107 np
= of_find_node_by_name(NULL
, "global-utilities");
109 guts
= of_iomap(np
, 0);
112 pr_err("mpc85xx-rdb: could not map global utilities register\n");
115 /* P1025 has pins muxed for QE and other functions. To
116 * enable QE UEC mode, we need to set bit QE0 for UCC1
117 * in Eth mode, QE0 and QE3 for UCC5 in Eth mode, QE9
118 * and QE12 for QE MII management singals in PMUXCR
121 setbits32(&guts
->pmuxcr
, MPC85xx_PMUXCR_QE(0) |
122 MPC85xx_PMUXCR_QE(3) |
123 MPC85xx_PMUXCR_QE(9) |
124 MPC85xx_PMUXCR_QE(12));
132 #endif /* CONFIG_QUICC_ENGINE */
134 printk(KERN_INFO
"MPC85xx RDB board from Freescale Semiconductor\n");
137 machine_arch_initcall(p2020_rdb
, mpc85xx_common_publish_devices
);
138 machine_arch_initcall(p2020_rdb_pc
, mpc85xx_common_publish_devices
);
139 machine_arch_initcall(p1020_mbg_pc
, mpc85xx_common_publish_devices
);
140 machine_arch_initcall(p1020_rdb
, mpc85xx_common_publish_devices
);
141 machine_arch_initcall(p1020_rdb_pc
, mpc85xx_common_publish_devices
);
142 machine_arch_initcall(p1020_rdb_pd
, mpc85xx_common_publish_devices
);
143 machine_arch_initcall(p1020_utm_pc
, mpc85xx_common_publish_devices
);
144 machine_arch_initcall(p1021_rdb_pc
, mpc85xx_common_publish_devices
);
145 machine_arch_initcall(p1025_rdb
, mpc85xx_common_publish_devices
);
146 machine_arch_initcall(p1024_rdb
, mpc85xx_common_publish_devices
);
149 * Called very early, device-tree isn't unflattened
151 static int __init
p2020_rdb_probe(void)
153 unsigned long root
= of_get_flat_dt_root();
155 if (of_flat_dt_is_compatible(root
, "fsl,P2020RDB"))
160 static int __init
p1020_rdb_probe(void)
162 unsigned long root
= of_get_flat_dt_root();
164 if (of_flat_dt_is_compatible(root
, "fsl,P1020RDB"))
169 static int __init
p1020_rdb_pc_probe(void)
171 unsigned long root
= of_get_flat_dt_root();
173 return of_flat_dt_is_compatible(root
, "fsl,P1020RDB-PC");
176 static int __init
p1020_rdb_pd_probe(void)
178 unsigned long root
= of_get_flat_dt_root();
180 return of_flat_dt_is_compatible(root
, "fsl,P1020RDB-PD");
183 static int __init
p1021_rdb_pc_probe(void)
185 unsigned long root
= of_get_flat_dt_root();
187 if (of_flat_dt_is_compatible(root
, "fsl,P1021RDB-PC"))
192 static int __init
p2020_rdb_pc_probe(void)
194 unsigned long root
= of_get_flat_dt_root();
196 if (of_flat_dt_is_compatible(root
, "fsl,P2020RDB-PC"))
201 static int __init
p1025_rdb_probe(void)
203 unsigned long root
= of_get_flat_dt_root();
205 return of_flat_dt_is_compatible(root
, "fsl,P1025RDB");
208 static int __init
p1020_mbg_pc_probe(void)
210 unsigned long root
= of_get_flat_dt_root();
212 return of_flat_dt_is_compatible(root
, "fsl,P1020MBG-PC");
215 static int __init
p1020_utm_pc_probe(void)
217 unsigned long root
= of_get_flat_dt_root();
219 return of_flat_dt_is_compatible(root
, "fsl,P1020UTM-PC");
222 static int __init
p1024_rdb_probe(void)
224 unsigned long root
= of_get_flat_dt_root();
226 return of_flat_dt_is_compatible(root
, "fsl,P1024RDB");
229 define_machine(p2020_rdb
) {
231 .probe
= p2020_rdb_probe
,
232 .setup_arch
= mpc85xx_rdb_setup_arch
,
233 .init_IRQ
= mpc85xx_rdb_pic_init
,
235 .pcibios_fixup_bus
= fsl_pcibios_fixup_bus
,
237 .get_irq
= mpic_get_irq
,
238 .restart
= fsl_rstcr_restart
,
239 .calibrate_decr
= generic_calibrate_decr
,
240 .progress
= udbg_progress
,
243 define_machine(p1020_rdb
) {
245 .probe
= p1020_rdb_probe
,
246 .setup_arch
= mpc85xx_rdb_setup_arch
,
247 .init_IRQ
= mpc85xx_rdb_pic_init
,
249 .pcibios_fixup_bus
= fsl_pcibios_fixup_bus
,
251 .get_irq
= mpic_get_irq
,
252 .restart
= fsl_rstcr_restart
,
253 .calibrate_decr
= generic_calibrate_decr
,
254 .progress
= udbg_progress
,
257 define_machine(p1021_rdb_pc
) {
258 .name
= "P1021 RDB-PC",
259 .probe
= p1021_rdb_pc_probe
,
260 .setup_arch
= mpc85xx_rdb_setup_arch
,
261 .init_IRQ
= mpc85xx_rdb_pic_init
,
263 .pcibios_fixup_bus
= fsl_pcibios_fixup_bus
,
265 .get_irq
= mpic_get_irq
,
266 .restart
= fsl_rstcr_restart
,
267 .calibrate_decr
= generic_calibrate_decr
,
268 .progress
= udbg_progress
,
271 define_machine(p2020_rdb_pc
) {
272 .name
= "P2020RDB-PC",
273 .probe
= p2020_rdb_pc_probe
,
274 .setup_arch
= mpc85xx_rdb_setup_arch
,
275 .init_IRQ
= mpc85xx_rdb_pic_init
,
277 .pcibios_fixup_bus
= fsl_pcibios_fixup_bus
,
279 .get_irq
= mpic_get_irq
,
280 .restart
= fsl_rstcr_restart
,
281 .calibrate_decr
= generic_calibrate_decr
,
282 .progress
= udbg_progress
,
285 define_machine(p1025_rdb
) {
287 .probe
= p1025_rdb_probe
,
288 .setup_arch
= mpc85xx_rdb_setup_arch
,
289 .init_IRQ
= mpc85xx_rdb_pic_init
,
291 .pcibios_fixup_bus
= fsl_pcibios_fixup_bus
,
293 .get_irq
= mpic_get_irq
,
294 .restart
= fsl_rstcr_restart
,
295 .calibrate_decr
= generic_calibrate_decr
,
296 .progress
= udbg_progress
,
299 define_machine(p1020_mbg_pc
) {
300 .name
= "P1020 MBG-PC",
301 .probe
= p1020_mbg_pc_probe
,
302 .setup_arch
= mpc85xx_rdb_setup_arch
,
303 .init_IRQ
= mpc85xx_rdb_pic_init
,
305 .pcibios_fixup_bus
= fsl_pcibios_fixup_bus
,
307 .get_irq
= mpic_get_irq
,
308 .restart
= fsl_rstcr_restart
,
309 .calibrate_decr
= generic_calibrate_decr
,
310 .progress
= udbg_progress
,
313 define_machine(p1020_utm_pc
) {
314 .name
= "P1020 UTM-PC",
315 .probe
= p1020_utm_pc_probe
,
316 .setup_arch
= mpc85xx_rdb_setup_arch
,
317 .init_IRQ
= mpc85xx_rdb_pic_init
,
319 .pcibios_fixup_bus
= fsl_pcibios_fixup_bus
,
321 .get_irq
= mpic_get_irq
,
322 .restart
= fsl_rstcr_restart
,
323 .calibrate_decr
= generic_calibrate_decr
,
324 .progress
= udbg_progress
,
327 define_machine(p1020_rdb_pc
) {
328 .name
= "P1020RDB-PC",
329 .probe
= p1020_rdb_pc_probe
,
330 .setup_arch
= mpc85xx_rdb_setup_arch
,
331 .init_IRQ
= mpc85xx_rdb_pic_init
,
333 .pcibios_fixup_bus
= fsl_pcibios_fixup_bus
,
335 .get_irq
= mpic_get_irq
,
336 .restart
= fsl_rstcr_restart
,
337 .calibrate_decr
= generic_calibrate_decr
,
338 .progress
= udbg_progress
,
341 define_machine(p1020_rdb_pd
) {
342 .name
= "P1020RDB-PD",
343 .probe
= p1020_rdb_pd_probe
,
344 .setup_arch
= mpc85xx_rdb_setup_arch
,
345 .init_IRQ
= mpc85xx_rdb_pic_init
,
347 .pcibios_fixup_bus
= fsl_pcibios_fixup_bus
,
349 .get_irq
= mpic_get_irq
,
350 .restart
= fsl_rstcr_restart
,
351 .calibrate_decr
= generic_calibrate_decr
,
352 .progress
= udbg_progress
,
355 define_machine(p1024_rdb
) {
357 .probe
= p1024_rdb_probe
,
358 .setup_arch
= mpc85xx_rdb_setup_arch
,
359 .init_IRQ
= mpc85xx_rdb_pic_init
,
361 .pcibios_fixup_bus
= fsl_pcibios_fixup_bus
,
363 .get_irq
= mpic_get_irq
,
364 .restart
= fsl_rstcr_restart
,
365 .calibrate_decr
= generic_calibrate_decr
,
366 .progress
= udbg_progress
,