1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21#include <linux/stddef.h>
22#include <linux/kernel.h>
23#include <linux/pci.h>
24#include <linux/kdev_t.h>
25#include <linux/delay.h>
26#include <linux/seq_file.h>
27#include <linux/of_platform.h>
28
29#include <asm/time.h>
30#include <asm/machdep.h>
31#include <asm/pci-bridge.h>
32#include <asm/mpic.h>
33#include <asm/prom.h>
34#include <mm/mmu_decl.h>
35#include <asm/udbg.h>
36
37#include <sysdev/fsl_soc.h>
38#include <sysdev/fsl_pci.h>
39
40#include "mpc85xx.h"
41
42#ifdef CONFIG_CPM2
43#include <asm/cpm2.h>
44#endif
45
46static void __init tqm85xx_pic_init(void)
47{
48 struct mpic *mpic = mpic_alloc(NULL, 0,
49 MPIC_BIG_ENDIAN,
50 0, 256, " OpenPIC ");
51 BUG_ON(mpic == NULL);
52 mpic_init(mpic);
53
54 mpc85xx_cpm2_pic_init();
55}
56
57
58
59
60static void __init tqm85xx_setup_arch(void)
61{
62 if (ppc_md.progress)
63 ppc_md.progress("tqm85xx_setup_arch()", 0);
64
65#ifdef CONFIG_CPM2
66 cpm2_reset();
67#endif
68
69 fsl_pci_assign_primary();
70}
71
72static void tqm85xx_show_cpuinfo(struct seq_file *m)
73{
74 uint pvid, svid, phid1;
75
76 pvid = mfspr(SPRN_PVR);
77 svid = mfspr(SPRN_SVR);
78
79 seq_printf(m, "Vendor\t\t: TQ Components\n");
80 seq_printf(m, "PVR\t\t: 0x%x\n", pvid);
81 seq_printf(m, "SVR\t\t: 0x%x\n", svid);
82
83
84 phid1 = mfspr(SPRN_HID1);
85 seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));
86}
87
88static void tqm85xx_ti1520_fixup(struct pci_dev *pdev)
89{
90 unsigned int val;
91
92
93 if (!machine_is(tqm85xx))
94 return;
95
96 dev_info(&pdev->dev, "Using TI 1520 fixup on TQM85xx\n");
97
98
99
100
101
102 pci_read_config_dword(pdev, 0x80, &val);
103 pci_write_config_dword(pdev, 0x80, val | (1 << 27));
104
105}
106DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_1520,
107 tqm85xx_ti1520_fixup);
108
109machine_arch_initcall(tqm85xx, mpc85xx_common_publish_devices);
110
111static const char * const board[] __initconst = {
112 "tqc,tqm8540",
113 "tqc,tqm8541",
114 "tqc,tqm8548",
115 "tqc,tqm8555",
116 "tqc,tqm8560",
117 NULL
118};
119
120
121
122
123static int __init tqm85xx_probe(void)
124{
125 return of_flat_dt_match(of_get_flat_dt_root(), board);
126}
127
128define_machine(tqm85xx) {
129 .name = "TQM85xx",
130 .probe = tqm85xx_probe,
131 .setup_arch = tqm85xx_setup_arch,
132 .init_IRQ = tqm85xx_pic_init,
133 .show_cpuinfo = tqm85xx_show_cpuinfo,
134 .get_irq = mpic_get_irq,
135 .restart = fsl_rstcr_restart,
136 .calibrate_decr = generic_calibrate_decr,
137 .progress = udbg_progress,
138};
139