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 #ifndef CONFIG_ARCH_RPC
56 struct ecard_request
{
61 unsigned int use_loader
;
65 struct expcard_blacklist
{
66 unsigned short manufacturer
;
67 unsigned short product
;
71 static ecard_t
*cards
;
72 static ecard_t
*slot_to_expcard
[MAX_ECARDS
];
73 static unsigned int ectcr
;
75 static unsigned int have_expmask
;
78 /* List of descriptions of cards which don't have an extended
79 * identification, or chunk directories containing a description.
81 static struct expcard_blacklist __initdata blacklist
[] = {
82 { MANU_ACORN
, PROD_ACORN_ETHER1
, "Acorn Ether1" }
86 ecard_loader_reset(volatile unsigned char *pa
, loader_t loader
);
88 ecard_loader_read(int off
, volatile unsigned char *pa
, loader_t loader
);
89 extern int setup_arm_irq(int, struct irqaction
*);
90 extern void do_ecard_IRQ(int, struct pt_regs
*);
94 ecard_irq_noexpmask(int intr_no
, void *dev_id
, struct pt_regs
*regs
);
96 static struct irqaction irqexpansioncard
= {
97 ecard_irq_noexpmask
, SA_INTERRUPT
, 0, "expansion cards", NULL
, NULL
100 static inline unsigned short
101 ecard_getu16(unsigned char *v
)
103 return v
[0] | v
[1] << 8;
106 static inline signed long
107 ecard_gets24(unsigned char *v
)
109 return v
[0] | v
[1] << 8 | v
[2] << 16 | ((v
[2] & 0x80) ? 0xff000000 : 0);
112 static inline ecard_t
*
113 slot_to_ecard(unsigned int slot
)
115 return slot
< MAX_ECARDS
? slot_to_expcard
[slot
] : NULL
;
118 /* ===================== Expansion card daemon ======================== */
120 * Since the loader programs on the expansion cards need to be run
121 * in a specific environment, create a separate task with this
122 * environment up, and pass requests to this task as and when we
125 * This should allow 99% of loaders to be called from Linux.
127 * From a security standpoint, we trust the card vendors. This
128 * may be a misplaced trust.
130 #define BUS_ADDR(x) ((((unsigned long)(x)) << 2) + IO_BASE)
131 #define POD_INT_ADDR(x) ((volatile unsigned char *)\
132 ((BUS_ADDR((x)) - IO_BASE) + IO_START))
135 ecard_task_reset(struct ecard_request
*req
)
137 if (req
->ec
== NULL
) {
140 for (ec
= cards
; ec
; ec
= ec
->next
) {
141 printk(KERN_DEBUG
"Resetting card %d\n",
145 ecard_loader_reset(POD_INT_ADDR(ec
->podaddr
),
148 printk(KERN_DEBUG
"All cards reset\n");
149 } else if (req
->ec
->loader
)
150 ecard_loader_reset(POD_INT_ADDR(req
->ec
->podaddr
),
155 ecard_task_readbytes(struct ecard_request
*req
)
157 unsigned char *buf
= (unsigned char *)req
->buffer
;
158 volatile unsigned char *base_addr
=
159 (volatile unsigned char *)POD_INT_ADDR(req
->ec
->podaddr
);
160 unsigned int len
= req
->length
;
162 if (req
->ec
->slot_no
== 8) {
164 * The card maintains an index which
165 * increments the address into a 4096-byte
166 * page on each access. We need to keep
167 * track of the counter.
169 static unsigned int index
;
170 unsigned int offset
, page
;
171 unsigned char byte
= 0; /* keep gcc quiet */
173 offset
= req
->address
& 4095;
174 page
= req
->address
>> 12;
181 if (offset
== 0 || index
> offset
) {
183 * We need to reset the index counter.
189 while (index
<= offset
) {
190 byte
= base_addr
[page
];
197 byte
= base_addr
[page
];
202 unsigned int off
= req
->address
;
204 if (!req
->use_loader
|| !req
->ec
->loader
) {
207 *buf
++ = base_addr
[off
];
213 * The following is required by some
214 * expansion card loader programs.
216 *(unsigned long *)0x108 = 0;
217 *buf
++ = ecard_loader_read(off
++, base_addr
,
226 static pid_t ecard_pid
;
227 static wait_queue_head_t ecard_wait
;
228 static wait_queue_head_t ecard_done
;
229 static struct ecard_request
*ecard_req
;
231 /* to be removed when exec_mmap becomes extern */
232 static int exec_mmap(void)
234 struct mm_struct
* mm
, * old_mm
;
236 old_mm
= current
->mm
;
237 if (old_mm
&& atomic_read(&old_mm
->mm_users
) == 1) {
238 flush_cache_mm(old_mm
);
241 flush_tlb_mm(old_mm
);
247 struct mm_struct
*active_mm
= current
->active_mm
;
250 current
->active_mm
= mm
;
251 activate_mm(active_mm
, mm
);
254 if (active_mm
!= old_mm
) BUG();
265 * Set up the expansion card
266 * daemon's environment.
268 static void ecard_init_task(int force
)
270 /* We want to set up the page tables for the following mapping:
272 * 0x03000000 0x03000000
273 * 0x03010000 unmapped
274 * 0x03210000 0x03210000
275 * 0x03400000 unmapped
276 * 0x08000000 0x08000000
277 * 0x10000000 unmapped
279 * FIXME: we don't follow this 100% yet.
281 pgd_t
*src_pgd
, *dst_pgd
;
282 unsigned int dst_addr
= IO_START
;
287 src_pgd
= pgd_offset(current
->mm
, IO_BASE
);
288 dst_pgd
= pgd_offset(current
->mm
, dst_addr
);
290 while (dst_addr
< IO_START
+ IO_SIZE
) {
291 *dst_pgd
++ = *src_pgd
++;
292 dst_addr
+= PGDIR_SIZE
;
295 flush_tlb_range(current
->mm
, IO_START
, IO_START
+ IO_SIZE
);
297 dst_addr
= EASI_START
;
298 src_pgd
= pgd_offset(current
->mm
, EASI_BASE
);
299 dst_pgd
= pgd_offset(current
->mm
, dst_addr
);
301 while (dst_addr
< EASI_START
+ EASI_SIZE
) {
302 *dst_pgd
++ = *src_pgd
++;
303 dst_addr
+= PGDIR_SIZE
;
306 flush_tlb_range(current
->mm
, EASI_START
, EASI_START
+ EASI_SIZE
);
310 ecard_task(void * unused
)
312 struct task_struct
*tsk
= current
;
318 * We don't want /any/ signals, not even SIGKILL
320 sigfillset(&tsk
->blocked
);
321 sigemptyset(&tsk
->pending
.signal
);
322 recalc_sigpending(tsk
);
324 strcpy(tsk
->comm
, "kecardd");
327 * Set up the environment
332 struct ecard_request
*req
;
335 req
= xchg(&ecard_req
, NULL
);
338 sigemptyset(&tsk
->pending
.signal
);
339 interruptible_sleep_on(&ecard_wait
);
341 } while (req
== NULL
);
345 ecard_task_readbytes(req
);
349 ecard_task_reset(req
);
352 wake_up(&ecard_done
);
357 * Wake the expansion card daemon to action our request.
359 * FIXME: The test here is not sufficient to detect if the
363 ecard_call(struct ecard_request
*req
)
366 * If we're called from task 0, or from an
367 * interrupt (will be keyboard interrupt),
368 * we forcefully set up the memory map, and
369 * call the loader. We can't schedule, or
370 * sleep for this call.
372 if ((current
== &init_task
|| in_interrupt()) &&
373 req
->req
== req_reset
&& req
->ec
== NULL
) {
375 ecard_task_reset(req
);
378 ecard_pid
= kernel_thread(ecard_task
, NULL
,
379 CLONE_FS
| CLONE_FILES
| CLONE_SIGHAND
);
383 wake_up(&ecard_wait
);
385 sleep_on(&ecard_done
);
390 * On 26-bit processors, we don't need the kcardd thread to access the
391 * expansion card loaders. We do it directly.
394 ecard_call(struct ecard_request
*req
)
396 if (req
->req
== req_reset
)
397 ecard_task_reset(req
);
399 ecard_task_readbytes(req
);
403 /* ======================= Mid-level card control ===================== */
405 * This is called to reset the loaders for each expansion card on reboot.
407 * This is required to make sure that the card is in the correct state
408 * that RiscOS expects it to be.
411 ecard_reset(int slot
)
413 struct ecard_request req
;
420 req
.ec
= slot_to_ecard(slot
);
425 if (have_expmask
&& slot
< 0) {
427 EXPMASK_ENABLE
= have_expmask
;
433 ecard_readbytes(void *addr
, ecard_t
*ec
, int off
, int len
, int useld
)
435 struct ecard_request req
;
437 req
.req
= req_readbytes
;
441 req
.use_loader
= useld
;
447 int ecard_readchunk(struct in_chunk_dir
*cd
, ecard_t
*ec
, int id
, int num
)
449 struct ex_chunk_dir excd
;
457 ecard_readbytes(&excd
, ec
, index
, 8, useld
);
459 if (c_id(&excd
) == 0) {
460 if (!useld
&& ec
->loader
) {
467 if (c_id(&excd
) == 0xf0) { /* link */
468 index
= c_start(&excd
);
471 if (c_id(&excd
) == 0x80) { /* loader */
473 ec
->loader
= (loader_t
)kmalloc(c_len(&excd
),
476 ecard_readbytes(ec
->loader
, ec
,
478 c_len(&excd
), useld
);
484 if (c_id(&excd
) == id
&& num
-- == 0)
488 if (c_id(&excd
) & 0x80) {
489 switch (c_id(&excd
) & 0x70) {
491 ecard_readbytes((unsigned char *)excd
.d
.string
, ec
,
492 (int)c_start(&excd
), c_len(&excd
),
499 cd
->start_offset
= c_start(&excd
);
500 memcpy(cd
->d
.string
, excd
.d
.string
, 256);
504 /* ======================= Interrupt control ============================ */
506 static void ecard_def_irq_enable(ecard_t
*ec
, int irqnr
)
509 if (irqnr
< 4 && have_expmask
) {
510 have_expmask
|= 1 << irqnr
;
511 EXPMASK_ENABLE
= have_expmask
;
516 static void ecard_def_irq_disable(ecard_t
*ec
, int irqnr
)
519 if (irqnr
< 4 && have_expmask
) {
520 have_expmask
&= ~(1 << irqnr
);
521 EXPMASK_ENABLE
= have_expmask
;
526 static int ecard_def_irq_pending(ecard_t
*ec
)
528 return !ec
->irqmask
|| ec
->irqaddr
[0] & ec
->irqmask
;
531 static void ecard_def_fiq_enable(ecard_t
*ec
, int fiqnr
)
533 panic("ecard_def_fiq_enable called - impossible");
536 static void ecard_def_fiq_disable(ecard_t
*ec
, int fiqnr
)
538 panic("ecard_def_fiq_disable called - impossible");
541 static int ecard_def_fiq_pending(ecard_t
*ec
)
543 return !ec
->fiqmask
|| ec
->fiqaddr
[0] & ec
->fiqmask
;
546 static expansioncard_ops_t ecard_default_ops
= {
547 ecard_def_irq_enable
,
548 ecard_def_irq_disable
,
549 ecard_def_irq_pending
,
550 ecard_def_fiq_enable
,
551 ecard_def_fiq_disable
,
552 ecard_def_fiq_pending
556 * Enable and disable interrupts from expansion cards.
557 * (interrupts are disabled for these functions).
559 * They are not meant to be called directly, but via enable/disable_irq.
561 void ecard_enableirq(unsigned int irqnr
)
563 ecard_t
*ec
= slot_to_ecard(irqnr
- 32);
567 ec
->ops
= &ecard_default_ops
;
569 if (ec
->claimed
&& ec
->ops
->irqenable
)
570 ec
->ops
->irqenable(ec
, irqnr
);
572 printk(KERN_ERR
"ecard: rejecting request to "
573 "enable IRQs for %d\n", irqnr
);
577 void ecard_disableirq(unsigned int irqnr
)
579 ecard_t
*ec
= slot_to_ecard(irqnr
- 32);
583 ec
->ops
= &ecard_default_ops
;
585 if (ec
->ops
&& ec
->ops
->irqdisable
)
586 ec
->ops
->irqdisable(ec
, irqnr
);
590 void ecard_enablefiq(unsigned int fiqnr
)
592 ecard_t
*ec
= slot_to_ecard(fiqnr
);
596 ec
->ops
= &ecard_default_ops
;
598 if (ec
->claimed
&& ec
->ops
->fiqenable
)
599 ec
->ops
->fiqenable(ec
, fiqnr
);
601 printk(KERN_ERR
"ecard: rejecting request to "
602 "enable FIQs for %d\n", fiqnr
);
606 void ecard_disablefiq(unsigned int fiqnr
)
608 ecard_t
*ec
= slot_to_ecard(fiqnr
);
612 ec
->ops
= &ecard_default_ops
;
614 if (ec
->ops
->fiqdisable
)
615 ec
->ops
->fiqdisable(ec
, fiqnr
);
620 ecard_dump_irq_state(ecard_t
*ec
)
622 printk(" %d: %sclaimed, ",
624 ec
->claimed
? "" : "not ");
626 if (ec
->ops
&& ec
->ops
->irqpending
&&
627 ec
->ops
!= &ecard_default_ops
)
628 printk("irq %spending\n",
629 ec
->ops
->irqpending(ec
) ? "" : "not ");
631 printk("irqaddr %p, mask = %02X, status = %02X\n",
632 ec
->irqaddr
, ec
->irqmask
, *ec
->irqaddr
);
636 ecard_check_lockup(void)
638 static int last
, lockup
;
642 * If the timer interrupt has not run since the last million
643 * unrecognised expansion card interrupts, then there is
644 * something seriously wrong. Disable the expansion card
645 * interrupts so at least we can continue.
647 * Maybe we ought to start a timer to re-enable them some time
650 if (last
== jiffies
) {
652 if (lockup
> 1000000) {
653 printk(KERN_ERR
"\nInterrupt lockup detected - "
654 "disabling all expansion card interrupts\n");
656 disable_irq(IRQ_EXPANSIONCARD
);
658 printk("Expansion card IRQ state:\n");
660 for (ec
= cards
; ec
; ec
= ec
->next
)
661 ecard_dump_irq_state(ec
);
667 * If we did not recognise the source of this interrupt,
668 * warn the user, but don't flood the user with these messages.
670 if (!last
|| time_after(jiffies
, last
+ 5*HZ
)) {
672 printk(KERN_WARNING
"Unrecognised interrupt from backplane\n");
677 ecard_irq_noexpmask(int intr_no
, void *dev_id
, struct pt_regs
*regs
)
682 for (ec
= cards
; ec
; ec
= ec
->next
) {
685 if (!ec
->claimed
|| ec
->irq
== NO_IRQ
|| ec
->slot_no
== 8)
688 if (ec
->ops
&& ec
->ops
->irqpending
)
689 pending
= ec
->ops
->irqpending(ec
);
691 pending
= ecard_default_ops
.irqpending(ec
);
694 do_ecard_IRQ(ec
->irq
, regs
);
701 ecard_check_lockup();
705 static unsigned char priority_masks
[] =
707 0xf0, 0xf1, 0xf3, 0xf7, 0xff, 0xff, 0xff, 0xff
710 static unsigned char first_set
[] =
712 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00,
713 0x03, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00
717 ecard_irq_expmask(int intr_no
, void *dev_id
, struct pt_regs
*regs
)
719 const unsigned int statusmask
= 15;
722 status
= EXPMASK_STATUS
& statusmask
;
727 slot
= first_set
[status
];
728 ec
= slot_to_ecard(slot
);
730 unsigned int oldexpmask
;
732 * this ugly code is so that we can operate a
733 * prioritorising system:
735 * Card 0 highest priority
738 * Card 3 lowest priority
740 * Serial cards should go in 0/1, ethernet/scsi in 2/3
741 * otherwise you will lose serial data at high speeds!
743 oldexpmask
= have_expmask
;
744 EXPMASK_ENABLE
= (have_expmask
&= priority_masks
[slot
]);
746 do_ecard_IRQ(ec
->irq
, regs
);
748 EXPMASK_ENABLE
= have_expmask
= oldexpmask
;
749 status
= EXPMASK_STATUS
& statusmask
;
753 printk(KERN_WARNING
"card%d: interrupt from unclaimed "
755 EXPMASK_ENABLE
= (have_expmask
&= ~(1 << slot
));
758 printk(KERN_WARNING
"Wild interrupt from backplane (masks)\n");
762 ecard_probeirqhw(void)
767 EXPMASK_ENABLE
= 0x00;
768 EXPMASK_STATUS
= 0xff;
769 found
= ((EXPMASK_STATUS
& 15) == 0);
770 EXPMASK_ENABLE
= 0xff;
775 printk(KERN_DEBUG
"Expansion card interrupt "
776 "management hardware found\n");
778 irqexpansioncard
.handler
= ecard_irq_expmask
;
780 /* for each card present, set a bit to '1' */
781 have_expmask
= 0x80000000;
783 for (ec
= cards
; ec
; ec
= ec
->next
)
784 have_expmask
|= 1 << ec
->slot_no
;
786 EXPMASK_ENABLE
= have_expmask
;
789 #define ecard_probeirqhw()
792 #ifndef IO_EC_MEMC8_BASE
793 #define IO_EC_MEMC8_BASE 0
796 unsigned int ecard_address(ecard_t
*ec
, card_type_t type
, card_speed_t speed
)
798 unsigned long address
= 0;
799 int slot
= ec
->slot_no
;
801 if (ec
->slot_no
== 8)
802 return IO_EC_MEMC8_BASE
;
804 ectcr
&= ~(1 << slot
);
809 address
= IO_EC_MEMC_BASE
+ (slot
<< 12);
814 address
= IO_EC_IOC_BASE
+ (slot
<< 12);
815 #ifdef IO_EC_IOC4_BASE
817 address
= IO_EC_IOC4_BASE
+ ((slot
- 4) << 12);
820 address
+= speed
<< 17;
823 #ifdef IO_EC_EASI_BASE
825 address
= IO_EC_EASI_BASE
+ (slot
<< 22);
826 if (speed
== ECARD_FAST
)
835 outb(ectcr
, IOMD_ECTCR
);
840 static int ecard_prints(char *buffer
, ecard_t
*ec
)
842 char *start
= buffer
;
844 buffer
+= sprintf(buffer
, " %d: %s ", ec
->slot_no
,
845 ec
->type
== ECARD_EASI
? "EASI" : " ");
847 if (ec
->cid
.id
== 0) {
848 struct in_chunk_dir incd
;
850 buffer
+= sprintf(buffer
, "[%04X:%04X] ",
851 ec
->cid
.manufacturer
, ec
->cid
.product
);
853 if (!ec
->card_desc
&& ec
->cid
.cd
&&
854 ecard_readchunk(&incd
, ec
, 0xf5, 0)) {
855 ec
->card_desc
= kmalloc(strlen(incd
.d
.string
)+1, GFP_KERNEL
);
858 strcpy((char *)ec
->card_desc
, incd
.d
.string
);
861 buffer
+= sprintf(buffer
, "%s\n", ec
->card_desc
? ec
->card_desc
: "*unknown*");
863 buffer
+= sprintf(buffer
, "Simple card %d\n", ec
->cid
.id
);
865 return buffer
- start
;
868 static int get_ecard_dev_info(char *buf
, char **start
, off_t pos
, int count
)
875 while (ec
&& count
> cnt
) {
876 len
= ecard_prints(buf
, ec
);
880 *start
= buf
+ (pos
- (at
- len
));
888 return (count
> cnt
) ? cnt
: count
;
891 static struct proc_dir_entry
*proc_bus_ecard_dir
= NULL
;
893 static void ecard_proc_init(void)
895 proc_bus_ecard_dir
= proc_mkdir("ecard", proc_bus
);
896 create_proc_info_entry("devices", 0, proc_bus_ecard_dir
,
901 * Probe for an expansion card.
903 * If bit 1 of the first byte of the card is set, then the
904 * card does not exist.
907 ecard_probe(int slot
, card_type_t type
)
914 ec
= kmalloc(sizeof(ecard_t
), GFP_KERNEL
);
919 memset(ec
, 0, sizeof(ecard_t
));
926 ec
->card_desc
= NULL
;
927 ec
->ops
= &ecard_default_ops
;
930 if ((ec
->podaddr
= ecard_address(ec
, type
, ECARD_SYNC
)) == 0)
934 ecard_readbytes(&cid
, ec
, 0, 16, 0);
938 ec
->cid
.id
= cid
.r_id
;
939 ec
->cid
.cd
= cid
.r_cd
;
940 ec
->cid
.is
= cid
.r_is
;
942 ec
->cid
.manufacturer
= ecard_getu16(cid
.r_manu
);
943 ec
->cid
.product
= ecard_getu16(cid
.r_prod
);
944 ec
->cid
.country
= cid
.r_country
;
945 ec
->cid
.irqmask
= cid
.r_irqmask
;
946 ec
->cid
.irqoff
= ecard_gets24(cid
.r_irqoff
);
947 ec
->cid
.fiqmask
= cid
.r_fiqmask
;
948 ec
->cid
.fiqoff
= ecard_gets24(cid
.r_fiqoff
);
950 ec
->irqaddr
= (unsigned char *)ioaddr(ec
->podaddr
);
953 ec
->irqmask
= ec
->cid
.irqmask
;
954 ec
->irqaddr
+= ec
->cid
.irqoff
;
955 ec
->fiqmask
= ec
->cid
.fiqmask
;
956 ec
->fiqaddr
+= ec
->cid
.fiqoff
;
962 for (i
= 0; i
< sizeof(blacklist
) / sizeof(*blacklist
); i
++)
963 if (blacklist
[i
].manufacturer
== ec
->cid
.manufacturer
&&
964 blacklist
[i
].product
== ec
->cid
.product
) {
965 ec
->card_desc
= blacklist
[i
].type
;
970 #ifdef IO_EC_MEMC8_BASE
974 #ifdef CONFIG_ARCH_RPC
975 /* On RiscPC, only first two slots have DMA capability */
979 #if 0 /* We don't support FIQs on expansion cards at the moment */
985 for (ecp
= &cards
; *ecp
; ecp
= &(*ecp
)->next
);
993 slot_to_expcard
[slot
] = ec
;
998 static ecard_t
*finding_pos
;
1000 void ecard_startfind(void)
1005 ecard_t
*ecard_find(int cid
, const card_ids
*cids
)
1008 finding_pos
= cards
;
1010 finding_pos
= finding_pos
->next
;
1012 for (; finding_pos
; finding_pos
= finding_pos
->next
) {
1013 if (finding_pos
->claimed
)
1017 if ((finding_pos
->cid
.id
^ cid
) == 0)
1020 unsigned int manufacturer
, product
;
1023 manufacturer
= finding_pos
->cid
.manufacturer
;
1024 product
= finding_pos
->cid
.product
;
1026 for (i
= 0; cids
[i
].manufacturer
!= 65535; i
++)
1027 if (manufacturer
== cids
[i
].manufacturer
&&
1028 product
== cids
[i
].product
)
1031 if (cids
[i
].manufacturer
!= 65535)
1039 static void __init
ecard_free_all(void)
1043 for (ec
= cards
; ec
; ec
= ecn
) {
1051 memset(slot_to_expcard
, 0, sizeof(slot_to_expcard
));
1055 * Initialise the expansion card system.
1056 * Locate all hardware - interrupt management and
1059 void __init
ecard_init(void)
1063 #ifdef CONFIG_CPU_32
1064 init_waitqueue_head(&ecard_wait
);
1065 init_waitqueue_head(&ecard_done
);
1068 printk("Probing expansion cards\n");
1070 for (slot
= 0; slot
< 8; slot
++) {
1071 if (ecard_probe(slot
, ECARD_EASI
) == -ENODEV
)
1072 ecard_probe(slot
, ECARD_IOC
);
1075 #ifdef IO_EC_MEMC8_BASE
1076 ecard_probe(8, ECARD_IOC
);
1081 if (setup_arm_irq(IRQ_EXPANSIONCARD
, &irqexpansioncard
)) {
1082 printk(KERN_ERR
"Unable to claim IRQ%d for expansion cards\n",
1090 EXPORT_SYMBOL(ecard_startfind
);
1091 EXPORT_SYMBOL(ecard_find
);
1092 EXPORT_SYMBOL(ecard_readchunk
);
1093 EXPORT_SYMBOL(ecard_address
);