ops-tx4927.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526
  1. /*
  2. * Define the pci_ops for the PCIC on Toshiba TX4927, TX4938, etc.
  3. *
  4. * Based on linux/arch/mips/pci/ops-tx4938.c,
  5. * linux/arch/mips/pci/fixup-rbtx4938.c,
  6. * linux/arch/mips/txx9/rbtx4938/setup.c,
  7. * and RBTX49xx patch from CELF patch archive.
  8. *
  9. * 2003-2005 (c) MontaVista Software, Inc.
  10. * Copyright (C) 2004 by Ralf Baechle (ralf@linux-mips.org)
  11. * (C) Copyright TOSHIBA CORPORATION 2000-2001, 2004-2007
  12. *
  13. * This program is free software; you can redistribute it and/or modify it
  14. * under the terms of the GNU General Public License as published by the
  15. * Free Software Foundation; either version 2 of the License, or (at your
  16. * option) any later version.
  17. */
  18. #include <linux/kernel.h>
  19. #include <linux/interrupt.h>
  20. #include <asm/txx9/pci.h>
  21. #include <asm/txx9/tx4927pcic.h>
  22. static struct {
  23. struct pci_controller *channel;
  24. struct tx4927_pcic_reg __iomem *pcicptr;
  25. } pcicptrs[2]; /* TX4938 has 2 pcic */
  26. static void __init set_tx4927_pcicptr(struct pci_controller *channel,
  27. struct tx4927_pcic_reg __iomem *pcicptr)
  28. {
  29. int i;
  30. for (i = 0; i < ARRAY_SIZE(pcicptrs); i++) {
  31. if (pcicptrs[i].channel == channel) {
  32. pcicptrs[i].pcicptr = pcicptr;
  33. return;
  34. }
  35. }
  36. for (i = 0; i < ARRAY_SIZE(pcicptrs); i++) {
  37. if (!pcicptrs[i].channel) {
  38. pcicptrs[i].channel = channel;
  39. pcicptrs[i].pcicptr = pcicptr;
  40. return;
  41. }
  42. }
  43. BUG();
  44. }
  45. struct tx4927_pcic_reg __iomem *get_tx4927_pcicptr(
  46. struct pci_controller *channel)
  47. {
  48. int i;
  49. for (i = 0; i < ARRAY_SIZE(pcicptrs); i++) {
  50. if (pcicptrs[i].channel == channel)
  51. return pcicptrs[i].pcicptr;
  52. }
  53. return NULL;
  54. }
  55. static int mkaddr(struct pci_bus *bus, unsigned int devfn, int where,
  56. struct tx4927_pcic_reg __iomem *pcicptr)
  57. {
  58. if (bus->parent == NULL &&
  59. devfn >= PCI_DEVFN(TX4927_PCIC_MAX_DEVNU, 0))
  60. return -1;
  61. __raw_writel(((bus->number & 0xff) << 0x10)
  62. | ((devfn & 0xff) << 0x08) | (where & 0xfc)
  63. | (bus->parent ? 1 : 0),
  64. &pcicptr->g2pcfgadrs);
  65. /* clear M_ABORT and Disable M_ABORT Int. */
  66. __raw_writel((__raw_readl(&pcicptr->pcistatus) & 0x0000ffff)
  67. | (PCI_STATUS_REC_MASTER_ABORT << 16),
  68. &pcicptr->pcistatus);
  69. return 0;
  70. }
  71. static int check_abort(struct tx4927_pcic_reg __iomem *pcicptr)
  72. {
  73. int code = PCIBIOS_SUCCESSFUL;
  74. /* wait write cycle completion before checking error status */
  75. while (__raw_readl(&pcicptr->pcicstatus) & TX4927_PCIC_PCICSTATUS_IWB)
  76. ;
  77. if (__raw_readl(&pcicptr->pcistatus)
  78. & (PCI_STATUS_REC_MASTER_ABORT << 16)) {
  79. __raw_writel((__raw_readl(&pcicptr->pcistatus) & 0x0000ffff)
  80. | (PCI_STATUS_REC_MASTER_ABORT << 16),
  81. &pcicptr->pcistatus);
  82. /* flush write buffer */
  83. iob();
  84. code = PCIBIOS_DEVICE_NOT_FOUND;
  85. }
  86. return code;
  87. }
  88. static u8 icd_readb(int offset, struct tx4927_pcic_reg __iomem *pcicptr)
  89. {
  90. #ifdef __BIG_ENDIAN
  91. offset ^= 3;
  92. #endif
  93. return __raw_readb((void __iomem *)&pcicptr->g2pcfgdata + offset);
  94. }
  95. static u16 icd_readw(int offset, struct tx4927_pcic_reg __iomem *pcicptr)
  96. {
  97. #ifdef __BIG_ENDIAN
  98. offset ^= 2;
  99. #endif
  100. return __raw_readw((void __iomem *)&pcicptr->g2pcfgdata + offset);
  101. }
  102. static u32 icd_readl(struct tx4927_pcic_reg __iomem *pcicptr)
  103. {
  104. return __raw_readl(&pcicptr->g2pcfgdata);
  105. }
  106. static void icd_writeb(u8 val, int offset,
  107. struct tx4927_pcic_reg __iomem *pcicptr)
  108. {
  109. #ifdef __BIG_ENDIAN
  110. offset ^= 3;
  111. #endif
  112. __raw_writeb(val, (void __iomem *)&pcicptr->g2pcfgdata + offset);
  113. }
  114. static void icd_writew(u16 val, int offset,
  115. struct tx4927_pcic_reg __iomem *pcicptr)
  116. {
  117. #ifdef __BIG_ENDIAN
  118. offset ^= 2;
  119. #endif
  120. __raw_writew(val, (void __iomem *)&pcicptr->g2pcfgdata + offset);
  121. }
  122. static void icd_writel(u32 val, struct tx4927_pcic_reg __iomem *pcicptr)
  123. {
  124. __raw_writel(val, &pcicptr->g2pcfgdata);
  125. }
  126. static struct tx4927_pcic_reg __iomem *pci_bus_to_pcicptr(struct pci_bus *bus)
  127. {
  128. struct pci_controller *channel = bus->sysdata;
  129. return get_tx4927_pcicptr(channel);
  130. }
  131. static int tx4927_pci_config_read(struct pci_bus *bus, unsigned int devfn,
  132. int where, int size, u32 *val)
  133. {
  134. struct tx4927_pcic_reg __iomem *pcicptr = pci_bus_to_pcicptr(bus);
  135. if (mkaddr(bus, devfn, where, pcicptr)) {
  136. *val = 0xffffffff;
  137. return -1;
  138. }
  139. switch (size) {
  140. case 1:
  141. *val = icd_readb(where & 3, pcicptr);
  142. break;
  143. case 2:
  144. *val = icd_readw(where & 3, pcicptr);
  145. break;
  146. default:
  147. *val = icd_readl(pcicptr);
  148. }
  149. return check_abort(pcicptr);
  150. }
  151. static int tx4927_pci_config_write(struct pci_bus *bus, unsigned int devfn,
  152. int where, int size, u32 val)
  153. {
  154. struct tx4927_pcic_reg __iomem *pcicptr = pci_bus_to_pcicptr(bus);
  155. if (mkaddr(bus, devfn, where, pcicptr))
  156. return -1;
  157. switch (size) {
  158. case 1:
  159. icd_writeb(val, where & 3, pcicptr);
  160. break;
  161. case 2:
  162. icd_writew(val, where & 3, pcicptr);
  163. break;
  164. default:
  165. icd_writel(val, pcicptr);
  166. }
  167. return check_abort(pcicptr);
  168. }
  169. static struct pci_ops tx4927_pci_ops = {
  170. .read = tx4927_pci_config_read,
  171. .write = tx4927_pci_config_write,
  172. };
  173. static struct {
  174. u8 trdyto;
  175. u8 retryto;
  176. u16 gbwc;
  177. } tx4927_pci_opts __devinitdata = {
  178. .trdyto = 0,
  179. .retryto = 0,
  180. .gbwc = 0xfe0, /* 4064 GBUSCLK for CCFG.GTOT=0b11 */
  181. };
  182. char *__devinit tx4927_pcibios_setup(char *str)
  183. {
  184. unsigned long val;
  185. if (!strncmp(str, "trdyto=", 7)) {
  186. if (strict_strtoul(str + 7, 0, &val) == 0)
  187. tx4927_pci_opts.trdyto = val;
  188. return NULL;
  189. }
  190. if (!strncmp(str, "retryto=", 8)) {
  191. if (strict_strtoul(str + 8, 0, &val) == 0)
  192. tx4927_pci_opts.retryto = val;
  193. return NULL;
  194. }
  195. if (!strncmp(str, "gbwc=", 5)) {
  196. if (strict_strtoul(str + 5, 0, &val) == 0)
  197. tx4927_pci_opts.gbwc = val;
  198. return NULL;
  199. }
  200. return str;
  201. }
  202. void __init tx4927_pcic_setup(struct tx4927_pcic_reg __iomem *pcicptr,
  203. struct pci_controller *channel, int extarb)
  204. {
  205. int i;
  206. unsigned long flags;
  207. set_tx4927_pcicptr(channel, pcicptr);
  208. if (!channel->pci_ops)
  209. printk(KERN_INFO
  210. "PCIC -- DID:%04x VID:%04x RID:%02x Arbiter:%s\n",
  211. __raw_readl(&pcicptr->pciid) >> 16,
  212. __raw_readl(&pcicptr->pciid) & 0xffff,
  213. __raw_readl(&pcicptr->pciccrev) & 0xff,
  214. extarb ? "External" : "Internal");
  215. channel->pci_ops = &tx4927_pci_ops;
  216. local_irq_save(flags);
  217. /* Disable All Initiator Space */
  218. __raw_writel(__raw_readl(&pcicptr->pciccfg)
  219. & ~(TX4927_PCIC_PCICCFG_G2PMEN(0)
  220. | TX4927_PCIC_PCICCFG_G2PMEN(1)
  221. | TX4927_PCIC_PCICCFG_G2PMEN(2)
  222. | TX4927_PCIC_PCICCFG_G2PIOEN),
  223. &pcicptr->pciccfg);
  224. /* GB->PCI mappings */
  225. __raw_writel((channel->io_resource->end - channel->io_resource->start)
  226. >> 4,
  227. &pcicptr->g2piomask);
  228. ____raw_writeq((channel->io_resource->start +
  229. channel->io_map_base - IO_BASE) |
  230. #ifdef __BIG_ENDIAN
  231. TX4927_PCIC_G2PIOGBASE_ECHG
  232. #else
  233. TX4927_PCIC_G2PIOGBASE_BSDIS
  234. #endif
  235. , &pcicptr->g2piogbase);
  236. ____raw_writeq(channel->io_resource->start - channel->io_offset,
  237. &pcicptr->g2piopbase);
  238. for (i = 0; i < 3; i++) {
  239. __raw_writel(0, &pcicptr->g2pmmask[i]);
  240. ____raw_writeq(0, &pcicptr->g2pmgbase[i]);
  241. ____raw_writeq(0, &pcicptr->g2pmpbase[i]);
  242. }
  243. if (channel->mem_resource->end) {
  244. __raw_writel((channel->mem_resource->end
  245. - channel->mem_resource->start) >> 4,
  246. &pcicptr->g2pmmask[0]);
  247. ____raw_writeq(channel->mem_resource->start |
  248. #ifdef __BIG_ENDIAN
  249. TX4927_PCIC_G2PMnGBASE_ECHG
  250. #else
  251. TX4927_PCIC_G2PMnGBASE_BSDIS
  252. #endif
  253. , &pcicptr->g2pmgbase[0]);
  254. ____raw_writeq(channel->mem_resource->start -
  255. channel->mem_offset,
  256. &pcicptr->g2pmpbase[0]);
  257. }
  258. /* PCI->GB mappings (I/O 256B) */
  259. __raw_writel(0, &pcicptr->p2giopbase); /* 256B */
  260. ____raw_writeq(0, &pcicptr->p2giogbase);
  261. /* PCI->GB mappings (MEM 512MB (64MB on R1.x)) */
  262. __raw_writel(0, &pcicptr->p2gm0plbase);
  263. __raw_writel(0, &pcicptr->p2gm0pubase);
  264. ____raw_writeq(TX4927_PCIC_P2GMnGBASE_TMEMEN |
  265. #ifdef __BIG_ENDIAN
  266. TX4927_PCIC_P2GMnGBASE_TECHG
  267. #else
  268. TX4927_PCIC_P2GMnGBASE_TBSDIS
  269. #endif
  270. , &pcicptr->p2gmgbase[0]);
  271. /* PCI->GB mappings (MEM 16MB) */
  272. __raw_writel(0xffffffff, &pcicptr->p2gm1plbase);
  273. __raw_writel(0xffffffff, &pcicptr->p2gm1pubase);
  274. ____raw_writeq(0, &pcicptr->p2gmgbase[1]);
  275. /* PCI->GB mappings (MEM 1MB) */
  276. __raw_writel(0xffffffff, &pcicptr->p2gm2pbase); /* 1MB */
  277. ____raw_writeq(0, &pcicptr->p2gmgbase[2]);
  278. /* Clear all (including IRBER) except for GBWC */
  279. __raw_writel((tx4927_pci_opts.gbwc << 16)
  280. & TX4927_PCIC_PCICCFG_GBWC_MASK,
  281. &pcicptr->pciccfg);
  282. /* Enable Initiator Memory Space */
  283. if (channel->mem_resource->end)
  284. __raw_writel(__raw_readl(&pcicptr->pciccfg)
  285. | TX4927_PCIC_PCICCFG_G2PMEN(0),
  286. &pcicptr->pciccfg);
  287. /* Enable Initiator I/O Space */
  288. if (channel->io_resource->end)
  289. __raw_writel(__raw_readl(&pcicptr->pciccfg)
  290. | TX4927_PCIC_PCICCFG_G2PIOEN,
  291. &pcicptr->pciccfg);
  292. /* Enable Initiator Config */
  293. __raw_writel(__raw_readl(&pcicptr->pciccfg)
  294. | TX4927_PCIC_PCICCFG_ICAEN | TX4927_PCIC_PCICCFG_TCAR,
  295. &pcicptr->pciccfg);
  296. /* Do not use MEMMUL, MEMINF: YMFPCI card causes M_ABORT. */
  297. __raw_writel(0, &pcicptr->pcicfg1);
  298. __raw_writel((__raw_readl(&pcicptr->g2ptocnt) & ~0xffff)
  299. | (tx4927_pci_opts.trdyto & 0xff)
  300. | ((tx4927_pci_opts.retryto & 0xff) << 8),
  301. &pcicptr->g2ptocnt);
  302. /* Clear All Local Bus Status */
  303. __raw_writel(TX4927_PCIC_PCICSTATUS_ALL, &pcicptr->pcicstatus);
  304. /* Enable All Local Bus Interrupts */
  305. __raw_writel(TX4927_PCIC_PCICSTATUS_ALL, &pcicptr->pcicmask);
  306. /* Clear All Initiator Status */
  307. __raw_writel(TX4927_PCIC_G2PSTATUS_ALL, &pcicptr->g2pstatus);
  308. /* Enable All Initiator Interrupts */
  309. __raw_writel(TX4927_PCIC_G2PSTATUS_ALL, &pcicptr->g2pmask);
  310. /* Clear All PCI Status Error */
  311. __raw_writel((__raw_readl(&pcicptr->pcistatus) & 0x0000ffff)
  312. | (TX4927_PCIC_PCISTATUS_ALL << 16),
  313. &pcicptr->pcistatus);
  314. /* Enable All PCI Status Error Interrupts */
  315. __raw_writel(TX4927_PCIC_PCISTATUS_ALL, &pcicptr->pcimask);
  316. if (!extarb) {
  317. /* Reset Bus Arbiter */
  318. __raw_writel(TX4927_PCIC_PBACFG_RPBA, &pcicptr->pbacfg);
  319. __raw_writel(0, &pcicptr->pbabm);
  320. /* Enable Bus Arbiter */
  321. __raw_writel(TX4927_PCIC_PBACFG_PBAEN, &pcicptr->pbacfg);
  322. }
  323. __raw_writel(PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY
  324. | PCI_COMMAND_PARITY | PCI_COMMAND_SERR,
  325. &pcicptr->pcistatus);
  326. local_irq_restore(flags);
  327. printk(KERN_DEBUG
  328. "PCI: COMMAND=%04x,PCIMASK=%04x,"
  329. "TRDYTO=%02x,RETRYTO=%02x,GBWC=%03x\n",
  330. __raw_readl(&pcicptr->pcistatus) & 0xffff,
  331. __raw_readl(&pcicptr->pcimask) & 0xffff,
  332. __raw_readl(&pcicptr->g2ptocnt) & 0xff,
  333. (__raw_readl(&pcicptr->g2ptocnt) & 0xff00) >> 8,
  334. (__raw_readl(&pcicptr->pciccfg) >> 16) & 0xfff);
  335. }
  336. static void tx4927_report_pcic_status1(struct tx4927_pcic_reg __iomem *pcicptr)
  337. {
  338. __u16 pcistatus = (__u16)(__raw_readl(&pcicptr->pcistatus) >> 16);
  339. __u32 g2pstatus = __raw_readl(&pcicptr->g2pstatus);
  340. __u32 pcicstatus = __raw_readl(&pcicptr->pcicstatus);
  341. static struct {
  342. __u32 flag;
  343. const char *str;
  344. } pcistat_tbl[] = {
  345. { PCI_STATUS_DETECTED_PARITY, "DetectedParityError" },
  346. { PCI_STATUS_SIG_SYSTEM_ERROR, "SignaledSystemError" },
  347. { PCI_STATUS_REC_MASTER_ABORT, "ReceivedMasterAbort" },
  348. { PCI_STATUS_REC_TARGET_ABORT, "ReceivedTargetAbort" },
  349. { PCI_STATUS_SIG_TARGET_ABORT, "SignaledTargetAbort" },
  350. { PCI_STATUS_PARITY, "MasterParityError" },
  351. }, g2pstat_tbl[] = {
  352. { TX4927_PCIC_G2PSTATUS_TTOE, "TIOE" },
  353. { TX4927_PCIC_G2PSTATUS_RTOE, "RTOE" },
  354. }, pcicstat_tbl[] = {
  355. { TX4927_PCIC_PCICSTATUS_PME, "PME" },
  356. { TX4927_PCIC_PCICSTATUS_TLB, "TLB" },
  357. { TX4927_PCIC_PCICSTATUS_NIB, "NIB" },
  358. { TX4927_PCIC_PCICSTATUS_ZIB, "ZIB" },
  359. { TX4927_PCIC_PCICSTATUS_PERR, "PERR" },
  360. { TX4927_PCIC_PCICSTATUS_SERR, "SERR" },
  361. { TX4927_PCIC_PCICSTATUS_GBE, "GBE" },
  362. { TX4927_PCIC_PCICSTATUS_IWB, "IWB" },
  363. };
  364. int i, cont;
  365. printk(KERN_ERR "");
  366. if (pcistatus & TX4927_PCIC_PCISTATUS_ALL) {
  367. printk(KERN_CONT "pcistat:%04x(", pcistatus);
  368. for (i = 0, cont = 0; i < ARRAY_SIZE(pcistat_tbl); i++)
  369. if (pcistatus & pcistat_tbl[i].flag)
  370. printk(KERN_CONT "%s%s",
  371. cont++ ? " " : "", pcistat_tbl[i].str);
  372. printk(KERN_CONT ") ");
  373. }
  374. if (g2pstatus & TX4927_PCIC_G2PSTATUS_ALL) {
  375. printk(KERN_CONT "g2pstatus:%08x(", g2pstatus);
  376. for (i = 0, cont = 0; i < ARRAY_SIZE(g2pstat_tbl); i++)
  377. if (g2pstatus & g2pstat_tbl[i].flag)
  378. printk(KERN_CONT "%s%s",
  379. cont++ ? " " : "", g2pstat_tbl[i].str);
  380. printk(KERN_CONT ") ");
  381. }
  382. if (pcicstatus & TX4927_PCIC_PCICSTATUS_ALL) {
  383. printk(KERN_CONT "pcicstatus:%08x(", pcicstatus);
  384. for (i = 0, cont = 0; i < ARRAY_SIZE(pcicstat_tbl); i++)
  385. if (pcicstatus & pcicstat_tbl[i].flag)
  386. printk(KERN_CONT "%s%s",
  387. cont++ ? " " : "", pcicstat_tbl[i].str);
  388. printk(KERN_CONT ")");
  389. }
  390. printk(KERN_CONT "\n");
  391. }
  392. void tx4927_report_pcic_status(void)
  393. {
  394. int i;
  395. for (i = 0; i < ARRAY_SIZE(pcicptrs); i++) {
  396. if (pcicptrs[i].pcicptr)
  397. tx4927_report_pcic_status1(pcicptrs[i].pcicptr);
  398. }
  399. }
  400. static void tx4927_dump_pcic_settings1(struct tx4927_pcic_reg __iomem *pcicptr)
  401. {
  402. int i;
  403. __u32 __iomem *preg = (__u32 __iomem *)pcicptr;
  404. printk(KERN_INFO "tx4927 pcic (0x%p) settings:", pcicptr);
  405. for (i = 0; i < sizeof(struct tx4927_pcic_reg); i += 4, preg++) {
  406. if (i % 32 == 0) {
  407. printk(KERN_CONT "\n");
  408. printk(KERN_INFO "%04x:", i);
  409. }
  410. /* skip registers with side-effects */
  411. if (i == offsetof(struct tx4927_pcic_reg, g2pintack)
  412. || i == offsetof(struct tx4927_pcic_reg, g2pspc)
  413. || i == offsetof(struct tx4927_pcic_reg, g2pcfgadrs)
  414. || i == offsetof(struct tx4927_pcic_reg, g2pcfgdata)) {
  415. printk(KERN_CONT " XXXXXXXX");
  416. continue;
  417. }
  418. printk(KERN_CONT " %08x", __raw_readl(preg));
  419. }
  420. printk(KERN_CONT "\n");
  421. }
  422. void tx4927_dump_pcic_settings(void)
  423. {
  424. int i;
  425. for (i = 0; i < ARRAY_SIZE(pcicptrs); i++) {
  426. if (pcicptrs[i].pcicptr)
  427. tx4927_dump_pcic_settings1(pcicptrs[i].pcicptr);
  428. }
  429. }
  430. irqreturn_t tx4927_pcierr_interrupt(int irq, void *dev_id)
  431. {
  432. struct pt_regs *regs = get_irq_regs();
  433. struct tx4927_pcic_reg __iomem *pcicptr =
  434. (struct tx4927_pcic_reg __iomem *)(unsigned long)dev_id;
  435. if (txx9_pci_err_action != TXX9_PCI_ERR_IGNORE) {
  436. printk(KERN_WARNING "PCIERR interrupt at 0x%0*lx\n",
  437. (int)(2 * sizeof(unsigned long)), regs->cp0_epc);
  438. tx4927_report_pcic_status1(pcicptr);
  439. }
  440. if (txx9_pci_err_action != TXX9_PCI_ERR_PANIC) {
  441. /* clear all pci errors */
  442. __raw_writel((__raw_readl(&pcicptr->pcistatus) & 0x0000ffff)
  443. | (TX4927_PCIC_PCISTATUS_ALL << 16),
  444. &pcicptr->pcistatus);
  445. __raw_writel(TX4927_PCIC_G2PSTATUS_ALL, &pcicptr->g2pstatus);
  446. __raw_writel(TX4927_PCIC_PBASTATUS_ALL, &pcicptr->pbastatus);
  447. __raw_writel(TX4927_PCIC_PCICSTATUS_ALL, &pcicptr->pcicstatus);
  448. return IRQ_HANDLED;
  449. }
  450. console_verbose();
  451. tx4927_dump_pcic_settings1(pcicptr);
  452. panic("PCI error.");
  453. }
  454. #ifdef CONFIG_TOSHIBA_FPCIB0
  455. static void __init tx4927_quirk_slc90e66_bridge(struct pci_dev *dev)
  456. {
  457. struct tx4927_pcic_reg __iomem *pcicptr = pci_bus_to_pcicptr(dev->bus);
  458. if (!pcicptr)
  459. return;
  460. if (__raw_readl(&pcicptr->pbacfg) & TX4927_PCIC_PBACFG_PBAEN) {
  461. /* Reset Bus Arbiter */
  462. __raw_writel(TX4927_PCIC_PBACFG_RPBA, &pcicptr->pbacfg);
  463. /*
  464. * swap reqBP and reqXP (raise priority of SLC90E66).
  465. * SLC90E66(PCI-ISA bridge) is connected to REQ2 on
  466. * PCI Backplane board.
  467. */
  468. __raw_writel(0x72543610, &pcicptr->pbareqport);
  469. __raw_writel(0, &pcicptr->pbabm);
  470. /* Use Fixed ParkMaster (required by SLC90E66) */
  471. __raw_writel(TX4927_PCIC_PBACFG_FIXPA, &pcicptr->pbacfg);
  472. /* Enable Bus Arbiter */
  473. __raw_writel(TX4927_PCIC_PBACFG_FIXPA |
  474. TX4927_PCIC_PBACFG_PBAEN,
  475. &pcicptr->pbacfg);
  476. printk(KERN_INFO "PCI: Use Fixed Park Master (REQPORT %08x)\n",
  477. __raw_readl(&pcicptr->pbareqport));
  478. }
  479. }
  480. #define PCI_DEVICE_ID_EFAR_SLC90E66_0 0x9460
  481. DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_EFAR, PCI_DEVICE_ID_EFAR_SLC90E66_0,
  482. tx4927_quirk_slc90e66_bridge);
  483. #endif