Commit 21176fed authored by Michael Ellerman's avatar Michael Ellerman Committed by Benjamin Herrenschmidt

powerpc/pci: Split IO vs MMIO indirect access hooks

The goal is to avoid adding overhead to MMIO when only PIO is needed
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarMichael Ellerman <michael@ellerman.id.au>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent e297d9dd
...@@ -481,10 +481,16 @@ __do_out_asm(_rec_outl, "stwbrx") ...@@ -481,10 +481,16 @@ __do_out_asm(_rec_outl, "stwbrx")
_memcpy_fromio(dst,PCI_FIX_ADDR(src),n) _memcpy_fromio(dst,PCI_FIX_ADDR(src),n)
#endif /* !CONFIG_EEH */ #endif /* !CONFIG_EEH */
#ifdef CONFIG_PPC_INDIRECT_IO #ifdef CONFIG_PPC_INDIRECT_PIO
#define DEF_PCI_HOOK(x) x #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 #else
#define DEF_PCI_HOOK(x) NULL #define DEF_PCI_HOOK_mem(x) NULL
#endif #endif
/* Structure containing all the hooks */ /* Structure containing all the hooks */
...@@ -504,7 +510,7 @@ extern struct ppc_pci_io { ...@@ -504,7 +510,7 @@ extern struct ppc_pci_io {
#define DEF_PCI_AC_RET(name, ret, at, al, space, aa) \ #define DEF_PCI_AC_RET(name, ret, at, al, space, aa) \
static inline ret name at \ 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 ppc_pci_io.name al; \
return __do_##name al; \ return __do_##name al; \
} }
...@@ -512,7 +518,7 @@ static inline ret name at \ ...@@ -512,7 +518,7 @@ static inline ret name at \
#define DEF_PCI_AC_NORET(name, at, al, space, aa) \ #define DEF_PCI_AC_NORET(name, at, al, space, aa) \
static inline void name at \ 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; \ ppc_pci_io.name al; \
else \ else \
__do_##name al; \ __do_##name al; \
......
...@@ -154,11 +154,17 @@ config PPC_P7_NAP ...@@ -154,11 +154,17 @@ config PPC_P7_NAP
config PPC_INDIRECT_IO config PPC_INDIRECT_IO
bool bool
select GENERIC_IOMAP 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 config GENERIC_IOMAP
bool bool
default n
source "drivers/cpufreq/Kconfig" source "drivers/cpufreq/Kconfig"
......
...@@ -6,7 +6,8 @@ config PPC_CELL_COMMON ...@@ -6,7 +6,8 @@ config PPC_CELL_COMMON
bool bool
select PPC_CELL select PPC_CELL
select PPC_DCR_MMIO select PPC_DCR_MMIO
select PPC_INDIRECT_IO select PPC_INDIRECT_PIO
select PPC_INDIRECT_MMIO
select PPC_NATIVE select PPC_NATIVE
select PPC_RTAS select PPC_RTAS
select IRQ_EDGE_EOI_HANDLER select IRQ_EDGE_EOI_HANDLER
......
config PPC_ISERIES config PPC_ISERIES
bool "IBM Legacy iSeries" bool "IBM Legacy iSeries"
depends on PPC64 && PPC_BOOK3S depends on PPC64 && PPC_BOOK3S
select PPC_INDIRECT_IO select PPC_INDIRECT_PIO
select PPC_INDIRECT_MMIO
select PPC_PCI_CHOICE if EXPERT select PPC_PCI_CHOICE if EXPERT
menu "iSeries device drivers" menu "iSeries device drivers"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment