aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-rpc/ecard.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-rpc/ecard.c')
-rw-r--r--arch/arm/mach-rpc/ecard.c32
1 files changed, 26 insertions, 6 deletions
diff --git a/arch/arm/mach-rpc/ecard.c b/arch/arm/mach-rpc/ecard.c
index 04b2f22c2739..eec5ecd6e948 100644
--- a/arch/arm/mach-rpc/ecard.c
+++ b/arch/arm/mach-rpc/ecard.c
@@ -70,17 +70,21 @@ struct expcard_blacklist {
70 unsigned short manufacturer; 70 unsigned short manufacturer;
71 unsigned short product; 71 unsigned short product;
72 const char *type; 72 const char *type;
73 void (*init)(ecard_t *ec);
73}; 74};
74 75
75static ecard_t *cards; 76static ecard_t *cards;
76static ecard_t *slot_to_expcard[MAX_ECARDS]; 77static ecard_t *slot_to_expcard[MAX_ECARDS];
77static unsigned int ectcr; 78static unsigned int ectcr;
78 79
80static void atomwide_3p_quirk(ecard_t *ec);
81
79/* List of descriptions of cards which don't have an extended 82/* List of descriptions of cards which don't have an extended
80 * identification, or chunk directories containing a description. 83 * identification, or chunk directories containing a description.
81 */ 84 */
82static struct expcard_blacklist __initdata blacklist[] = { 85static struct expcard_blacklist __initdata blacklist[] = {
83 { MANU_ACORN, PROD_ACORN_ETHER1, "Acorn Ether1" } 86 { MANU_ACORN, PROD_ACORN_ETHER1, "Acorn Ether1" },
87 { MANU_ATOMWIDE, PROD_ATOMWIDE_3PSERIAL, NULL, atomwide_3p_quirk },
84}; 88};
85 89
86asmlinkage extern int 90asmlinkage extern int
@@ -496,18 +500,21 @@ static void ecard_dump_irq_state(void)
496 printk("Expansion card IRQ state:\n"); 500 printk("Expansion card IRQ state:\n");
497 501
498 for (ec = cards; ec; ec = ec->next) { 502 for (ec = cards; ec; ec = ec->next) {
503 const char *claimed;
504
499 if (ec->slot_no == 8) 505 if (ec->slot_no == 8)
500 continue; 506 continue;
501 507
502 printk(" %d: %sclaimed, ", 508 claimed = ec->claimed ? "" : "not ";
503 ec->slot_no, ec->claimed ? "" : "not ");
504 509
505 if (ec->ops && ec->ops->irqpending && 510 if (ec->ops && ec->ops->irqpending &&
506 ec->ops != &ecard_default_ops) 511 ec->ops != &ecard_default_ops)
507 printk("irq %spending\n", 512 printk(" %d: %sclaimed irq %spending\n",
513 ec->slot_no, claimed,
508 ec->ops->irqpending(ec) ? "" : "not "); 514 ec->ops->irqpending(ec) ? "" : "not ");
509 else 515 else
510 printk("irqaddr %p, mask = %02X, status = %02X\n", 516 printk(" %d: %sclaimed irqaddr %p, mask = %02X, status = %02X\n",
517 ec->slot_no, claimed,
511 ec->irqaddr, ec->irqmask, readb(ec->irqaddr)); 518 ec->irqaddr, ec->irqmask, readb(ec->irqaddr));
512 } 519 }
513} 520}
@@ -868,6 +875,16 @@ void __iomem *ecardm_iomap(struct expansion_card *ec, unsigned int res,
868} 875}
869EXPORT_SYMBOL(ecardm_iomap); 876EXPORT_SYMBOL(ecardm_iomap);
870 877
878static void atomwide_3p_quirk(ecard_t *ec)
879{
880 void __iomem *addr = __ecard_address(ec, ECARD_IOC, ECARD_SYNC);
881 unsigned int i;
882
883 /* Disable interrupts on each port */
884 for (i = 0x2000; i <= 0x2800; i += 0x0400)
885 writeb(0, addr + i + 4);
886}
887
871/* 888/*
872 * Probe for an expansion card. 889 * Probe for an expansion card.
873 * 890 *
@@ -924,7 +941,10 @@ static int __init ecard_probe(int slot, unsigned irq, card_type_t type)
924 for (i = 0; i < ARRAY_SIZE(blacklist); i++) 941 for (i = 0; i < ARRAY_SIZE(blacklist); i++)
925 if (blacklist[i].manufacturer == ec->cid.manufacturer && 942 if (blacklist[i].manufacturer == ec->cid.manufacturer &&
926 blacklist[i].product == ec->cid.product) { 943 blacklist[i].product == ec->cid.product) {
927 ec->card_desc = blacklist[i].type; 944 if (blacklist[i].type)
945 ec->card_desc = blacklist[i].type;
946 if (blacklist[i].init)
947 blacklist[i].init(ec);
928 break; 948 break;
929 } 949 }
930 950