diff options
Diffstat (limited to 'include/asm-powerpc')
-rw-r--r-- | include/asm-powerpc/dcr-mmio.h | 6 | ||||
-rw-r--r-- | include/asm-powerpc/dcr-native.h | 6 | ||||
-rw-r--r-- | include/asm-powerpc/io.h | 4 |
3 files changed, 8 insertions, 8 deletions
diff --git a/include/asm-powerpc/dcr-mmio.h b/include/asm-powerpc/dcr-mmio.h index 6b82c3ba495..08532ff1899 100644 --- a/include/asm-powerpc/dcr-mmio.h +++ b/include/asm-powerpc/dcr-mmio.h @@ -33,16 +33,16 @@ typedef struct { extern dcr_host_t dcr_map(struct device_node *dev, unsigned int dcr_n, unsigned int dcr_c); -extern void dcr_unmap(dcr_host_t host, unsigned int dcr_n, unsigned int dcr_c); +extern void dcr_unmap(dcr_host_t host, unsigned int dcr_c); static inline u32 dcr_read(dcr_host_t host, unsigned int dcr_n) { - return in_be32(host.token + dcr_n * host.stride); + return in_be32(host.token + ((host.base + dcr_n) * host.stride)); } static inline void dcr_write(dcr_host_t host, unsigned int dcr_n, u32 value) { - out_be32(host.token + dcr_n * host.stride, value); + out_be32(host.token + ((host.base + dcr_n) * host.stride), value); } extern u64 of_translate_dcr_address(struct device_node *dev, diff --git a/include/asm-powerpc/dcr-native.h b/include/asm-powerpc/dcr-native.h index f41058c0f6c..8dbb1ab0aa0 100644 --- a/include/asm-powerpc/dcr-native.h +++ b/include/asm-powerpc/dcr-native.h @@ -29,9 +29,9 @@ typedef struct { #define DCR_MAP_OK(host) (1) #define dcr_map(dev, dcr_n, dcr_c) ((dcr_host_t){ .base = (dcr_n) }) -#define dcr_unmap(host, dcr_n, dcr_c) do {} while (0) -#define dcr_read(host, dcr_n) mfdcr(dcr_n) -#define dcr_write(host, dcr_n, value) mtdcr(dcr_n, value) +#define dcr_unmap(host, dcr_c) do {} while (0) +#define dcr_read(host, dcr_n) mfdcr(dcr_n + host.base) +#define dcr_write(host, dcr_n, value) mtdcr(dcr_n + host.base, value) /* Device Control Registers */ void __mtdcr(int reg, unsigned int val); diff --git a/include/asm-powerpc/io.h b/include/asm-powerpc/io.h index affba7052fb..0d0589ef8ea 100644 --- a/include/asm-powerpc/io.h +++ b/include/asm-powerpc/io.h @@ -138,12 +138,12 @@ 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) { - return le64_to_cpu(in_be64(addr)); + return swab64(in_be64(addr)); } static inline void out_le64(volatile u64 __iomem *addr, u64 val) { - out_be64(addr, cpu_to_le64(val)); + out_be64(addr, swab64(val)); } #endif /* __powerpc64__ */ |