Skip to content

Commit 1eac59d

Browse files
author
Russell King
committed
ARM: riscpc: add ecard quirk for Atomwide 3port serial card
Atomwide 3port serial cards seem to leave their interrupts active when exiting RISC OS, resulting in an interrupt storm during boot, and the expansion card interrupt being disabled. Avoid this by manually disabling the interrupt on each serial port via a custom quirk function. Signed-off-by: Russell King <[email protected]>
1 parent 090a37c commit 1eac59d

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

arch/arm/mach-rpc/ecard.c

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,21 @@ struct expcard_blacklist {
7070
unsigned short manufacturer;
7171
unsigned short product;
7272
const char *type;
73+
void (*init)(ecard_t *ec);
7374
};
7475

7576
static ecard_t *cards;
7677
static ecard_t *slot_to_expcard[MAX_ECARDS];
7778
static unsigned int ectcr;
7879

80+
static void atomwide_3p_quirk(ecard_t *ec);
81+
7982
/* List of descriptions of cards which don't have an extended
8083
* identification, or chunk directories containing a description.
8184
*/
8285
static 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 },
8488
};
8589

8690
asmlinkage extern int
@@ -871,6 +875,16 @@ void __iomem *ecardm_iomap(struct expansion_card *ec, unsigned int res,
871875
}
872876
EXPORT_SYMBOL(ecardm_iomap);
873877

878+
static 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+
874888
/*
875889
* Probe for an expansion card.
876890
*
@@ -927,7 +941,10 @@ static int __init ecard_probe(int slot, unsigned irq, card_type_t type)
927941
for (i = 0; i < ARRAY_SIZE(blacklist); i++)
928942
if (blacklist[i].manufacturer == ec->cid.manufacturer &&
929943
blacklist[i].product == ec->cid.product) {
930-
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);
931948
break;
932949
}
933950

0 commit comments

Comments
 (0)