]> err.no Git - linux-2.6/blobdiff - include/asm-arm/arch-orion5x/io.h
Merge git://git.kernel.org/pub/scm/linux/kernel/git/kkeil/ISDN-2.6
[linux-2.6] / include / asm-arm / arch-orion5x / io.h
index 5148ab7ad1f83404b9ae53caeba8582f4ed08941..59f1bc96a23b7a803287cf6719b4489921043fa1 100644 (file)
 #include "orion5x.h"
 
 #define IO_SPACE_LIMIT         0xffffffff
-#define IO_SPACE_REMAP         ORION5X_PCI_SYS_IO_BASE
 
 static inline void __iomem *
 __arch_ioremap(unsigned long paddr, size_t size, unsigned int mtype)
 {
        void __iomem *retval;
-
-       if (mtype == MT_DEVICE && size && paddr >= ORION5X_REGS_PHYS_BASE &&
-           paddr + size <= ORION5X_REGS_PHYS_BASE + ORION5X_REGS_SIZE) {
-               retval = (void __iomem *)ORION5X_REGS_VIRT_BASE +
-                               (paddr - ORION5X_REGS_PHYS_BASE);
+       unsigned long offs = paddr - ORION5X_REGS_PHYS_BASE;
+       if (mtype == MT_DEVICE && size && offs < ORION5X_REGS_SIZE &&
+           size <= ORION5X_REGS_SIZE && offs + size <= ORION5X_REGS_SIZE) {
+               retval = (void __iomem *)ORION5X_REGS_VIRT_BASE + offs;
        } else {
                retval = __arm_ioremap(paddr, size, mtype);
        }
@@ -54,15 +52,12 @@ static inline void __iomem *__io(unsigned long addr)
 /*****************************************************************************
  * Helpers to access Orion registers
  ****************************************************************************/
-#define orion5x_read(r)                __raw_readl(r)
-#define orion5x_write(r, val)  __raw_writel(val, r)
-
 /*
  * These are not preempt-safe.  Locks, if needed, must be taken
  * care of by the caller.
  */
-#define orion5x_setbits(r, mask)       orion5x_write((r), orion5x_read(r) | (mask))
-#define orion5x_clrbits(r, mask)       orion5x_write((r), orion5x_read(r) & ~(mask))
+#define orion5x_setbits(r, mask)       writel(readl(r) | (mask), (r))
+#define orion5x_clrbits(r, mask)       writel(readl(r) & ~(mask), (r))
 
 
 #endif