1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3 * SBC8641D board specific routines
4 *
5 * Copyright 2008 Wind River Systems Inc.
6 *
7 * By Paul Gortmaker (see MAINTAINERS for contact information)
8 *
9 * Based largely on the 8641 HPCN support by Freescale Semiconductor Inc.
10 */
11
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/of_platform.h>
19
20 #include <asm/time.h>
21 #include <asm/machdep.h>
22 #include <asm/pci-bridge.h>
23 #include <asm/prom.h>
24 #include <mm/mmu_decl.h>
25 #include <asm/udbg.h>
26
27 #include <asm/mpic.h>
28
29 #include <sysdev/fsl_pci.h>
30 #include <sysdev/fsl_soc.h>
31
32 #include "mpc86xx.h"
33
34 static void __init
sbc8641_setup_arch(void)35 sbc8641_setup_arch(void)
36 {
37 if (ppc_md.progress)
38 ppc_md.progress("sbc8641_setup_arch()", 0);
39
40 printk("SBC8641 board from Wind River\n");
41
42 #ifdef CONFIG_SMP
43 mpc86xx_smp_init();
44 #endif
45
46 fsl_pci_assign_primary();
47 }
48
49
50 static void
sbc8641_show_cpuinfo(struct seq_file * m)51 sbc8641_show_cpuinfo(struct seq_file *m)
52 {
53 uint svid = mfspr(SPRN_SVR);
54
55 seq_printf(m, "Vendor\t\t: Wind River Systems\n");
56
57 seq_printf(m, "SVR\t\t: 0x%x\n", svid);
58 }
59
60
61 /*
62 * Called very early, device-tree isn't unflattened
63 */
sbc8641_probe(void)64 static int __init sbc8641_probe(void)
65 {
66 if (of_machine_is_compatible("wind,sbc8641"))
67 return 1; /* Looks good */
68
69 return 0;
70 }
71
72 machine_arch_initcall(sbc8641, mpc86xx_common_publish_devices);
73
define_machine(sbc8641)74 define_machine(sbc8641) {
75 .name = "SBC8641D",
76 .probe = sbc8641_probe,
77 .setup_arch = sbc8641_setup_arch,
78 .init_IRQ = mpc86xx_init_irq,
79 .show_cpuinfo = sbc8641_show_cpuinfo,
80 .get_irq = mpic_get_irq,
81 .time_init = mpc86xx_time_init,
82 .calibrate_decr = generic_calibrate_decr,
83 .progress = udbg_progress,
84 #ifdef CONFIG_PCI
85 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
86 #endif
87 };
88