]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/asm-arm/arch-ixp4xx/io.h
[ARM] 4767/2: ixp4xx: Add bitops.h include to io.h
[linux-2.6-omap-h63xx.git] / include / asm-arm / arch-ixp4xx / io.h
index b7b5414d9320d7289dad9b6142fa316ef9f2870e..de181ce958db86d23f4749e23ea2b0a8d4b43fb4 100644 (file)
 #ifndef __ASM_ARM_ARCH_IO_H
 #define __ASM_ARM_ARCH_IO_H
 
+#include <linux/bitops.h>
+
 #include <asm/hardware.h>
 
 #define IO_SPACE_LIMIT 0xffff0000
 
-#define        BIT(x)  ((1)<<(x))
-
-
 extern int (*ixp4xx_pci_read)(u32 addr, u32 cmd, u32* data);
 extern int ixp4xx_pci_write(u32 addr, u32 cmd, u32 data);
 
@@ -59,18 +58,18 @@ extern int ixp4xx_pci_write(u32 addr, u32 cmd, u32 data);
  * fallback to the default.
  */
 static inline void __iomem *
-__ixp4xx_ioremap(unsigned long addr, size_t size, unsigned long flags)
+__ixp4xx_ioremap(unsigned long addr, size_t size, unsigned int mtype)
 {
-       if((addr < 0x48000000) || (addr > 0x4fffffff))
-               return __ioremap(addr, size, flags);
+       if((addr < PCIBIOS_MIN_MEM) || (addr > 0x4fffffff))
+               return __arm_ioremap(addr, size, mtype);
 
-       return (void *)addr;
+       return (void __iomem *)addr;
 }
 
 static inline void
 __ixp4xx_iounmap(void __iomem *addr)
 {
-       if ((u32)addr >= VMALLOC_START)
+       if ((__force u32)addr >= VMALLOC_START)
                __iounmap(addr);
 }
 
@@ -144,9 +143,9 @@ __ixp4xx_writesw(volatile void __iomem *bus_addr, const u16 *vaddr, int count)
 static inline void 
 __ixp4xx_writel(u32 value, volatile void __iomem *p)
 {
-       u32 addr = (u32)p;
+       u32 addr = (__force u32)p;
        if (addr >= VMALLOC_START) {
-               __raw_writel(value, addr);
+               __raw_writel(value, p);
                return;
        }
 
@@ -211,11 +210,11 @@ __ixp4xx_readsw(const volatile void __iomem *bus_addr, u16 *vaddr, u32 count)
 static inline unsigned long 
 __ixp4xx_readl(const volatile void __iomem *p)
 {
-       u32 addr = (u32)p;
+       u32 addr = (__force u32)p;
        u32 data;
 
        if (addr >= VMALLOC_START)
-               return __raw_readl(addr);
+               return __raw_readl(p);
 
        if (ixp4xx_pci_read(addr, NP_CMD_MEMREAD, &data))
                return 0xffffffff;
@@ -238,23 +237,6 @@ __ixp4xx_readsl(const volatile void __iomem *bus_addr, u32 *vaddr, u32 count)
 #define memcpy_fromio(a,c,l)           _memcpy_fromio((a),(c),(l))
 #define memcpy_toio(c,a,l)             _memcpy_toio((c),(a),(l))
 
-static inline int
-check_signature(const unsigned char __iomem *bus_addr, const unsigned char *signature,
-               int length)
-{
-       int retval = 0;
-       do {
-               if (readb(bus_addr) != *signature)
-                       goto out;
-               bus_addr++;
-               signature++;
-               length--;
-       } while (length);
-       retval = 1;
-out:
-       return retval;
-}
-
 #endif
 
 #ifndef CONFIG_PCI
@@ -458,7 +440,7 @@ __ixp4xx_ioread32(const void __iomem *addr)
                return  (unsigned int)__ixp4xx_inl(port & PIO_MASK);
        else {
 #ifndef CONFIG_IXP4XX_INDIRECT_PCI
-               return le32_to_cpu(__raw_readl((u32)port));
+               return le32_to_cpu((__force __le32)__raw_readl(addr));
 #else
                return (unsigned int)__ixp4xx_readl(addr);
 #endif
@@ -543,7 +525,7 @@ __ixp4xx_iowrite32(u32 value, void __iomem *addr)
                __ixp4xx_outl(value, port & PIO_MASK);
        else
 #ifndef CONFIG_IXP4XX_INDIRECT_PCI
-               __raw_writel(cpu_to_le32(value), port);
+               __raw_writel((u32 __force)cpu_to_le32(value), addr);
 #else
                __ixp4xx_writel(value, addr);
 #endif