diff options
Diffstat (limited to 'arch/arm/kernel/ecard.c')
-rw-r--r-- | arch/arm/kernel/ecard.c | 36 |
1 files changed, 13 insertions, 23 deletions
diff --git a/arch/arm/kernel/ecard.c b/arch/arm/kernel/ecard.c index d16500110ee9..4dd0edab6a65 100644 --- a/arch/arm/kernel/ecard.c +++ b/arch/arm/kernel/ecard.c | |||
@@ -237,7 +237,7 @@ static void ecard_init_pgtables(struct mm_struct *mm) | |||
237 | 237 | ||
238 | memcpy(dst_pgd, src_pgd, sizeof(pgd_t) * (IO_SIZE / PGDIR_SIZE)); | 238 | memcpy(dst_pgd, src_pgd, sizeof(pgd_t) * (IO_SIZE / PGDIR_SIZE)); |
239 | 239 | ||
240 | src_pgd = pgd_offset(mm, EASI_BASE); | 240 | src_pgd = pgd_offset(mm, (unsigned long)EASI_BASE); |
241 | dst_pgd = pgd_offset(mm, EASI_START); | 241 | dst_pgd = pgd_offset(mm, EASI_START); |
242 | 242 | ||
243 | memcpy(dst_pgd, src_pgd, sizeof(pgd_t) * (EASI_SIZE / PGDIR_SIZE)); | 243 | memcpy(dst_pgd, src_pgd, sizeof(pgd_t) * (EASI_SIZE / PGDIR_SIZE)); |
@@ -674,44 +674,37 @@ static int __init ecard_probeirqhw(void) | |||
674 | #define ecard_probeirqhw() (0) | 674 | #define ecard_probeirqhw() (0) |
675 | #endif | 675 | #endif |
676 | 676 | ||
677 | #ifndef IO_EC_MEMC8_BASE | 677 | static void __iomem *__ecard_address(ecard_t *ec, card_type_t type, card_speed_t speed) |
678 | #define IO_EC_MEMC8_BASE 0 | ||
679 | #endif | ||
680 | |||
681 | static unsigned int __ecard_address(ecard_t *ec, card_type_t type, card_speed_t speed) | ||
682 | { | 678 | { |
683 | unsigned long address = 0; | 679 | void __iomem *address = NULL; |
684 | int slot = ec->slot_no; | 680 | int slot = ec->slot_no; |
685 | 681 | ||
686 | if (ec->slot_no == 8) | 682 | if (ec->slot_no == 8) |
687 | return IO_EC_MEMC8_BASE; | 683 | return ECARD_MEMC8_BASE; |
688 | 684 | ||
689 | ectcr &= ~(1 << slot); | 685 | ectcr &= ~(1 << slot); |
690 | 686 | ||
691 | switch (type) { | 687 | switch (type) { |
692 | case ECARD_MEMC: | 688 | case ECARD_MEMC: |
693 | if (slot < 4) | 689 | if (slot < 4) |
694 | address = IO_EC_MEMC_BASE + (slot << 12); | 690 | address = ECARD_MEMC_BASE + (slot << 14); |
695 | break; | 691 | break; |
696 | 692 | ||
697 | case ECARD_IOC: | 693 | case ECARD_IOC: |
698 | if (slot < 4) | 694 | if (slot < 4) |
699 | address = IO_EC_IOC_BASE + (slot << 12); | 695 | address = ECARD_IOC_BASE + (slot << 14); |
700 | #ifdef IO_EC_IOC4_BASE | ||
701 | else | 696 | else |
702 | address = IO_EC_IOC4_BASE + ((slot - 4) << 12); | 697 | address = ECARD_IOC4_BASE + ((slot - 4) << 14); |
703 | #endif | ||
704 | if (address) | 698 | if (address) |
705 | address += speed << 17; | 699 | address += speed << 19; |
706 | break; | 700 | break; |
707 | 701 | ||
708 | #ifdef IO_EC_EASI_BASE | ||
709 | case ECARD_EASI: | 702 | case ECARD_EASI: |
710 | address = IO_EC_EASI_BASE + (slot << 22); | 703 | address = ECARD_EASI_BASE + (slot << 24); |
711 | if (speed == ECARD_FAST) | 704 | if (speed == ECARD_FAST) |
712 | ectcr |= 1 << slot; | 705 | ectcr |= 1 << slot; |
713 | break; | 706 | break; |
714 | #endif | 707 | |
715 | default: | 708 | default: |
716 | break; | 709 | break; |
717 | } | 710 | } |
@@ -990,6 +983,7 @@ ecard_probe(int slot, card_type_t type) | |||
990 | ecard_t **ecp; | 983 | ecard_t **ecp; |
991 | ecard_t *ec; | 984 | ecard_t *ec; |
992 | struct ex_ecid cid; | 985 | struct ex_ecid cid; |
986 | void __iomem *addr; | ||
993 | int i, rc; | 987 | int i, rc; |
994 | 988 | ||
995 | ec = ecard_alloc_card(type, slot); | 989 | ec = ecard_alloc_card(type, slot); |
@@ -999,7 +993,7 @@ ecard_probe(int slot, card_type_t type) | |||
999 | } | 993 | } |
1000 | 994 | ||
1001 | rc = -ENODEV; | 995 | rc = -ENODEV; |
1002 | if ((ec->podaddr = __ecard_address(ec, type, ECARD_SYNC)) == 0) | 996 | if ((addr = __ecard_address(ec, type, ECARD_SYNC)) == NULL) |
1003 | goto nodev; | 997 | goto nodev; |
1004 | 998 | ||
1005 | cid.r_zero = 1; | 999 | cid.r_zero = 1; |
@@ -1019,7 +1013,7 @@ ecard_probe(int slot, card_type_t type) | |||
1019 | ec->cid.fiqmask = cid.r_fiqmask; | 1013 | ec->cid.fiqmask = cid.r_fiqmask; |
1020 | ec->cid.fiqoff = ecard_gets24(cid.r_fiqoff); | 1014 | ec->cid.fiqoff = ecard_gets24(cid.r_fiqoff); |
1021 | ec->fiqaddr = | 1015 | ec->fiqaddr = |
1022 | ec->irqaddr = (void __iomem *)ioaddr(ec->podaddr); | 1016 | ec->irqaddr = addr; |
1023 | 1017 | ||
1024 | if (ec->cid.is) { | 1018 | if (ec->cid.is) { |
1025 | ec->irqmask = ec->cid.irqmask; | 1019 | ec->irqmask = ec->cid.irqmask; |
@@ -1048,10 +1042,8 @@ ecard_probe(int slot, card_type_t type) | |||
1048 | set_irq_flags(ec->irq, IRQF_VALID); | 1042 | set_irq_flags(ec->irq, IRQF_VALID); |
1049 | } | 1043 | } |
1050 | 1044 | ||
1051 | #ifdef IO_EC_MEMC8_BASE | ||
1052 | if (slot == 8) | 1045 | if (slot == 8) |
1053 | ec->irq = 11; | 1046 | ec->irq = 11; |
1054 | #endif | ||
1055 | #ifdef CONFIG_ARCH_RPC | 1047 | #ifdef CONFIG_ARCH_RPC |
1056 | /* On RiscPC, only first two slots have DMA capability */ | 1048 | /* On RiscPC, only first two slots have DMA capability */ |
1057 | if (slot < 2) | 1049 | if (slot < 2) |
@@ -1097,9 +1089,7 @@ static int __init ecard_init(void) | |||
1097 | ecard_probe(slot, ECARD_IOC); | 1089 | ecard_probe(slot, ECARD_IOC); |
1098 | } | 1090 | } |
1099 | 1091 | ||
1100 | #ifdef IO_EC_MEMC8_BASE | ||
1101 | ecard_probe(8, ECARD_IOC); | 1092 | ecard_probe(8, ECARD_IOC); |
1102 | #endif | ||
1103 | 1093 | ||
1104 | irqhw = ecard_probeirqhw(); | 1094 | irqhw = ecard_probeirqhw(); |
1105 | 1095 | ||