1
2
3
4
5
6
7
8
9
10
11#ifndef _ASM_PCI_H
12#define _ASM_PCI_H
13
14#ifdef __KERNEL__
15#include <linux/mm.h>
16
17#if 0
18#define __pcbdebug(FMT, ADDR, ...) \
19 printk(KERN_DEBUG "PCIBRIDGE[%08x]: "FMT"\n", \
20 (u32)(ADDR), ##__VA_ARGS__)
21
22#define __pcidebug(FMT, BUS, DEVFN, WHERE,...) \
23do { \
24 printk(KERN_DEBUG "PCI[%02x:%02x.%x + %02x]: "FMT"\n", \
25 (BUS)->number, \
26 PCI_SLOT(DEVFN), \
27 PCI_FUNC(DEVFN), \
28 (u32)(WHERE), ##__VA_ARGS__); \
29} while (0)
30
31#else
32#define __pcbdebug(FMT, ADDR, ...) do {} while (0)
33#define __pcidebug(FMT, BUS, DEVFN, WHERE, ...) do {} while (0)
34#endif
35
36
37
38
39
40#ifdef CONFIG_PCI
41#define pcibios_assign_all_busses() 1
42extern void unit_pci_init(void);
43#else
44#define pcibios_assign_all_busses() 0
45#endif
46
47#define PCIBIOS_MIN_IO 0xBE000004
48#define PCIBIOS_MIN_MEM 0xB8000000
49
50void pcibios_set_master(struct pci_dev *dev);
51
52
53
54
55
56#include <linux/types.h>
57#include <linux/slab.h>
58#include <asm/scatterlist.h>
59#include <linux/string.h>
60#include <asm/io.h>
61
62struct pci_dev;
63
64
65
66
67
68#define PCI_DMA_BUS_IS_PHYS (1)
69
70
71static inline int pci_controller_num(struct pci_dev *dev)
72{
73 return 0;
74}
75
76#define HAVE_PCI_MMAP
77extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
78 enum pci_mmap_state mmap_state,
79 int write_combine);
80
81#endif
82
83
84#include <asm-generic/pci-dma-compat.h>
85
86static inline struct resource *
87pcibios_select_root(struct pci_dev *pdev, struct resource *res)
88{
89 struct resource *root = NULL;
90
91 if (res->flags & IORESOURCE_IO)
92 root = &ioport_resource;
93 if (res->flags & IORESOURCE_MEM)
94 root = &iomem_resource;
95
96 return root;
97}
98
99static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
100{
101 return channel ? 15 : 14;
102}
103
104#include <asm-generic/pci_iomap.h>
105
106#endif
107