1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * MPC86xx HPCN board specific routines
5 * Recode: ZHANG WEI <wei.zhang@freescale.com>
6 * Initial author: Xianghua Xiao <x.xiao@freescale.com>
8 * Copyright 2006 Freescale Semiconductor Inc.
11 #include <linux/stddef.h>
12 #include <linux/kernel.h>
13 #include <linux/pci.h>
14 #include <linux/kdev_t.h>
15 #include <linux/delay.h>
16 #include <linux/seq_file.h>
17 #include <linux/of_platform.h>
20 #include <asm/machdep.h>
21 #include <asm/pci-bridge.h>
23 #include <mm/mmu_decl.h>
25 #include <asm/swiotlb.h>
29 #include <sysdev/fsl_pci.h>
30 #include <sysdev/fsl_soc.h>
37 #define DBG(fmt...) do { printk(KERN_ERR fmt); } while(0)
39 #define DBG(fmt...) do { } while(0)
43 extern int uli_exclude_device(struct pci_controller *hose,
44 u_char bus, u_char devfn);
46 static int mpc86xx_exclude_device(struct pci_controller *hose,
47 u_char bus, u_char devfn)
49 if (hose->dn == fsl_pci_primary)
50 return uli_exclude_device(hose, bus, devfn);
52 return PCIBIOS_SUCCESSFUL;
54 #endif /* CONFIG_PCI */
58 mpc86xx_hpcn_setup_arch(void)
61 ppc_md.progress("mpc86xx_hpcn_setup_arch()", 0);
64 ppc_md.pci_exclude_device = mpc86xx_exclude_device;
67 printk("MPC86xx HPCN board from Freescale Semiconductor\n");
73 fsl_pci_assign_primary();
80 mpc86xx_hpcn_show_cpuinfo(struct seq_file *m)
82 uint svid = mfspr(SPRN_SVR);
84 seq_printf(m, "Vendor\t\t: Freescale Semiconductor\n");
86 seq_printf(m, "SVR\t\t: 0x%x\n", svid);
91 * Called very early, device-tree isn't unflattened
93 static int __init mpc86xx_hpcn_probe(void)
95 if (of_machine_is_compatible("fsl,mpc8641hpcn"))
96 return 1; /* Looks good */
98 /* Be nice and don't give silent boot death. Delete this in 2.6.27 */
99 if (of_machine_is_compatible("mpc86xx")) {
100 pr_warn("WARNING: your dts/dtb is old. You must update before the next kernel release.\n");
107 static const struct of_device_id of_bus_ids[] __initconst = {
108 { .compatible = "fsl,srio", },
112 static int __init declare_of_platform_devices(void)
114 mpc86xx_common_publish_devices();
115 of_platform_bus_probe(NULL, of_bus_ids, NULL);
119 machine_arch_initcall(mpc86xx_hpcn, declare_of_platform_devices);
121 define_machine(mpc86xx_hpcn) {
122 .name = "MPC86xx HPCN",
123 .probe = mpc86xx_hpcn_probe,
124 .setup_arch = mpc86xx_hpcn_setup_arch,
125 .init_IRQ = mpc86xx_init_irq,
126 .show_cpuinfo = mpc86xx_hpcn_show_cpuinfo,
127 .get_irq = mpic_get_irq,
128 .time_init = mpc86xx_time_init,
129 .calibrate_decr = generic_calibrate_decr,
130 .progress = udbg_progress,
132 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,