18 #include <linux/kernel.h>
35 if (pcicptrs[i].channel == channel) {
41 if (!pcicptrs[i].channel) {
56 if (pcicptrs[i].channel == channel)
57 return pcicptrs[
i].pcicptr;
69 | ((devfn & 0xff) << 0x08) | (where & 0xfc)
71 &pcicptr->g2pcfgadrs);
116 static void icd_writeb(
u8 val,
int offset,
124 static void icd_writew(
u16 val,
int offset,
143 static int tx4927_pci_config_read(
struct pci_bus *bus,
unsigned int devfn,
148 if (mkaddr(bus, devfn, where, pcicptr)) {
154 *val = icd_readb(where & 3, pcicptr);
157 *val = icd_readw(where & 3, pcicptr);
160 *val = icd_readl(pcicptr);
162 return check_abort(pcicptr);
165 static int tx4927_pci_config_write(
struct pci_bus *bus,
unsigned int devfn,
166 int where,
int size,
u32 val)
170 if (mkaddr(bus, devfn, where, pcicptr))
174 icd_writeb(val, where & 3, pcicptr);
177 icd_writew(val, where & 3, pcicptr);
180 icd_writel(val, pcicptr);
182 return check_abort(pcicptr);
185 static struct pci_ops tx4927_pci_ops = {
186 .read = tx4927_pci_config_read,
187 .write = tx4927_pci_config_write,
204 if (!
strncmp(str,
"trdyto=", 7)) {
206 tx4927_pci_opts.trdyto =
val;
209 if (!
strncmp(str,
"retryto=", 8)) {
211 tx4927_pci_opts.retryto =
val;
214 if (!
strncmp(str,
"gbwc=", 5)) {
216 tx4927_pci_opts.gbwc =
val;
228 set_tx4927_pcicptr(channel, pcicptr);
230 if (!channel->pci_ops)
232 "PCIC -- DID:%04x VID:%04x RID:%02x Arbiter:%s\n",
236 extarb ?
"External" :
"Internal");
237 channel->pci_ops = &tx4927_pci_ops;
250 __raw_writel((channel->io_resource->end - channel->io_resource->start)
252 &pcicptr->g2piomask);
253 ____raw_writeq((channel->io_resource->start +
254 channel->io_map_base -
IO_BASE) |
260 , &pcicptr->g2piogbase);
261 ____raw_writeq(channel->io_resource->start - channel->io_offset,
262 &pcicptr->g2piopbase);
263 for (i = 0; i < 3; i++) {
265 ____raw_writeq(0, &pcicptr->g2pmgbase[i]);
266 ____raw_writeq(0, &pcicptr->g2pmpbase[i]);
268 if (channel->mem_resource->end) {
270 - channel->mem_resource->start) >> 4,
271 &pcicptr->g2pmmask[0]);
272 ____raw_writeq(channel->mem_resource->start |
278 , &pcicptr->g2pmgbase[0]);
279 ____raw_writeq(channel->mem_resource->start -
281 &pcicptr->g2pmpbase[0]);
285 ____raw_writeq(0, &pcicptr->p2giogbase);
295 , &pcicptr->p2gmgbase[0]);
299 ____raw_writeq(0, &pcicptr->p2gmgbase[1]);
302 ____raw_writeq(0, &pcicptr->p2gmgbase[2]);
309 if (channel->mem_resource->end)
314 if (channel->io_resource->end)
327 | (tx4927_pci_opts.trdyto & 0xff)
328 | ((tx4927_pci_opts.retryto & 0xff) << 8),
342 &pcicptr->pcistatus);
356 &pcicptr->pcistatus);
360 "PCI: COMMAND=%04x,PCIMASK=%04x,"
361 "TRDYTO=%02x,RETRYTO=%02x,GBWC=%03x\n",
387 }, pcicstat_tbl[] = {
402 for (i = 0, cont = 0; i <
ARRAY_SIZE(pcistat_tbl); i++)
403 if (pcistatus & pcistat_tbl[i].
flag)
405 cont++ ?
" " :
"", pcistat_tbl[i].
str);
410 for (i = 0, cont = 0; i <
ARRAY_SIZE(g2pstat_tbl); i++)
411 if (g2pstatus & g2pstat_tbl[i].
flag)
413 cont++ ?
" " :
"", g2pstat_tbl[i].
str);
418 for (i = 0, cont = 0; i <
ARRAY_SIZE(pcicstat_tbl); i++)
419 if (pcicstatus & pcicstat_tbl[i].
flag)
421 cont++ ?
" " :
"", pcicstat_tbl[i].
str);
432 if (pcicptrs[i].pcicptr)
433 tx4927_report_pcic_status1(pcicptrs[i].pcicptr);
466 if (pcicptrs[i].pcicptr)
467 tx4927_dump_pcic_settings1(pcicptrs[i].pcicptr);
479 (
int)(2 *
sizeof(
unsigned long)), regs->
cp0_epc);
480 tx4927_report_pcic_status1(pcicptr);
485 | (TX4927_PCIC_PCISTATUS_ALL << 16),
493 tx4927_dump_pcic_settings1(pcicptr);
497 #ifdef CONFIG_TOSHIBA_FPCIB0
524 #define PCI_DEVICE_ID_EFAR_SLC90E66_0 0x9460
526 tx4927_quirk_slc90e66_bridge);