diff options
author | Scott Wood <scottwood@freescale.com> | 2014-04-07 23:49:35 (GMT) |
---|---|---|
committer | Scott Wood <scottwood@freescale.com> | 2014-04-07 23:49:35 (GMT) |
commit | 62b8c978ee6b8d135d9e7953221de58000dba986 (patch) | |
tree | 683b04b2e627f6710c22c151b23c8cc9a165315e /arch/powerpc/include/asm/io.h | |
parent | 78fd82238d0e5716578c326404184a27ba67fd6e (diff) | |
download | linux-fsl-qoriq-62b8c978ee6b8d135d9e7953221de58000dba986.tar.xz |
Rewind v3.13-rc3+ (78fd82238d0e5716) to v3.12
Diffstat (limited to 'arch/powerpc/include/asm/io.h')
-rw-r--r-- | arch/powerpc/include/asm/io.h | 69 |
1 files changed, 19 insertions, 50 deletions
diff --git a/arch/powerpc/include/asm/io.h b/arch/powerpc/include/asm/io.h index 575fbf8..5a64757 100644 --- a/arch/powerpc/include/asm/io.h +++ b/arch/powerpc/include/asm/io.h @@ -21,7 +21,7 @@ extern struct pci_dev *isa_bridge_pcidev; /* * has legacy ISA devices ? */ -#define arch_has_dev_port() (isa_bridge_pcidev != NULL || isa_io_special) +#define arch_has_dev_port() (isa_bridge_pcidev != NULL) #endif #include <linux/device.h> @@ -113,7 +113,7 @@ extern bool isa_io_special; /* gcc 4.0 and older doesn't have 'Z' constraint */ #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ == 0) -#define DEF_MMIO_IN_X(name, size, insn) \ +#define DEF_MMIO_IN_LE(name, size, insn) \ static inline u##size name(const volatile u##size __iomem *addr) \ { \ u##size ret; \ @@ -122,7 +122,7 @@ static inline u##size name(const volatile u##size __iomem *addr) \ return ret; \ } -#define DEF_MMIO_OUT_X(name, size, insn) \ +#define DEF_MMIO_OUT_LE(name, size, insn) \ static inline void name(volatile u##size __iomem *addr, u##size val) \ { \ __asm__ __volatile__("sync;"#insn" %1,0,%2" \ @@ -130,7 +130,7 @@ static inline void name(volatile u##size __iomem *addr, u##size val) \ IO_SET_SYNC_FLAG(); \ } #else /* newer gcc */ -#define DEF_MMIO_IN_X(name, size, insn) \ +#define DEF_MMIO_IN_LE(name, size, insn) \ static inline u##size name(const volatile u##size __iomem *addr) \ { \ u##size ret; \ @@ -139,7 +139,7 @@ static inline u##size name(const volatile u##size __iomem *addr) \ return ret; \ } -#define DEF_MMIO_OUT_X(name, size, insn) \ +#define DEF_MMIO_OUT_LE(name, size, insn) \ static inline void name(volatile u##size __iomem *addr, u##size val) \ { \ __asm__ __volatile__("sync;"#insn" %1,%y0" \ @@ -148,7 +148,7 @@ static inline void name(volatile u##size __iomem *addr, u##size val) \ } #endif -#define DEF_MMIO_IN_D(name, size, insn) \ +#define DEF_MMIO_IN_BE(name, size, insn) \ static inline u##size name(const volatile u##size __iomem *addr) \ { \ u##size ret; \ @@ -157,7 +157,7 @@ static inline u##size name(const volatile u##size __iomem *addr) \ return ret; \ } -#define DEF_MMIO_OUT_D(name, size, insn) \ +#define DEF_MMIO_OUT_BE(name, size, insn) \ static inline void name(volatile u##size __iomem *addr, u##size val) \ { \ __asm__ __volatile__("sync;"#insn"%U0%X0 %1,%0" \ @@ -165,37 +165,22 @@ static inline void name(volatile u##size __iomem *addr, u##size val) \ IO_SET_SYNC_FLAG(); \ } -DEF_MMIO_IN_D(in_8, 8, lbz); -DEF_MMIO_OUT_D(out_8, 8, stb); -#ifdef __BIG_ENDIAN__ -DEF_MMIO_IN_D(in_be16, 16, lhz); -DEF_MMIO_IN_D(in_be32, 32, lwz); -DEF_MMIO_IN_X(in_le16, 16, lhbrx); -DEF_MMIO_IN_X(in_le32, 32, lwbrx); +DEF_MMIO_IN_BE(in_8, 8, lbz); +DEF_MMIO_IN_BE(in_be16, 16, lhz); +DEF_MMIO_IN_BE(in_be32, 32, lwz); +DEF_MMIO_IN_LE(in_le16, 16, lhbrx); +DEF_MMIO_IN_LE(in_le32, 32, lwbrx); -DEF_MMIO_OUT_D(out_be16, 16, sth); -DEF_MMIO_OUT_D(out_be32, 32, stw); -DEF_MMIO_OUT_X(out_le16, 16, sthbrx); -DEF_MMIO_OUT_X(out_le32, 32, stwbrx); -#else -DEF_MMIO_IN_X(in_be16, 16, lhbrx); -DEF_MMIO_IN_X(in_be32, 32, lwbrx); -DEF_MMIO_IN_D(in_le16, 16, lhz); -DEF_MMIO_IN_D(in_le32, 32, lwz); - -DEF_MMIO_OUT_X(out_be16, 16, sthbrx); -DEF_MMIO_OUT_X(out_be32, 32, stwbrx); -DEF_MMIO_OUT_D(out_le16, 16, sth); -DEF_MMIO_OUT_D(out_le32, 32, stw); - -#endif /* __BIG_ENDIAN */ +DEF_MMIO_OUT_BE(out_8, 8, stb); +DEF_MMIO_OUT_BE(out_be16, 16, sth); +DEF_MMIO_OUT_BE(out_be32, 32, stw); +DEF_MMIO_OUT_LE(out_le16, 16, sthbrx); +DEF_MMIO_OUT_LE(out_le32, 32, stwbrx); #ifdef __powerpc64__ - -#ifdef __BIG_ENDIAN__ -DEF_MMIO_OUT_D(out_be64, 64, std); -DEF_MMIO_IN_D(in_be64, 64, ld); +DEF_MMIO_OUT_BE(out_be64, 64, std); +DEF_MMIO_IN_BE(in_be64, 64, ld); /* There is no asm instructions for 64 bits reverse loads and stores */ static inline u64 in_le64(const volatile u64 __iomem *addr) @@ -207,22 +192,6 @@ static inline void out_le64(volatile u64 __iomem *addr, u64 val) { out_be64(addr, swab64(val)); } -#else -DEF_MMIO_OUT_D(out_le64, 64, std); -DEF_MMIO_IN_D(in_le64, 64, ld); - -/* There is no asm instructions for 64 bits reverse loads and stores */ -static inline u64 in_be64(const volatile u64 __iomem *addr) -{ - return swab64(in_le64(addr)); -} - -static inline void out_be64(volatile u64 __iomem *addr, u64 val) -{ - out_le64(addr, swab64(val)); -} - -#endif #endif /* __powerpc64__ */ /* |