1#ifndef __ALPHA_PCI_H
2#define __ALPHA_PCI_H
3
4#ifdef __KERNEL__
5
6#include <linux/spinlock.h>
7#include <linux/dma-mapping.h>
8#include <linux/scatterlist.h>
9#include <asm/machvec.h>
10#include <asm-generic/pci-bridge.h>
11
12
13
14
15
16struct pci_dev;
17struct pci_bus;
18struct resource;
19struct pci_iommu_arena;
20struct page;
21
22
23
24struct pci_controller {
25 struct pci_controller *next;
26 struct pci_bus *bus;
27 struct resource *io_space;
28 struct resource *mem_space;
29
30
31
32
33 unsigned long sparse_mem_base;
34 unsigned long dense_mem_base;
35 unsigned long sparse_io_base;
36 unsigned long dense_io_base;
37
38
39 unsigned long config_space_base;
40
41 unsigned int index;
42
43
44 unsigned int need_domain_info;
45
46 struct pci_iommu_arena *sg_pci;
47 struct pci_iommu_arena *sg_isa;
48
49 void *sysdata;
50};
51
52
53
54
55#define pcibios_assign_all_busses() 1
56
57#define PCIBIOS_MIN_IO alpha_mv.min_io_address
58#define PCIBIOS_MIN_MEM alpha_mv.min_mem_address
59
60extern void pcibios_set_master(struct pci_dev *dev);
61
62
63
64
65
66
67#define PCI_DMA_BUS_IS_PHYS 0
68
69#ifdef CONFIG_PCI
70
71
72#include <asm-generic/pci-dma-compat.h>
73
74#endif
75
76
77static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
78{
79 return channel ? 15 : 14;
80}
81
82#define pci_domain_nr(bus) ((struct pci_controller *)(bus)->sysdata)->index
83
84static inline int pci_proc_domain(struct pci_bus *bus)
85{
86 struct pci_controller *hose = bus->sysdata;
87 return hose->need_domain_info;
88}
89
90#endif
91
92
93#define IOBASE_HOSE 0
94#define IOBASE_SPARSE_MEM 1
95#define IOBASE_DENSE_MEM 2
96#define IOBASE_SPARSE_IO 3
97#define IOBASE_DENSE_IO 4
98#define IOBASE_ROOT_BUS 5
99#define IOBASE_FROM_HOSE 0x10000
100
101extern struct pci_dev *isa_bridge;
102
103extern int pci_legacy_read(struct pci_bus *bus, loff_t port, u32 *val,
104 size_t count);
105extern int pci_legacy_write(struct pci_bus *bus, loff_t port, u32 val,
106 size_t count);
107extern int pci_mmap_legacy_page_range(struct pci_bus *bus,
108 struct vm_area_struct *vma,
109 enum pci_mmap_state mmap_state);
110extern void pci_adjust_legacy_attr(struct pci_bus *bus,
111 enum pci_mmap_state mmap_type);
112#define HAVE_PCI_LEGACY 1
113
114extern int pci_create_resource_files(struct pci_dev *dev);
115extern void pci_remove_resource_files(struct pci_dev *dev);
116
117#endif
118