diff options
author | Michael Ellerman <michael@ozlabs.org> | 2011-04-11 17:25:01 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2011-04-27 00:18:27 -0400 |
commit | 21176fed25c3b0cb17c6c42d71b4e3d68b8f9dd4 (patch) | |
tree | bd3b54affe6feda4966b688a218bb2bd0bc82611 | |
parent | e297d9dd5cfafbeb2e7585bb444941848e030454 (diff) |
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: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r-- | arch/powerpc/include/asm/io.h | 16 | ||||
-rw-r--r-- | arch/powerpc/platforms/Kconfig | 10 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/Kconfig | 3 | ||||
-rw-r--r-- | arch/powerpc/platforms/iseries/Kconfig | 3 |
4 files changed, 23 insertions, 9 deletions
diff --git a/arch/powerpc/include/asm/io.h b/arch/powerpc/include/asm/io.h index 001f2f11c19..2f365f5007a 100644 --- a/arch/powerpc/include/asm/io.h +++ b/arch/powerpc/include/asm/io.h | |||
@@ -481,10 +481,16 @@ __do_out_asm(_rec_outl, "stwbrx") | |||
481 | _memcpy_fromio(dst,PCI_FIX_ADDR(src),n) | 481 | _memcpy_fromio(dst,PCI_FIX_ADDR(src),n) |
482 | #endif /* !CONFIG_EEH */ | 482 | #endif /* !CONFIG_EEH */ |
483 | 483 | ||
484 | #ifdef CONFIG_PPC_INDIRECT_IO | 484 | #ifdef CONFIG_PPC_INDIRECT_PIO |
485 | #define DEF_PCI_HOOK(x) x | 485 | #define DEF_PCI_HOOK_pio(x) x |
486 | #else | ||
487 | #define DEF_PCI_HOOK_pio(x) NULL | ||
488 | #endif | ||
489 | |||
490 | #ifdef CONFIG_PPC_INDIRECT_MMIO | ||
491 | #define DEF_PCI_HOOK_mem(x) x | ||
486 | #else | 492 | #else |
487 | #define DEF_PCI_HOOK(x) NULL | 493 | #define DEF_PCI_HOOK_mem(x) NULL |
488 | #endif | 494 | #endif |
489 | 495 | ||
490 | /* Structure containing all the hooks */ | 496 | /* Structure containing all the hooks */ |
@@ -504,7 +510,7 @@ extern struct ppc_pci_io { | |||
504 | #define DEF_PCI_AC_RET(name, ret, at, al, space, aa) \ | 510 | #define DEF_PCI_AC_RET(name, ret, at, al, space, aa) \ |
505 | static inline ret name at \ | 511 | static inline ret name at \ |
506 | { \ | 512 | { \ |
507 | if (DEF_PCI_HOOK(ppc_pci_io.name) != NULL) \ | 513 | if (DEF_PCI_HOOK_##space(ppc_pci_io.name) != NULL) \ |
508 | return ppc_pci_io.name al; \ | 514 | return ppc_pci_io.name al; \ |
509 | return __do_##name al; \ | 515 | return __do_##name al; \ |
510 | } | 516 | } |
@@ -512,7 +518,7 @@ static inline ret name at \ | |||
512 | #define DEF_PCI_AC_NORET(name, at, al, space, aa) \ | 518 | #define DEF_PCI_AC_NORET(name, at, al, space, aa) \ |
513 | static inline void name at \ | 519 | static inline void name at \ |
514 | { \ | 520 | { \ |
515 | if (DEF_PCI_HOOK(ppc_pci_io.name) != NULL) \ | 521 | if (DEF_PCI_HOOK_##space(ppc_pci_io.name) != NULL) \ |
516 | ppc_pci_io.name al; \ | 522 | ppc_pci_io.name al; \ |
517 | else \ | 523 | else \ |
518 | __do_##name al; \ | 524 | __do_##name al; \ |
diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig index 658ffc50493..54db9fbab1d 100644 --- a/arch/powerpc/platforms/Kconfig +++ b/arch/powerpc/platforms/Kconfig | |||
@@ -154,11 +154,17 @@ config PPC_P7_NAP | |||
154 | config PPC_INDIRECT_IO | 154 | config PPC_INDIRECT_IO |
155 | bool | 155 | bool |
156 | select GENERIC_IOMAP | 156 | select GENERIC_IOMAP |
157 | default n | 157 | |
158 | config PPC_INDIRECT_PIO | ||
159 | bool | ||
160 | select PPC_INDIRECT_IO | ||
161 | |||
162 | config PPC_INDIRECT_MMIO | ||
163 | bool | ||
164 | select PPC_INDIRECT_IO | ||
158 | 165 | ||
159 | config GENERIC_IOMAP | 166 | config GENERIC_IOMAP |
160 | bool | 167 | bool |
161 | default n | ||
162 | 168 | ||
163 | source "drivers/cpufreq/Kconfig" | 169 | source "drivers/cpufreq/Kconfig" |
164 | 170 | ||
diff --git a/arch/powerpc/platforms/cell/Kconfig b/arch/powerpc/platforms/cell/Kconfig index 81239ebed83..3c7f1de06cd 100644 --- a/arch/powerpc/platforms/cell/Kconfig +++ b/arch/powerpc/platforms/cell/Kconfig | |||
@@ -6,7 +6,8 @@ config PPC_CELL_COMMON | |||
6 | bool | 6 | bool |
7 | select PPC_CELL | 7 | select PPC_CELL |
8 | select PPC_DCR_MMIO | 8 | select PPC_DCR_MMIO |
9 | select PPC_INDIRECT_IO | 9 | select PPC_INDIRECT_PIO |
10 | select PPC_INDIRECT_MMIO | ||
10 | select PPC_NATIVE | 11 | select PPC_NATIVE |
11 | select PPC_RTAS | 12 | select PPC_RTAS |
12 | select IRQ_EDGE_EOI_HANDLER | 13 | select IRQ_EDGE_EOI_HANDLER |
diff --git a/arch/powerpc/platforms/iseries/Kconfig b/arch/powerpc/platforms/iseries/Kconfig index e5bc9f75d47..ea1d3622b41 100644 --- a/arch/powerpc/platforms/iseries/Kconfig +++ b/arch/powerpc/platforms/iseries/Kconfig | |||
@@ -1,7 +1,8 @@ | |||
1 | config PPC_ISERIES | 1 | config PPC_ISERIES |
2 | bool "IBM Legacy iSeries" | 2 | bool "IBM Legacy iSeries" |
3 | depends on PPC64 && PPC_BOOK3S | 3 | depends on PPC64 && PPC_BOOK3S |
4 | select PPC_INDIRECT_IO | 4 | select PPC_INDIRECT_PIO |
5 | select PPC_INDIRECT_MMIO | ||
5 | select PPC_PCI_CHOICE if EXPERT | 6 | select PPC_PCI_CHOICE if EXPERT |
6 | 7 | ||
7 | menu "iSeries device drivers" | 8 | menu "iSeries device drivers" |