Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 175868
b: refs/heads/master
c: cba3622
h: refs/heads/master
v: v3
  • Loading branch information
Krzysztof Hałasa committed Dec 5, 2009
1 parent fa5a948 commit e178411
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 58e570d1182a9dc3bc52d8dc508c6bd5b2d279c7
refs/heads/master: cba362221b12b102dff1f21b291fdc7b93e24a18
23 changes: 15 additions & 8 deletions trunk/arch/arm/mach-ixp4xx/include/mach/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,24 @@ extern int ixp4xx_pci_write(u32 addr, u32 cmd, u32 data);
* access registers. If something outside of PCI is ioremap'd, we
* fallback to the default.
*/

static inline int is_pci_memory(u32 addr)
{
return (addr >= PCIBIOS_MIN_MEM) && (addr <= 0x4FFFFFFF);
}

static inline void __iomem * __indirect_ioremap(unsigned long addr, size_t size,
unsigned int mtype)
{
if((addr < PCIBIOS_MIN_MEM) || (addr > 0x4fffffff))
if (!is_pci_memory(addr))
return __arm_ioremap(addr, size, mtype);

return (void __iomem *)addr;
}

static inline void __indirect_iounmap(void __iomem *addr)
{
if ((__force u32)addr >= VMALLOC_START)
if (!is_pci_memory((__force u32)addr))
__iounmap(addr);
}

Expand Down Expand Up @@ -94,7 +100,7 @@ static inline void __indirect_writeb(u8 value, volatile void __iomem *p)
u32 addr = (u32)p;
u32 n, byte_enables, data;

if (addr >= VMALLOC_START) {
if (!is_pci_memory(addr)) {
__raw_writeb(value, addr);
return;
}
Expand All @@ -117,7 +123,7 @@ static inline void __indirect_writew(u16 value, volatile void __iomem *p)
u32 addr = (u32)p;
u32 n, byte_enables, data;

if (addr >= VMALLOC_START) {
if (!is_pci_memory(addr)) {
__raw_writew(value, addr);
return;
}
Expand All @@ -138,7 +144,8 @@ static inline void __indirect_writesw(volatile void __iomem *bus_addr,
static inline void __indirect_writel(u32 value, volatile void __iomem *p)
{
u32 addr = (__force u32)p;
if (addr >= VMALLOC_START) {

if (!is_pci_memory(addr)) {
__raw_writel(value, p);
return;
}
Expand All @@ -158,7 +165,7 @@ static inline unsigned char __indirect_readb(const volatile void __iomem *p)
u32 addr = (u32)p;
u32 n, byte_enables, data;

if (addr >= VMALLOC_START)
if (!is_pci_memory(addr))
return __raw_readb(addr);

n = addr % 4;
Expand All @@ -181,7 +188,7 @@ static inline unsigned short __indirect_readw(const volatile void __iomem *p)
u32 addr = (u32)p;
u32 n, byte_enables, data;

if (addr >= VMALLOC_START)
if (!is_pci_memory(addr))
return __raw_readw(addr);

n = addr % 4;
Expand All @@ -204,7 +211,7 @@ static inline unsigned long __indirect_readl(const volatile void __iomem *p)
u32 addr = (__force u32)p;
u32 data;

if (addr >= VMALLOC_START)
if (!is_pci_memory(addr))
return __raw_readl(p);

if (ixp4xx_pci_read(addr, NP_CMD_MEMREAD, &data))
Expand Down

0 comments on commit e178411

Please sign in to comment.