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>
22 #include <mm/mmu_decl.h>
24 #include <asm/swiotlb.h>
28 #include <sysdev/fsl_pci.h>
29 #include <sysdev/fsl_soc.h>
36 #define DBG(fmt...) do { printk(KERN_ERR fmt); } while(0)
38 #define DBG(fmt...) do { } while(0)
42 extern int uli_exclude_device(struct pci_controller *hose,
43 u_char bus, u_char devfn);
45 static int mpc86xx_exclude_device(struct pci_controller *hose,
46 u_char bus, u_char devfn)
48 if (hose->dn == fsl_pci_primary)
49 return uli_exclude_device(hose, bus, devfn);
51 return PCIBIOS_SUCCESSFUL;
53 #endif /* CONFIG_PCI */
57 mpc86xx_hpcn_setup_arch(void)
60 ppc_md.progress("mpc86xx_hpcn_setup_arch()", 0);
63 ppc_md.pci_exclude_device = mpc86xx_exclude_device;
66 printk("MPC86xx HPCN board from Freescale Semiconductor\n");
72 fsl_pci_assign_primary();
79 mpc86xx_hpcn_show_cpuinfo(struct seq_file *m)
81 uint svid = mfspr(SPRN_SVR);
83 seq_printf(m, "Vendor\t\t: Freescale Semiconductor\n");
85 seq_printf(m, "SVR\t\t: 0x%x\n", svid);
90 * Called very early, device-tree isn't unflattened
92 static int __init mpc86xx_hpcn_probe(void)
94 if (of_machine_is_compatible("fsl,mpc8641hpcn"))
95 return 1; /* Looks good */
100 static const struct of_device_id of_bus_ids[] __initconst = {
101 { .compatible = "fsl,srio", },
105 static int __init declare_of_platform_devices(void)
107 mpc86xx_common_publish_devices();
108 of_platform_bus_probe(NULL, of_bus_ids, NULL);
112 machine_arch_initcall(mpc86xx_hpcn, declare_of_platform_devices);
114 define_machine(mpc86xx_hpcn) {
115 .name = "MPC86xx HPCN",
116 .probe = mpc86xx_hpcn_probe,
117 .setup_arch = mpc86xx_hpcn_setup_arch,
118 .init_IRQ = mpc86xx_init_irq,
119 .show_cpuinfo = mpc86xx_hpcn_show_cpuinfo,
120 .get_irq = mpic_get_irq,
121 .time_init = mpc86xx_time_init,
122 .calibrate_decr = generic_calibrate_decr,
123 .progress = udbg_progress,
125 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,