Merge branch 'pci/resource' into next
* pci/resource: microblaze/PCI: Remove pcibios_setup_bus_{self/devices} dead code ARC: Remove empty kernel/pcibios.c PCI: Add a generic weak pcibios_align_resource() PCI: Add a generic weak pcibios_fixup_bus()
This commit is contained in:
commit
9198407e23
|
@ -12,7 +12,6 @@ obj-y := arcksyms.o setup.o irq.o reset.o ptrace.o process.o devtree.o
|
|||
obj-y += signal.o traps.o sys.o troubleshoot.o stacktrace.o disasm.o
|
||||
obj-$(CONFIG_ISA_ARCOMPACT) += entry-compact.o intc-compact.o
|
||||
obj-$(CONFIG_ISA_ARCV2) += entry-arcv2.o intc-arcv2.o
|
||||
obj-$(CONFIG_PCI) += pcibios.o
|
||||
|
||||
obj-$(CONFIG_MODULES) += arcksyms.o module.o
|
||||
obj-$(CONFIG_SMP) += smp.o
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2014-2015 Synopsys, Inc. (www.synopsys.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#include <linux/pci.h>
|
||||
|
||||
/*
|
||||
* We don't have to worry about legacy ISA devices, so nothing to do here
|
||||
*/
|
||||
resource_size_t pcibios_align_resource(void *data, const struct resource *res,
|
||||
resource_size_t size, resource_size_t align)
|
||||
{
|
||||
return res->start;
|
||||
}
|
||||
|
||||
void pcibios_fixup_bus(struct pci_bus *bus)
|
||||
{
|
||||
}
|
|
@ -22,23 +22,6 @@
|
|||
#include <linux/pci-ecam.h>
|
||||
#include <linux/slab.h>
|
||||
|
||||
/*
|
||||
* Called after each bus is probed, but before its children are examined
|
||||
*/
|
||||
void pcibios_fixup_bus(struct pci_bus *bus)
|
||||
{
|
||||
/* nothing to do, expected to be removed in the future */
|
||||
}
|
||||
|
||||
/*
|
||||
* We don't have to worry about legacy ISA devices, so nothing to do here
|
||||
*/
|
||||
resource_size_t pcibios_align_resource(void *data, const struct resource *res,
|
||||
resource_size_t size, resource_size_t align)
|
||||
{
|
||||
return res->start;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_ACPI
|
||||
/*
|
||||
* Try to assign the IRQ number when probing a new device
|
||||
|
|
|
@ -2,10 +2,6 @@
|
|||
#include <linux/kernel.h>
|
||||
#include <hwregs/intr_vect.h>
|
||||
|
||||
void pcibios_fixup_bus(struct pci_bus *b)
|
||||
{
|
||||
}
|
||||
|
||||
void pcibios_set_master(struct pci_dev *dev)
|
||||
{
|
||||
u8 lat;
|
||||
|
|
|
@ -411,13 +411,6 @@ pcibios_disable_device (struct pci_dev *dev)
|
|||
acpi_pci_irq_disable(dev);
|
||||
}
|
||||
|
||||
resource_size_t
|
||||
pcibios_align_resource (void *data, const struct resource *res,
|
||||
resource_size_t size, resource_size_t align)
|
||||
{
|
||||
return res->start;
|
||||
}
|
||||
|
||||
/**
|
||||
* ia64_pci_get_legacy_mem - generic legacy mem routine
|
||||
* @bus: bus to get legacy memory base address for
|
||||
|
|
|
@ -81,9 +81,6 @@ extern pgprot_t pci_phys_mem_access_prot(struct file *file,
|
|||
|
||||
#define HAVE_ARCH_PCI_RESOURCE_TO_USER
|
||||
|
||||
extern void pcibios_setup_bus_devices(struct pci_bus *bus);
|
||||
extern void pcibios_setup_bus_self(struct pci_bus *bus);
|
||||
|
||||
/* This part of code was originally in xilinx-pci.h */
|
||||
#ifdef CONFIG_PCI_XILINX
|
||||
extern void __init xilinx_pci_init(void);
|
||||
|
|
|
@ -678,144 +678,6 @@ static void pcibios_fixup_resources(struct pci_dev *dev)
|
|||
}
|
||||
DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, pcibios_fixup_resources);
|
||||
|
||||
/* This function tries to figure out if a bridge resource has been initialized
|
||||
* by the firmware or not. It doesn't have to be absolutely bullet proof, but
|
||||
* things go more smoothly when it gets it right. It should covers cases such
|
||||
* as Apple "closed" bridge resources and bare-metal pSeries unassigned bridges
|
||||
*/
|
||||
static int pcibios_uninitialized_bridge_resource(struct pci_bus *bus,
|
||||
struct resource *res)
|
||||
{
|
||||
struct pci_controller *hose = pci_bus_to_host(bus);
|
||||
struct pci_dev *dev = bus->self;
|
||||
resource_size_t offset;
|
||||
u16 command;
|
||||
int i;
|
||||
|
||||
/* Job is a bit different between memory and IO */
|
||||
if (res->flags & IORESOURCE_MEM) {
|
||||
/* If the BAR is non-0 (res != pci_mem_offset) then it's
|
||||
* probably been initialized by somebody
|
||||
*/
|
||||
if (res->start != hose->pci_mem_offset)
|
||||
return 0;
|
||||
|
||||
/* The BAR is 0, let's check if memory decoding is enabled on
|
||||
* the bridge. If not, we consider it unassigned
|
||||
*/
|
||||
pci_read_config_word(dev, PCI_COMMAND, &command);
|
||||
if ((command & PCI_COMMAND_MEMORY) == 0)
|
||||
return 1;
|
||||
|
||||
/* Memory decoding is enabled and the BAR is 0. If any of
|
||||
* the bridge resources covers that starting address (0 then
|
||||
* it's good enough for us for memory
|
||||
*/
|
||||
for (i = 0; i < 3; i++) {
|
||||
if ((hose->mem_resources[i].flags & IORESOURCE_MEM) &&
|
||||
hose->mem_resources[i].start == hose->pci_mem_offset)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Well, it starts at 0 and we know it will collide so we may as
|
||||
* well consider it as unassigned. That covers the Apple case.
|
||||
*/
|
||||
return 1;
|
||||
} else {
|
||||
/* If the BAR is non-0, then we consider it assigned */
|
||||
offset = (unsigned long)hose->io_base_virt - _IO_BASE;
|
||||
if (((res->start - offset) & 0xfffffffful) != 0)
|
||||
return 0;
|
||||
|
||||
/* Here, we are a bit different than memory as typically IO
|
||||
* space starting at low addresses -is- valid. What we do
|
||||
* instead if that we consider as unassigned anything that
|
||||
* doesn't have IO enabled in the PCI command register,
|
||||
* and that's it.
|
||||
*/
|
||||
pci_read_config_word(dev, PCI_COMMAND, &command);
|
||||
if (command & PCI_COMMAND_IO)
|
||||
return 0;
|
||||
|
||||
/* It's starting at 0 and IO is disabled in the bridge, consider
|
||||
* it unassigned
|
||||
*/
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Fixup resources of a PCI<->PCI bridge */
|
||||
static void pcibios_fixup_bridge(struct pci_bus *bus)
|
||||
{
|
||||
struct resource *res;
|
||||
int i;
|
||||
|
||||
struct pci_dev *dev = bus->self;
|
||||
|
||||
pci_bus_for_each_resource(bus, res, i) {
|
||||
if (!res)
|
||||
continue;
|
||||
if (!res->flags)
|
||||
continue;
|
||||
if (i >= 3 && bus->self->transparent)
|
||||
continue;
|
||||
|
||||
pr_debug("PCI:%s Bus rsrc %d %016llx-%016llx [%x] fixup...\n",
|
||||
pci_name(dev), i,
|
||||
(unsigned long long)res->start,
|
||||
(unsigned long long)res->end,
|
||||
(unsigned int)res->flags);
|
||||
|
||||
/* Try to detect uninitialized P2P bridge resources,
|
||||
* and clear them out so they get re-assigned later
|
||||
*/
|
||||
if (pcibios_uninitialized_bridge_resource(bus, res)) {
|
||||
res->flags = 0;
|
||||
pr_debug("PCI:%s (unassigned)\n",
|
||||
pci_name(dev));
|
||||
} else {
|
||||
pr_debug("PCI:%s %016llx-%016llx\n",
|
||||
pci_name(dev),
|
||||
(unsigned long long)res->start,
|
||||
(unsigned long long)res->end);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void pcibios_setup_bus_self(struct pci_bus *bus)
|
||||
{
|
||||
/* Fix up the bus resources for P2P bridges */
|
||||
if (bus->self != NULL)
|
||||
pcibios_fixup_bridge(bus);
|
||||
}
|
||||
|
||||
void pcibios_setup_bus_devices(struct pci_bus *bus)
|
||||
{
|
||||
struct pci_dev *dev;
|
||||
|
||||
pr_debug("PCI: Fixup bus devices %d (%s)\n",
|
||||
bus->number, bus->self ? pci_name(bus->self) : "PHB");
|
||||
|
||||
list_for_each_entry(dev, &bus->devices, bus_list) {
|
||||
/* Setup OF node pointer in archdata */
|
||||
dev->dev.of_node = pci_device_to_OF_node(dev);
|
||||
|
||||
/* Fixup NUMA node as it may not be setup yet by the generic
|
||||
* code and is needed by the DMA init
|
||||
*/
|
||||
set_dev_node(&dev->dev, pcibus_to_node(dev->bus));
|
||||
|
||||
/* Read default IRQs and fixup if necessary */
|
||||
dev->irq = of_irq_parse_and_map_pci(dev, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void pcibios_fixup_bus(struct pci_bus *bus)
|
||||
{
|
||||
/* nothing to do */
|
||||
}
|
||||
EXPORT_SYMBOL(pcibios_fixup_bus);
|
||||
|
||||
/*
|
||||
* We need to avoid collisions with `mirrored' VGA ports
|
||||
* and other strange ISA hardware, so we always want the
|
||||
|
@ -829,13 +691,6 @@ EXPORT_SYMBOL(pcibios_fixup_bus);
|
|||
* but we want to try to avoid allocating at 0x2900-0x2bff
|
||||
* which might have be mirrored at 0x0100-0x03ff..
|
||||
*/
|
||||
resource_size_t pcibios_align_resource(void *data, const struct resource *res,
|
||||
resource_size_t size, resource_size_t align)
|
||||
{
|
||||
return res->start;
|
||||
}
|
||||
EXPORT_SYMBOL(pcibios_align_resource);
|
||||
|
||||
int pcibios_add_device(struct pci_dev *dev)
|
||||
{
|
||||
dev->irq = of_irq_parse_and_map_pci(dev, 0, 0);
|
||||
|
|
|
@ -262,10 +262,6 @@ static int zpci_cfg_store(struct zpci_dev *zdev, int offset, u32 val, u8 len)
|
|||
return rc;
|
||||
}
|
||||
|
||||
void pcibios_fixup_bus(struct pci_bus *bus)
|
||||
{
|
||||
}
|
||||
|
||||
resource_size_t pcibios_align_resource(void *data, const struct resource *res,
|
||||
resource_size_t size,
|
||||
resource_size_t align)
|
||||
|
|
|
@ -163,14 +163,6 @@ static int __init pcibios_init(void)
|
|||
}
|
||||
subsys_initcall(pcibios_init);
|
||||
|
||||
/*
|
||||
* Called after each bus is probed, but before its children
|
||||
* are examined.
|
||||
*/
|
||||
void pcibios_fixup_bus(struct pci_bus *bus)
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
* We need to avoid collisions with `mirrored' VGA ports
|
||||
* and other strange ISA hardware, so we always want the
|
||||
|
|
|
@ -106,9 +106,3 @@ void pcibios_fixup_bus(struct pci_bus *pbus)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
resource_size_t pcibios_align_resource(void *data, const struct resource *res,
|
||||
resource_size_t size, resource_size_t align)
|
||||
{
|
||||
return res->start;
|
||||
}
|
||||
|
|
|
@ -690,16 +690,6 @@ struct pci_bus *pci_scan_one_pbm(struct pci_pbm_info *pbm,
|
|||
return bus;
|
||||
}
|
||||
|
||||
void pcibios_fixup_bus(struct pci_bus *pbus)
|
||||
{
|
||||
}
|
||||
|
||||
resource_size_t pcibios_align_resource(void *data, const struct resource *res,
|
||||
resource_size_t size, resource_size_t align)
|
||||
{
|
||||
return res->start;
|
||||
}
|
||||
|
||||
int pcibios_enable_device(struct pci_dev *dev, int mask)
|
||||
{
|
||||
u16 cmd, oldcmd;
|
||||
|
|
|
@ -746,12 +746,6 @@ static void watchdog_reset() {
|
|||
}
|
||||
#endif
|
||||
|
||||
resource_size_t pcibios_align_resource(void *data, const struct resource *res,
|
||||
resource_size_t size, resource_size_t align)
|
||||
{
|
||||
return res->start;
|
||||
}
|
||||
|
||||
int pcibios_enable_device(struct pci_dev *pdev, int mask)
|
||||
{
|
||||
return 0;
|
||||
|
|
|
@ -66,16 +66,6 @@ static int pci_scan_flags[TILE_NUM_PCIE];
|
|||
static struct pci_ops tile_cfg_ops;
|
||||
|
||||
|
||||
/*
|
||||
* We don't need to worry about the alignment of resources.
|
||||
*/
|
||||
resource_size_t pcibios_align_resource(void *data, const struct resource *res,
|
||||
resource_size_t size, resource_size_t align)
|
||||
{
|
||||
return res->start;
|
||||
}
|
||||
EXPORT_SYMBOL(pcibios_align_resource);
|
||||
|
||||
/*
|
||||
* Open a FD to the hypervisor PCI device.
|
||||
*
|
||||
|
@ -380,14 +370,6 @@ int __init pcibios_init(void)
|
|||
}
|
||||
subsys_initcall(pcibios_init);
|
||||
|
||||
/*
|
||||
* No bus fixups needed.
|
||||
*/
|
||||
void pcibios_fixup_bus(struct pci_bus *bus)
|
||||
{
|
||||
/* Nothing needs to be done. */
|
||||
}
|
||||
|
||||
void pcibios_set_master(struct pci_dev *dev)
|
||||
{
|
||||
/* No special bus mastering setup handling. */
|
||||
|
|
|
@ -108,15 +108,6 @@ static struct pci_ops tile_cfg_ops;
|
|||
/* Mask of CPUs that should receive PCIe interrupts. */
|
||||
static struct cpumask intr_cpus_map;
|
||||
|
||||
/* We don't need to worry about the alignment of resources. */
|
||||
resource_size_t pcibios_align_resource(void *data, const struct resource *res,
|
||||
resource_size_t size,
|
||||
resource_size_t align)
|
||||
{
|
||||
return res->start;
|
||||
}
|
||||
EXPORT_SYMBOL(pcibios_align_resource);
|
||||
|
||||
/*
|
||||
* Pick a CPU to receive and handle the PCIe interrupts, based on the IRQ #.
|
||||
* For now, we simply send interrupts to non-dataplane CPUs.
|
||||
|
@ -1049,11 +1040,6 @@ int __init pcibios_init(void)
|
|||
}
|
||||
subsys_initcall(pcibios_init);
|
||||
|
||||
/* No bus fixups needed. */
|
||||
void pcibios_fixup_bus(struct pci_bus *bus)
|
||||
{
|
||||
}
|
||||
|
||||
/* Process any "pci=" kernel boot arguments. */
|
||||
char *__init pcibios_setup(char *str)
|
||||
{
|
||||
|
|
|
@ -2344,6 +2344,15 @@ void pcie_bus_configure_settings(struct pci_bus *bus)
|
|||
}
|
||||
EXPORT_SYMBOL_GPL(pcie_bus_configure_settings);
|
||||
|
||||
/*
|
||||
* Called after each bus is probed, but before its children are examined. This
|
||||
* is marked as __weak because multiple architectures define it.
|
||||
*/
|
||||
void __weak pcibios_fixup_bus(struct pci_bus *bus)
|
||||
{
|
||||
/* nothing to do, expected to be removed in the future */
|
||||
}
|
||||
|
||||
unsigned int pci_scan_child_bus(struct pci_bus *bus)
|
||||
{
|
||||
unsigned int devfn, pass, max = bus->busn_res.start;
|
||||
|
|
|
@ -234,6 +234,19 @@ static int pci_revert_fw_address(struct resource *res, struct pci_dev *dev,
|
|||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* We don't have to worry about legacy ISA devices, so nothing to do here.
|
||||
* This is marked as __weak because multiple architectures define it; it should
|
||||
* eventually go away.
|
||||
*/
|
||||
resource_size_t __weak pcibios_align_resource(void *data,
|
||||
const struct resource *res,
|
||||
resource_size_t size,
|
||||
resource_size_t align)
|
||||
{
|
||||
return res->start;
|
||||
}
|
||||
|
||||
static int __pci_assign_resource(struct pci_bus *bus, struct pci_dev *dev,
|
||||
int resno, resource_size_t size, resource_size_t align)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue