ops-tx4927.c 16 KB

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