2 * linux/arch/arm/kernel/ecard.c
4 * Find all installed expansion cards, and handle interrupts from them.
6 * Copyright 1995-1998 Russell King
8 * Created from information from Acorns RiscOS3 PRMs
10 * 08-Dec-1996 RMK Added code for the 9'th expansion card - the ether
12 * 06-May-1997 RMK Added blacklist for cards whose loader doesn't work.
13 * 12-Sep-1997 RMK Created new handling of interrupt enables/disables
14 * - cards can now register their own routine to control
15 * interrupts (recommended).
16 * 29-Sep-1997 RMK Expansion card interrupt hardware not being re-enabled
17 * on reset from Linux. (Caused cards not to respond
18 * under RiscOS without hard reset).
19 * 15-Feb-1998 RMK Added DMA support
20 * 12-Sep-1998 RMK Added EASI support
21 * 10-Jan-1999 RMK Run loaders in a simulated RISC OS environment.
22 * 17-Apr-1999 RMK Support for EASI Type C cycles.
26 #define __KERNEL_SYSCALLS__
28 #include <linux/config.h>
29 #include <linux/module.h>
30 #include <linux/kernel.h>
31 #include <linux/types.h>
32 #include <linux/sched.h>
33 #include <linux/interrupt.h>
35 #include <linux/malloc.h>
36 #include <linux/proc_fs.h>
37 #include <linux/init.h>
40 #include <asm/ecard.h>
41 #include <asm/hardware.h>
44 #include <asm/pgalloc.h>
45 #include <asm/mmu_context.h>
47 #ifdef CONFIG_ARCH_ARC
48 #include <asm/arch/oldlatches.h>
50 #define oldlatch_init()
53 #ifndef CONFIG_ARCH_RPC
62 struct ecard_request
{
67 unsigned int use_loader
;
71 struct expcard_blacklist
{
72 unsigned short manufacturer
;
73 unsigned short product
;
77 static ecard_t
*cards
;
78 static ecard_t
*slot_to_expcard
[MAX_ECARDS
];
79 static unsigned int ectcr
;
81 static unsigned int have_expmask
;
84 /* List of descriptions of cards which don't have an extended
85 * identification, or chunk directories containing a description.
87 static struct expcard_blacklist __initdata blacklist
[] = {
88 { MANU_ACORN
, PROD_ACORN_ETHER1
, "Acorn Ether1" }
92 ecard_loader_reset(volatile unsigned char *pa
, loader_t loader
);
94 ecard_loader_read(int off
, volatile unsigned char *pa
, loader_t loader
);
95 extern int setup_arm_irq(int, struct irqaction
*);
96 extern void do_ecard_IRQ(int, struct pt_regs
*);
100 ecard_irq_noexpmask(int intr_no
, void *dev_id
, struct pt_regs
*regs
);
102 static struct irqaction irqexpansioncard
= {
103 ecard_irq_noexpmask
, SA_INTERRUPT
, 0, "expansion cards", NULL
, NULL
106 static inline unsigned short
107 ecard_getu16(unsigned char *v
)
109 return v
[0] | v
[1] << 8;
112 static inline signed long
113 ecard_gets24(unsigned char *v
)
115 return v
[0] | v
[1] << 8 | v
[2] << 16 | ((v
[2] & 0x80) ? 0xff000000 : 0);
118 static inline ecard_t
*
119 slot_to_ecard(unsigned int slot
)
121 return slot
< MAX_ECARDS
? slot_to_expcard
[slot
] : NULL
;
124 /* ===================== Expansion card daemon ======================== */
126 * Since the loader programs on the expansion cards need to be run
127 * in a specific environment, create a separate task with this
128 * environment up, and pass requests to this task as and when we
131 * This should allow 99% of loaders to be called from Linux.
133 * From a security standpoint, we trust the card vendors. This
134 * may be a misplaced trust.
136 #define BUS_ADDR(x) ((((unsigned long)(x)) << 2) + IO_BASE)
137 #define POD_INT_ADDR(x) ((volatile unsigned char *)\
138 ((BUS_ADDR((x)) - IO_BASE) + IO_START))
141 ecard_task_reset(struct ecard_request
*req
)
143 if (req
->ec
== NULL
) {
146 for (ec
= cards
; ec
; ec
= ec
->next
) {
147 printk(KERN_DEBUG
"Resetting card %d\n",
151 ecard_loader_reset(POD_INT_ADDR(ec
->podaddr
),
154 printk(KERN_DEBUG
"All cards reset\n");
155 } else if (req
->ec
->loader
)
156 ecard_loader_reset(POD_INT_ADDR(req
->ec
->podaddr
),
161 ecard_task_readbytes(struct ecard_request
*req
)
163 unsigned char *buf
= (unsigned char *)req
->buffer
;
164 volatile unsigned char *base_addr
=
165 (volatile unsigned char *)POD_INT_ADDR(req
->ec
->podaddr
);
166 unsigned int len
= req
->length
;
168 if (req
->ec
->slot_no
== 8) {
170 * The card maintains an index which
171 * increments the address into a 4096-byte
172 * page on each access. We need to keep
173 * track of the counter.
175 static unsigned int index
;
176 unsigned int offset
, page
;
177 unsigned char byte
= 0; /* keep gcc quiet */
179 offset
= req
->address
& 4095;
180 page
= req
->address
>> 12;
187 if (offset
== 0 || index
> offset
) {
189 * We need to reset the index counter.
195 while (index
<= offset
) {
196 byte
= base_addr
[page
];
203 byte
= base_addr
[page
];
208 unsigned int off
= req
->address
;
210 if (!req
->use_loader
|| !req
->ec
->loader
) {
213 *buf
++ = base_addr
[off
];
219 * The following is required by some
220 * expansion card loader programs.
222 *(unsigned long *)0x108 = 0;
223 *buf
++ = ecard_loader_read(off
++, base_addr
,
232 static pid_t ecard_pid
;
233 static wait_queue_head_t ecard_wait
;
234 static wait_queue_head_t ecard_done
;
235 static struct ecard_request
*ecard_req
;
237 /* to be removed when exec_mmap becomes extern */
238 static int exec_mmap(void)
240 struct mm_struct
* mm
, * old_mm
;
242 old_mm
= current
->mm
;
243 if (old_mm
&& atomic_read(&old_mm
->mm_users
) == 1) {
244 flush_cache_mm(old_mm
);
247 flush_tlb_mm(old_mm
);
253 struct mm_struct
*active_mm
= current
->active_mm
;
256 current
->active_mm
= mm
;
257 activate_mm(active_mm
, mm
);
260 if (active_mm
!= old_mm
) BUG();
271 * Set up the expansion card
272 * daemon's environment.
275 ecard_init_task(void)
277 /* We want to set up the page tables for the following mapping:
279 * 0x03000000 0x03000000
280 * 0x03010000 unmapped
281 * 0x03210000 0x03210000
282 * 0x03400000 unmapped
283 * 0x08000000 0x08000000
284 * 0x10000000 unmapped
286 * FIXME: we don't follow this 100% yet.
288 pgd_t
*src_pgd
, *dst_pgd
;
289 unsigned int dst_addr
= IO_START
;
293 src_pgd
= pgd_offset(current
->mm
, IO_BASE
);
294 dst_pgd
= pgd_offset(current
->mm
, dst_addr
);
296 while (dst_addr
< IO_START
+ IO_SIZE
) {
297 *dst_pgd
++ = *src_pgd
++;
298 dst_addr
+= PGDIR_SIZE
;
301 flush_tlb_range(current
->mm
, IO_START
, IO_START
+ IO_SIZE
);
303 dst_addr
= EASI_START
;
304 src_pgd
= pgd_offset(current
->mm
, EASI_BASE
);
305 dst_pgd
= pgd_offset(current
->mm
, dst_addr
);
307 while (dst_addr
< EASI_START
+ EASI_SIZE
) {
308 *dst_pgd
++ = *src_pgd
++;
309 dst_addr
+= PGDIR_SIZE
;
312 flush_tlb_range(current
->mm
, EASI_START
, EASI_START
+ EASI_SIZE
);
316 ecard_task(void * unused
)
318 current
->session
= 1;
322 * We don't want /any/ signals, not even SIGKILL
324 sigfillset(¤t
->blocked
);
325 sigemptyset(¤t
->signal
);
327 strcpy(current
->comm
, "kecardd");
330 * Set up the environment
335 struct ecard_request
*req
;
338 req
= xchg(&ecard_req
, NULL
);
341 sigemptyset(¤t
->signal
);
342 interruptible_sleep_on(&ecard_wait
);
344 } while (req
== NULL
);
348 ecard_task_readbytes(req
);
352 ecard_task_reset(req
);
355 wake_up(&ecard_done
);
360 * Wake the expansion card daemon to action our request.
362 * FIXME: The test here is not sufficient to detect if the
366 ecard_call(struct ecard_request
*req
)
369 * If we're called from task 0, or from an
370 * interrupt (will be keyboard interrupt),
371 * we forcefully set up the memory map, and
372 * call the loader. We can't schedule, or
373 * sleep for this call.
375 if ((current
== &init_task
|| in_interrupt()) &&
376 req
->req
== req_reset
&& req
->ec
== NULL
) {
378 ecard_task_reset(req
);
381 ecard_pid
= kernel_thread(ecard_task
, NULL
, 0);
385 wake_up(&ecard_wait
);
387 sleep_on(&ecard_done
);
392 * On 26-bit processors, we don't need the kcardd thread to access the
393 * expansion card loaders. We do it directly.
396 ecard_call(struct ecard_request
*req
)
398 if (req
->req
== req_reset
)
399 ecard_task_reset(req
);
401 ecard_task_readbytes(req
);
405 /* ======================= Mid-level card control ===================== */
407 * This is called to reset the loaders for each expansion card on reboot.
409 * This is required to make sure that the card is in the correct state
410 * that RiscOS expects it to be.
413 ecard_reset(int slot
)
415 struct ecard_request req
;
422 req
.ec
= slot_to_ecard(slot
);
427 if (have_expmask
&& slot
< 0) {
429 EXPMASK_ENABLE
= have_expmask
;
435 ecard_readbytes(void *addr
, ecard_t
*ec
, int off
, int len
, int useld
)
437 struct ecard_request req
;
439 req
.req
= req_readbytes
;
443 req
.use_loader
= useld
;
449 int ecard_readchunk(struct in_chunk_dir
*cd
, ecard_t
*ec
, int id
, int num
)
451 struct ex_chunk_dir excd
;
459 ecard_readbytes(&excd
, ec
, index
, 8, useld
);
461 if (c_id(&excd
) == 0) {
462 if (!useld
&& ec
->loader
) {
469 if (c_id(&excd
) == 0xf0) { /* link */
470 index
= c_start(&excd
);
473 if (c_id(&excd
) == 0x80) { /* loader */
475 ec
->loader
= (loader_t
)kmalloc(c_len(&excd
),
478 ecard_readbytes(ec
->loader
, ec
,
480 c_len(&excd
), useld
);
486 if (c_id(&excd
) == id
&& num
-- == 0)
490 if (c_id(&excd
) & 0x80) {
491 switch (c_id(&excd
) & 0x70) {
493 ecard_readbytes((unsigned char *)excd
.d
.string
, ec
,
494 (int)c_start(&excd
), c_len(&excd
),
501 cd
->start_offset
= c_start(&excd
);
502 memcpy(cd
->d
.string
, excd
.d
.string
, 256);
506 /* ======================= Interrupt control ============================ */
508 static void ecard_def_irq_enable(ecard_t
*ec
, int irqnr
)
511 if (irqnr
< 4 && have_expmask
) {
512 have_expmask
|= 1 << irqnr
;
513 EXPMASK_ENABLE
= have_expmask
;
518 static void ecard_def_irq_disable(ecard_t
*ec
, int irqnr
)
521 if (irqnr
< 4 && have_expmask
) {
522 have_expmask
&= ~(1 << irqnr
);
523 EXPMASK_ENABLE
= have_expmask
;
528 static int ecard_def_irq_pending(ecard_t
*ec
)
530 return !ec
->irqmask
|| ec
->irqaddr
[0] & ec
->irqmask
;
533 static void ecard_def_fiq_enable(ecard_t
*ec
, int fiqnr
)
535 panic("ecard_def_fiq_enable called - impossible");
538 static void ecard_def_fiq_disable(ecard_t
*ec
, int fiqnr
)
540 panic("ecard_def_fiq_disable called - impossible");
543 static int ecard_def_fiq_pending(ecard_t
*ec
)
545 return !ec
->fiqmask
|| ec
->fiqaddr
[0] & ec
->fiqmask
;
548 static expansioncard_ops_t ecard_default_ops
= {
549 ecard_def_irq_enable
,
550 ecard_def_irq_disable
,
551 ecard_def_irq_pending
,
552 ecard_def_fiq_enable
,
553 ecard_def_fiq_disable
,
554 ecard_def_fiq_pending
558 * Enable and disable interrupts from expansion cards.
559 * (interrupts are disabled for these functions).
561 * They are not meant to be called directly, but via enable/disable_irq.
563 void ecard_enableirq(unsigned int irqnr
)
565 ecard_t
*ec
= slot_to_ecard(irqnr
- 32);
569 ec
->ops
= &ecard_default_ops
;
571 if (ec
->claimed
&& ec
->ops
->irqenable
)
572 ec
->ops
->irqenable(ec
, irqnr
);
574 printk(KERN_ERR
"ecard: rejecting request to "
575 "enable IRQs for %d\n", irqnr
);
579 void ecard_disableirq(unsigned int irqnr
)
581 ecard_t
*ec
= slot_to_ecard(irqnr
- 32);
585 ec
->ops
= &ecard_default_ops
;
587 if (ec
->ops
&& ec
->ops
->irqdisable
)
588 ec
->ops
->irqdisable(ec
, irqnr
);
592 void ecard_enablefiq(unsigned int fiqnr
)
594 ecard_t
*ec
= slot_to_ecard(fiqnr
);
598 ec
->ops
= &ecard_default_ops
;
600 if (ec
->claimed
&& ec
->ops
->fiqenable
)
601 ec
->ops
->fiqenable(ec
, fiqnr
);
603 printk(KERN_ERR
"ecard: rejecting request to "
604 "enable FIQs for %d\n", fiqnr
);
608 void ecard_disablefiq(unsigned int fiqnr
)
610 ecard_t
*ec
= slot_to_ecard(fiqnr
);
614 ec
->ops
= &ecard_default_ops
;
616 if (ec
->ops
->fiqdisable
)
617 ec
->ops
->fiqdisable(ec
, fiqnr
);
622 ecard_dump_irq_state(ecard_t
*ec
)
624 printk(" %d: %sclaimed, ",
626 ec
->claimed
? "" : "not ");
628 if (ec
->ops
&& ec
->ops
->irqpending
&&
629 ec
->ops
!= &ecard_default_ops
)
630 printk("irq %spending\n",
631 ec
->ops
->irqpending(ec
) ? "" : "not ");
633 printk("irqaddr %p, mask = %02X, status = %02X\n",
634 ec
->irqaddr
, ec
->irqmask
, *ec
->irqaddr
);
638 ecard_check_lockup(void)
640 static int last
, lockup
;
644 * If the timer interrupt has not run since the last million
645 * unrecognised expansion card interrupts, then there is
646 * something seriously wrong. Disable the expansion card
647 * interrupts so at least we can continue.
649 * Maybe we ought to start a timer to re-enable them some time
652 if (last
== jiffies
) {
654 if (lockup
> 1000000) {
655 printk(KERN_ERR
"\nInterrupt lockup detected - "
656 "disabling all expansion card interrupts\n");
658 disable_irq(IRQ_EXPANSIONCARD
);
660 printk("Expansion card IRQ state:\n");
662 for (ec
= cards
; ec
; ec
= ec
->next
)
663 ecard_dump_irq_state(ec
);
669 * If we did not recognise the source of this interrupt,
670 * warn the user, but don't flood the user with these messages.
672 if (!last
|| time_after(jiffies
, last
+ 5*HZ
)) {
674 printk(KERN_WARNING
"Unrecognised interrupt from backplane\n");
679 ecard_irq_noexpmask(int intr_no
, void *dev_id
, struct pt_regs
*regs
)
684 for (ec
= cards
; ec
; ec
= ec
->next
) {
687 if (!ec
->claimed
|| ec
->irq
== NO_IRQ
|| ec
->slot_no
== 8)
690 if (ec
->ops
&& ec
->ops
->irqpending
)
691 pending
= ec
->ops
->irqpending(ec
);
693 pending
= ecard_default_ops
.irqpending(ec
);
696 do_ecard_IRQ(ec
->irq
, regs
);
703 ecard_check_lockup();
707 static unsigned char priority_masks
[] =
709 0xf0, 0xf1, 0xf3, 0xf7, 0xff, 0xff, 0xff, 0xff
712 static unsigned char first_set
[] =
714 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00,
715 0x03, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00
719 ecard_irq_expmask(int intr_no
, void *dev_id
, struct pt_regs
*regs
)
721 const unsigned int statusmask
= 15;
724 status
= EXPMASK_STATUS
& statusmask
;
729 slot
= first_set
[status
];
730 ec
= slot_to_ecard(slot
);
732 unsigned int oldexpmask
;
734 * this ugly code is so that we can operate a
735 * prioritorising system:
737 * Card 0 highest priority
740 * Card 3 lowest priority
742 * Serial cards should go in 0/1, ethernet/scsi in 2/3
743 * otherwise you will lose serial data at high speeds!
745 oldexpmask
= have_expmask
;
746 EXPMASK_ENABLE
= (have_expmask
&= priority_masks
[slot
]);
748 do_ecard_IRQ(ec
->irq
, regs
);
750 EXPMASK_ENABLE
= have_expmask
= oldexpmask
;
751 status
= EXPMASK_STATUS
& statusmask
;
755 printk(KERN_WARNING
"card%d: interrupt from unclaimed "
757 EXPMASK_ENABLE
= (have_expmask
&= ~(1 << slot
));
760 printk(KERN_WARNING
"Wild interrupt from backplane (masks)\n");
764 ecard_probeirqhw(void)
769 EXPMASK_ENABLE
= 0x00;
770 EXPMASK_STATUS
= 0xff;
771 found
= ((EXPMASK_STATUS
& 15) == 0);
772 EXPMASK_ENABLE
= 0xff;
777 printk(KERN_DEBUG
"Expansion card interrupt "
778 "management hardware found\n");
780 irqexpansioncard
.handler
= ecard_irq_expmask
;
782 /* for each card present, set a bit to '1' */
783 have_expmask
= 0x80000000;
785 for (ec
= cards
; ec
; ec
= ec
->next
)
786 have_expmask
|= 1 << ec
->slot_no
;
788 EXPMASK_ENABLE
= have_expmask
;
791 #define ecard_probeirqhw()
794 #ifndef IO_EC_MEMC8_BASE
795 #define IO_EC_MEMC8_BASE 0
798 unsigned int ecard_address(ecard_t
*ec
, card_type_t type
, card_speed_t speed
)
800 unsigned long address
= 0;
801 int slot
= ec
->slot_no
;
803 if (ec
->slot_no
== 8)
804 return IO_EC_MEMC8_BASE
;
806 ectcr
&= ~(1 << slot
);
811 address
= IO_EC_MEMC_BASE
+ (slot
<< 12);
816 address
= IO_EC_IOC_BASE
+ (slot
<< 12);
817 #ifdef IO_EC_IOC4_BASE
819 address
= IO_EC_IOC4_BASE
+ ((slot
- 4) << 12);
822 address
+= speed
<< 17;
825 #ifdef IO_EC_EASI_BASE
827 address
= IO_EC_EASI_BASE
+ (slot
<< 22);
828 if (speed
== ECARD_FAST
)
837 outb(ectcr
, IOMD_ECTCR
);
842 static int ecard_prints(char *buffer
, ecard_t
*ec
)
844 char *start
= buffer
;
846 buffer
+= sprintf(buffer
, " %d: %s ", ec
->slot_no
,
847 ec
->type
== ECARD_EASI
? "EASI" : " ");
849 if (ec
->cid
.id
== 0) {
850 struct in_chunk_dir incd
;
852 buffer
+= sprintf(buffer
, "[%04X:%04X] ",
853 ec
->cid
.manufacturer
, ec
->cid
.product
);
855 if (!ec
->card_desc
&& ec
->cid
.cd
&&
856 ecard_readchunk(&incd
, ec
, 0xf5, 0)) {
857 ec
->card_desc
= kmalloc(strlen(incd
.d
.string
)+1, GFP_KERNEL
);
860 strcpy((char *)ec
->card_desc
, incd
.d
.string
);
863 buffer
+= sprintf(buffer
, "%s\n", ec
->card_desc
? ec
->card_desc
: "*unknown*");
865 buffer
+= sprintf(buffer
, "Simple card %d\n", ec
->cid
.id
);
867 return buffer
- start
;
870 static int get_ecard_dev_info(char *buf
, char **start
, off_t pos
, int count
)
877 while (ec
&& count
> cnt
) {
878 len
= ecard_prints(buf
, ec
);
882 *start
= buf
+ (pos
- (at
- len
));
890 return (count
> cnt
) ? cnt
: count
;
893 static struct proc_dir_entry
*proc_bus_ecard_dir
= NULL
;
895 static void ecard_proc_init(void)
897 proc_bus_ecard_dir
= proc_mkdir("ecard", proc_bus
);
898 create_proc_info_entry("devices", 0, proc_bus_ecard_dir
,
903 * Probe for an expansion card.
905 * If bit 1 of the first byte of the card is set, then the
906 * card does not exist.
909 ecard_probe(int slot
, card_type_t type
)
916 ec
= kmalloc(sizeof(ecard_t
), GFP_KERNEL
);
921 memset(ec
, 0, sizeof(ecard_t
));
928 ec
->card_desc
= NULL
;
929 ec
->ops
= &ecard_default_ops
;
932 if ((ec
->podaddr
= ecard_address(ec
, type
, ECARD_SYNC
)) == 0)
936 ecard_readbytes(&cid
, ec
, 0, 16, 0);
940 ec
->cid
.id
= cid
.r_id
;
941 ec
->cid
.cd
= cid
.r_cd
;
942 ec
->cid
.is
= cid
.r_is
;
944 ec
->cid
.manufacturer
= ecard_getu16(cid
.r_manu
);
945 ec
->cid
.product
= ecard_getu16(cid
.r_prod
);
946 ec
->cid
.country
= cid
.r_country
;
947 ec
->cid
.irqmask
= cid
.r_irqmask
;
948 ec
->cid
.irqoff
= ecard_gets24(cid
.r_irqoff
);
949 ec
->cid
.fiqmask
= cid
.r_fiqmask
;
950 ec
->cid
.fiqoff
= ecard_gets24(cid
.r_fiqoff
);
952 ec
->irqaddr
= (unsigned char *)ioaddr(ec
->podaddr
);
955 ec
->irqmask
= ec
->cid
.irqmask
;
956 ec
->irqaddr
+= ec
->cid
.irqoff
;
957 ec
->fiqmask
= ec
->cid
.fiqmask
;
958 ec
->fiqaddr
+= ec
->cid
.fiqoff
;
964 for (i
= 0; i
< sizeof(blacklist
) / sizeof(*blacklist
); i
++)
965 if (blacklist
[i
].manufacturer
== ec
->cid
.manufacturer
&&
966 blacklist
[i
].product
== ec
->cid
.product
) {
967 ec
->card_desc
= blacklist
[i
].type
;
972 #ifdef IO_EC_MEMC8_BASE
976 #ifdef CONFIG_ARCH_RPC
977 /* On RiscPC, only first two slots have DMA capability */
981 #if 0 /* We don't support FIQs on expansion cards at the moment */
987 for (ecp
= &cards
; *ecp
; ecp
= &(*ecp
)->next
);
995 slot_to_expcard
[slot
] = ec
;
1000 static ecard_t
*finding_pos
;
1002 void ecard_startfind(void)
1007 ecard_t
*ecard_find(int cid
, const card_ids
*cids
)
1010 finding_pos
= cards
;
1012 finding_pos
= finding_pos
->next
;
1014 for (; finding_pos
; finding_pos
= finding_pos
->next
) {
1015 if (finding_pos
->claimed
)
1019 if ((finding_pos
->cid
.id
^ cid
) == 0)
1022 unsigned int manufacturer
, product
;
1025 manufacturer
= finding_pos
->cid
.manufacturer
;
1026 product
= finding_pos
->cid
.product
;
1028 for (i
= 0; cids
[i
].manufacturer
!= 65535; i
++)
1029 if (manufacturer
== cids
[i
].manufacturer
&&
1030 product
== cids
[i
].product
)
1033 if (cids
[i
].manufacturer
!= 65535)
1041 static void __init
ecard_free_all(void)
1045 for (ec
= cards
; ec
; ec
= ecn
) {
1053 memset(slot_to_expcard
, 0, sizeof(slot_to_expcard
));
1057 * Initialise the expansion card system.
1058 * Locate all hardware - interrupt management and
1061 void __init
ecard_init(void)
1067 #ifdef CONFIG_CPU_32
1068 init_waitqueue_head(&ecard_wait
);
1069 init_waitqueue_head(&ecard_done
);
1072 printk("Probing expansion cards\n");
1074 for (slot
= 0; slot
< 8; slot
++) {
1075 if (ecard_probe(slot
, ECARD_EASI
) == -ENODEV
)
1076 ecard_probe(slot
, ECARD_IOC
);
1079 #ifdef IO_EC_MEMC8_BASE
1080 ecard_probe(8, ECARD_IOC
);
1085 if (setup_arm_irq(IRQ_EXPANSIONCARD
, &irqexpansioncard
)) {
1086 printk(KERN_ERR
"Unable to claim IRQ%d for expansion cards\n",
1094 EXPORT_SYMBOL(ecard_startfind
);
1095 EXPORT_SYMBOL(ecard_find
);
1096 EXPORT_SYMBOL(ecard_readchunk
);
1097 EXPORT_SYMBOL(ecard_address
);