28 #include <linux/pci.h>
49 0x281022, 0x2200005, 0x6000021, 0x80f808,
51 0x0, 0x0, 0x0, 0x28100b,
59 0xfffffffd, 0x0, 0x0, 0x0,
62 0x28100b, 0x2200005, 0x6000021, 0x80f808,
63 0xac1d, 0x0, 0x0, 0x0,
64 0x0, 0x0, 0x0, 0x28100b,
72 0xff000008, 0xffffc000, 0xffffc000, 0xffffc000,
73 0xffffc000, 0x0, 0x0, 0x0,
75 0x20811022, 0x2200003, 0x3000000, 0x0,
76 0xfd000000, 0xfe000000, 0xfe004000, 0xfe008000,
77 0xfe00c000, 0x0, 0x0, 0x30100b,
80 0x3d0, 0x3c0, 0xa0000, 0x0,
85 0xff800008, 0xffffc000, 0xffffc000, 0xffffc000,
88 0x30100b, 0x2200003, 0x3000000, 0x0,
89 0xfd000000, 0xfe000000, 0xfe004000, 0xfe008000,
90 0x0, 0x0, 0x0, 0x30100b,
93 0x3d0, 0x3c0, 0xa0000, 0x0,
98 0xffffc000, 0x0, 0x0, 0x0,
101 0x20821022, 0x2a00006, 0x10100000, 0x8,
102 0xfe010000, 0x0, 0x0, 0x0,
103 0x0, 0x0, 0x0, 0x20821022,
112 0xfffffff9, 0xffffff01, 0xffffffc1, 0xffffffe1,
113 0xffffff81, 0xffffffc1, 0x0, 0x0,
115 0x20901022, 0x2a00049, 0x6010003, 0x802000,
116 0x18b1, 0x1001, 0x1801, 0x1881,
117 0x1401, 0x1841, 0x0, 0x20901022,
120 0x0, 0x0, 0x0, 0xaa5b,
124 static const uint32_t ac97_hdr[] = {
125 0xffffff81, 0x0, 0x0, 0x0,
128 0x20931022, 0x2a00041, 0x4010001, 0x0,
129 0x1481, 0x0, 0x0, 0x0,
130 0x0, 0x0, 0x0, 0x20931022,
131 0x0, 0x0, 0x0, 0x205,
137 static const uint32_t ohci_hdr[] = {
138 0xfffff000, 0x0, 0x0, 0x0,
141 0x20941022, 0x2300006, 0xc031002, 0x0,
142 0xfe01a000, 0x0, 0x0, 0x0,
143 0x0, 0x0, 0x0, 0x20941022,
144 0x0, 0x40, 0x0, 0x40a,
145 0xc8020001, 0x0, 0x0, 0x0,
151 static const uint32_t ehci_hdr[] = {
152 0xfffff000, 0x0, 0x0, 0x0,
155 0x20951022, 0x2300006, 0xc032002, 0x0,
156 0xfe01b000, 0x0, 0x0, 0x0,
157 0x0, 0x0, 0x0, 0x20951022,
158 0x0, 0x40, 0x0, 0x40a,
159 0xc8020001, 0x0, 0x0, 0x0,
162 0x1, 0x40080000, 0x0, 0x0,
164 0x01000001, 0x0, 0x0, 0x0,
165 0x2020, 0x0, 0x0, 0x0,
171 static int bar_probing;
177 static int is_simulated(
unsigned int bus,
unsigned int devfn)
198 addr = (
uint32_t)hdr + reg + (bar_probing ? -0x10 : 0x20);
204 static int pci_olpc_read(
unsigned int seg,
unsigned int bus,
212 if (!is_simulated(bus, devfn))
224 addr = hdr_addr(is_lx ? lxnb_hdr : gxnb_hdr, reg);
227 addr = hdr_addr(is_lx ? lxfb_hdr : gxfb_hdr, reg);
230 addr = is_lx ? hdr_addr(aes_hdr, reg) : &ff_loc;
233 addr = hdr_addr(isa_hdr, reg);
236 addr = hdr_addr(ac97_hdr, reg);
239 addr = hdr_addr(ohci_hdr, reg);
242 addr = hdr_addr(ehci_hdr, reg);
266 static int pci_olpc_write(
unsigned int seg,
unsigned int bus,
267 unsigned int devfn,
int reg,
int len,
uint32_t value)
272 if (!is_simulated(bus, devfn))
285 if ((reg >= 0x10) && (reg < 0x2c)) {
298 " %x reg %x value %x\n", devfn, reg, value);
305 .read = pci_olpc_read,
306 .write = pci_olpc_write,
313 is_lx = is_geode_lx();