2 * linux/arch/alpha/kernel/sys_jensen.c
4 * Copyright (C) 1995 Linus Torvalds
5 * Copyright (C) 1998, 1999 Richard Henderson
7 * Code supporting the Jensen.
10 #include <linux/kernel.h>
11 #include <linux/types.h>
13 #include <linux/sched.h>
14 #include <linux/pci.h>
15 #include <linux/init.h>
17 #include <asm/ptrace.h>
18 #include <asm/system.h>
20 #define __EXTERN_INLINE inline
22 #include <asm/jensen.h>
23 #undef __EXTERN_INLINE
27 #include <asm/mmu_context.h>
28 #include <asm/pgtable.h>
33 #include "machvec_impl.h"
37 * Jensen is special: the vector is 0x8X0 for EISA interrupt X, and
38 * 0x9X0 for the local motherboard interrupts.
40 * Note especially that those local interrupts CANNOT be masked,
41 * which causes much of the pain below...
45 * 0x800 - IRQ0 interval timer (not used, as we use the RTC timer)
46 * 0x810 - IRQ1 line printer (duh..)
47 * 0x860 - IRQ6 floppy disk
54 * PCI-based systems are more sane: they don't have the local
55 * interrupts at all, and have only normal PCI interrupts from
56 * devices. Happily it's easy enough to do a sane mapping from the
59 * Note that this means that we may have to do a hardware
60 * "local_op" to a different interrupt than we report to the rest of the
65 jensen_local_startup(unsigned int irq)
67 /* the parport is really hw IRQ 1, silly Jensen. */
69 i8259a_startup_irq(1);
72 * For all true local interrupts, set the flag that prevents
73 * the IPL from being dropped during handler processing.
75 if (irq_desc[irq].action)
76 irq_desc[irq].action->flags |= SA_INTERRUPT;
81 jensen_local_shutdown(unsigned int irq)
83 /* the parport is really hw IRQ 1, silly Jensen. */
85 i8259a_disable_irq(1);
89 jensen_local_enable(unsigned int irq)
91 /* the parport is really hw IRQ 1, silly Jensen. */
97 jensen_local_disable(unsigned int irq)
99 /* the parport is really hw IRQ 1, silly Jensen. */
101 i8259a_disable_irq(1);
105 jensen_local_ack(unsigned int irq)
107 /* the parport is really hw IRQ 1, silly Jensen. */
109 i8259a_mask_and_ack_irq(1);
113 jensen_local_end(unsigned int irq)
115 /* the parport is really hw IRQ 1, silly Jensen. */
120 static struct hw_interrupt_type jensen_local_irq_type = {
122 startup: jensen_local_startup,
123 shutdown: jensen_local_shutdown,
124 enable: jensen_local_enable,
125 disable: jensen_local_disable,
126 ack: jensen_local_ack,
127 end: jensen_local_end,
131 jensen_device_interrupt(unsigned long vector, struct pt_regs * regs)
137 printk("Whee.. NMI received. Probable hardware error\n");
138 printk("61=%02x, 461=%02x\n", inb(0x61), inb(0x461));
141 /* local device interrupts: */
142 case 0x900: irq = 4; break; /* com1 -> irq 4 */
143 case 0x920: irq = 3; break; /* com2 -> irq 3 */
144 case 0x980: irq = 1; break; /* kbd -> irq 1 */
145 case 0x990: irq = 9; break; /* mouse -> irq 9 */
148 if (vector > 0x900) {
149 printk("Unknown local interrupt %lx\n", vector);
153 irq = (vector - 0x800) >> 4;
159 /* If there is no handler yet... */
160 if (irq_desc[irq].action == NULL) {
161 /* If it is a local interrupt that cannot be masked... */
164 /* Clear keyboard/mouse state */
167 /* Reset serial ports */
179 /* A useful bit of code to find out if an interrupt is going wild. */
181 static unsigned int last_msg = 0, last_cc = 0;
182 static int last_irq = -1, count = 0;
185 __asm __volatile("rpcc %0" : "=r"(cc));
187 #define JENSEN_CYCLES_PER_SEC (150000000)
188 if (cc - last_msg > ((JENSEN_CYCLES_PER_SEC) * 3) ||
190 printk(KERN_CRIT " irq %d count %d cc %u @ %lx\n",
191 irq, count, cc-last_cc, regs->pc);
200 handle_irq(irq, regs);
204 jensen_init_irq(void)
208 irq_desc[1].handler = &jensen_local_irq_type;
209 irq_desc[4].handler = &jensen_local_irq_type;
210 irq_desc[3].handler = &jensen_local_irq_type;
211 irq_desc[7].handler = &jensen_local_irq_type;
212 irq_desc[9].handler = &jensen_local_irq_type;
214 common_init_isa_dma();
218 jensen_init_arch(void)
220 struct pci_controller *hose;
222 /* Create a hose so that we can report i/o base addresses to
225 pci_isa_hose = hose = alloc_pci_controller();
226 hose->io_space = &ioport_resource;
227 hose->mem_space = &iomem_resource;
230 hose->sparse_mem_base = EISA_MEM - IDENT_ADDR;
231 hose->dense_mem_base = 0;
232 hose->sparse_io_base = EISA_IO - IDENT_ADDR;
233 hose->dense_io_base = 0;
235 hose->sg_isa = hose->sg_pci = NULL;
236 __direct_map_base = 0;
237 __direct_map_size = 0xffffffff;
241 jensen_machine_check (u64 vector, u64 la, struct pt_regs *regs)
243 printk(KERN_CRIT "Machine check\n");
246 #define jensen_pci_tbi ((void*)0)
253 struct alpha_machine_vector jensen_mv __initmv = {
254 vector_name: "Jensen",
256 IO_LITE(JENSEN,jensen),
258 machine_check: jensen_machine_check,
259 max_dma_address: ALPHA_MAX_DMA_ADDRESS,
263 device_interrupt: jensen_device_interrupt,
265 init_arch: jensen_init_arch,
266 init_irq: jensen_init_irq,
267 init_rtc: common_init_rtc,