blob: cb77e66c969f3263af9c73db14b52df4b5d2598c [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef ASMARM_PCI_H
2#define ASMARM_PCI_H
3
4#ifdef __KERNEL__
Linus Torvalds1da177e2005-04-16 15:20:36 -07005#include <asm-generic/pci-dma-compat.h>
Rob Herringdc8d9662011-06-29 10:59:45 -05006#include <asm-generic/pci-bridge.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07007
Anton Vorontsov52882172010-04-19 13:20:49 +01008#include <asm/mach/pci.h> /* for pci_sys_data */
Russell Kinga09e64f2008-08-05 16:14:15 +01009#include <mach/hardware.h> /* for PCIBIOS_MIN_* */
Linus Torvalds1da177e2005-04-16 15:20:36 -070010
Rob Herringdc8d9662011-06-29 10:59:45 -050011static inline int pcibios_assign_all_busses(void)
12{
13 return pci_has_flag(PCI_REASSIGN_ALL_RSRC);
14}
15
Anton Vorontsov52882172010-04-19 13:20:49 +010016#ifdef CONFIG_PCI_DOMAINS
17static inline int pci_domain_nr(struct pci_bus *bus)
18{
19 struct pci_sys_data *root = bus->sysdata;
20
21 return root->domain;
22}
23
24static inline int pci_proc_domain(struct pci_bus *bus)
25{
26 return pci_domain_nr(bus);
27}
28#endif /* CONFIG_PCI_DOMAINS */
29
Mike Rapoporta8fc0782007-09-23 15:59:52 +010030#ifdef CONFIG_PCI_HOST_ITE8152
31/* ITE bridge requires setting latency timer to avoid early bus access
32 termination by PIC bus mater devices
33*/
34extern void pcibios_set_master(struct pci_dev *dev);
35#else
Linus Torvalds1da177e2005-04-16 15:20:36 -070036static inline void pcibios_set_master(struct pci_dev *dev)
37{
38 /* No special bus mastering setup handling */
39}
Mike Rapoporta8fc0782007-09-23 15:59:52 +010040#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070041
David Shaohua Lic9c3e452005-04-01 00:07:31 -050042static inline void pcibios_penalize_isa_irq(int irq, int active)
Linus Torvalds1da177e2005-04-16 15:20:36 -070043{
44 /* We don't do dynamic PCI IRQ allocation */
45}
46
47/*
48 * The PCI address space does equal the physical memory address space.
49 * The networking and block device layers use this boolean for bounce
50 * buffer decisions.
51 */
Russell King88c381b2008-09-13 21:23:06 +010052#define PCI_DMA_BUS_IS_PHYS (1)
Linus Torvalds1da177e2005-04-16 15:20:36 -070053
Andrew Mortonbb4a61b2005-06-06 23:07:46 -070054#ifdef CONFIG_PCI
David S. Millere24c2d92005-06-02 12:55:50 -070055static inline void pci_dma_burst_advice(struct pci_dev *pdev,
56 enum pci_dma_burst_strategy *strat,
57 unsigned long *strategy_parameter)
58{
59 *strat = PCI_DMA_BURST_INFINITY;
60 *strategy_parameter = ~0UL;
61}
Andrew Mortonbb4a61b2005-06-06 23:07:46 -070062#endif
David S. Millere24c2d92005-06-02 12:55:50 -070063
Linus Torvalds1da177e2005-04-16 15:20:36 -070064#define HAVE_PCI_MMAP
65extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
66 enum pci_mmap_state mmap_state, int write_combine);
67
68extern void
69pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
70 struct resource *res);
71
Dominik Brodowski43c34732005-08-04 18:06:21 -070072extern void
73pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
74 struct pci_bus_region *region);
75
Russell Kingdd438e72008-07-25 20:55:52 +010076/*
77 * Dummy implementation; always return 0.
78 */
79static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
80{
81 return 0;
82}
83
Linus Torvalds1da177e2005-04-16 15:20:36 -070084#endif /* __KERNEL__ */
85
86#endif