]> err.no Git - linux-2.6/commitdiff
ppc: Use the indirect_pci.c from arch/powerpc/sysdev
authorPaul Mackerras <paulus@samba.org>
Wed, 26 Oct 2005 06:36:55 +0000 (16:36 +1000)
committerPaul Mackerras <paulus@samba.org>
Wed, 26 Oct 2005 06:36:55 +0000 (16:36 +1000)
This defines a CONFIG_INDIRECT_PCI symbol to control whether it
gets used or not, and fixes the Kconfig to select that symbol for
platforms that need it.

Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/Kconfig
arch/powerpc/platforms/embedded6xx/Kconfig
arch/powerpc/sysdev/Makefile
arch/ppc/Kconfig
arch/ppc/Makefile
arch/ppc/syslib/Makefile
arch/ppc/syslib/indirect_pci.c [deleted file]

index 27f122e1f8494f02e61242a50782f8837804f9a0..a3451d5bb7883f806f86b1c5689d33435c223f98 100644 (file)
@@ -280,11 +280,13 @@ config PPC_PSERIES
 config PPC_CHRP
        bool "  Common Hardware Reference Platform (CHRP) based machines"
        depends on PPC_MULTIPLATFORM && PPC32
+       select PPC_INDIRECT_PCI
        default y
 
 config PPC_PMAC
        bool "  Apple PowerMac based machines"
        depends on PPC_MULTIPLATFORM
+       select PPC_INDIRECT_PCI if PPC32
        default y
 
 config PPC_PMAC64
@@ -296,6 +298,7 @@ config PPC_PMAC64
 config PPC_PREP
        bool "  PowerPC Reference Platform (PReP) based machines"
        depends on PPC_MULTIPLATFORM && PPC32
+       select PPC_INDIRECT_PCI
        default y
 
 config PPC_MAPLE
@@ -637,6 +640,12 @@ config GENERIC_ISA_DMA
        depends on PPC64 || POWER4 || 6xx && !CPM2
        default y
 
+config PPC_INDIRECT_PCI
+       bool
+       depends on PCI
+       default y if 40x || 44x || 85xx || 83xx
+       default n
+
 config EISA
        bool
 
@@ -677,6 +686,7 @@ config PCI_QSPAN
 config PCI_8260
        bool
        depends on PCI && 8260
+       select PPC_INDIRECT_PCI
        default y
 
 config 8260_PCI9
index 2d755b79d51f34ccf6d36ef0133a2ddb87d44d46..784b41e194652c49319f52c4d6bac217add752d2 100644 (file)
@@ -27,6 +27,7 @@ config CHESTNUT
 
 config SPRUCE
        bool "IBM-Spruce"
+       select PPC_INDIRECT_PCI
 
 config HDPU
        bool "Sky-HDPU"
@@ -50,15 +51,19 @@ config LOPEC
 
 config MVME5100
        bool "Motorola-MVME5100"
+       select PPC_INDIRECT_PCI
 
 config PPLUS
        bool "Motorola-PowerPlus"
+       select PPC_INDIRECT_PCI
 
 config PRPMC750
        bool "Motorola-PrPMC750"
+       select PPC_INDIRECT_PCI
 
 config PRPMC800
        bool "Motorola-PrPMC800"
+       select PPC_INDIRECT_PCI
 
 config SANDPOINT
        bool "Motorola-Sandpoint"
@@ -74,6 +79,7 @@ config PAL4
 
 config GEMINI
        bool "Synergy-Gemini"
+       select PPC_INDIRECT_PCI
        depends on BROKEN
        help
          Select Gemini if configuring for a Synergy Microsystems' Gemini
@@ -226,6 +232,7 @@ config MV64360              # Really MV64360 & MV64460
 config MV64X60
        bool
        depends on (GT64260 || MV64360)
+       select PPC_INDIRECT_PCI
        default y
 
 menu "Set bridge options"
@@ -274,6 +281,7 @@ config EPIC_SERIAL_MODE
 config MPC10X_BRIDGE
        bool
        depends on POWERPMC250 || LOPEC || SANDPOINT
+       select PPC_INDIRECT_PCI
        default y
 
 config MPC10X_OPENPIC
index c649f03acf689f87bde1dd7b29dae630a514bb3e..e66fef652fac3225873a425afb5d9e6dcc578e3e 100644 (file)
@@ -1,3 +1,2 @@
 obj-$(CONFIG_MPIC)             += mpic.o
-indirectpci-$(CONFIG_PPC_PMAC) = indirect_pci.o
-obj-$(CONFIG_PPC32)            += $(indirectpci-y)
+obj-$(CONFIG_PPC_INDIRECT_PCI) += indirect_pci.o
index ed9c9727d75f854bde9638ab44330b2c7186d120..e3efaf47d08363ea0c71f53d9ea74b6daa6b7352 100644 (file)
@@ -568,6 +568,7 @@ config CHESTNUT
 
 config SPRUCE
        bool "IBM-Spruce"
+       select PPC_INDIRECT_PCI
 
 config HDPU
        bool "Sky-HDPU"
@@ -591,15 +592,19 @@ config LOPEC
 
 config MVME5100
        bool "Motorola-MVME5100"
+       select PPC_INDIRECT_PCI
 
 config PPLUS
        bool "Motorola-PowerPlus"
+       select PPC_INDIRECT_PCI
 
 config PRPMC750
        bool "Motorola-PrPMC750"
+       select PPC_INDIRECT_PCI
 
 config PRPMC800
        bool "Motorola-PrPMC800"
+       select PPC_INDIRECT_PCI
 
 config SANDPOINT
        bool "Motorola-Sandpoint"
@@ -616,6 +621,7 @@ config PAL4
 config GEMINI
        bool "Synergy-Gemini"
        depends on BROKEN
+       select PPC_INDIRECT_PCI
        help
          Select Gemini if configuring for a Synergy Microsystems' Gemini
          series Single Board Computer.  More information is available at:
@@ -749,11 +755,13 @@ config CPM2
 config PPC_CHRP
        bool "  Common Hardware Reference Platform (CHRP) based machines"
        depends on PPC_MULTIPLATFORM
+       select PPC_INDIRECT_PCI
        default y
 
 config PPC_PMAC
        bool "  Apple PowerMac based machines"
        depends on PPC_MULTIPLATFORM
+       select PPC_INDIRECT_PCI
        default y
 
 config PPC_PMAC64
@@ -764,6 +772,7 @@ config PPC_PMAC64
 config PPC_PREP
        bool "  PowerPC Reference Platform (PReP) based machines"
        depends on PPC_MULTIPLATFORM
+       select PPC_INDIRECT_PCI
        default y
 
 config PPC_OF
@@ -797,6 +806,7 @@ config MV64360              # Really MV64360 & MV64460
 config MV64X60
        bool
        depends on (GT64260 || MV64360)
+       select PPC_INDIRECT_PCI
        default y
 
 menu "Set bridge options"
@@ -845,6 +855,7 @@ config EPIC_SERIAL_MODE
 config MPC10X_BRIDGE
        bool
        depends on POWERPMC250 || LOPEC || SANDPOINT
+       select PPC_INDIRECT_PCI
        default y
 
 config MPC10X_OPENPIC
@@ -1139,6 +1150,12 @@ config GENERIC_ISA_DMA
        depends on POWER3 || POWER4 || 6xx && !CPM2
        default y
 
+config PPC_INDIRECT_PCI
+       bool
+       depends on PCI
+       default y if 40x || 44x || 85xx || 83xx
+       default n
+
 config EISA
        bool
        help
@@ -1182,6 +1199,7 @@ config PCI_QSPAN
 config PCI_8260
        bool
        depends on PCI && 8260
+       select PPC_INDIRECT_PCI
        default y
 
 config 8260_PCI9
index aedc9ae13b2a942e9ae639e12c0c4585f84c32a0..121d2347b89fd1a69a82eb298c3ec01c6a9a7679 100644 (file)
@@ -61,7 +61,8 @@ head-$(CONFIG_PPC_FPU)                += arch/powerpc/kernel/fpu.o
 
 core-y                         += arch/ppc/kernel/ arch/powerpc/kernel/ \
                                   arch/ppc/platforms/ \
-                                  arch/ppc/mm/ arch/ppc/lib/ arch/ppc/syslib/
+                                  arch/ppc/mm/ arch/ppc/lib/ \
+                                  arch/ppc/syslib/ arch/powerpc/sysdev/
 core-$(CONFIG_4xx)             += arch/ppc/platforms/4xx/
 core-$(CONFIG_83xx)            += arch/ppc/platforms/83xx/
 core-$(CONFIG_85xx)            += arch/ppc/platforms/85xx/
index f6a2f1938bfabe8c76bab5449ba2deff85d4dd35..5739a19b9ed9a005f20aa7bb4872fc5353d4009e 100644 (file)
@@ -31,7 +31,7 @@ obj-$(CONFIG_GEN_RTC)         += todc_time.o
 obj-$(CONFIG_PPC4xx_DMA)       += ppc4xx_dma.o
 obj-$(CONFIG_PPC4xx_EDMA)      += ppc4xx_sgdma.o
 ifeq ($(CONFIG_40x),y)
-obj-$(CONFIG_PCI)              += indirect_pci.o pci_auto.o ppc405_pci.o
+obj-$(CONFIG_PCI)              += pci_auto.o ppc405_pci.o
 endif
 endif
 obj-$(CONFIG_8xx)              += m8xx_setup.o ppc8xx_pic.o $(wdt-mpc8xx-y) \
@@ -40,43 +40,43 @@ ifeq ($(CONFIG_8xx),y)
 obj-$(CONFIG_PCI)              += qspan_pci.o i8259.o
 endif
 obj-$(CONFIG_PPC_OF)           += prom_init.o prom.o
-obj-$(CONFIG_PPC_PMAC)         += open_pic.o indirect_pci.o
+obj-$(CONFIG_PPC_PMAC)         += open_pic.o
 obj-$(CONFIG_POWER4)           += open_pic2.o
-obj-$(CONFIG_PPC_CHRP)         += open_pic.o indirect_pci.o i8259.o
-obj-$(CONFIG_PPC_PREP)         += open_pic.o indirect_pci.o i8259.o todc_time.o
-obj-$(CONFIG_BAMBOO)           += indirect_pci.o pci_auto.o todc_time.o
+obj-$(CONFIG_PPC_CHRP)         += open_pic.o i8259.o
+obj-$(CONFIG_PPC_PREP)         += open_pic.o i8259.o todc_time.o
+obj-$(CONFIG_BAMBOO)           += pci_auto.o todc_time.o
 obj-$(CONFIG_CPCI690)          += todc_time.o pci_auto.o
-obj-$(CONFIG_EBONY)            += indirect_pci.o pci_auto.o todc_time.o
+obj-$(CONFIG_EBONY)            += pci_auto.o todc_time.o
 obj-$(CONFIG_EV64260)          += todc_time.o pci_auto.o
 obj-$(CONFIG_CHESTNUT)         += mv64360_pic.o pci_auto.o
-obj-$(CONFIG_GEMINI)           += open_pic.o indirect_pci.o
+obj-$(CONFIG_GEMINI)           += open_pic.o
 obj-$(CONFIG_GT64260)          += gt64260_pic.o
 obj-$(CONFIG_LOPEC)            += i8259.o pci_auto.o todc_time.o
 obj-$(CONFIG_HDPU)             += pci_auto.o
-obj-$(CONFIG_LUAN)             += indirect_pci.o pci_auto.o todc_time.o
+obj-$(CONFIG_LUAN)             += pci_auto.o todc_time.o
 obj-$(CONFIG_KATANA)           += pci_auto.o
 obj-$(CONFIG_MV64360)          += mv64360_pic.o
-obj-$(CONFIG_MV64X60)          += mv64x60.o mv64x60_win.o indirect_pci.o
-obj-$(CONFIG_MVME5100)         += open_pic.o todc_time.o indirect_pci.o \
+obj-$(CONFIG_MV64X60)          += mv64x60.o mv64x60_win.o
+obj-$(CONFIG_MVME5100)         += open_pic.o todc_time.o \
                                        pci_auto.o hawk_common.o
 obj-$(CONFIG_MVME5100_IPMC761_PRESENT) += i8259.o
-obj-$(CONFIG_OCOTEA)           += indirect_pci.o pci_auto.o todc_time.o
+obj-$(CONFIG_OCOTEA)           += pci_auto.o todc_time.o
 obj-$(CONFIG_PAL4)             += cpc700_pic.o
 obj-$(CONFIG_POWERPMC250)      += pci_auto.o
 obj-$(CONFIG_PPLUS)            += hawk_common.o open_pic.o i8259.o \
-                                  indirect_pci.o todc_time.o pci_auto.o
-obj-$(CONFIG_PRPMC750)         += open_pic.o indirect_pci.o pci_auto.o \
+                                  todc_time.o pci_auto.o
+obj-$(CONFIG_PRPMC750)         += open_pic.o pci_auto.o \
                                        hawk_common.o
 obj-$(CONFIG_HARRIER)          += harrier.o
-obj-$(CONFIG_PRPMC800)         += open_pic.o indirect_pci.o pci_auto.o
+obj-$(CONFIG_PRPMC800)         += open_pic.o pci_auto.o
 obj-$(CONFIG_RADSTONE_PPC7D)   += i8259.o pci_auto.o
 obj-$(CONFIG_SANDPOINT)                += i8259.o pci_auto.o todc_time.o
 obj-$(CONFIG_SBC82xx)          += todc_time.o
-obj-$(CONFIG_SPRUCE)           += cpc700_pic.o indirect_pci.o pci_auto.o \
+obj-$(CONFIG_SPRUCE)           += cpc700_pic.o pci_auto.o \
                                   todc_time.o
 obj-$(CONFIG_8260)             += m8260_setup.o pq2_devices.o pq2_sys.o \
                                   ppc_sys.o
-obj-$(CONFIG_PCI_8260)         += m82xx_pci.o indirect_pci.o pci_auto.o
+obj-$(CONFIG_PCI_8260)         += m82xx_pci.o pci_auto.o
 obj-$(CONFIG_8260_PCI9)                += m8260_pci_erratum9.o
 obj-$(CONFIG_CPM2)             += cpm2_common.o cpm2_pic.o
 ifeq ($(CONFIG_PPC_GEN550),y)
@@ -87,7 +87,7 @@ ifeq ($(CONFIG_SERIAL_MPSC_CONSOLE),y)
 obj-$(CONFIG_SERIAL_TEXT_DEBUG)        += mv64x60_dbg.o
 endif
 obj-$(CONFIG_BOOTX_TEXT)       += btext.o
-obj-$(CONFIG_MPC10X_BRIDGE)    += mpc10x_common.o indirect_pci.o ppc_sys.o
+obj-$(CONFIG_MPC10X_BRIDGE)    += mpc10x_common.o ppc_sys.o
 obj-$(CONFIG_MPC10X_OPENPIC)   += open_pic.o
 obj-$(CONFIG_40x)              += dcr.o
 obj-$(CONFIG_BOOKE)            += dcr.o
@@ -95,12 +95,12 @@ obj-$(CONFIG_85xx)          += open_pic.o ppc85xx_common.o ppc85xx_setup.o \
                                        ppc_sys.o i8259.o mpc85xx_sys.o \
                                        mpc85xx_devices.o
 ifeq ($(CONFIG_85xx),y)
-obj-$(CONFIG_PCI)              += indirect_pci.o pci_auto.o
+obj-$(CONFIG_PCI)              += pci_auto.o
 endif
 obj-$(CONFIG_83xx)             += ipic.o ppc83xx_setup.o ppc_sys.o \
                                        mpc83xx_sys.o mpc83xx_devices.o
 ifeq ($(CONFIG_83xx),y)
-obj-$(CONFIG_PCI)              += indirect_pci.o pci_auto.o
+obj-$(CONFIG_PCI)              += pci_auto.o
 endif
 obj-$(CONFIG_MPC8548_CDS)      += todc_time.o
 obj-$(CONFIG_MPC8555_CDS)      += todc_time.o
diff --git a/arch/ppc/syslib/indirect_pci.c b/arch/ppc/syslib/indirect_pci.c
deleted file mode 100644 (file)
index e714884..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * Support for indirect PCI bridges.
- *
- * Copyright (C) 1998 Gabriel Paubert.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- */
-
-#include <linux/kernel.h>
-#include <linux/pci.h>
-#include <linux/delay.h>
-#include <linux/string.h>
-#include <linux/init.h>
-
-#include <asm/io.h>
-#include <asm/prom.h>
-#include <asm/pci-bridge.h>
-#include <asm/machdep.h>
-
-#ifdef CONFIG_PPC_INDIRECT_PCI_BE
-#define PCI_CFG_OUT out_be32
-#else
-#define PCI_CFG_OUT out_le32
-#endif
-
-static int
-indirect_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
-                    int len, u32 *val)
-{
-       struct pci_controller *hose = bus->sysdata;
-       volatile void __iomem *cfg_data;
-       u8 cfg_type = 0;
-
-       if (ppc_md.pci_exclude_device)
-               if (ppc_md.pci_exclude_device(bus->number, devfn))
-                       return PCIBIOS_DEVICE_NOT_FOUND;
-       
-       if (hose->set_cfg_type)
-               if (bus->number != hose->first_busno)
-                       cfg_type = 1;
-
-       PCI_CFG_OUT(hose->cfg_addr,                                      
-                (0x80000000 | ((bus->number - hose->bus_offset) << 16)
-                 | (devfn << 8) | ((offset & 0xfc) | cfg_type)));
-
-       /*
-        * Note: the caller has already checked that offset is
-        * suitably aligned and that len is 1, 2 or 4.
-        */
-       cfg_data = hose->cfg_data + (offset & 3);
-       switch (len) {
-       case 1:
-               *val = in_8(cfg_data);
-               break;
-       case 2:
-               *val = in_le16(cfg_data);
-               break;
-       default:
-               *val = in_le32(cfg_data);
-               break;
-       }
-       return PCIBIOS_SUCCESSFUL;
-}
-
-static int
-indirect_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
-                     int len, u32 val)
-{
-       struct pci_controller *hose = bus->sysdata;
-       volatile void __iomem *cfg_data;
-       u8 cfg_type = 0;
-
-       if (ppc_md.pci_exclude_device)
-               if (ppc_md.pci_exclude_device(bus->number, devfn))
-                       return PCIBIOS_DEVICE_NOT_FOUND;
-
-       if (hose->set_cfg_type)
-               if (bus->number != hose->first_busno)
-                       cfg_type = 1;
-
-       PCI_CFG_OUT(hose->cfg_addr,                                      
-                (0x80000000 | ((bus->number - hose->bus_offset) << 16)
-                 | (devfn << 8) | ((offset & 0xfc) | cfg_type)));
-
-       /*
-        * Note: the caller has already checked that offset is
-        * suitably aligned and that len is 1, 2 or 4.
-        */
-       cfg_data = hose->cfg_data + (offset & 3);
-       switch (len) {
-       case 1:
-               out_8(cfg_data, val);
-               break;
-       case 2:
-               out_le16(cfg_data, val);
-               break;
-       default:
-               out_le32(cfg_data, val);
-               break;
-       }
-       return PCIBIOS_SUCCESSFUL;
-}
-
-static struct pci_ops indirect_pci_ops =
-{
-       indirect_read_config,
-       indirect_write_config
-};
-
-void __init
-setup_indirect_pci_nomap(struct pci_controller* hose, void __iomem * cfg_addr,
-       void __iomem * cfg_data)
-{
-       hose->cfg_addr = cfg_addr;
-       hose->cfg_data = cfg_data;
-       hose->ops = &indirect_pci_ops;
-}
-
-void __init
-setup_indirect_pci(struct pci_controller* hose, u32 cfg_addr, u32 cfg_data)
-{
-       unsigned long base = cfg_addr & PAGE_MASK;
-       void __iomem *mbase, *addr, *data;
-
-       mbase = ioremap(base, PAGE_SIZE);
-       addr = mbase + (cfg_addr & ~PAGE_MASK);
-       if ((cfg_data & PAGE_MASK) != base)
-               mbase = ioremap(cfg_data & PAGE_MASK, PAGE_SIZE);
-       data = mbase + (cfg_data & ~PAGE_MASK);
-       setup_indirect_pci_nomap(hose, addr, data);
-}