提交 21176fed 编写于 作者: M Michael Ellerman 提交者: 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: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: NMichael Ellerman <michael@ellerman.id.au>
Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
上级 e297d9dd
......@@ -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; \
......
......@@ -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"
......
......@@ -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
......
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"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册