2.5.14: New PCI allocation code (alpha, arm, parisc) [2/2]
Subsystems (3)
PATCH 1/1 2.5.14: New PCI allocation code (alpha, arm, parisc) [2/2]
Summary of changes:
- alpha, arm: code related to PCI-PCI bridges from pcibios_fixup_bus() removed - now it's generic;
- pdev_sort_resource: sort resources all together, no matter IO or memory;
- pbus_assign_resources_sorted: ditto;
- pci_bridge_check_ranges, pci_setup_bridge: changed for prefetch support;
- pbus_size_io, pbus_size_mem: core stuff; tested with randomly generated sets of resources;
- pbus_size_bridges: pass #2 (pass #1 is PCI probing, common for all archs);
- pbus_assign_resources: pass #3.
Ivan.
PS. These patches are completely independent to PCI reorg suggested by Greg KH. The only conflict would be in arch/i386/kernel/pci-i386.c (pcibios_align_resource) due to changed location of this file.
arch/alpha/kernel/pci.c +4 -19
@@ -246,25 +246,6 @@ pcibios_fixup_bus(struct pci_bus *bus)/* Root bus */ bus->resource[0 ] = hose->io_space; bus->resource[1 ] = hose->mem_space; - }else { -/* This is a bridge. Do not care how it's initialized, -just link its resources to the bus ones */ -int i; - -for (i=0 ; i<3 ; i++) { - bus->resource[i] = - &dev->resource[PCI_BRIDGE_RESOURCES +i]; - bus->resource[i]->name = bus->name; - } - bus->resource[0 ]->flags |=pci_bridge_check_io (dev); - bus->resource[1 ]->flags |=IORESOURCE_MEM ; -/* For now, propogate hose limits to the bus; -we'll adjust them later. */ - bus->resource[0 ]->end = hose->io_space->end; - bus->resource[1 ]->end = hose->mem_space->end; -/* Turn off downstream PF memory address range by default */ - bus->resource[2 ]->start =1024 *1024 ; - bus->resource[2 ]->end = bus->resource[2 ]->start -1 ; }for (ln = bus->devices.next; ln != &bus->devices; ln = ln->next) {
@@ -349,6 +330,10 @@ pcibios_fixup_pbus_ranges(struct pci_bus ranges->io_end -= hose->io_space->start; ranges->mem_start -= hose->mem_space->start; ranges->mem_end -= hose->mem_space->start; +/* FIXME: On older alphas we could use dense memory space +to access prefetchable resources. */ + ranges->prefetch_start -= hose->mem_space->start; + ranges->prefetch_end -= hose->mem_space->start; }int
arch/arm/kernel/bios32.c +1 -14
@@ -346,20 +346,7 @@ pbus_assign_bus_resources(struct pci_busstruct pci_dev *dev = bus->self;int i; -if (dev) { -for (i =0 ; i <3 ; i++) { -if (root->resource[i]) { - bus->resource[i] = &dev->resource[PCI_BRIDGE_RESOURCES +i]; - bus->resource[i]->end = root->resource[i]->end; - bus->resource[i]->name = bus->name; - } - } - bus->resource[0 ]->flags |=pci_bridge_check_io (dev); - bus->resource[1 ]->flags |=IORESOURCE_MEM ; - -if (bus->resource[2 ] && root->resource[2 ]) - bus->resource[2 ]->flags = root->resource[2 ]->flags; - }else { +if (!dev) {/* * Assign root bus resources. */
include/linux/pci.h +2 -3
@@ -464,9 +464,9 @@ struct pci_ops {struct pbus_set_ranges_data { -int found_vga;unsigned long io_start, io_end;unsigned long mem_start, mem_end; +unsigned long prefetch_start, prefetch_end; };struct pci_device_id {
@@ -583,8 +583,7 @@ int pci_enable_wake(struct pci_dev *dev,int pci_claim_resource (struct pci_dev *,int );void pci_assign_unassigned_resources (void );void pdev_enable_device (struct pci_dev *); -void pdev_sort_resources (struct pci_dev *,struct resource_list *,u32 ); -unsigned long pci_bridge_check_io (struct pci_dev *); +void pdev_sort_resources (struct pci_dev *,struct resource_list *);void pci_fixup_irqs (u8 (*)(struct pci_dev *,u8 *),int (*)(struct pci_dev *,u8 ,u8 ));#define HAVE_PCI_REQ_REGIONS
drivers/pci/setup-bus.c +273 -118
486 lines not on this page · raw message
drivers/pci/setup-res.c +21 -23
68 lines not on this page · raw message