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