diff options
Diffstat (limited to 'drivers/pci/setup-bus.c')
-rw-r--r-- | drivers/pci/setup-bus.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index 8fa2d4be88de..dad5425f1f09 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c | |||
@@ -469,16 +469,23 @@ static void pci_setup_bridge_io(struct pci_bus *bus) | |||
469 | struct pci_dev *bridge = bus->self; | 469 | struct pci_dev *bridge = bus->self; |
470 | struct resource *res; | 470 | struct resource *res; |
471 | struct pci_bus_region region; | 471 | struct pci_bus_region region; |
472 | unsigned long io_mask; | ||
473 | u8 io_base_lo, io_limit_lo; | ||
472 | u32 l, io_upper16; | 474 | u32 l, io_upper16; |
473 | 475 | ||
476 | io_mask = PCI_IO_RANGE_MASK; | ||
477 | if (bridge->io_window_1k) | ||
478 | io_mask = PCI_IO_1K_RANGE_MASK; | ||
479 | |||
474 | /* Set up the top and bottom of the PCI I/O segment for this bus. */ | 480 | /* Set up the top and bottom of the PCI I/O segment for this bus. */ |
475 | res = bus->resource[0]; | 481 | res = bus->resource[0]; |
476 | pcibios_resource_to_bus(bridge, ®ion, res); | 482 | pcibios_resource_to_bus(bridge, ®ion, res); |
477 | if (res->flags & IORESOURCE_IO) { | 483 | if (res->flags & IORESOURCE_IO) { |
478 | pci_read_config_dword(bridge, PCI_IO_BASE, &l); | 484 | pci_read_config_dword(bridge, PCI_IO_BASE, &l); |
479 | l &= 0xffff0000; | 485 | l &= 0xffff0000; |
480 | l |= (region.start >> 8) & 0x00f0; | 486 | io_base_lo = (region.start >> 8) & io_mask; |
481 | l |= region.end & 0xf000; | 487 | io_limit_lo = (region.end >> 8) & io_mask; |
488 | l |= ((u32) io_limit_lo << 8) | io_base_lo; | ||
482 | /* Set up upper 16 bits of I/O base/limit. */ | 489 | /* Set up upper 16 bits of I/O base/limit. */ |
483 | io_upper16 = (region.end & 0xffff0000) | (region.start >> 16); | 490 | io_upper16 = (region.end & 0xffff0000) | (region.start >> 16); |
484 | dev_info(&bridge->dev, " bridge window %pR\n", res); | 491 | dev_info(&bridge->dev, " bridge window %pR\n", res); |