2 * TURBOchannel architecture calls.
4 * Copyright (c) Harald Koerfgen, 1998
5 * Copyright (c) 2001, 2003, 2005, 2006 Maciej W. Rozycki
6 * Copyright (c) 2005 James Simmons
8 * This file is subject to the terms and conditions of the GNU
9 * General Public License. See the file "COPYING" in the main
10 * directory of this archive for more details.
12 #include <linux/compiler.h>
13 #include <linux/errno.h>
14 #include <linux/init.h>
15 #include <linux/string.h>
17 #include <linux/types.h>
19 #include <asm/addrspace.h>
20 #include <asm/bootinfo.h>
21 #include <asm/paccess.h>
23 #include <asm/dec/interrupts.h>
24 #include <asm/dec/prom.h>
25 #include <asm/dec/system.h>
28 * Protected read byte from TURBOchannel slot space.
30 int tc_preadb(u8
*valp
, void __iomem
*addr
)
32 return get_dbe(*valp
, (u8
*)addr
);
36 * Get TURBOchannel bus information as specified by the spec, plus
37 * the slot space base address and the number of slots.
39 int __init
tc_bus_get_info(struct tc_bus
*tbus
)
44 memcpy(&tbus
->info
, rex_gettcinfo(), sizeof(tbus
->info
));
45 tbus
->slot_base
= CPHYSADDR((long)rex_slot_address(0));
47 switch (mips_machtype
) {
49 tbus
->num_tcslots
= 7;
53 tbus
->ext_slot_base
= 0x20000000;
54 tbus
->ext_slot_size
= 0x20000000;
57 tbus
->num_tcslots
= 3;
60 tbus
->num_tcslots
= 2;
68 * Get the IRQ for the specified slot.
70 void __init
tc_device_get_irq(struct tc_dev
*tdev
)
74 tdev
->interrupt
= dec_interrupt
[DEC_IRQ_TC0
];
77 tdev
->interrupt
= dec_interrupt
[DEC_IRQ_TC1
];
80 tdev
->interrupt
= dec_interrupt
[DEC_IRQ_TC2
];
83 * Yuck! DS5000/200 onboard devices
86 tdev
->interrupt
= dec_interrupt
[DEC_IRQ_TC5
];
89 tdev
->interrupt
= dec_interrupt
[DEC_IRQ_TC6
];