Merge branch 'next/cleanup2' of git://git.linaro.org/people/arnd/arm-soc
[pandora-kernel.git] / arch / arm / kernel / ecard.c
index d165001..4dd0eda 100644 (file)
@@ -237,7 +237,7 @@ static void ecard_init_pgtables(struct mm_struct *mm)
 
        memcpy(dst_pgd, src_pgd, sizeof(pgd_t) * (IO_SIZE / PGDIR_SIZE));
 
-       src_pgd = pgd_offset(mm, EASI_BASE);
+       src_pgd = pgd_offset(mm, (unsigned long)EASI_BASE);
        dst_pgd = pgd_offset(mm, EASI_START);
 
        memcpy(dst_pgd, src_pgd, sizeof(pgd_t) * (EASI_SIZE / PGDIR_SIZE));
@@ -674,44 +674,37 @@ static int __init ecard_probeirqhw(void)
 #define ecard_probeirqhw() (0)
 #endif
 
-#ifndef IO_EC_MEMC8_BASE
-#define IO_EC_MEMC8_BASE 0
-#endif
-
-static unsigned int __ecard_address(ecard_t *ec, card_type_t type, card_speed_t speed)
+static void __iomem *__ecard_address(ecard_t *ec, card_type_t type, card_speed_t speed)
 {
-       unsigned long address = 0;
+       void __iomem *address = NULL;
        int slot = ec->slot_no;
 
        if (ec->slot_no == 8)
-               return IO_EC_MEMC8_BASE;
+               return ECARD_MEMC8_BASE;
 
        ectcr &= ~(1 << slot);
 
        switch (type) {
        case ECARD_MEMC:
                if (slot < 4)
-                       address = IO_EC_MEMC_BASE + (slot << 12);
+                       address = ECARD_MEMC_BASE + (slot << 14);
                break;
 
        case ECARD_IOC:
                if (slot < 4)
-                       address = IO_EC_IOC_BASE + (slot << 12);
-#ifdef IO_EC_IOC4_BASE
+                       address = ECARD_IOC_BASE + (slot << 14);
                else
-                       address = IO_EC_IOC4_BASE + ((slot - 4) << 12);
-#endif
+                       address = ECARD_IOC4_BASE + ((slot - 4) << 14);
                if (address)
-                       address +=  speed << 17;
+                       address += speed << 19;
                break;
 
-#ifdef IO_EC_EASI_BASE
        case ECARD_EASI:
-               address = IO_EC_EASI_BASE + (slot << 22);
+               address = ECARD_EASI_BASE + (slot << 24);
                if (speed == ECARD_FAST)
                        ectcr |= 1 << slot;
                break;
-#endif
+
        default:
                break;
        }
@@ -990,6 +983,7 @@ ecard_probe(int slot, card_type_t type)
        ecard_t **ecp;
        ecard_t *ec;
        struct ex_ecid cid;
+       void __iomem *addr;
        int i, rc;
 
        ec = ecard_alloc_card(type, slot);
@@ -999,7 +993,7 @@ ecard_probe(int slot, card_type_t type)
        }
 
        rc = -ENODEV;
-       if ((ec->podaddr = __ecard_address(ec, type, ECARD_SYNC)) == 0)
+       if ((addr = __ecard_address(ec, type, ECARD_SYNC)) == NULL)
                goto nodev;
 
        cid.r_zero = 1;
@@ -1019,7 +1013,7 @@ ecard_probe(int slot, card_type_t type)
        ec->cid.fiqmask = cid.r_fiqmask;
        ec->cid.fiqoff  = ecard_gets24(cid.r_fiqoff);
        ec->fiqaddr     =
-       ec->irqaddr     = (void __iomem *)ioaddr(ec->podaddr);
+       ec->irqaddr     = addr;
 
        if (ec->cid.is) {
                ec->irqmask = ec->cid.irqmask;
@@ -1048,10 +1042,8 @@ ecard_probe(int slot, card_type_t type)
                set_irq_flags(ec->irq, IRQF_VALID);
        }
 
-#ifdef IO_EC_MEMC8_BASE
        if (slot == 8)
                ec->irq = 11;
-#endif
 #ifdef CONFIG_ARCH_RPC
        /* On RiscPC, only first two slots have DMA capability */
        if (slot < 2)
@@ -1097,9 +1089,7 @@ static int __init ecard_init(void)
                        ecard_probe(slot, ECARD_IOC);
        }
 
-#ifdef IO_EC_MEMC8_BASE
        ecard_probe(8, ECARD_IOC);
-#endif
 
        irqhw = ecard_probeirqhw();