pci.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658
  1. /* $Id: pci.c,v 1.39 2002/01/05 01:13:43 davem Exp $
  2. * pci.c: UltraSparc PCI controller support.
  3. *
  4. * Copyright (C) 1997, 1998, 1999 David S. Miller (davem@redhat.com)
  5. * Copyright (C) 1998, 1999 Eddie C. Dost (ecd@skynet.be)
  6. * Copyright (C) 1999 Jakub Jelinek (jj@ultra.linux.cz)
  7. */
  8. #include <linux/module.h>
  9. #include <linux/kernel.h>
  10. #include <linux/string.h>
  11. #include <linux/sched.h>
  12. #include <linux/capability.h>
  13. #include <linux/errno.h>
  14. #include <linux/smp_lock.h>
  15. #include <linux/init.h>
  16. #include <asm/uaccess.h>
  17. #include <asm/pbm.h>
  18. #include <asm/pgtable.h>
  19. #include <asm/irq.h>
  20. #include <asm/ebus.h>
  21. #include <asm/isa.h>
  22. #include <asm/prom.h>
  23. unsigned long pci_memspace_mask = 0xffffffffUL;
  24. #ifndef CONFIG_PCI
  25. /* A "nop" PCI implementation. */
  26. asmlinkage int sys_pciconfig_read(unsigned long bus, unsigned long dfn,
  27. unsigned long off, unsigned long len,
  28. unsigned char *buf)
  29. {
  30. return 0;
  31. }
  32. asmlinkage int sys_pciconfig_write(unsigned long bus, unsigned long dfn,
  33. unsigned long off, unsigned long len,
  34. unsigned char *buf)
  35. {
  36. return 0;
  37. }
  38. #else
  39. /* List of all PCI controllers found in the system. */
  40. struct pci_controller_info *pci_controller_root = NULL;
  41. /* Each PCI controller found gets a unique index. */
  42. int pci_num_controllers = 0;
  43. volatile int pci_poke_in_progress;
  44. volatile int pci_poke_cpu = -1;
  45. volatile int pci_poke_faulted;
  46. static DEFINE_SPINLOCK(pci_poke_lock);
  47. void pci_config_read8(u8 *addr, u8 *ret)
  48. {
  49. unsigned long flags;
  50. u8 byte;
  51. spin_lock_irqsave(&pci_poke_lock, flags);
  52. pci_poke_cpu = smp_processor_id();
  53. pci_poke_in_progress = 1;
  54. pci_poke_faulted = 0;
  55. __asm__ __volatile__("membar #Sync\n\t"
  56. "lduba [%1] %2, %0\n\t"
  57. "membar #Sync"
  58. : "=r" (byte)
  59. : "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E_L)
  60. : "memory");
  61. pci_poke_in_progress = 0;
  62. pci_poke_cpu = -1;
  63. if (!pci_poke_faulted)
  64. *ret = byte;
  65. spin_unlock_irqrestore(&pci_poke_lock, flags);
  66. }
  67. void pci_config_read16(u16 *addr, u16 *ret)
  68. {
  69. unsigned long flags;
  70. u16 word;
  71. spin_lock_irqsave(&pci_poke_lock, flags);
  72. pci_poke_cpu = smp_processor_id();
  73. pci_poke_in_progress = 1;
  74. pci_poke_faulted = 0;
  75. __asm__ __volatile__("membar #Sync\n\t"
  76. "lduha [%1] %2, %0\n\t"
  77. "membar #Sync"
  78. : "=r" (word)
  79. : "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E_L)
  80. : "memory");
  81. pci_poke_in_progress = 0;
  82. pci_poke_cpu = -1;
  83. if (!pci_poke_faulted)
  84. *ret = word;
  85. spin_unlock_irqrestore(&pci_poke_lock, flags);
  86. }
  87. void pci_config_read32(u32 *addr, u32 *ret)
  88. {
  89. unsigned long flags;
  90. u32 dword;
  91. spin_lock_irqsave(&pci_poke_lock, flags);
  92. pci_poke_cpu = smp_processor_id();
  93. pci_poke_in_progress = 1;
  94. pci_poke_faulted = 0;
  95. __asm__ __volatile__("membar #Sync\n\t"
  96. "lduwa [%1] %2, %0\n\t"
  97. "membar #Sync"
  98. : "=r" (dword)
  99. : "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E_L)
  100. : "memory");
  101. pci_poke_in_progress = 0;
  102. pci_poke_cpu = -1;
  103. if (!pci_poke_faulted)
  104. *ret = dword;
  105. spin_unlock_irqrestore(&pci_poke_lock, flags);
  106. }
  107. void pci_config_write8(u8 *addr, u8 val)
  108. {
  109. unsigned long flags;
  110. spin_lock_irqsave(&pci_poke_lock, flags);
  111. pci_poke_cpu = smp_processor_id();
  112. pci_poke_in_progress = 1;
  113. pci_poke_faulted = 0;
  114. __asm__ __volatile__("membar #Sync\n\t"
  115. "stba %0, [%1] %2\n\t"
  116. "membar #Sync"
  117. : /* no outputs */
  118. : "r" (val), "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E_L)
  119. : "memory");
  120. pci_poke_in_progress = 0;
  121. pci_poke_cpu = -1;
  122. spin_unlock_irqrestore(&pci_poke_lock, flags);
  123. }
  124. void pci_config_write16(u16 *addr, u16 val)
  125. {
  126. unsigned long flags;
  127. spin_lock_irqsave(&pci_poke_lock, flags);
  128. pci_poke_cpu = smp_processor_id();
  129. pci_poke_in_progress = 1;
  130. pci_poke_faulted = 0;
  131. __asm__ __volatile__("membar #Sync\n\t"
  132. "stha %0, [%1] %2\n\t"
  133. "membar #Sync"
  134. : /* no outputs */
  135. : "r" (val), "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E_L)
  136. : "memory");
  137. pci_poke_in_progress = 0;
  138. pci_poke_cpu = -1;
  139. spin_unlock_irqrestore(&pci_poke_lock, flags);
  140. }
  141. void pci_config_write32(u32 *addr, u32 val)
  142. {
  143. unsigned long flags;
  144. spin_lock_irqsave(&pci_poke_lock, flags);
  145. pci_poke_cpu = smp_processor_id();
  146. pci_poke_in_progress = 1;
  147. pci_poke_faulted = 0;
  148. __asm__ __volatile__("membar #Sync\n\t"
  149. "stwa %0, [%1] %2\n\t"
  150. "membar #Sync"
  151. : /* no outputs */
  152. : "r" (val), "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E_L)
  153. : "memory");
  154. pci_poke_in_progress = 0;
  155. pci_poke_cpu = -1;
  156. spin_unlock_irqrestore(&pci_poke_lock, flags);
  157. }
  158. /* Probe for all PCI controllers in the system. */
  159. extern void sabre_init(struct device_node *, const char *);
  160. extern void psycho_init(struct device_node *, const char *);
  161. extern void schizo_init(struct device_node *, const char *);
  162. extern void schizo_plus_init(struct device_node *, const char *);
  163. extern void tomatillo_init(struct device_node *, const char *);
  164. extern void sun4v_pci_init(struct device_node *, const char *);
  165. static struct {
  166. char *model_name;
  167. void (*init)(struct device_node *, const char *);
  168. } pci_controller_table[] __initdata = {
  169. { "SUNW,sabre", sabre_init },
  170. { "pci108e,a000", sabre_init },
  171. { "pci108e,a001", sabre_init },
  172. { "SUNW,psycho", psycho_init },
  173. { "pci108e,8000", psycho_init },
  174. { "SUNW,schizo", schizo_init },
  175. { "pci108e,8001", schizo_init },
  176. { "SUNW,schizo+", schizo_plus_init },
  177. { "pci108e,8002", schizo_plus_init },
  178. { "SUNW,tomatillo", tomatillo_init },
  179. { "pci108e,a801", tomatillo_init },
  180. { "SUNW,sun4v-pci", sun4v_pci_init },
  181. };
  182. #define PCI_NUM_CONTROLLER_TYPES (sizeof(pci_controller_table) / \
  183. sizeof(pci_controller_table[0]))
  184. static int __init pci_controller_init(const char *model_name, int namelen, struct device_node *dp)
  185. {
  186. int i;
  187. for (i = 0; i < PCI_NUM_CONTROLLER_TYPES; i++) {
  188. if (!strncmp(model_name,
  189. pci_controller_table[i].model_name,
  190. namelen)) {
  191. pci_controller_table[i].init(dp, model_name);
  192. return 1;
  193. }
  194. }
  195. return 0;
  196. }
  197. static int __init pci_is_controller(const char *model_name, int namelen, struct device_node *dp)
  198. {
  199. int i;
  200. for (i = 0; i < PCI_NUM_CONTROLLER_TYPES; i++) {
  201. if (!strncmp(model_name,
  202. pci_controller_table[i].model_name,
  203. namelen)) {
  204. return 1;
  205. }
  206. }
  207. return 0;
  208. }
  209. static int __init pci_controller_scan(int (*handler)(const char *, int, struct device_node *))
  210. {
  211. struct device_node *dp;
  212. int count = 0;
  213. for_each_node_by_name(dp, "pci") {
  214. struct property *prop;
  215. int len;
  216. prop = of_find_property(dp, "model", &len);
  217. if (!prop)
  218. prop = of_find_property(dp, "compatible", &len);
  219. if (prop) {
  220. const char *model = prop->value;
  221. int item_len = 0;
  222. /* Our value may be a multi-valued string in the
  223. * case of some compatible properties. For sanity,
  224. * only try the first one.
  225. */
  226. while (model[item_len] && len) {
  227. len--;
  228. item_len++;
  229. }
  230. if (handler(model, item_len, dp))
  231. count++;
  232. }
  233. }
  234. return count;
  235. }
  236. /* Is there some PCI controller in the system? */
  237. int __init pcic_present(void)
  238. {
  239. return pci_controller_scan(pci_is_controller);
  240. }
  241. struct pci_iommu_ops *pci_iommu_ops;
  242. EXPORT_SYMBOL(pci_iommu_ops);
  243. extern struct pci_iommu_ops pci_sun4u_iommu_ops,
  244. pci_sun4v_iommu_ops;
  245. /* Find each controller in the system, attach and initialize
  246. * software state structure for each and link into the
  247. * pci_controller_root. Setup the controller enough such
  248. * that bus scanning can be done.
  249. */
  250. static void __init pci_controller_probe(void)
  251. {
  252. if (tlb_type == hypervisor)
  253. pci_iommu_ops = &pci_sun4v_iommu_ops;
  254. else
  255. pci_iommu_ops = &pci_sun4u_iommu_ops;
  256. printk("PCI: Probing for controllers.\n");
  257. pci_controller_scan(pci_controller_init);
  258. }
  259. static void __init pci_scan_each_controller_bus(void)
  260. {
  261. struct pci_controller_info *p;
  262. for (p = pci_controller_root; p; p = p->next)
  263. p->scan_bus(p);
  264. }
  265. extern void power_init(void);
  266. static int __init pcibios_init(void)
  267. {
  268. pci_controller_probe();
  269. if (pci_controller_root == NULL)
  270. return 0;
  271. pci_scan_each_controller_bus();
  272. isa_init();
  273. ebus_init();
  274. power_init();
  275. return 0;
  276. }
  277. subsys_initcall(pcibios_init);
  278. void pcibios_fixup_bus(struct pci_bus *pbus)
  279. {
  280. struct pci_pbm_info *pbm = pbus->sysdata;
  281. /* Generic PCI bus probing sets these to point at
  282. * &io{port,mem}_resouce which is wrong for us.
  283. */
  284. pbus->resource[0] = &pbm->io_space;
  285. pbus->resource[1] = &pbm->mem_space;
  286. }
  287. struct resource *pcibios_select_root(struct pci_dev *pdev, struct resource *r)
  288. {
  289. struct pci_pbm_info *pbm = pdev->bus->sysdata;
  290. struct resource *root = NULL;
  291. if (r->flags & IORESOURCE_IO)
  292. root = &pbm->io_space;
  293. if (r->flags & IORESOURCE_MEM)
  294. root = &pbm->mem_space;
  295. return root;
  296. }
  297. void pcibios_update_irq(struct pci_dev *pdev, int irq)
  298. {
  299. }
  300. void pcibios_align_resource(void *data, struct resource *res,
  301. resource_size_t size, resource_size_t align)
  302. {
  303. }
  304. int pcibios_enable_device(struct pci_dev *pdev, int mask)
  305. {
  306. return 0;
  307. }
  308. void pcibios_resource_to_bus(struct pci_dev *pdev, struct pci_bus_region *region,
  309. struct resource *res)
  310. {
  311. struct pci_pbm_info *pbm = pdev->bus->sysdata;
  312. struct resource zero_res, *root;
  313. zero_res.start = 0;
  314. zero_res.end = 0;
  315. zero_res.flags = res->flags;
  316. if (res->flags & IORESOURCE_IO)
  317. root = &pbm->io_space;
  318. else
  319. root = &pbm->mem_space;
  320. pbm->parent->resource_adjust(pdev, &zero_res, root);
  321. region->start = res->start - zero_res.start;
  322. region->end = res->end - zero_res.start;
  323. }
  324. EXPORT_SYMBOL(pcibios_resource_to_bus);
  325. void pcibios_bus_to_resource(struct pci_dev *pdev, struct resource *res,
  326. struct pci_bus_region *region)
  327. {
  328. struct pci_pbm_info *pbm = pdev->bus->sysdata;
  329. struct resource *root;
  330. res->start = region->start;
  331. res->end = region->end;
  332. if (res->flags & IORESOURCE_IO)
  333. root = &pbm->io_space;
  334. else
  335. root = &pbm->mem_space;
  336. pbm->parent->resource_adjust(pdev, res, root);
  337. }
  338. EXPORT_SYMBOL(pcibios_bus_to_resource);
  339. char * __init pcibios_setup(char *str)
  340. {
  341. return str;
  342. }
  343. /* Platform support for /proc/bus/pci/X/Y mmap()s. */
  344. /* If the user uses a host-bridge as the PCI device, he may use
  345. * this to perform a raw mmap() of the I/O or MEM space behind
  346. * that controller.
  347. *
  348. * This can be useful for execution of x86 PCI bios initialization code
  349. * on a PCI card, like the xfree86 int10 stuff does.
  350. */
  351. static int __pci_mmap_make_offset_bus(struct pci_dev *pdev, struct vm_area_struct *vma,
  352. enum pci_mmap_state mmap_state)
  353. {
  354. struct pcidev_cookie *pcp = pdev->sysdata;
  355. struct pci_pbm_info *pbm;
  356. struct pci_controller_info *p;
  357. unsigned long space_size, user_offset, user_size;
  358. if (!pcp)
  359. return -ENXIO;
  360. pbm = pcp->pbm;
  361. if (!pbm)
  362. return -ENXIO;
  363. p = pbm->parent;
  364. if (p->pbms_same_domain) {
  365. unsigned long lowest, highest;
  366. lowest = ~0UL; highest = 0UL;
  367. if (mmap_state == pci_mmap_io) {
  368. if (p->pbm_A.io_space.flags) {
  369. lowest = p->pbm_A.io_space.start;
  370. highest = p->pbm_A.io_space.end + 1;
  371. }
  372. if (p->pbm_B.io_space.flags) {
  373. if (lowest > p->pbm_B.io_space.start)
  374. lowest = p->pbm_B.io_space.start;
  375. if (highest < p->pbm_B.io_space.end + 1)
  376. highest = p->pbm_B.io_space.end + 1;
  377. }
  378. space_size = highest - lowest;
  379. } else {
  380. if (p->pbm_A.mem_space.flags) {
  381. lowest = p->pbm_A.mem_space.start;
  382. highest = p->pbm_A.mem_space.end + 1;
  383. }
  384. if (p->pbm_B.mem_space.flags) {
  385. if (lowest > p->pbm_B.mem_space.start)
  386. lowest = p->pbm_B.mem_space.start;
  387. if (highest < p->pbm_B.mem_space.end + 1)
  388. highest = p->pbm_B.mem_space.end + 1;
  389. }
  390. space_size = highest - lowest;
  391. }
  392. } else {
  393. if (mmap_state == pci_mmap_io) {
  394. space_size = (pbm->io_space.end -
  395. pbm->io_space.start) + 1;
  396. } else {
  397. space_size = (pbm->mem_space.end -
  398. pbm->mem_space.start) + 1;
  399. }
  400. }
  401. /* Make sure the request is in range. */
  402. user_offset = vma->vm_pgoff << PAGE_SHIFT;
  403. user_size = vma->vm_end - vma->vm_start;
  404. if (user_offset >= space_size ||
  405. (user_offset + user_size) > space_size)
  406. return -EINVAL;
  407. if (p->pbms_same_domain) {
  408. unsigned long lowest = ~0UL;
  409. if (mmap_state == pci_mmap_io) {
  410. if (p->pbm_A.io_space.flags)
  411. lowest = p->pbm_A.io_space.start;
  412. if (p->pbm_B.io_space.flags &&
  413. lowest > p->pbm_B.io_space.start)
  414. lowest = p->pbm_B.io_space.start;
  415. } else {
  416. if (p->pbm_A.mem_space.flags)
  417. lowest = p->pbm_A.mem_space.start;
  418. if (p->pbm_B.mem_space.flags &&
  419. lowest > p->pbm_B.mem_space.start)
  420. lowest = p->pbm_B.mem_space.start;
  421. }
  422. vma->vm_pgoff = (lowest + user_offset) >> PAGE_SHIFT;
  423. } else {
  424. if (mmap_state == pci_mmap_io) {
  425. vma->vm_pgoff = (pbm->io_space.start +
  426. user_offset) >> PAGE_SHIFT;
  427. } else {
  428. vma->vm_pgoff = (pbm->mem_space.start +
  429. user_offset) >> PAGE_SHIFT;
  430. }
  431. }
  432. return 0;
  433. }
  434. /* Adjust vm_pgoff of VMA such that it is the physical page offset corresponding
  435. * to the 32-bit pci bus offset for DEV requested by the user.
  436. *
  437. * Basically, the user finds the base address for his device which he wishes
  438. * to mmap. They read the 32-bit value from the config space base register,
  439. * add whatever PAGE_SIZE multiple offset they wish, and feed this into the
  440. * offset parameter of mmap on /proc/bus/pci/XXX for that device.
  441. *
  442. * Returns negative error code on failure, zero on success.
  443. */
  444. static int __pci_mmap_make_offset(struct pci_dev *dev, struct vm_area_struct *vma,
  445. enum pci_mmap_state mmap_state)
  446. {
  447. unsigned long user_offset = vma->vm_pgoff << PAGE_SHIFT;
  448. unsigned long user32 = user_offset & pci_memspace_mask;
  449. unsigned long largest_base, this_base, addr32;
  450. int i;
  451. if ((dev->class >> 8) == PCI_CLASS_BRIDGE_HOST)
  452. return __pci_mmap_make_offset_bus(dev, vma, mmap_state);
  453. /* Figure out which base address this is for. */
  454. largest_base = 0UL;
  455. for (i = 0; i <= PCI_ROM_RESOURCE; i++) {
  456. struct resource *rp = &dev->resource[i];
  457. /* Active? */
  458. if (!rp->flags)
  459. continue;
  460. /* Same type? */
  461. if (i == PCI_ROM_RESOURCE) {
  462. if (mmap_state != pci_mmap_mem)
  463. continue;
  464. } else {
  465. if ((mmap_state == pci_mmap_io &&
  466. (rp->flags & IORESOURCE_IO) == 0) ||
  467. (mmap_state == pci_mmap_mem &&
  468. (rp->flags & IORESOURCE_MEM) == 0))
  469. continue;
  470. }
  471. this_base = rp->start;
  472. addr32 = (this_base & PAGE_MASK) & pci_memspace_mask;
  473. if (mmap_state == pci_mmap_io)
  474. addr32 &= 0xffffff;
  475. if (addr32 <= user32 && this_base > largest_base)
  476. largest_base = this_base;
  477. }
  478. if (largest_base == 0UL)
  479. return -EINVAL;
  480. /* Now construct the final physical address. */
  481. if (mmap_state == pci_mmap_io)
  482. vma->vm_pgoff = (((largest_base & ~0xffffffUL) | user32) >> PAGE_SHIFT);
  483. else
  484. vma->vm_pgoff = (((largest_base & ~(pci_memspace_mask)) | user32) >> PAGE_SHIFT);
  485. return 0;
  486. }
  487. /* Set vm_flags of VMA, as appropriate for this architecture, for a pci device
  488. * mapping.
  489. */
  490. static void __pci_mmap_set_flags(struct pci_dev *dev, struct vm_area_struct *vma,
  491. enum pci_mmap_state mmap_state)
  492. {
  493. vma->vm_flags |= (VM_IO | VM_RESERVED);
  494. }
  495. /* Set vm_page_prot of VMA, as appropriate for this architecture, for a pci
  496. * device mapping.
  497. */
  498. static void __pci_mmap_set_pgprot(struct pci_dev *dev, struct vm_area_struct *vma,
  499. enum pci_mmap_state mmap_state)
  500. {
  501. /* Our io_remap_pfn_range takes care of this, do nothing. */
  502. }
  503. /* Perform the actual remap of the pages for a PCI device mapping, as appropriate
  504. * for this architecture. The region in the process to map is described by vm_start
  505. * and vm_end members of VMA, the base physical address is found in vm_pgoff.
  506. * The pci device structure is provided so that architectures may make mapping
  507. * decisions on a per-device or per-bus basis.
  508. *
  509. * Returns a negative error code on failure, zero on success.
  510. */
  511. int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
  512. enum pci_mmap_state mmap_state,
  513. int write_combine)
  514. {
  515. int ret;
  516. ret = __pci_mmap_make_offset(dev, vma, mmap_state);
  517. if (ret < 0)
  518. return ret;
  519. __pci_mmap_set_flags(dev, vma, mmap_state);
  520. __pci_mmap_set_pgprot(dev, vma, mmap_state);
  521. vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
  522. ret = io_remap_pfn_range(vma, vma->vm_start,
  523. vma->vm_pgoff,
  524. vma->vm_end - vma->vm_start,
  525. vma->vm_page_prot);
  526. if (ret)
  527. return ret;
  528. return 0;
  529. }
  530. /* Return the domain nuber for this pci bus */
  531. int pci_domain_nr(struct pci_bus *pbus)
  532. {
  533. struct pci_pbm_info *pbm = pbus->sysdata;
  534. int ret;
  535. if (pbm == NULL || pbm->parent == NULL) {
  536. ret = -ENXIO;
  537. } else {
  538. struct pci_controller_info *p = pbm->parent;
  539. ret = p->index;
  540. if (p->pbms_same_domain == 0)
  541. ret = ((ret << 1) +
  542. ((pbm == &pbm->parent->pbm_B) ? 1 : 0));
  543. }
  544. return ret;
  545. }
  546. EXPORT_SYMBOL(pci_domain_nr);
  547. int pcibios_prep_mwi(struct pci_dev *dev)
  548. {
  549. /* We set correct PCI_CACHE_LINE_SIZE register values for every
  550. * device probed on this platform. So there is nothing to check
  551. * and this always succeeds.
  552. */
  553. return 0;
  554. }
  555. #endif /* !(CONFIG_PCI) */