20 #include <linux/stddef.h>
21 #include <linux/kernel.h>
23 #include <linux/errno.h>
24 #include <linux/reboot.h>
25 #include <linux/pci.h>
26 #include <linux/kdev_t.h>
41 #include <asm/machdep.h>
42 #include <asm/pci-bridge.h>
53 #include <asm/swiotlb.h>
61 #define DBG(fmt...) udbg_printf(fmt)
66 #define MV88E1111_SCR 0x10
67 #define MV88E1111_SCR_125CLK 0x0010
68 static int mpc8568_fixup_125_clock(
struct phy_device *phydev)
99 static int mpc8568_mds_phy_fixups(
struct phy_device *phydev)
115 temp = (temp & (~0x8000)) | 0x4000;
160 #ifdef CONFIG_QUICC_ENGINE
161 static void __init mpc85xx_mds_reset_ucc_phys(
void)
176 if (machine_is(mpc8568_mds)) {
177 #define BCSR_UCC1_GETH_EN (0x1 << 7)
178 #define BCSR_UCC2_GETH_EN (0x1 << 7)
179 #define BCSR_UCC1_MODE_MSK (0x3 << 4)
180 #define BCSR_UCC2_MODE_MSK (0x3 << 0)
183 clrbits8(&bcsr_regs[8], BCSR_UCC1_GETH_EN);
184 clrbits8(&bcsr_regs[9], BCSR_UCC2_GETH_EN);
187 clrbits8(&bcsr_regs[11], BCSR_UCC1_MODE_MSK |
191 setbits8(&bcsr_regs[8], BCSR_UCC1_GETH_EN);
192 setbits8(&bcsr_regs[9], BCSR_UCC2_GETH_EN);
193 }
else if (machine_is(mpc8569_mds)) {
194 #define BCSR7_UCC12_GETHnRST (0x1 << 2)
195 #define BCSR8_UEM_MARVELL_RST (0x1 << 1)
196 #define BCSR_UCC_RGMII (0x1 << 6)
197 #define BCSR_UCC_RTBI (0x1 << 5)
203 clrbits8(&bcsr_regs[7], BCSR7_UCC12_GETHnRST);
204 setbits8(&bcsr_regs[8], BCSR8_UEM_MARVELL_RST);
206 setbits8(&bcsr_regs[7], BCSR7_UCC12_GETHnRST);
207 clrbits8(&bcsr_regs[8], BCSR8_UEM_MARVELL_RST);
211 "ucc_geth")) !=
NULL;) {
212 const unsigned int *prop;
225 if (
strcmp(
"rtbi", (
const char *)prop) == 0)
226 clrsetbits_8(&bcsr_regs[7 + ucc_num],
227 BCSR_UCC_RGMII, BCSR_UCC_RTBI);
229 }
else if (machine_is(p1021_mds)) {
230 #define BCSR11_ENET_MICRST (0x1 << 5)
232 clrbits8(&bcsr_regs[11], BCSR11_ENET_MICRST);
233 setbits8(&bcsr_regs[11], BCSR11_ENET_MICRST);
239 static void __init mpc85xx_mds_qe_init(
void)
265 for_each_node_by_name(ucc,
"ucc")
269 mpc85xx_mds_reset_ucc_phys();
271 if (machine_is(p1021_mds)) {
273 struct ccsr_guts
__iomem *guts;
279 pr_err(
"mpc85xx-rdb: could not map global utilities register\n");
287 setbits32(&guts->pmuxcr, MPC85xx_PMUXCR_QE(0) |
288 MPC85xx_PMUXCR_QE(3) |
289 MPC85xx_PMUXCR_QE(9) |
290 MPC85xx_PMUXCR_QE(12));
299 static void __init mpc85xx_mds_qeic_init(
void)
316 if (machine_is(p1021_mds))
318 qe_ic_cascade_high_mpic);
324 static void __init mpc85xx_mds_qe_init(
void) { }
325 static void __init mpc85xx_mds_qeic_init(
void) { }
328 static void __init mpc85xx_mds_setup_arch(
void)
331 ppc_md.progress(
"mpc85xx_mds_setup_arch()", 0);
335 mpc85xx_mds_qe_init();
337 fsl_pci_assign_primary();
343 static int __init board_fixups(
void)
346 char *compstrs[2] = {
"fsl,gianfar-mdio",
"fsl,ucc-mdio"};
355 snprintf(phy_id,
sizeof(phy_id),
"%llx:%02x",
356 (
unsigned long long)
res.start, 1);
362 snprintf(phy_id,
sizeof(phy_id),
"%llx:%02x",
363 (
unsigned long long)
res.start, 7);
374 static int __init mpc85xx_publish_devices(
void)
376 if (machine_is(mpc8568_mds))
378 if (machine_is(mpc8569_mds))
392 static void __init mpc85xx_mds_pic_init(
void)
395 MPIC_SINGLE_DEST_CPU,
396 0, 256,
" OpenPIC ");
400 mpc85xx_mds_qeic_init();
403 static int __init mpc85xx_mds_probe(
void)
405 unsigned long root = of_get_flat_dt_root();
407 return of_flat_dt_is_compatible(root,
"MPC85xxMDS");
411 .name =
"MPC8568 MDS",
412 .probe = mpc85xx_mds_probe,
413 .setup_arch = mpc85xx_mds_setup_arch,
414 .init_IRQ = mpc85xx_mds_pic_init,
416 .restart = fsl_rstcr_restart,
420 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
424 static int __init mpc8569_mds_probe(
void)
426 unsigned long root = of_get_flat_dt_root();
428 return of_flat_dt_is_compatible(root,
"fsl,MPC8569EMDS");
432 .name =
"MPC8569 MDS",
433 .probe = mpc8569_mds_probe,
434 .setup_arch = mpc85xx_mds_setup_arch,
435 .init_IRQ = mpc85xx_mds_pic_init,
437 .restart = fsl_rstcr_restart,
441 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
445 static int __init p1021_mds_probe(
void)
447 unsigned long root = of_get_flat_dt_root();
449 return of_flat_dt_is_compatible(root,
"fsl,P1021MDS");
455 .probe = p1021_mds_probe,
456 .setup_arch = mpc85xx_mds_setup_arch,
457 .init_IRQ = mpc85xx_mds_pic_init,
459 .restart = fsl_rstcr_restart,
463 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,