6b13f685e
김민수
BSP 최초 추가
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
|
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/pci.h>
#include <asm/mipsregs.h>
#include <asm/sni.h>
#include <irq.h>
#define SCSI PCIMT_IRQ_SCSI
#define ETH PCIMT_IRQ_ETHERNET
#define INTA PCIMT_IRQ_INTA
#define INTB PCIMT_IRQ_INTB
#define INTC PCIMT_IRQ_INTC
#define INTD PCIMT_IRQ_INTD
static char irq_tab_rm200[8][5] __initdata = {
{ 0, 0, 0, 0, 0 },
{ SCSI, SCSI, SCSI, SCSI, SCSI },
{ ETH, ETH, ETH, ETH, ETH },
{ INTB, INTB, INTB, INTB, INTB },
{ 0, 0, 0, 0, 0 },
{ 0, INTB, INTC, INTD, INTA },
{ 0, INTC, INTD, INTA, INTB },
{ 0, INTD, INTA, INTB, INTC },
};
static char irq_tab_rm300d[8][5] __initdata = {
{ 0, 0, 0, 0, 0 },
{ SCSI, SCSI, SCSI, SCSI, SCSI },
{ 0, INTC, INTD, INTA, INTB },
{ INTB, INTB, INTB, INTB, INTB },
{ 0, 0, 0, 0, 0 },
{ 0, INTB, INTC, INTD, INTA },
{ 0, INTC, INTD, INTA, INTB },
{ 0, INTD, INTA, INTB, INTC },
};
static char irq_tab_rm300e[5][5] __initdata = {
{ 0, 0, 0, 0, 0 },
{ SCSI, SCSI, SCSI, SCSI, SCSI },
{ 0, INTC, INTD, INTA, INTB },
{ 0, INTD, INTA, INTB, INTC },
{ 0, INTA, INTB, INTC, INTD },
};
#undef SCSI
#undef ETH
#undef INTA
#undef INTB
#undef INTC
#undef INTD
#define SCSI0 PCIT_IRQ_SCSI0
#define SCSI1 PCIT_IRQ_SCSI1
#define ETH PCIT_IRQ_ETHERNET
#define INTA PCIT_IRQ_INTA
#define INTB PCIT_IRQ_INTB
#define INTC PCIT_IRQ_INTC
#define INTD PCIT_IRQ_INTD
static char irq_tab_pcit[13][5] __initdata = {
{ 0, 0, 0, 0, 0 },
{ SCSI0, SCSI0, SCSI0, SCSI0, SCSI0 },
{ SCSI1, SCSI1, SCSI1, SCSI1, SCSI1 },
{ ETH, ETH, ETH, ETH, ETH },
{ 0, INTA, INTB, INTC, INTD },
{ 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0 },
{ 0, INTA, INTB, INTC, INTD },
{ 0, INTB, INTC, INTD, INTA },
{ 0, INTC, INTD, INTA, INTB },
{ 0, INTD, INTA, INTB, INTC },
{ 0, INTA, INTB, INTC, INTD },
};
static char irq_tab_pcit_cplus[13][5] __initdata = {
{ 0, 0, 0, 0, 0 },
{ 0, INTB, INTC, INTD, INTA },
{ 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0 },
{ 0, INTA, INTB, INTC, INTD },
{ 0, INTB, INTC, INTD, INTA },
};
static inline int is_rm300_revd(void)
{
unsigned char csmsr = *(volatile unsigned char *)PCIMT_CSMSR;
return (csmsr & 0xa0) == 0x20;
}
int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
switch (sni_brd_type) {
case SNI_BRD_PCI_TOWER_CPLUS:
if (slot == 4) {
while (dev && dev->bus->number != 1)
dev = dev->bus->self;
if (dev && dev->devfn >= PCI_DEVFN(4, 0))
slot = 5;
}
return irq_tab_pcit_cplus[slot][pin];
case SNI_BRD_PCI_TOWER:
return irq_tab_pcit[slot][pin];
case SNI_BRD_PCI_MTOWER:
if (is_rm300_revd())
return irq_tab_rm300d[slot][pin];
case SNI_BRD_PCI_DESKTOP:
return irq_tab_rm200[slot][pin];
case SNI_BRD_PCI_MTOWER_CPLUS:
return irq_tab_rm300e[slot][pin];
}
return 0;
}
int pcibios_plat_dev_init(struct pci_dev *dev)
{
return 0;
}
|