Commit 8a4b6958 authored by Ivan Kokshaysky's avatar Ivan Kokshaysky Committed by Richard Henderson

[PATCH] alpha PCI setup update

Until now, we were configuring all PCI resources from scratch.
This patch allows to use unchanged PCI setup on platforms
where the firmware does it reasonably well (titan and marvel).

[The patch to setup-bus.c that removes "FIXME" from here (ie makes
pci_assign_unassigned_resources to match its name) exists at least
for two months, but I've yet to convince Linus that it does the
right thing...]

Ivan.
parent 235b9607
...@@ -42,6 +42,8 @@ const char *const pci_mem_names[] = { ...@@ -42,6 +42,8 @@ const char *const pci_mem_names[] = {
const char pci_hae0_name[] = "HAE0"; const char pci_hae0_name[] = "HAE0";
/* Indicate whether we respect the PCI setup left by console. */
int __initdata pci_probe_only;
/* /*
* The PCI controller list. * The PCI controller list.
...@@ -270,6 +272,10 @@ pcibios_fixup_bus(struct pci_bus *bus) ...@@ -270,6 +272,10 @@ pcibios_fixup_bus(struct pci_bus *bus)
end = hose->mem_space->start + pci_mem_end; end = hose->mem_space->start + pci_mem_end;
if (hose->mem_space->end > end) if (hose->mem_space->end > end)
hose->mem_space->end = end; hose->mem_space->end = end;
} else if (pci_probe_only &&
(dev->class >> 8) == PCI_CLASS_BRIDGE_PCI) {
pci_read_bridge_bases(bus);
pcibios_fixup_device_resources(dev, bus);
} }
for (ln = bus->devices.next; ln != &bus->devices; ln = ln->next) { for (ln = bus->devices.next; ln != &bus->devices; ln = ln->next) {
...@@ -407,6 +413,30 @@ pcibios_set_master(struct pci_dev *dev) ...@@ -407,6 +413,30 @@ pcibios_set_master(struct pci_dev *dev)
pci_write_config_byte(dev, PCI_LATENCY_TIMER, 64); pci_write_config_byte(dev, PCI_LATENCY_TIMER, 64);
} }
static void __init
pcibios_claim_console_setup(void)
{
struct list_head *lb;
for(lb = pci_root_buses.next; lb != &pci_root_buses; lb = lb->next) {
struct pci_bus *b = pci_bus_b(lb);
struct list_head *ld;
for (ld = b->devices.next; ld != &b->devices; ld = ld->next) {
struct pci_dev *dev = pci_dev_b(ld);
int i;
for (i = 0; i < PCI_NUM_RESOURCES; i++) {
struct resource *r = &dev->resource[i];
if (r->parent || !r->start || !r->flags)
continue;
pci_claim_resource(dev, i);
}
}
}
}
void __init void __init
common_init_pci(void) common_init_pci(void)
{ {
...@@ -424,6 +454,11 @@ common_init_pci(void) ...@@ -424,6 +454,11 @@ common_init_pci(void)
next_busno += 1; next_busno += 1;
} }
if (pci_probe_only)
pcibios_claim_console_setup();
else /* FIXME: `else' will be removed when
pci_assign_unassigned_resources() is able to work
correctly with [partially] allocated PCI tree. */
pci_assign_unassigned_resources(); pci_assign_unassigned_resources();
pci_fixup_irqs(alpha_mv.pci_swizzle, alpha_mv.pci_map_irq); pci_fixup_irqs(alpha_mv.pci_swizzle, alpha_mv.pci_map_irq);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment