[RFC 7/7] Unite all PCI-e on 85xx and 86xx under one codebase

Kumar Gala galak at kernel.crashing.org
Fri Feb 16 14:33:56 EST 2007


> diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/ 
> pci_32.c
> index d8ef2e1..29243ed 100644
> --- a/arch/powerpc/kernel/pci_32.c
> +++ b/arch/powerpc/kernel/pci_32.c
> @@ -81,7 +81,18 @@ fixup_cpc710_pci64(struct pci_dev* dev)
>  	dev->resource[1].start = dev->resource[1].end = 0;
>  	dev->resource[1].flags = 0;
>  }
> -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_IBM,	 
> PCI_DEVICE_ID_IBM_CPC710_PCI64,	fixup_cpc710_pci64);
> +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_IBM,  
> PCI_DEVICE_ID_IBM_CPC710_PCI64, fixup_cpc710_pci64);
> +
> +static void __devinit skip_fake_bridge(struct pci_dev *dev)
> +{
> +	/* Make it an error to skip the fake bridge
> +	 * in pci_setup_device() in probe.c */
> +	dev->hdr_type = 0x7f;
> +}
> +DECLARE_PCI_FIXUP_EARLY(0x1957, 0x3fff, skip_fake_bridge);
> +DECLARE_PCI_FIXUP_EARLY(0x3fff, 0x1957, skip_fake_bridge);
> +DECLARE_PCI_FIXUP_EARLY(0xff3f, 0x5719, skip_fake_bridge);
> +

What is this all about?  And what's with the various munging going on  
with the vendor and device IDs?

> diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c b/arch/ 
> powerpc/platforms/85xx/mpc85xx_cds.c
> index 2027855..dc8ddde 100644
> --- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c
> +++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
> @@ -65,18 +65,7 @@ extern int mpc85xx_pci2_busno;
>
>  static int mpc85xx_exclude_device(u_char bus, u_char devfn)
>  {
> -	if (bus == 0 && PCI_SLOT(devfn) == 0)
> -		return PCIBIOS_DEVICE_NOT_FOUND;
> -	if (mpc85xx_pci2_busno)
> -		if (bus == (mpc85xx_pci2_busno) && PCI_SLOT(devfn) == 0)
> -			return PCIBIOS_DEVICE_NOT_FOUND;
> -	/* We explicitly do not go past the Tundra 320 Bridge */
> -	if ((bus == 1) && (PCI_SLOT(devfn) == ARCADIA_2ND_BRIDGE_IDSEL))
> -		return PCIBIOS_DEVICE_NOT_FOUND;
> -	if ((bus == 0) && (PCI_SLOT(devfn) == ARCADIA_2ND_BRIDGE_IDSEL))
> -		return PCIBIOS_DEVICE_NOT_FOUND;
> -	else
> -		return PCIBIOS_SUCCESSFUL;
> +	return PCIBIOS_SUCCESSFUL;
>  }

If you are going to always return PCIBIOS_SUCCESSFUL, just get ride  
of the function completely.

>
>  void __init
> diff --git a/arch/powerpc/platforms/85xx/pci.c b/arch/powerpc/ 
> platforms/85xx/pci.c
> index 5c70797..8afb74f 100644
> --- a/arch/powerpc/platforms/85xx/pci.c
> +++ b/arch/powerpc/platforms/85xx/pci.c
> @@ -137,7 +137,6 @@ int __init add_bridge(struct device_node
>  	struct pci_controller *hose;
>  	struct resource rsrc;
>  	const int *bus_range;
> -	unsigned int temp;
>  	int primary = 1, has_address = 0;
>  	phys_addr_t immr = get_immrbase();
>
> @@ -177,12 +176,10 @@ int __init add_bridge(struct device_node
>  	if ((rsrc.start & 0xfffff) == 0xa000) {
>  		setup_indirect_pcie(hose, immr + 0xa000, immr + 0xa004);
>  		mpc85xx_setup_pcie(hose);
> -		primary = 1;
> +		primary = 0;
>  		hose->bus_offset = hose->first_busno;
>  		/* Setup PEX window registers */
>  		setup_pcie_atmu(hose, &rsrc);
> -		early_read_config_dword(hose, 0, 0, 0x404, &temp);
> -		printk("Reg 0x404 is 0x%x\n",temp);

having this patch clean stuff others added is fun :)

- k



More information about the Linuxppc-dev mailing list