[PATCH V4 3/3] powerpc/fsl-pci: Unify pci/pcie initialization code

Jia Hongtao-B38951 B38951 at freescale.com
Fri Aug 3 12:20:50 EST 2012



> -----Original Message-----
> From: Wood Scott-B07421
> Sent: Friday, August 03, 2012 4:19 AM
> To: Jia Hongtao-B38951
> Cc: linuxppc-dev at lists.ozlabs.org; galak at kernel.crashing.org; Wood Scott-
> B07421; Li Yang-R58472
> Subject: Re: [PATCH V4 3/3] powerpc/fsl-pci: Unify pci/pcie
> initialization code
> 
> On 08/02/2012 06:42 AM, Jia Hongtao wrote:
> > We unified the Freescale pci/pcie initialization by changing the
> fsl_pci
> > to a platform driver. In previous PCI code architecture the
> initialization
> > routine is called at board_setup_arch stage. Now the initialization is
> done
> > in probe function which is architectural better. Also It's convenient
> for
> > adding PM support for PCI controller in later patch.
> >
> > Now we registered pci controllers as platform devices. So we combine
> two
> > initialization code as one platform driver.
> >
> > Signed-off-by: Jia Hongtao <B38951 at freescale.com>
> > Signed-off-by: Li Yang <leoli at freescale.com>
> > Signed-off-by: Chunhe Lan <Chunhe.Lan at freescale.com>
> > ---
> >  arch/powerpc/platforms/85xx/mpc85xx_ds.c |   32 ++--------
> >  arch/powerpc/sysdev/fsl_pci.c            |  102 ++++++++++++++++++----
> -------
> >  arch/powerpc/sysdev/fsl_pci.h            |    6 +-
> >  drivers/edac/mpc85xx_edac.c              |   43 ++++---------
> >  4 files changed, 83 insertions(+), 100 deletions(-)
> >
> > diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ds.c
> b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
> > index 56f8c8f..f2c7b1c 100644
> > --- a/arch/powerpc/platforms/85xx/mpc85xx_ds.c
> > +++ b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
> > @@ -20,7 +20,6 @@
> >  #include <linux/seq_file.h>
> >  #include <linux/interrupt.h>
> >  #include <linux/of_platform.h>
> > -#include <linux/memblock.h>
> >
> >  #include <asm/time.h>
> >  #include <asm/machdep.h>
> > @@ -117,40 +116,16 @@ void __init mpc85xx_ds_pic_init(void)
> >  extern int uli_exclude_device(struct pci_controller *hose,
> >  				u_char bus, u_char devfn);
> >
> > -static struct device_node *pci_with_uli;
> > -
> >  static int mpc85xx_exclude_device(struct pci_controller *hose,
> >  				   u_char bus, u_char devfn)
> >  {
> > -	if (hose->dn == pci_with_uli)
> > +	if (hose->dn == fsl_pci_primary)
> >  		return uli_exclude_device(hose, bus, devfn);
> >
> >  	return PCIBIOS_SUCCESSFUL;
> >  }
> >  #endif	/* CONFIG_PCI */
> >
> > -static void __init mpc85xx_ds_pci_init(void)
> > -{
> > -#ifdef CONFIG_PCI
> > -	struct device_node *node;
> > -
> > -	fsl_pci_init();
> > -
> > -	/* See if we have a ULI under the primary */
> > -
> > -	node = of_find_node_by_name(NULL, "uli1575");
> > -	while ((pci_with_uli = of_get_parent(node))) {
> > -		of_node_put(node);
> > -		node = pci_with_uli;
> > -
> > -		if (pci_with_uli == fsl_pci_primary) {
> > -			ppc_md.pci_exclude_device = mpc85xx_exclude_device;
> > -			break;
> > -		}
> > -	}
> > -#endif
> > -}
> > -
> >  /*
> >   * Setup the architecture
> >   */
> > @@ -159,8 +134,11 @@ static void __init mpc85xx_ds_setup_arch(void)
> >  	if (ppc_md.progress)
> >  		ppc_md.progress("mpc85xx_ds_setup_arch()", 0);
> >
> > +#ifdef CONFIG_PCI
> > +	ppc_md.pci_exclude_device = mpc85xx_exclude_device;
> > +#endif
> 
> Why are you eliminating the uli lookup?  We don't want to call
> uli_exclude_device on boards that don't have a uli.
> 
> -Scott

I found out that all 85xx_ds boards (mpc8572ds, mpc8544ds, p2020ds) have
ULI. Also in platform driver fsl_pci_primary is determined at arch_initcall
which means at the stage of board_setup_arch fsl_pci_primary is not ready.

-Hongtao.



More information about the Linuxppc-dev mailing list