Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 96702be5 authored by Bjorn Helgaas's avatar Bjorn Helgaas
Browse files

Merge branch 'pci/resource' into next

* pci/resource:
  PCI: Allocate 64-bit BARs above 4G when possible
  PCI: Enforce bus address limits in resource allocation
  PCI: Split out bridge window override of minimum allocation address
  agp/ati: Use PCI_COMMAND instead of hard-coded 4
  agp/intel: Use CPU physical address, not bus address, for ioremap()
  agp/intel: Use pci_bus_address() to get GTTADR bus address
  agp/intel: Use pci_bus_address() to get MMADR bus address
  agp/intel: Support 64-bit GMADR
  agp/intel: Rename gtt_bus_addr to gtt_phys_addr
  drm/i915: Rename gtt_bus_addr to gtt_phys_addr
  agp: Use pci_resource_start() to get CPU physical address for BAR
  agp: Support 64-bit APBASE
  PCI: Add pci_bus_address() to get bus address of a BAR
  PCI: Convert pcibios_resource_to_bus() to take a pci_bus, not a pci_dev
  PCI: Change pci_bus_region addresses to dma_addr_t
parents 04f982be d56dbf5b
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -83,7 +83,7 @@ static int pci_mmap_resource(struct kobject *kobj,
	if (iomem_is_exclusive(res->start))
	if (iomem_is_exclusive(res->start))
		return -EINVAL;
		return -EINVAL;


	pcibios_resource_to_bus(pdev, &bar, res);
	pcibios_resource_to_bus(pdev->bus, &bar, res);
	vma->vm_pgoff += bar.start >> (PAGE_SHIFT - (sparse ? 5 : 0));
	vma->vm_pgoff += bar.start >> (PAGE_SHIFT - (sparse ? 5 : 0));
	mmap_type = res->flags & IORESOURCE_MEM ? pci_mmap_mem : pci_mmap_io;
	mmap_type = res->flags & IORESOURCE_MEM ? pci_mmap_mem : pci_mmap_io;


@@ -139,7 +139,7 @@ static int sparse_mem_mmap_fits(struct pci_dev *pdev, int num)
	long dense_offset;
	long dense_offset;
	unsigned long sparse_size;
	unsigned long sparse_size;


	pcibios_resource_to_bus(pdev, &bar, &pdev->resource[num]);
	pcibios_resource_to_bus(pdev->bus, &bar, &pdev->resource[num]);


	/* All core logic chips have 4G sparse address space, except
	/* All core logic chips have 4G sparse address space, except
	   CIA which has 16G (see xxx_SPARSE_MEM and xxx_DENSE_MEM
	   CIA which has 16G (see xxx_SPARSE_MEM and xxx_DENSE_MEM
+2 −2
Original line number Original line Diff line number Diff line
@@ -835,7 +835,7 @@ static void pcibios_fixup_resources(struct pci_dev *dev)
		 * at 0 as unset as well, except if PCI_PROBE_ONLY is also set
		 * at 0 as unset as well, except if PCI_PROBE_ONLY is also set
		 * since in that case, we don't want to re-assign anything
		 * since in that case, we don't want to re-assign anything
		 */
		 */
		pcibios_resource_to_bus(dev, &reg, res);
		pcibios_resource_to_bus(dev->bus, &reg, res);
		if (pci_has_flag(PCI_REASSIGN_ALL_RSRC) ||
		if (pci_has_flag(PCI_REASSIGN_ALL_RSRC) ||
		    (reg.start == 0 && !pci_has_flag(PCI_PROBE_ONLY))) {
		    (reg.start == 0 && !pci_has_flag(PCI_PROBE_ONLY))) {
			/* Only print message if not re-assigning */
			/* Only print message if not re-assigning */
@@ -886,7 +886,7 @@ static int pcibios_uninitialized_bridge_resource(struct pci_bus *bus,


	/* Job is a bit different between memory and IO */
	/* Job is a bit different between memory and IO */
	if (res->flags & IORESOURCE_MEM) {
	if (res->flags & IORESOURCE_MEM) {
		pcibios_resource_to_bus(dev, &region, res);
		pcibios_resource_to_bus(dev->bus, &region, res);


		/* If the BAR is non-0 then it's probably been initialized */
		/* If the BAR is non-0 then it's probably been initialized */
		if (region.start != 0)
		if (region.start != 0)
+2 −2
Original line number Original line Diff line number Diff line
@@ -111,7 +111,7 @@ static void of_pci_parse_addrs(struct device_node *node, struct pci_dev *dev)
		res->name = pci_name(dev);
		res->name = pci_name(dev);
		region.start = base;
		region.start = base;
		region.end = base + size - 1;
		region.end = base + size - 1;
		pcibios_bus_to_resource(dev, res, &region);
		pcibios_bus_to_resource(dev->bus, res, &region);
	}
	}
}
}


@@ -280,7 +280,7 @@ void of_scan_pci_bridge(struct pci_dev *dev)
		res->flags = flags;
		res->flags = flags;
		region.start = of_read_number(&ranges[1], 2);
		region.start = of_read_number(&ranges[1], 2);
		region.end = region.start + size - 1;
		region.end = region.start + size - 1;
		pcibios_bus_to_resource(dev, res, &region);
		pcibios_bus_to_resource(dev->bus, res, &region);
	}
	}
	sprintf(bus->name, "PCI Bus %04x:%02x", pci_domain_nr(bus),
	sprintf(bus->name, "PCI Bus %04x:%02x", pci_domain_nr(bus),
		bus->number);
		bus->number);
+3 −3
Original line number Original line Diff line number Diff line
@@ -392,7 +392,7 @@ static void apb_fake_ranges(struct pci_dev *dev,
	res->flags = IORESOURCE_IO;
	res->flags = IORESOURCE_IO;
	region.start = (first << 21);
	region.start = (first << 21);
	region.end = (last << 21) + ((1 << 21) - 1);
	region.end = (last << 21) + ((1 << 21) - 1);
	pcibios_bus_to_resource(dev, res, &region);
	pcibios_bus_to_resource(dev->bus, res, &region);


	pci_read_config_byte(dev, APB_MEM_ADDRESS_MAP, &map);
	pci_read_config_byte(dev, APB_MEM_ADDRESS_MAP, &map);
	apb_calc_first_last(map, &first, &last);
	apb_calc_first_last(map, &first, &last);
@@ -400,7 +400,7 @@ static void apb_fake_ranges(struct pci_dev *dev,
	res->flags = IORESOURCE_MEM;
	res->flags = IORESOURCE_MEM;
	region.start = (first << 29);
	region.start = (first << 29);
	region.end = (last << 29) + ((1 << 29) - 1);
	region.end = (last << 29) + ((1 << 29) - 1);
	pcibios_bus_to_resource(dev, res, &region);
	pcibios_bus_to_resource(dev->bus, res, &region);
}
}


static void pci_of_scan_bus(struct pci_pbm_info *pbm,
static void pci_of_scan_bus(struct pci_pbm_info *pbm,
@@ -491,7 +491,7 @@ static void of_scan_pci_bridge(struct pci_pbm_info *pbm,
		res->flags = flags;
		res->flags = flags;
		region.start = GET_64BIT(ranges, 1);
		region.start = GET_64BIT(ranges, 1);
		region.end = region.start + size - 1;
		region.end = region.start + size - 1;
		pcibios_bus_to_resource(dev, res, &region);
		pcibios_bus_to_resource(dev->bus, res, &region);
	}
	}
after_ranges:
after_ranges:
	sprintf(bus->name, "PCI Bus %04x:%02x", pci_domain_nr(bus),
	sprintf(bus->name, "PCI Bus %04x:%02x", pci_domain_nr(bus),
+0 −1
Original line number Original line Diff line number Diff line
@@ -125,7 +125,6 @@ int setup_msi_irq(struct pci_dev *dev, struct msi_desc *msidesc,


/* generic pci stuff */
/* generic pci stuff */
#include <asm-generic/pci.h>
#include <asm-generic/pci.h>
#define PCIBIOS_MAX_MEM_32 0xffffffff


#ifdef CONFIG_NUMA
#ifdef CONFIG_NUMA
/* Returns the node based on pci bus */
/* Returns the node based on pci bus */
Loading