diff options
author | Paul Mundt <lethal@linux-sh.org> | 2011-05-23 23:05:26 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2011-05-23 23:05:26 -0400 |
commit | 8b1aaeaf54f1bcaa0bbec6bb170db367c998d27c (patch) | |
tree | 2478e1708f5a3da261597f4aa1011d4d41c2cc84 /arch/powerpc/include/asm/io.h | |
parent | bca606a646a2b1f4fa1ae2b22a0ac707505d7297 (diff) | |
parent | 5e152b4c9e0fce6149c74406346a7ae7e7a17727 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into rmobile-latest
Diffstat (limited to 'arch/powerpc/include/asm/io.h')
-rw-r--r-- | arch/powerpc/include/asm/io.h | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/arch/powerpc/include/asm/io.h b/arch/powerpc/include/asm/io.h index 001f2f11c19b..45698d55cd6a 100644 --- a/arch/powerpc/include/asm/io.h +++ b/arch/powerpc/include/asm/io.h | |||
@@ -2,6 +2,8 @@ | |||
2 | #define _ASM_POWERPC_IO_H | 2 | #define _ASM_POWERPC_IO_H |
3 | #ifdef __KERNEL__ | 3 | #ifdef __KERNEL__ |
4 | 4 | ||
5 | #define ARCH_HAS_IOREMAP_WC | ||
6 | |||
5 | /* | 7 | /* |
6 | * This program is free software; you can redistribute it and/or | 8 | * This program is free software; you can redistribute it and/or |
7 | * modify it under the terms of the GNU General Public License | 9 | * modify it under the terms of the GNU General Public License |
@@ -481,10 +483,16 @@ __do_out_asm(_rec_outl, "stwbrx") | |||
481 | _memcpy_fromio(dst,PCI_FIX_ADDR(src),n) | 483 | _memcpy_fromio(dst,PCI_FIX_ADDR(src),n) |
482 | #endif /* !CONFIG_EEH */ | 484 | #endif /* !CONFIG_EEH */ |
483 | 485 | ||
484 | #ifdef CONFIG_PPC_INDIRECT_IO | 486 | #ifdef CONFIG_PPC_INDIRECT_PIO |
485 | #define DEF_PCI_HOOK(x) x | 487 | #define DEF_PCI_HOOK_pio(x) x |
488 | #else | ||
489 | #define DEF_PCI_HOOK_pio(x) NULL | ||
490 | #endif | ||
491 | |||
492 | #ifdef CONFIG_PPC_INDIRECT_MMIO | ||
493 | #define DEF_PCI_HOOK_mem(x) x | ||
486 | #else | 494 | #else |
487 | #define DEF_PCI_HOOK(x) NULL | 495 | #define DEF_PCI_HOOK_mem(x) NULL |
488 | #endif | 496 | #endif |
489 | 497 | ||
490 | /* Structure containing all the hooks */ | 498 | /* Structure containing all the hooks */ |
@@ -504,7 +512,7 @@ extern struct ppc_pci_io { | |||
504 | #define DEF_PCI_AC_RET(name, ret, at, al, space, aa) \ | 512 | #define DEF_PCI_AC_RET(name, ret, at, al, space, aa) \ |
505 | static inline ret name at \ | 513 | static inline ret name at \ |
506 | { \ | 514 | { \ |
507 | if (DEF_PCI_HOOK(ppc_pci_io.name) != NULL) \ | 515 | if (DEF_PCI_HOOK_##space(ppc_pci_io.name) != NULL) \ |
508 | return ppc_pci_io.name al; \ | 516 | return ppc_pci_io.name al; \ |
509 | return __do_##name al; \ | 517 | return __do_##name al; \ |
510 | } | 518 | } |
@@ -512,7 +520,7 @@ static inline ret name at \ | |||
512 | #define DEF_PCI_AC_NORET(name, at, al, space, aa) \ | 520 | #define DEF_PCI_AC_NORET(name, at, al, space, aa) \ |
513 | static inline void name at \ | 521 | static inline void name at \ |
514 | { \ | 522 | { \ |
515 | if (DEF_PCI_HOOK(ppc_pci_io.name) != NULL) \ | 523 | if (DEF_PCI_HOOK_##space(ppc_pci_io.name) != NULL) \ |
516 | ppc_pci_io.name al; \ | 524 | ppc_pci_io.name al; \ |
517 | else \ | 525 | else \ |
518 | __do_##name al; \ | 526 | __do_##name al; \ |
@@ -616,12 +624,13 @@ static inline void iosync(void) | |||
616 | * * ioremap is the standard one and provides non-cacheable guarded mappings | 624 | * * ioremap is the standard one and provides non-cacheable guarded mappings |
617 | * and can be hooked by the platform via ppc_md | 625 | * and can be hooked by the platform via ppc_md |
618 | * | 626 | * |
619 | * * ioremap_flags allows to specify the page flags as an argument and can | 627 | * * ioremap_prot allows to specify the page flags as an argument and can |
620 | * also be hooked by the platform via ppc_md. ioremap_prot is the exact | 628 | * also be hooked by the platform via ppc_md. |
621 | * same thing as ioremap_flags. | ||
622 | * | 629 | * |
623 | * * ioremap_nocache is identical to ioremap | 630 | * * ioremap_nocache is identical to ioremap |
624 | * | 631 | * |
632 | * * ioremap_wc enables write combining | ||
633 | * | ||
625 | * * iounmap undoes such a mapping and can be hooked | 634 | * * iounmap undoes such a mapping and can be hooked |
626 | * | 635 | * |
627 | * * __ioremap_at (and the pending __iounmap_at) are low level functions to | 636 | * * __ioremap_at (and the pending __iounmap_at) are low level functions to |
@@ -629,7 +638,7 @@ static inline void iosync(void) | |||
629 | * currently be hooked. Must be page aligned. | 638 | * currently be hooked. Must be page aligned. |
630 | * | 639 | * |
631 | * * __ioremap is the low level implementation used by ioremap and | 640 | * * __ioremap is the low level implementation used by ioremap and |
632 | * ioremap_flags and cannot be hooked (but can be used by a hook on one | 641 | * ioremap_prot and cannot be hooked (but can be used by a hook on one |
633 | * of the previous ones) | 642 | * of the previous ones) |
634 | * | 643 | * |
635 | * * __ioremap_caller is the same as above but takes an explicit caller | 644 | * * __ioremap_caller is the same as above but takes an explicit caller |
@@ -640,10 +649,10 @@ static inline void iosync(void) | |||
640 | * | 649 | * |
641 | */ | 650 | */ |
642 | extern void __iomem *ioremap(phys_addr_t address, unsigned long size); | 651 | extern void __iomem *ioremap(phys_addr_t address, unsigned long size); |
643 | extern void __iomem *ioremap_flags(phys_addr_t address, unsigned long size, | 652 | extern void __iomem *ioremap_prot(phys_addr_t address, unsigned long size, |
644 | unsigned long flags); | 653 | unsigned long flags); |
654 | extern void __iomem *ioremap_wc(phys_addr_t address, unsigned long size); | ||
645 | #define ioremap_nocache(addr, size) ioremap((addr), (size)) | 655 | #define ioremap_nocache(addr, size) ioremap((addr), (size)) |
646 | #define ioremap_prot(addr, size, prot) ioremap_flags((addr), (size), (prot)) | ||
647 | 656 | ||
648 | extern void iounmap(volatile void __iomem *addr); | 657 | extern void iounmap(volatile void __iomem *addr); |
649 | 658 | ||