21 #ifdef CONFIG_TOSHIBA_FPCIB0
23 #include <linux/slab.h>
24 #include <asm/i8259.h>
35 fake_dev.bus = &fake_bus;
37 fake_dev.devfn =
devfn;
38 fake_bus.number =
bus;
39 fake_bus.sysdata = hose;
40 fake_bus.
ops = hose->pci_ops;
44 fake_bus.parent = &fake_bus;
46 fake_bus.parent =
NULL;
48 return pci_read_config_word(&fake_dev, offset, value);
64 for (pci_devfn = 0; pci_devfn < 0xff; pci_devfn++) {
67 if (early_read_config_word(hose, top_bus, current_bus,
78 early_read_config_word(hose, top_bus, current_bus,
82 "PCI: %02x:%02x not 66MHz capable.\n",
83 current_bus, pci_devfn);
92 static struct resource primary_pci_mem_res[2] = {
93 { .name =
"PCI MEM" },
94 { .name =
"PCI MMIO" },
96 static struct resource primary_pci_io_res = { .name =
"PCI IO" };
98 .mem_resource = &primary_pci_mem_res[0],
99 .io_resource = &primary_pci_io_res,
117 unsigned long io_base,
unsigned long io_size)
124 int min_size = 0x10000;
130 new->r_mem[0].name =
"PCI mem";
131 new->r_mem[1].name =
"PCI mmio";
132 new->r_io.name =
"PCI io";
133 new->c.mem_resource =
new->r_mem;
134 new->c.io_resource = &
new->r_io;
137 BUG_ON(pcic != &txx9_primary_pcic);
145 pcic->mem_resource[0].start =
mem_base;
146 pcic->mem_resource[0].end = mem_base + mem_size - 1;
150 unsigned long min = 0,
max = 0x20000000;
153 if (txx9_pci_mem_high)
154 mem_size = 0x20000000;
156 mem_size = 0x08000000;
158 if (txx9_pci_mem_high) {
163 for (; mem_size >= min_size; mem_size /= 2) {
165 &pcic->mem_resource[0],
170 if (mem_size < min_size)
176 pcic->mem_resource[1].start =
io_base;
177 pcic->mem_resource[1].end = io_base + io_size - 1;
179 goto release_and_exit;
183 io_size = 0x01000000;
185 for (; io_size >= min_size; io_size /= 2) {
187 &pcic->mem_resource[1],
188 io_size, 0, 0x20000000,
192 if (io_size < min_size)
193 goto release_and_exit;
194 io_base = pcic->mem_resource[1].start;
198 if (pcic == &txx9_primary_pcic &&
201 set_io_port_base(
IO_BASE + pcic->mem_resource[1].start);
202 pcic->io_resource->start = 0;
204 pcic->io_map_base =
IO_BASE + pcic->mem_resource[1].start;
207 pcic->io_resource->start =
212 pcic->io_resource->end = pcic->io_resource->start + io_size - 1;
214 pcic->mem_offset = 0;
217 &pcic->mem_resource[1], &pcic->mem_resource[0]);
231 txx9_arch_pci_init(
void)
240 #ifdef CONFIG_PICMG_PCI_BACKPLANE_DEFAULT
247 #ifdef CONFIG_TOSHIBA_FPCIB0
260 txx9_i8259_irq_setup(
int irq)
266 "cascade(i8259)", (
void *)(
long)irq);
281 txx9_i8259_irq_setup(irq);
282 pci_read_config_byte(dev, 0x64, ®_64);
283 pci_read_config_dword(dev, 0xb0, ®_b0);
284 pci_read_config_byte(dev, 0xe1, ®_e1);
288 reg_b0 |= 0x00010000;
292 pci_write_config_byte(dev, 0x64, reg_64);
293 pci_write_config_dword(dev, 0xb0, reg_b0);
294 pci_write_config_byte(dev, 0xe1, reg_e1);
310 int regs[2] = {0x41, 0x43};
319 pci_read_config_byte(dev, regs[i], &dat);
320 pci_write_config_byte(dev, regs[i], dat | 0x80);
321 pci_read_config_byte(dev, regs[i], &dat);
324 pci_read_config_byte(dev, 0x5c, &dat);
335 pci_write_config_byte(dev, regs[i], dat);
336 pci_read_config_byte(dev, 0x5c, &dat);
364 pci_read_config_byte(dev,
PCI_BIST, &bist);
375 #ifdef CONFIG_TOSHIBA_FPCIB0
376 #define PCI_DEVICE_ID_EFAR_SLC90E66_0 0x9460
378 quirk_slc90e66_bridge);
401 char * (*txx9_board_pcibios_setup)(
char *
str) __initdata;
407 if (!
strcmp(str,
"picmg")) {
412 }
else if (!
strcmp(str,
"nopicmg")) {
417 }
else if (!
strncmp(str,
"clk=", 4)) {
420 if (
strcmp(val,
"33") == 0)
422 else if (
strcmp(val,
"66") == 0)
427 }
else if (!
strncmp(str,
"err=", 4)) {
428 if (!
strcmp(str + 4,
"panic"))
430 else if (!
strcmp(str + 4,
"ignore"))