pci.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604
  1. /*
  2. * arch/arm/mach-orion5x/pci.c
  3. *
  4. * PCI and PCIe functions for Marvell Orion System On Chip
  5. *
  6. * Maintainer: Tzachi Perelstein <tzachi@marvell.com>
  7. *
  8. * This file is licensed under the terms of the GNU General Public
  9. * License version 2. This program is licensed "as is" without any
  10. * warranty of any kind, whether express or implied.
  11. */
  12. #include <linux/kernel.h>
  13. #include <linux/pci.h>
  14. #include <linux/slab.h>
  15. #include <linux/mbus.h>
  16. #include <video/vga.h>
  17. #include <asm/irq.h>
  18. #include <asm/mach/pci.h>
  19. #include <plat/pcie.h>
  20. #include <plat/addr-map.h>
  21. #include <mach/orion5x.h>
  22. #include "common.h"
  23. /*****************************************************************************
  24. * Orion has one PCIe controller and one PCI controller.
  25. *
  26. * Note1: The local PCIe bus number is '0'. The local PCI bus number
  27. * follows the scanned PCIe bridged busses, if any.
  28. *
  29. * Note2: It is possible for PCI/PCIe agents to access many subsystem's
  30. * space, by configuring BARs and Address Decode Windows, e.g. flashes on
  31. * device bus, Orion registers, etc. However this code only enable the
  32. * access to DDR banks.
  33. ****************************************************************************/
  34. /*****************************************************************************
  35. * PCIe controller
  36. ****************************************************************************/
  37. #define PCIE_BASE ((void __iomem *)ORION5X_PCIE_VIRT_BASE)
  38. void __init orion5x_pcie_id(u32 *dev, u32 *rev)
  39. {
  40. *dev = orion_pcie_dev_id(PCIE_BASE);
  41. *rev = orion_pcie_rev(PCIE_BASE);
  42. }
  43. static int pcie_valid_config(int bus, int dev)
  44. {
  45. /*
  46. * Don't go out when trying to access --
  47. * 1. nonexisting device on local bus
  48. * 2. where there's no device connected (no link)
  49. */
  50. if (bus == 0 && dev == 0)
  51. return 1;
  52. if (!orion_pcie_link_up(PCIE_BASE))
  53. return 0;
  54. if (bus == 0 && dev != 1)
  55. return 0;
  56. return 1;
  57. }
  58. /*
  59. * PCIe config cycles are done by programming the PCIE_CONF_ADDR register
  60. * and then reading the PCIE_CONF_DATA register. Need to make sure these
  61. * transactions are atomic.
  62. */
  63. static DEFINE_SPINLOCK(orion5x_pcie_lock);
  64. static int pcie_rd_conf(struct pci_bus *bus, u32 devfn, int where,
  65. int size, u32 *val)
  66. {
  67. unsigned long flags;
  68. int ret;
  69. if (pcie_valid_config(bus->number, PCI_SLOT(devfn)) == 0) {
  70. *val = 0xffffffff;
  71. return PCIBIOS_DEVICE_NOT_FOUND;
  72. }
  73. spin_lock_irqsave(&orion5x_pcie_lock, flags);
  74. ret = orion_pcie_rd_conf(PCIE_BASE, bus, devfn, where, size, val);
  75. spin_unlock_irqrestore(&orion5x_pcie_lock, flags);
  76. return ret;
  77. }
  78. static int pcie_rd_conf_wa(struct pci_bus *bus, u32 devfn,
  79. int where, int size, u32 *val)
  80. {
  81. int ret;
  82. if (pcie_valid_config(bus->number, PCI_SLOT(devfn)) == 0) {
  83. *val = 0xffffffff;
  84. return PCIBIOS_DEVICE_NOT_FOUND;
  85. }
  86. /*
  87. * We only support access to the non-extended configuration
  88. * space when using the WA access method (or we would have to
  89. * sacrifice 256M of CPU virtual address space.)
  90. */
  91. if (where >= 0x100) {
  92. *val = 0xffffffff;
  93. return PCIBIOS_DEVICE_NOT_FOUND;
  94. }
  95. ret = orion_pcie_rd_conf_wa((void __iomem *)ORION5X_PCIE_WA_VIRT_BASE,
  96. bus, devfn, where, size, val);
  97. return ret;
  98. }
  99. static int pcie_wr_conf(struct pci_bus *bus, u32 devfn,
  100. int where, int size, u32 val)
  101. {
  102. unsigned long flags;
  103. int ret;
  104. if (pcie_valid_config(bus->number, PCI_SLOT(devfn)) == 0)
  105. return PCIBIOS_DEVICE_NOT_FOUND;
  106. spin_lock_irqsave(&orion5x_pcie_lock, flags);
  107. ret = orion_pcie_wr_conf(PCIE_BASE, bus, devfn, where, size, val);
  108. spin_unlock_irqrestore(&orion5x_pcie_lock, flags);
  109. return ret;
  110. }
  111. static struct pci_ops pcie_ops = {
  112. .read = pcie_rd_conf,
  113. .write = pcie_wr_conf,
  114. };
  115. static int __init pcie_setup(struct pci_sys_data *sys)
  116. {
  117. struct resource *res;
  118. int dev;
  119. /*
  120. * Generic PCIe unit setup.
  121. */
  122. orion_pcie_setup(PCIE_BASE);
  123. /*
  124. * Check whether to apply Orion-1/Orion-NAS PCIe config
  125. * read transaction workaround.
  126. */
  127. dev = orion_pcie_dev_id(PCIE_BASE);
  128. if (dev == MV88F5181_DEV_ID || dev == MV88F5182_DEV_ID) {
  129. printk(KERN_NOTICE "Applying Orion-1/Orion-NAS PCIe config "
  130. "read transaction workaround\n");
  131. orion5x_setup_pcie_wa_win(ORION5X_PCIE_WA_PHYS_BASE,
  132. ORION5X_PCIE_WA_SIZE);
  133. pcie_ops.read = pcie_rd_conf_wa;
  134. }
  135. /*
  136. * Request resources.
  137. */
  138. res = kzalloc(sizeof(struct resource) * 2, GFP_KERNEL);
  139. if (!res)
  140. panic("pcie_setup unable to alloc resources");
  141. /*
  142. * IORESOURCE_IO
  143. */
  144. sys->io_offset = 0;
  145. res[0].name = "PCIe I/O Space";
  146. res[0].flags = IORESOURCE_IO;
  147. res[0].start = ORION5X_PCIE_IO_BUS_BASE;
  148. res[0].end = res[0].start + ORION5X_PCIE_IO_SIZE - 1;
  149. if (request_resource(&ioport_resource, &res[0]))
  150. panic("Request PCIe IO resource failed\n");
  151. pci_add_resource_offset(&sys->resources, &res[0], sys->io_offset);
  152. /*
  153. * IORESOURCE_MEM
  154. */
  155. res[1].name = "PCIe Memory Space";
  156. res[1].flags = IORESOURCE_MEM;
  157. res[1].start = ORION5X_PCIE_MEM_PHYS_BASE;
  158. res[1].end = res[1].start + ORION5X_PCIE_MEM_SIZE - 1;
  159. if (request_resource(&iomem_resource, &res[1]))
  160. panic("Request PCIe Memory resource failed\n");
  161. pci_add_resource_offset(&sys->resources, &res[1], sys->mem_offset);
  162. return 1;
  163. }
  164. /*****************************************************************************
  165. * PCI controller
  166. ****************************************************************************/
  167. #define ORION5X_PCI_REG(x) (ORION5X_PCI_VIRT_BASE | (x))
  168. #define PCI_MODE ORION5X_PCI_REG(0xd00)
  169. #define PCI_CMD ORION5X_PCI_REG(0xc00)
  170. #define PCI_P2P_CONF ORION5X_PCI_REG(0x1d14)
  171. #define PCI_CONF_ADDR ORION5X_PCI_REG(0xc78)
  172. #define PCI_CONF_DATA ORION5X_PCI_REG(0xc7c)
  173. /*
  174. * PCI_MODE bits
  175. */
  176. #define PCI_MODE_64BIT (1 << 2)
  177. #define PCI_MODE_PCIX ((1 << 4) | (1 << 5))
  178. /*
  179. * PCI_CMD bits
  180. */
  181. #define PCI_CMD_HOST_REORDER (1 << 29)
  182. /*
  183. * PCI_P2P_CONF bits
  184. */
  185. #define PCI_P2P_BUS_OFFS 16
  186. #define PCI_P2P_BUS_MASK (0xff << PCI_P2P_BUS_OFFS)
  187. #define PCI_P2P_DEV_OFFS 24
  188. #define PCI_P2P_DEV_MASK (0x1f << PCI_P2P_DEV_OFFS)
  189. /*
  190. * PCI_CONF_ADDR bits
  191. */
  192. #define PCI_CONF_REG(reg) ((reg) & 0xfc)
  193. #define PCI_CONF_FUNC(func) (((func) & 0x3) << 8)
  194. #define PCI_CONF_DEV(dev) (((dev) & 0x1f) << 11)
  195. #define PCI_CONF_BUS(bus) (((bus) & 0xff) << 16)
  196. #define PCI_CONF_ADDR_EN (1 << 31)
  197. /*
  198. * Internal configuration space
  199. */
  200. #define PCI_CONF_FUNC_STAT_CMD 0
  201. #define PCI_CONF_REG_STAT_CMD 4
  202. #define PCIX_STAT 0x64
  203. #define PCIX_STAT_BUS_OFFS 8
  204. #define PCIX_STAT_BUS_MASK (0xff << PCIX_STAT_BUS_OFFS)
  205. /*
  206. * PCI Address Decode Windows registers
  207. */
  208. #define PCI_BAR_SIZE_DDR_CS(n) (((n) == 0) ? ORION5X_PCI_REG(0xc08) : \
  209. ((n) == 1) ? ORION5X_PCI_REG(0xd08) : \
  210. ((n) == 2) ? ORION5X_PCI_REG(0xc0c) : \
  211. ((n) == 3) ? ORION5X_PCI_REG(0xd0c) : 0)
  212. #define PCI_BAR_REMAP_DDR_CS(n) (((n) == 0) ? ORION5X_PCI_REG(0xc48) : \
  213. ((n) == 1) ? ORION5X_PCI_REG(0xd48) : \
  214. ((n) == 2) ? ORION5X_PCI_REG(0xc4c) : \
  215. ((n) == 3) ? ORION5X_PCI_REG(0xd4c) : 0)
  216. #define PCI_BAR_ENABLE ORION5X_PCI_REG(0xc3c)
  217. #define PCI_ADDR_DECODE_CTRL ORION5X_PCI_REG(0xd3c)
  218. /*
  219. * PCI configuration helpers for BAR settings
  220. */
  221. #define PCI_CONF_FUNC_BAR_CS(n) ((n) >> 1)
  222. #define PCI_CONF_REG_BAR_LO_CS(n) (((n) & 1) ? 0x18 : 0x10)
  223. #define PCI_CONF_REG_BAR_HI_CS(n) (((n) & 1) ? 0x1c : 0x14)
  224. /*
  225. * PCI config cycles are done by programming the PCI_CONF_ADDR register
  226. * and then reading the PCI_CONF_DATA register. Need to make sure these
  227. * transactions are atomic.
  228. */
  229. static DEFINE_SPINLOCK(orion5x_pci_lock);
  230. static int orion5x_pci_cardbus_mode;
  231. static int orion5x_pci_local_bus_nr(void)
  232. {
  233. u32 conf = readl(PCI_P2P_CONF);
  234. return((conf & PCI_P2P_BUS_MASK) >> PCI_P2P_BUS_OFFS);
  235. }
  236. static int orion5x_pci_hw_rd_conf(int bus, int dev, u32 func,
  237. u32 where, u32 size, u32 *val)
  238. {
  239. unsigned long flags;
  240. spin_lock_irqsave(&orion5x_pci_lock, flags);
  241. writel(PCI_CONF_BUS(bus) |
  242. PCI_CONF_DEV(dev) | PCI_CONF_REG(where) |
  243. PCI_CONF_FUNC(func) | PCI_CONF_ADDR_EN, PCI_CONF_ADDR);
  244. *val = readl(PCI_CONF_DATA);
  245. if (size == 1)
  246. *val = (*val >> (8*(where & 0x3))) & 0xff;
  247. else if (size == 2)
  248. *val = (*val >> (8*(where & 0x3))) & 0xffff;
  249. spin_unlock_irqrestore(&orion5x_pci_lock, flags);
  250. return PCIBIOS_SUCCESSFUL;
  251. }
  252. static int orion5x_pci_hw_wr_conf(int bus, int dev, u32 func,
  253. u32 where, u32 size, u32 val)
  254. {
  255. unsigned long flags;
  256. int ret = PCIBIOS_SUCCESSFUL;
  257. spin_lock_irqsave(&orion5x_pci_lock, flags);
  258. writel(PCI_CONF_BUS(bus) |
  259. PCI_CONF_DEV(dev) | PCI_CONF_REG(where) |
  260. PCI_CONF_FUNC(func) | PCI_CONF_ADDR_EN, PCI_CONF_ADDR);
  261. if (size == 4) {
  262. __raw_writel(val, PCI_CONF_DATA);
  263. } else if (size == 2) {
  264. __raw_writew(val, PCI_CONF_DATA + (where & 0x3));
  265. } else if (size == 1) {
  266. __raw_writeb(val, PCI_CONF_DATA + (where & 0x3));
  267. } else {
  268. ret = PCIBIOS_BAD_REGISTER_NUMBER;
  269. }
  270. spin_unlock_irqrestore(&orion5x_pci_lock, flags);
  271. return ret;
  272. }
  273. static int orion5x_pci_valid_config(int bus, u32 devfn)
  274. {
  275. if (bus == orion5x_pci_local_bus_nr()) {
  276. /*
  277. * Don't go out for local device
  278. */
  279. if (PCI_SLOT(devfn) == 0 && PCI_FUNC(devfn) != 0)
  280. return 0;
  281. /*
  282. * When the PCI signals are directly connected to a
  283. * Cardbus slot, ignore all but device IDs 0 and 1.
  284. */
  285. if (orion5x_pci_cardbus_mode && PCI_SLOT(devfn) > 1)
  286. return 0;
  287. }
  288. return 1;
  289. }
  290. static int orion5x_pci_rd_conf(struct pci_bus *bus, u32 devfn,
  291. int where, int size, u32 *val)
  292. {
  293. if (!orion5x_pci_valid_config(bus->number, devfn)) {
  294. *val = 0xffffffff;
  295. return PCIBIOS_DEVICE_NOT_FOUND;
  296. }
  297. return orion5x_pci_hw_rd_conf(bus->number, PCI_SLOT(devfn),
  298. PCI_FUNC(devfn), where, size, val);
  299. }
  300. static int orion5x_pci_wr_conf(struct pci_bus *bus, u32 devfn,
  301. int where, int size, u32 val)
  302. {
  303. if (!orion5x_pci_valid_config(bus->number, devfn))
  304. return PCIBIOS_DEVICE_NOT_FOUND;
  305. return orion5x_pci_hw_wr_conf(bus->number, PCI_SLOT(devfn),
  306. PCI_FUNC(devfn), where, size, val);
  307. }
  308. static struct pci_ops pci_ops = {
  309. .read = orion5x_pci_rd_conf,
  310. .write = orion5x_pci_wr_conf,
  311. };
  312. static void __init orion5x_pci_set_bus_nr(int nr)
  313. {
  314. u32 p2p = readl(PCI_P2P_CONF);
  315. if (readl(PCI_MODE) & PCI_MODE_PCIX) {
  316. /*
  317. * PCI-X mode
  318. */
  319. u32 pcix_status, bus, dev;
  320. bus = (p2p & PCI_P2P_BUS_MASK) >> PCI_P2P_BUS_OFFS;
  321. dev = (p2p & PCI_P2P_DEV_MASK) >> PCI_P2P_DEV_OFFS;
  322. orion5x_pci_hw_rd_conf(bus, dev, 0, PCIX_STAT, 4, &pcix_status);
  323. pcix_status &= ~PCIX_STAT_BUS_MASK;
  324. pcix_status |= (nr << PCIX_STAT_BUS_OFFS);
  325. orion5x_pci_hw_wr_conf(bus, dev, 0, PCIX_STAT, 4, pcix_status);
  326. } else {
  327. /*
  328. * PCI Conventional mode
  329. */
  330. p2p &= ~PCI_P2P_BUS_MASK;
  331. p2p |= (nr << PCI_P2P_BUS_OFFS);
  332. writel(p2p, PCI_P2P_CONF);
  333. }
  334. }
  335. static void __init orion5x_pci_master_slave_enable(void)
  336. {
  337. int bus_nr, func, reg;
  338. u32 val;
  339. bus_nr = orion5x_pci_local_bus_nr();
  340. func = PCI_CONF_FUNC_STAT_CMD;
  341. reg = PCI_CONF_REG_STAT_CMD;
  342. orion5x_pci_hw_rd_conf(bus_nr, 0, func, reg, 4, &val);
  343. val |= (PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER);
  344. orion5x_pci_hw_wr_conf(bus_nr, 0, func, reg, 4, val | 0x7);
  345. }
  346. static void __init orion5x_setup_pci_wins(struct mbus_dram_target_info *dram)
  347. {
  348. u32 win_enable;
  349. int bus;
  350. int i;
  351. /*
  352. * First, disable windows.
  353. */
  354. win_enable = 0xffffffff;
  355. writel(win_enable, PCI_BAR_ENABLE);
  356. /*
  357. * Setup windows for DDR banks.
  358. */
  359. bus = orion5x_pci_local_bus_nr();
  360. for (i = 0; i < dram->num_cs; i++) {
  361. struct mbus_dram_window *cs = dram->cs + i;
  362. u32 func = PCI_CONF_FUNC_BAR_CS(cs->cs_index);
  363. u32 reg;
  364. u32 val;
  365. /*
  366. * Write DRAM bank base address register.
  367. */
  368. reg = PCI_CONF_REG_BAR_LO_CS(cs->cs_index);
  369. orion5x_pci_hw_rd_conf(bus, 0, func, reg, 4, &val);
  370. val = (cs->base & 0xfffff000) | (val & 0xfff);
  371. orion5x_pci_hw_wr_conf(bus, 0, func, reg, 4, val);
  372. /*
  373. * Write DRAM bank size register.
  374. */
  375. reg = PCI_CONF_REG_BAR_HI_CS(cs->cs_index);
  376. orion5x_pci_hw_wr_conf(bus, 0, func, reg, 4, 0);
  377. writel((cs->size - 1) & 0xfffff000,
  378. PCI_BAR_SIZE_DDR_CS(cs->cs_index));
  379. writel(cs->base & 0xfffff000,
  380. PCI_BAR_REMAP_DDR_CS(cs->cs_index));
  381. /*
  382. * Enable decode window for this chip select.
  383. */
  384. win_enable &= ~(1 << cs->cs_index);
  385. }
  386. /*
  387. * Re-enable decode windows.
  388. */
  389. writel(win_enable, PCI_BAR_ENABLE);
  390. /*
  391. * Disable automatic update of address remapping when writing to BARs.
  392. */
  393. orion5x_setbits(PCI_ADDR_DECODE_CTRL, 1);
  394. }
  395. static int __init pci_setup(struct pci_sys_data *sys)
  396. {
  397. struct resource *res;
  398. /*
  399. * Point PCI unit MBUS decode windows to DRAM space.
  400. */
  401. orion5x_setup_pci_wins(&orion_mbus_dram_info);
  402. /*
  403. * Master + Slave enable
  404. */
  405. orion5x_pci_master_slave_enable();
  406. /*
  407. * Force ordering
  408. */
  409. orion5x_setbits(PCI_CMD, PCI_CMD_HOST_REORDER);
  410. /*
  411. * Request resources
  412. */
  413. res = kzalloc(sizeof(struct resource) * 2, GFP_KERNEL);
  414. if (!res)
  415. panic("pci_setup unable to alloc resources");
  416. /*
  417. * IORESOURCE_IO
  418. */
  419. sys->io_offset = 0;
  420. res[0].name = "PCI I/O Space";
  421. res[0].flags = IORESOURCE_IO;
  422. res[0].start = ORION5X_PCI_IO_BUS_BASE;
  423. res[0].end = res[0].start + ORION5X_PCI_IO_SIZE - 1;
  424. if (request_resource(&ioport_resource, &res[0]))
  425. panic("Request PCI IO resource failed\n");
  426. pci_add_resource_offset(&sys->resources, &res[0], sys->io_offset);
  427. /*
  428. * IORESOURCE_MEM
  429. */
  430. res[1].name = "PCI Memory Space";
  431. res[1].flags = IORESOURCE_MEM;
  432. res[1].start = ORION5X_PCI_MEM_PHYS_BASE;
  433. res[1].end = res[1].start + ORION5X_PCI_MEM_SIZE - 1;
  434. if (request_resource(&iomem_resource, &res[1]))
  435. panic("Request PCI Memory resource failed\n");
  436. pci_add_resource_offset(&sys->resources, &res[1], sys->mem_offset);
  437. return 1;
  438. }
  439. /*****************************************************************************
  440. * General PCIe + PCI
  441. ****************************************************************************/
  442. static void __devinit rc_pci_fixup(struct pci_dev *dev)
  443. {
  444. /*
  445. * Prevent enumeration of root complex.
  446. */
  447. if (dev->bus->parent == NULL && dev->devfn == 0) {
  448. int i;
  449. for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
  450. dev->resource[i].start = 0;
  451. dev->resource[i].end = 0;
  452. dev->resource[i].flags = 0;
  453. }
  454. }
  455. }
  456. DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MARVELL, PCI_ANY_ID, rc_pci_fixup);
  457. static int orion5x_pci_disabled __initdata;
  458. void __init orion5x_pci_disable(void)
  459. {
  460. orion5x_pci_disabled = 1;
  461. }
  462. void __init orion5x_pci_set_cardbus_mode(void)
  463. {
  464. orion5x_pci_cardbus_mode = 1;
  465. }
  466. int __init orion5x_pci_sys_setup(int nr, struct pci_sys_data *sys)
  467. {
  468. int ret = 0;
  469. vga_base = ORION5X_PCIE_MEM_PHYS_BASE;
  470. if (nr == 0) {
  471. orion_pcie_set_local_bus_nr(PCIE_BASE, sys->busnr);
  472. ret = pcie_setup(sys);
  473. } else if (nr == 1 && !orion5x_pci_disabled) {
  474. orion5x_pci_set_bus_nr(sys->busnr);
  475. ret = pci_setup(sys);
  476. }
  477. return ret;
  478. }
  479. struct pci_bus __init *orion5x_pci_sys_scan_bus(int nr, struct pci_sys_data *sys)
  480. {
  481. struct pci_bus *bus;
  482. if (nr == 0) {
  483. bus = pci_scan_root_bus(NULL, sys->busnr, &pcie_ops, sys,
  484. &sys->resources);
  485. } else if (nr == 1 && !orion5x_pci_disabled) {
  486. bus = pci_scan_root_bus(NULL, sys->busnr, &pci_ops, sys,
  487. &sys->resources);
  488. } else {
  489. bus = NULL;
  490. BUG();
  491. }
  492. return bus;
  493. }
  494. int __init orion5x_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
  495. {
  496. int bus = dev->bus->number;
  497. /*
  498. * PCIe endpoint?
  499. */
  500. if (orion5x_pci_disabled || bus < orion5x_pci_local_bus_nr())
  501. return IRQ_ORION5X_PCIE0_INT;
  502. return -1;
  503. }