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

Commit daeb4c0c authored by Russell King's avatar Russell King
Browse files

ARM: PCI: get rid of pci_std_swizzle()



Most PCI implementations use the standard PCI swizzle function, which
handles the well defined behaviour of PCI-to-PCI bridges which can be
found on cards (eg, four port ethernet cards.)

Rather than having almost every platform specify the standard swizzle
function, make this the default when no swizzle function is supplied.
Therefore, a swizzle function only needs to be provided when there is
something exceptional which needs to be handled.

This gets rid of the swizzle initializer from 47 files, and leaves us
with just two platforms specifying a swizzle function: ARM Integrator
and Chalice CATS.

Acked-by: default avatarKrzysztof Hałasa <khc@pm.waw.pl>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 1bc39ac5
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -48,11 +48,6 @@ struct pci_sys_data {
	void		*private_data;	/* platform controller private data	*/
};

/*
 * This is the standard PCI-PCI bridge swizzling algorithm.
 */
#define pci_std_swizzle pci_common_swizzle

/*
 * Call this with your hw_pci struct to initialise the PCI system.
 */
+16 −3
Original line number Diff line number Diff line
@@ -374,16 +374,29 @@ EXPORT_SYMBOL(pcibios_fixup_bus);
#endif

/*
 * Swizzle the device pin each time we cross a bridge.
 * This might update pin and returns the slot number.
 * Swizzle the device pin each time we cross a bridge.  If a platform does
 * not provide a swizzle function, we perform the standard PCI swizzling.
 *
 * The default swizzling walks up the bus tree one level at a time, applying
 * the standard swizzle function at each step, stopping when it finds the PCI
 * root bus.  This will return the slot number of the bridge device on the
 * root bus and the interrupt pin on that device which should correspond
 * with the downstream device interrupt.
 *
 * Platforms may override this, in which case the slot and pin returned
 * depend entirely on the platform code.  However, please note that the
 * PCI standard swizzle is implemented on plug-in cards and Cardbus based
 * PCI extenders, so it can not be ignored.
 */
static u8 __devinit pcibios_swizzle(struct pci_dev *dev, u8 *pin)
{
	struct pci_sys_data *sys = dev->sysdata;
	int slot = 0, oldpin = *pin;
	int slot, oldpin = *pin;

	if (sys->swizzle)
		slot = sys->swizzle(dev, pin);
	else
		slot = pci_common_swizzle(dev, pin);

	if (debug_pci)
		printk("PCI: %s swizzling pin %d => pin %d slot %d\n",
+0 −2
Original line number Diff line number Diff line
@@ -221,7 +221,6 @@ static struct cns3xxx_pcie cns3xxx_pcie[] = {
		.irqs = { IRQ_CNS3XXX_PCIE0_RC, IRQ_CNS3XXX_PCIE0_DEVICE, },
		.hw_pci = {
			.domain = 0,
			.swizzle = pci_std_swizzle,
			.nr_controllers = 1,
			.setup = cns3xxx_pci_setup,
			.scan = cns3xxx_pci_scan_bus,
@@ -264,7 +263,6 @@ static struct cns3xxx_pcie cns3xxx_pcie[] = {
		.irqs = { IRQ_CNS3XXX_PCIE1_RC, IRQ_CNS3XXX_PCIE1_DEVICE, },
		.hw_pci = {
			.domain = 1,
			.swizzle = pci_std_swizzle,
			.nr_controllers = 1,
			.setup = cns3xxx_pci_setup,
			.scan = cns3xxx_pci_scan_bus,
+0 −1
Original line number Diff line number Diff line
@@ -201,7 +201,6 @@ static int __init dove_pcie_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)

static struct hw_pci dove_pci __initdata = {
	.nr_controllers	= 2,
	.swizzle	= pci_std_swizzle,
	.setup		= dove_pcie_setup,
	.scan		= dove_pcie_scan_bus,
	.map_irq	= dove_pcie_map_irq,
+0 −1
Original line number Diff line number Diff line
@@ -29,7 +29,6 @@ static int __init ebsa285_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
}

static struct hw_pci ebsa285_pci __initdata = {
	.swizzle		= pci_std_swizzle,
	.map_irq		= ebsa285_map_irq,
	.nr_controllers		= 1,
	.setup			= dc21285_setup,
Loading