powerpc/pci: Split IO vs MMIO indirect access hooks
authorMichael Ellerman <michael@ozlabs.org>
Mon, 11 Apr 2011 21:25:01 +0000 (21:25 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Wed, 27 Apr 2011 04:18:27 +0000 (14:18 +1000)
The goal is to avoid adding overhead to MMIO when only PIO is needed

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/include/asm/io.h
arch/powerpc/platforms/Kconfig
arch/powerpc/platforms/cell/Kconfig
arch/powerpc/platforms/iseries/Kconfig

index 001f2f11c19bbf9f1cfaa1f0e417986eacdb80f5..2f365f5007a06a244d693fcf343defcc6ec1afd0 100644 (file)
@@ -481,10 +481,16 @@ __do_out_asm(_rec_outl, "stwbrx")
                                _memcpy_fromio(dst,PCI_FIX_ADDR(src),n)
 #endif /* !CONFIG_EEH */
 
-#ifdef CONFIG_PPC_INDIRECT_IO
-#define DEF_PCI_HOOK(x)                x
+#ifdef CONFIG_PPC_INDIRECT_PIO
+#define DEF_PCI_HOOK_pio(x)    x
+#else
+#define DEF_PCI_HOOK_pio(x)    NULL
+#endif
+
+#ifdef CONFIG_PPC_INDIRECT_MMIO
+#define DEF_PCI_HOOK_mem(x)    x
 #else
-#define DEF_PCI_HOOK(x)                NULL
+#define DEF_PCI_HOOK_mem(x)    NULL
 #endif
 
 /* Structure containing all the hooks */
@@ -504,7 +510,7 @@ extern struct ppc_pci_io {
 #define DEF_PCI_AC_RET(name, ret, at, al, space, aa)           \
 static inline ret name at                                      \
 {                                                              \
-       if (DEF_PCI_HOOK(ppc_pci_io.name) != NULL)              \
+       if (DEF_PCI_HOOK_##space(ppc_pci_io.name) != NULL)      \
                return ppc_pci_io.name al;                      \
        return __do_##name al;                                  \
 }
@@ -512,7 +518,7 @@ static inline ret name at                                   \
 #define DEF_PCI_AC_NORET(name, at, al, space, aa)              \
 static inline void name at                                     \
 {                                                              \
-       if (DEF_PCI_HOOK(ppc_pci_io.name) != NULL)              \
+       if (DEF_PCI_HOOK_##space(ppc_pci_io.name) != NULL)              \
                ppc_pci_io.name al;                             \
        else                                                    \
                __do_##name al;                                 \
index 658ffc50493dbc46c1a599be1f462a27be3a21f8..54db9fbab1dc3a6c16f936bbe11a9a5cf0058a8f 100644 (file)
@@ -154,11 +154,17 @@ config PPC_P7_NAP
 config PPC_INDIRECT_IO
        bool
        select GENERIC_IOMAP
-       default n
+
+config PPC_INDIRECT_PIO
+       bool
+       select PPC_INDIRECT_IO
+
+config PPC_INDIRECT_MMIO
+       bool
+       select PPC_INDIRECT_IO
 
 config GENERIC_IOMAP
        bool
-       default n
 
 source "drivers/cpufreq/Kconfig"
 
index 81239ebed83fef43d7a726c6d0edcf5e30931c92..3c7f1de06cdfe1d26579562fc24ec8d67f909e22 100644 (file)
@@ -6,7 +6,8 @@ config PPC_CELL_COMMON
        bool
        select PPC_CELL
        select PPC_DCR_MMIO
-       select PPC_INDIRECT_IO
+       select PPC_INDIRECT_PIO
+       select PPC_INDIRECT_MMIO
        select PPC_NATIVE
        select PPC_RTAS
        select IRQ_EDGE_EOI_HANDLER
index e5bc9f75d474c9d44718f29c14061b2e17384221..ea1d3622b41c13a96d1c14525909a7fffd21b0c8 100644 (file)
@@ -1,7 +1,8 @@
 config PPC_ISERIES
        bool "IBM Legacy iSeries"
        depends on PPC64 && PPC_BOOK3S
-       select PPC_INDIRECT_IO
+       select PPC_INDIRECT_PIO
+       select PPC_INDIRECT_MMIO
        select PPC_PCI_CHOICE if EXPERT
 
 menu "iSeries device drivers"