9 #ifndef __ASM_MACH_POWERTV_IOREMAP_H
10 #define __ASM_MACH_POWERTV_IOREMAP_H
12 #include <linux/types.h>
14 #include <linux/compiler.h>
16 #include <asm/pgtable-bits.h>
17 #include <asm/addrspace.h>
21 #define IOR_PHYS_BITS (IOR_BPC * sizeof(phys_addr_t))
22 #define IOR_DMA_BITS (IOR_BPC * sizeof(dma_addr_t))
39 #define IOR_PHYS_MSBITS (IOR_PHYS_BITS - IOR_LSBITS)
40 #define IOR_NUM_PHYS_TO_DMA ((phys_addr_t) 1 << IOR_PHYS_MSBITS)
42 #define IOR_DMA_MSBITS (IOR_DMA_BITS - IOR_LSBITS)
43 #define IOR_NUM_DMA_TO_PHYS ((dma_addr_t) 1 << IOR_DMA_MSBITS)
57 #define _IOR_OFFSET_WIDTH(n) (1 << order_base_2(n))
58 #define IOR_OFFSET_WIDTH(n) \
59 (_IOR_OFFSET_WIDTH(n) < 8 ? 8 : _IOR_OFFSET_WIDTH(n))
61 #define IOR_PHYS_OFFSET_BITS IOR_OFFSET_WIDTH(IOR_PHYS_MSBITS)
62 #define IOR_PHYS_SHIFT (IOR_PHYS_BITS - IOR_PHYS_OFFSET_BITS)
64 #define IOR_DMA_OFFSET_BITS IOR_OFFSET_WIDTH(IOR_DMA_MSBITS)
65 #define IOR_DMA_SHIFT (IOR_DMA_BITS - IOR_DMA_OFFSET_BITS)
102 return dma + (_dma_to_phys_offset_raw(dma) <<
IOR_DMA_SHIFT);
129 start_offset = _dma_to_phys_offset_raw(start);
139 if (start_offset != 0) {
143 last = start + size - 1;
147 if (dma_to_phys_offset == start_offset &&
148 size != 0 && start <= last) {
152 result = (
void __iomem *) (
unsigned long)
155 result = (
void __iomem *) (
unsigned long)
163 static inline int plat_iounmap(
const volatile void __iomem *
addr)