blob: 92e2a833693d4c9298bc8eed9d2c8d91b51387eb [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>
6
Anton Vorontsov52882172010-04-19 13:20:49 +01007#include <asm/mach/pci.h> /* for pci_sys_data */
Russell Kinga09e64f2008-08-05 16:14:15 +01008#include <mach/hardware.h> /* for PCIBIOS_MIN_* */
Linus Torvalds1da177e2005-04-16 15:20:36 -07009
Anton Vorontsov52882172010-04-19 13:20:49 +010010#ifdef CONFIG_PCI_DOMAINS
11static inline int pci_domain_nr(struct pci_bus *bus)
12{
13 struct pci_sys_data *root = bus->sysdata;
14
15 return root->domain;
16}
17
18static inline int pci_proc_domain(struct pci_bus *bus)
19{
20 return pci_domain_nr(bus);
21}
22#endif /* CONFIG_PCI_DOMAINS */
23
Mike Rapoporta8fc0782007-09-23 15:59:52 +010024#ifdef CONFIG_PCI_HOST_ITE8152
25/* ITE bridge requires setting latency timer to avoid early bus access
26 termination by PIC bus mater devices
27*/
28extern void pcibios_set_master(struct pci_dev *dev);
29#else
Linus Torvalds1da177e2005-04-16 15:20:36 -070030static inline void pcibios_set_master(struct pci_dev *dev)
31{
32 /* No special bus mastering setup handling */
33}
Mike Rapoporta8fc0782007-09-23 15:59:52 +010034#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070035
David Shaohua Lic9c3e452005-04-01 00:07:31 -050036static inline void pcibios_penalize_isa_irq(int irq, int active)
Linus Torvalds1da177e2005-04-16 15:20:36 -070037{
38 /* We don't do dynamic PCI IRQ allocation */
39}
40
41/*
42 * The PCI address space does equal the physical memory address space.
43 * The networking and block device layers use this boolean for bounce
44 * buffer decisions.
45 */
Russell King88c381b2008-09-13 21:23:06 +010046#define PCI_DMA_BUS_IS_PHYS (1)
Linus Torvalds1da177e2005-04-16 15:20:36 -070047
Andrew Mortonbb4a61b2005-06-06 23:07:46 -070048#ifdef CONFIG_PCI
David S. Millere24c2d92005-06-02 12:55:50 -070049static inline void pci_dma_burst_advice(struct pci_dev *pdev,
50 enum pci_dma_burst_strategy *strat,
51 unsigned long *strategy_parameter)
52{
53 *strat = PCI_DMA_BURST_INFINITY;
54 *strategy_parameter = ~0UL;
55}
Andrew Mortonbb4a61b2005-06-06 23:07:46 -070056#endif
David S. Millere24c2d92005-06-02 12:55:50 -070057
Linus Torvalds1da177e2005-04-16 15:20:36 -070058#define HAVE_PCI_MMAP
59extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
60 enum pci_mmap_state mmap_state, int write_combine);
61
62extern void
63pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
64 struct resource *res);
65
Dominik Brodowski43c34732005-08-04 18:06:21 -070066extern void
67pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
68 struct pci_bus_region *region);
69
Russell Kingdd438e72008-07-25 20:55:52 +010070/*
71 * Dummy implementation; always return 0.
72 */
73static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
74{
75 return 0;
76}
77
Linus Torvalds1da177e2005-04-16 15:20:36 -070078#endif /* __KERNEL__ */
79
80#endif