diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-03-01 13:46:46 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-03-24 05:37:37 -0400 |
commit | 530c2eaa6ab69fca94911f2aa74fe3e11b1cd19b (patch) | |
tree | ea4e3c5a028a3d5eaccb8cffe244eb5439b09e47 | |
parent | b4ac08492d06e4f2cea24a5b2579b4b0a0f537ce (diff) |
ARM: riscpc: remove expansion card irq mask register
This register is only present on older platforms, and not on RiscPC,
so lets remove this unused support.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r-- | arch/arm/mach-rpc/ecard.c | 103 |
1 files changed, 2 insertions, 101 deletions
diff --git a/arch/arm/mach-rpc/ecard.c b/arch/arm/mach-rpc/ecard.c index 1a6cfc8ca277..f7ee875b2f37 100644 --- a/arch/arm/mach-rpc/ecard.c +++ b/arch/arm/mach-rpc/ecard.c | |||
@@ -55,10 +55,6 @@ | |||
55 | 55 | ||
56 | #include "ecard.h" | 56 | #include "ecard.h" |
57 | 57 | ||
58 | #ifndef CONFIG_ARCH_RPC | ||
59 | #define HAVE_EXPMASK | ||
60 | #endif | ||
61 | |||
62 | struct ecard_request { | 58 | struct ecard_request { |
63 | void (*fn)(struct ecard_request *); | 59 | void (*fn)(struct ecard_request *); |
64 | ecard_t *ec; | 60 | ecard_t *ec; |
@@ -78,9 +74,6 @@ struct expcard_blacklist { | |||
78 | static ecard_t *cards; | 74 | static ecard_t *cards; |
79 | static ecard_t *slot_to_expcard[MAX_ECARDS]; | 75 | static ecard_t *slot_to_expcard[MAX_ECARDS]; |
80 | static unsigned int ectcr; | 76 | static unsigned int ectcr; |
81 | #ifdef HAS_EXPMASK | ||
82 | static unsigned int have_expmask; | ||
83 | #endif | ||
84 | 77 | ||
85 | /* List of descriptions of cards which don't have an extended | 78 | /* List of descriptions of cards which don't have an extended |
86 | * identification, or chunk directories containing a description. | 79 | * identification, or chunk directories containing a description. |
@@ -391,22 +384,10 @@ int ecard_readchunk(struct in_chunk_dir *cd, ecard_t *ec, int id, int num) | |||
391 | 384 | ||
392 | static void ecard_def_irq_enable(ecard_t *ec, int irqnr) | 385 | static void ecard_def_irq_enable(ecard_t *ec, int irqnr) |
393 | { | 386 | { |
394 | #ifdef HAS_EXPMASK | ||
395 | if (irqnr < 4 && have_expmask) { | ||
396 | have_expmask |= 1 << irqnr; | ||
397 | __raw_writeb(have_expmask, EXPMASK_ENABLE); | ||
398 | } | ||
399 | #endif | ||
400 | } | 387 | } |
401 | 388 | ||
402 | static void ecard_def_irq_disable(ecard_t *ec, int irqnr) | 389 | static void ecard_def_irq_disable(ecard_t *ec, int irqnr) |
403 | { | 390 | { |
404 | #ifdef HAS_EXPMASK | ||
405 | if (irqnr < 4 && have_expmask) { | ||
406 | have_expmask &= ~(1 << irqnr); | ||
407 | __raw_writeb(have_expmask, EXPMASK_ENABLE); | ||
408 | } | ||
409 | #endif | ||
410 | } | 391 | } |
411 | 392 | ||
412 | static int ecard_def_irq_pending(ecard_t *ec) | 393 | static int ecard_def_irq_pending(ecard_t *ec) |
@@ -598,83 +579,6 @@ ecard_irq_handler(unsigned int irq, struct irq_desc *desc) | |||
598 | ecard_check_lockup(desc); | 579 | ecard_check_lockup(desc); |
599 | } | 580 | } |
600 | 581 | ||
601 | #ifdef HAS_EXPMASK | ||
602 | static unsigned char priority_masks[] = | ||
603 | { | ||
604 | 0xf0, 0xf1, 0xf3, 0xf7, 0xff, 0xff, 0xff, 0xff | ||
605 | }; | ||
606 | |||
607 | static unsigned char first_set[] = | ||
608 | { | ||
609 | 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, | ||
610 | 0x03, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00 | ||
611 | }; | ||
612 | |||
613 | static void | ||
614 | ecard_irqexp_handler(unsigned int irq, struct irq_desc *desc) | ||
615 | { | ||
616 | const unsigned int statusmask = 15; | ||
617 | unsigned int status; | ||
618 | |||
619 | status = __raw_readb(EXPMASK_STATUS) & statusmask; | ||
620 | if (status) { | ||
621 | unsigned int slot = first_set[status]; | ||
622 | ecard_t *ec = slot_to_ecard(slot); | ||
623 | |||
624 | if (ec->claimed) { | ||
625 | /* | ||
626 | * this ugly code is so that we can operate a | ||
627 | * prioritorising system: | ||
628 | * | ||
629 | * Card 0 highest priority | ||
630 | * Card 1 | ||
631 | * Card 2 | ||
632 | * Card 3 lowest priority | ||
633 | * | ||
634 | * Serial cards should go in 0/1, ethernet/scsi in 2/3 | ||
635 | * otherwise you will lose serial data at high speeds! | ||
636 | */ | ||
637 | generic_handle_irq(ec->irq); | ||
638 | } else { | ||
639 | printk(KERN_WARNING "card%d: interrupt from unclaimed " | ||
640 | "card???\n", slot); | ||
641 | have_expmask &= ~(1 << slot); | ||
642 | __raw_writeb(have_expmask, EXPMASK_ENABLE); | ||
643 | } | ||
644 | } else | ||
645 | printk(KERN_WARNING "Wild interrupt from backplane (masks)\n"); | ||
646 | } | ||
647 | |||
648 | static int __init ecard_probeirqhw(void) | ||
649 | { | ||
650 | ecard_t *ec; | ||
651 | int found; | ||
652 | |||
653 | __raw_writeb(0x00, EXPMASK_ENABLE); | ||
654 | __raw_writeb(0xff, EXPMASK_STATUS); | ||
655 | found = (__raw_readb(EXPMASK_STATUS) & 15) == 0; | ||
656 | __raw_writeb(0xff, EXPMASK_ENABLE); | ||
657 | |||
658 | if (found) { | ||
659 | printk(KERN_DEBUG "Expansion card interrupt " | ||
660 | "management hardware found\n"); | ||
661 | |||
662 | /* for each card present, set a bit to '1' */ | ||
663 | have_expmask = 0x80000000; | ||
664 | |||
665 | for (ec = cards; ec; ec = ec->next) | ||
666 | have_expmask |= 1 << ec->slot_no; | ||
667 | |||
668 | __raw_writeb(have_expmask, EXPMASK_ENABLE); | ||
669 | } | ||
670 | |||
671 | return found; | ||
672 | } | ||
673 | #else | ||
674 | #define ecard_irqexp_handler NULL | ||
675 | #define ecard_probeirqhw() (0) | ||
676 | #endif | ||
677 | |||
678 | static void __iomem *__ecard_address(ecard_t *ec, card_type_t type, card_speed_t speed) | 582 | static void __iomem *__ecard_address(ecard_t *ec, card_type_t type, card_speed_t speed) |
679 | { | 583 | { |
680 | void __iomem *address = NULL; | 584 | void __iomem *address = NULL; |
@@ -1073,7 +977,7 @@ static int __init ecard_probe(int slot, unsigned irq, card_type_t type) | |||
1073 | static int __init ecard_init(void) | 977 | static int __init ecard_init(void) |
1074 | { | 978 | { |
1075 | struct task_struct *task; | 979 | struct task_struct *task; |
1076 | int slot, irqhw, irqbase; | 980 | int slot, irqbase; |
1077 | 981 | ||
1078 | irqbase = irq_alloc_descs(-1, 0, 8, -1); | 982 | irqbase = irq_alloc_descs(-1, 0, 8, -1); |
1079 | if (irqbase < 0) | 983 | if (irqbase < 0) |
@@ -1096,10 +1000,7 @@ static int __init ecard_init(void) | |||
1096 | 1000 | ||
1097 | ecard_probe(8, 11, ECARD_IOC); | 1001 | ecard_probe(8, 11, ECARD_IOC); |
1098 | 1002 | ||
1099 | irqhw = ecard_probeirqhw(); | 1003 | irq_set_chained_handler(IRQ_EXPANSIONCARD, ecard_irq_handler); |
1100 | |||
1101 | irq_set_chained_handler(IRQ_EXPANSIONCARD, | ||
1102 | irqhw ? ecard_irqexp_handler : ecard_irq_handler); | ||
1103 | 1004 | ||
1104 | ecard_proc_init(); | 1005 | ecard_proc_init(); |
1105 | 1006 | ||