This source file includes following definitions.
- microdev_ioport_map
1
2
3
4
5
6
7
8
9
10
11
12 #include <linux/init.h>
13 #include <linux/pci.h>
14 #include <linux/wait.h>
15 #include <asm/io.h>
16 #include <mach/microdev.h>
17
18
19
20
21
22
23
24
25
26
27
28
29 #define PVR 0xff000030
30
31
32 #define IO_IDE2_BASE 0x170ul
33 #define IO_IDE1_BASE 0x1f0ul
34 #define IO_ISP1161_BASE 0x290ul
35 #define IO_SERIAL2_BASE 0x2f8ul
36 #define IO_LAN91C111_BASE 0x300ul
37 #define IO_IDE2_MISC 0x376ul
38 #define IO_SUPERIO_BASE 0x3f0ul
39 #define IO_IDE1_MISC 0x3f6ul
40 #define IO_SERIAL1_BASE 0x3f8ul
41
42 #define IO_ISP1161_EXTENT 0x04ul
43 #define IO_LAN91C111_EXTENT 0x10ul
44 #define IO_SUPERIO_EXTENT 0x02ul
45 #define IO_IDE_EXTENT 0x08ul
46 #define IO_SERIAL_EXTENT 0x10ul
47
48 #define IO_LAN91C111_PHYS 0xa7500000ul
49 #define IO_ISP1161_PHYS 0xa7700000ul
50 #define IO_SUPERIO_PHYS 0xa7800000ul
51
52
53
54
55 void __iomem *microdev_ioport_map(unsigned long offset, unsigned int len)
56 {
57 unsigned long result;
58
59 if ((offset >= IO_LAN91C111_BASE) &&
60 (offset < IO_LAN91C111_BASE + IO_LAN91C111_EXTENT)) {
61
62
63
64 result = IO_LAN91C111_PHYS + offset - IO_LAN91C111_BASE;
65 } else if ((offset >= IO_SUPERIO_BASE) &&
66 (offset < IO_SUPERIO_BASE + IO_SUPERIO_EXTENT)) {
67
68
69
70
71
72 result = IO_SUPERIO_PHYS + (offset << 1);
73 } else if (((offset >= IO_IDE1_BASE) &&
74 (offset < IO_IDE1_BASE + IO_IDE_EXTENT)) ||
75 (offset == IO_IDE1_MISC)) {
76
77
78
79
80
81 result = IO_SUPERIO_PHYS + (offset << 1);
82 } else if (((offset >= IO_IDE2_BASE) &&
83 (offset < IO_IDE2_BASE + IO_IDE_EXTENT)) ||
84 (offset == IO_IDE2_MISC)) {
85
86
87
88
89
90 result = IO_SUPERIO_PHYS + (offset << 1);
91 } else if ((offset >= IO_SERIAL1_BASE) &&
92 (offset < IO_SERIAL1_BASE + IO_SERIAL_EXTENT)) {
93
94
95
96
97
98 result = IO_SUPERIO_PHYS + (offset << 1);
99 } else if ((offset >= IO_SERIAL2_BASE) &&
100 (offset < IO_SERIAL2_BASE + IO_SERIAL_EXTENT)) {
101
102
103
104
105
106 result = IO_SUPERIO_PHYS + (offset << 1);
107 } else if ((offset >= IO_ISP1161_BASE) &&
108 (offset < IO_ISP1161_BASE + IO_ISP1161_EXTENT)) {
109
110
111
112 result = IO_ISP1161_PHYS + offset - IO_ISP1161_BASE;
113 } else {
114
115
116
117 printk("Warning: unexpected port in %s( offset = 0x%lx )\n",
118 __func__, offset);
119 result = PVR;
120 }
121
122 return (void __iomem *)result;
123 }