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

Kumar Gala galak at kernel.crashing.org
Fri Aug 10 23:09:07 EST 2012


On Aug 10, 2012, at 3:19 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.
> 
> We also change the way of determining primary bus for fitting platform
> driver. Thanks to the proposal from Ben. Please refer to the link below:
> https://lists.ozlabs.org/pipermail/linuxppc-dev/2012-June/098586.html
> 
> 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>
> ---
> Changes for V6:
> - Fix "isa_io_base could not be zero" bug. Thanks to Ben.
> 
> - Determining primary by looking for ISA node does not work for ge_imp3a.
>  It's fixed by adding ISA node to its devied tree.
> 
> arch/powerpc/boot/dts/ge_imp3a.dts         |    4 +
> arch/powerpc/kernel/pci-common.c           |    2 +-
> arch/powerpc/platforms/85xx/common.c       |   10 +++
> arch/powerpc/platforms/85xx/corenet_ds.c   |   31 +--------
> arch/powerpc/platforms/85xx/ge_imp3a.c     |   48 +------------
> arch/powerpc/platforms/85xx/mpc8536_ds.c   |   36 +---------
> arch/powerpc/platforms/85xx/mpc85xx_ads.c  |    9 +--
> arch/powerpc/platforms/85xx/mpc85xx_cds.c  |   14 +----
> arch/powerpc/platforms/85xx/mpc85xx_ds.c   |   38 ++--------
> arch/powerpc/platforms/85xx/mpc85xx_mds.c  |   38 +---------
> arch/powerpc/platforms/85xx/mpc85xx_rdb.c  |   28 +++-----
> arch/powerpc/platforms/85xx/p1010rdb.c     |   14 +----
> arch/powerpc/platforms/85xx/p1022_ds.c     |   34 +---------
> arch/powerpc/platforms/85xx/p1022_rdk.c    |   34 +---------
> arch/powerpc/platforms/85xx/p1023_rds.c    |    7 +--
> arch/powerpc/platforms/85xx/p2041_rdb.c    |    2 +-
> arch/powerpc/platforms/85xx/p3041_ds.c     |    2 +-
> arch/powerpc/platforms/85xx/p4080_ds.c     |    2 +-
> arch/powerpc/platforms/85xx/p5020_ds.c     |    2 +-
> arch/powerpc/platforms/85xx/p5040_ds.c     |    2 +-
> arch/powerpc/platforms/85xx/qemu_e500.c    |    3 +-
> arch/powerpc/platforms/85xx/sbc8548.c      |   19 +-----
> arch/powerpc/platforms/85xx/socrates.c     |   11 +---
> arch/powerpc/platforms/85xx/stx_gp3.c      |   11 +---
> arch/powerpc/platforms/85xx/tqm85xx.c      |   21 +------
> arch/powerpc/platforms/85xx/xes_mpc85xx.c  |   54 ++-------------
> arch/powerpc/platforms/86xx/gef_ppc9a.c    |   10 +--
> arch/powerpc/platforms/86xx/gef_sbc310.c   |   11 +---
> arch/powerpc/platforms/86xx/gef_sbc610.c   |   10 +--
> arch/powerpc/platforms/86xx/mpc8610_hpcd.c |   19 +----
> arch/powerpc/platforms/86xx/mpc86xx_hpcn.c |   40 +----------
> arch/powerpc/platforms/86xx/sbc8641d.c     |   12 +---
> arch/powerpc/sysdev/fsl_pci.c              |  102 +++++++++++++++++-----------
> arch/powerpc/sysdev/fsl_pci.h              |    9 ++-
> drivers/edac/mpc85xx_edac.c                |   43 +++---------
> 35 files changed, 165 insertions(+), 567 deletions(-)
> 

[ snip ]

> diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
> index 0f75bd5..2a09aa5 100644
> --- a/arch/powerpc/kernel/pci-common.c
> +++ b/arch/powerpc/kernel/pci-common.c
> @@ -734,7 +734,7 @@ void __devinit pci_process_bridge_OF_ranges(struct pci_controller *hose,
> 			hose->io_base_virt = ioremap(cpu_addr, size);
> 
> 			/* Expect trouble if pci_addr is not 0 */
> -			if (primary)
> +			if (primary || !isa_io_base)
> 				isa_io_base =
> 					(unsigned long)hose->io_base_virt;
> #endif /* CONFIG_PPC32 */

Make this a separate patch.

- k


More information about the Linuxppc-dev mailing list