From: James S. <jsi...@us...> - 2001-10-26 22:30:54
|
Update of /cvsroot/linux-mips/linux/arch/mips/philips/nino In directory usw-pr-cvs1:/tmp/cvs-serv29207/arch/mips/philips/nino Modified Files: Makefile int-handler.S irq.c setup.c time.c Removed Files: reset.c Log Message: Nino updates. Index: Makefile =================================================================== RCS file: /cvsroot/linux-mips/linux/arch/mips/philips/nino/Makefile,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Makefile 2001/10/05 21:29:43 1.2 +++ Makefile 2001/10/26 22:30:51 1.3 @@ -15,7 +15,8 @@ all: nino.o -obj-y := int-handler.o setup.o irq.o time.o reset.o rtc.o prom.o power.o +obj-y := int-handler.o irq.o setup.o \ + prom.o power.o time.o int-handler.o: int-handler.S Index: int-handler.S =================================================================== RCS file: /cvsroot/linux-mips/linux/arch/mips/philips/nino/int-handler.S,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- int-handler.S 2001/06/22 02:29:32 1.1.1.1 +++ int-handler.S 2001/10/26 22:30:51 1.2 @@ -1,137 +1,82 @@ /* - * linux/arch/mips/philips/nino/int-handler.S - * - * Copyright (C) 1999 Harald Koerfgen - * Copyright (C) 2000 Jim Pick (ji...@ji...) - * Copyright (C) 2001 Steven J. Hill (sj...@re...) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. + * int-handler.S: Interrupt exception dispatch code for Philips Nino * - * Interrupt handler for Philips Nino. + * Copyright (C) 2001 Steven J. Hill (sj...@re...) */ + #include <asm/asm.h> -#include <asm/regdef.h> #include <asm/mipsregs.h> +#include <asm/regdef.h> #include <asm/stackframe.h> -#include <asm/tx3912.h> - - .data - .globl HighPriVect - -HighPriVect: .word spurious # Reserved - .word io_posnegint0 # IOPOSINT(0) or IONEGINT(0) - .word spurious # CHIDMACNTINT - .word spurious # TELDMACNTINT - .word spurious # SNDDMACNTINT - .word spurious # Reserved - .word io_negint56 # IONEGINT(6) or IONEGINT(5) - .word spurious # Reserved - .word io_posint56 # IOPOSINT(6) or IOPOSINT(5) - .word spurious # Reserved - .word spurious # UARTBRXINT - .word uarta_rx # UARTARXINT - .word spurious # Reserved - .word periodic_timer # PERINT - .word spurious # ALARMINT - .word spurious # POSPWROKINT or NEGPWROKINT - -/* - * Here is the entry point to handle all interrupts. - */ - .text - .set noreorder - .align 5 - NESTED(nino_handle_int, PT_SIZE, ra) - .set noat - SAVE_ALL - CLI - .set at - - /* - * Get pending Interrupts - */ - mfc0 t0, CP0_CAUSE # Get pending interrupts - andi t2, t0, IE_IRQ4 # IRQ4 (high priority) - bne t2, IE_IRQ4, low_priority - nop -/* - * Ok, we've got a high priority interrupt (a.k.a. an external interrupt). - * Read Interrupt Status Register 6 to get vector. - */ -high_priority: - lui t0, %hi(IntStatus6) - lw t1, %lo(IntStatus6)(t0) - andi t1, INT6_INTVECT - la t2, HighPriVect - addu t1, t1, t2 - lw t2, 0(t1) - jr t2 - nop + /* + * Here is the table of interrupts for the Philips Nino + * which uses the Philips PR31700/Toshiba TMPR3912 core. + * + * MIPS IRQ PR31700 IRQ Source + * -------- ----------- ------ + * 0 1 Sound, LCD, telecom + * 1 2 UARTA & UARTB + * 2 3 MFIO (positive edge) + * 3 4 MFIO (negative edge) + * 4 5 Timers, power management + * 5 6 High priority interrupts + * + * We handle the IRQ according to the priorities below: + * + * Highest ---- High priority interrupts + * UARTA & UARTB + * Timers, power management + * Sound, LCD, telecom + * Multi-function IO (positive edge) + * Lowest ---- Multi-function IO (negative edge) + * + * then we just return, if multiple IRQs are pending then + * we will just take another exception, big deal. + */ -/* - * Ok, we've got one of over a hundred other interupts. - */ -low_priority: - lui t0, %hi(IntStatus1) - lw t1, %lo(IntStatus1)(t0) - j handle_it - li a0, 20 + .text + .set noreorder + .set noat + .align 5 + NESTED(ninoIRQ, PT_SIZE, sp) + SAVE_ALL + CLI + .set at + mfc0 s0, CP0_CAUSE # get irq mask -/* - * We don't currently handle spurious interrupts. - */ -spurious: - j spurious_interrupt - nop + /* Check for IRQ4 */ + andi a0, s0, C_IRQ4 + beq a0, zero, 1f + andi a0, s0, C_IRQ2 # delay slot, check for IRQ2 -/* - * We have the IRQ number, dispatch to the real handler. - */ -handle_it: jal do_IRQ - move a1,sp - j ret_from_irq - nop + /* High priority interrupt */ + move a0, sp + jal irq4_dispatch + nop # delay slot -/************************************ - * High priority interrupt mappings * - ************************************/ - -/* - * Periodic timer - IRQ 0 - */ -periodic_timer: - j handle_it - li a0, 0 + j ret_from_irq + nop # delay slot -/* - * UARTA RX - IRQ 3 - */ -uarta_rx: - j handle_it - li a0, 3 +1: + /* Check for IRQ2 */ + beq a0, zero, 1f + nop # delay slot -/* - * GPIO Pin 0 transition - IRQ 10 - */ -io_posnegint0: - j handle_it - li a0, 10 + /* UART interrupt of some sort */ + move a0, sp + jal irq2_dispatch + nop # delay slot -/* - * GPIO Pin 5 or 6 transition (0-to-1) - IRQ 11 - */ -io_posint56: - j handle_it - li a0, 11 + j ret_from_irq + nop # delay slot -/* - * GPIO Pin 5 or 6 transition (1-to-0) - IRQ 12 - */ -io_negint56: - j handle_it - li a0, 12 +1: + /* We should never get here */ + move a0, sp + jal irq_bad + nop - END(nino_handle_int) + j ret_from_irq + nop + END(ninoIRQ) Index: irq.c =================================================================== RCS file: /cvsroot/linux-mips/linux/arch/mips/philips/nino/irq.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- irq.c 2001/09/04 15:58:40 1.2 +++ irq.c 2001/10/26 22:30:51 1.3 @@ -1,28 +1,23 @@ /* - * linux/arch/mips/philips/nino/irq.c + * irq.c: Fine grained interrupt handling for Nino * - * Copyright (C) 1992 Linus Torvalds - * Copyright (C) 1999 Harald Koerfgen - * Copyright (C) 2000 Pavel Machek (pa...@su...) - * Copyright (C) 2001 Steven J. Hill (sj...@re...) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Generic interrupt handler for Philips Nino. + * Copyright (C) 2001 Steven J. Hill (sj...@re...) */ -#include <linux/errno.h> #include <linux/init.h> + +#include <linux/errno.h> #include <linux/kernel_stat.h> #include <linux/signal.h> #include <linux/sched.h> #include <linux/types.h> #include <linux/interrupt.h> +#include <linux/irq.h> #include <linux/ioport.h> #include <linux/timex.h> #include <linux/slab.h> #include <linux/random.h> +#include <linux/smp.h> +#include <linux/smp_lock.h> #include <asm/bitops.h> #include <asm/bootinfo.h> @@ -30,285 +25,265 @@ #include <asm/irq.h> #include <asm/mipsregs.h> #include <asm/system.h> + +#include <asm/ptrace.h> +#include <asm/processor.h> #include <asm/tx3912.h> -unsigned long spurious_count = 0; +/* + * Linux has a controller-independent x86 interrupt architecture. + * every controller has a 'controller-template', that is used + * by the main code to do the right thing. Each driver-visible + * interrupt source is transparently wired to the apropriate + * controller. Thus drivers need not be aware of the + * interrupt-controller. + * + * Various interrupt controllers we handle: 8259 PIC, SMP IO-APIC, + * PIIX4's internal 8259 PIC and SGI's Visual Workstation Cobalt (IO-)APIC. + * (IO-APICs assumed to be messaging to Pentium local-APICs) + * + * the code is designed to be easily extended with new/different + * interrupt controllers, without having to do assembly magic. + */ -irq_cpustat_t irq_stat [NR_CPUS]; +extern asmlinkage void ninoIRQ(void); +extern asmlinkage void do_IRQ(int irq, struct pt_regs *regs); +extern void init_generic_irq(void); -static inline void mask_irq(unsigned int irq_nr) +static void enable_irq4(unsigned int irq) { - switch (irq_nr) { - case 0: /* Periodic Timer Interrupt */ - IntClear5 = INT5_PERIODICINT; - IntClear6 = INT6_PERIODICINT; - IntEnable6 &= ~INT6_PERIODICINT; - break; - - case 3: - /* Serial port receive interrupt */ - break; - - case 2: - /* Serial port transmit interrupt */ - break; - - default: - printk( "Attempt to mask unknown IRQ %d?\n", irq_nr ); - } -} + unsigned long flags; -static inline void unmask_irq(unsigned int irq_nr) -{ - switch (irq_nr) { - case 0: + save_and_cli(flags); + if(irq == 0) { + IntEnable5 |= INT5_PERIODICINT; IntEnable6 |= INT6_PERIODICINT; - break; - - case 3: - /* Serial port receive interrupt */ - break; - - case 2: - /* Serial port transmit interrupt */ - break; - - default: - printk( "Attempt to unmask unknown IRQ %d?\n", irq_nr ); } + restore_flags(flags); } -void disable_irq(unsigned int irq_nr) +static unsigned int startup_irq4(unsigned int irq) { - unsigned long flags; + enable_irq4(irq); - save_and_cli(flags); - mask_irq(irq_nr); - restore_flags(flags); + return 0; /* Never anything pending */ } -void enable_irq(unsigned int irq_nr) +static void disable_irq4(unsigned int irq) { - unsigned long flags; + unsigned long flags; - save_and_cli(flags); - unmask_irq(irq_nr); - restore_flags(flags); + save_and_cli(flags); + if(irq == 0) { + IntEnable6 &= ~INT6_PERIODICINT; + IntClear5 |= INT5_PERIODICINT; + IntClear6 |= INT6_PERIODICINT; + } + restore_flags(flags); } - -/* - * Pointers to the low-level handlers: first the general ones, then the - * fast ones, then the bad ones. - */ -extern void interrupt(void); -static struct irqaction *irq_action[NR_IRQS] = -{ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL -}; +#define shutdown_irq4 disable_irq4 +#define mask_and_ack_irq4 disable_irq4 -int get_irq_list(char *buf) +static void end_irq4(unsigned int irq) { - int i, len = 0; - struct irqaction *action; - - for (i = 0; i < NR_IRQS; i++) { - action = irq_action[i]; - if (!action) - continue; - len += sprintf(buf + len, "%2d: %8d %c %s", - i, kstat.irqs[0][i], - (action->flags & SA_INTERRUPT) ? '+' : ' ', - action->name); - for (action = action->next; action; action = action->next) { - len += sprintf(buf + len, ",%s %s", - (action->flags & SA_INTERRUPT) ? " +" : "", - action->name); - } - len += sprintf(buf + len, "\n"); - } - return len; + if(!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS))) + enable_irq4(irq); } -atomic_t __mips_bh_counter; +static struct hw_interrupt_type irq4_type = { + "IRQ4", + startup_irq4, + shutdown_irq4, + enable_irq4, + disable_irq4, + mask_and_ack_irq4, + end_irq4, + NULL +}; -/* - * do_IRQ handles IRQ's that have been installed without the - * SA_INTERRUPT flag: it uses the full signal-handling return - * and runs with other interrupts enabled. All relatively slow - * IRQ's should use this format: notably the keyboard/timer - * routines. - */ -asmlinkage void do_IRQ(int irq, struct pt_regs *regs) +void irq4_dispatch(struct pt_regs *regs) { - struct irqaction *action; - int do_random, cpu; + int irq = -1; - if (irq == 20) { - if (IntStatus2 & 0xfffff00) { - if (IntStatus2 & 0x0f000000) - return do_IRQ(2, regs); + if(IntStatus6 & INT6_PERIODICINT) { + irq = 0; + goto done; } - } - cpu = smp_processor_id(); - irq_enter(cpu, irq); - kstat.irqs[cpu][irq]++; + /* if irq == -1, then the interrupt has already been cleared */ + if(irq == -1) { + printk("IRQ6 Status Register = 0x%08x\n", IntStatus6); + goto end; + } - if (irq == 20) { - printk("20 %08lx %08lx\n %08lx %08lx\n %08lx\n", - IntStatus1, IntStatus2, IntStatus3, - IntStatus4, IntStatus5 ); - printk("20 %08lx %08lx\n %08lx %08lx\n %08lx\n", - IntEnable1, IntEnable2, IntEnable3, - IntEnable4, IntEnable5 ); +done: + do_IRQ(irq, regs); - } +end: + return; +} - mask_irq(irq); - action = *(irq + irq_action); - if (action) { - if (!(action->flags & SA_INTERRUPT)) - __sti(); - do_random = 0; - do { - do_random |= action->flags; - action->handler(irq, action->dev_id, regs); - action = action->next; - } while (action); - if (do_random & SA_SAMPLE_RANDOM) - add_interrupt_randomness(irq); - unmask_irq(irq); - __cli(); - } else { - IntClear1 = ~0; - IntClear3 = ~0; - IntClear4 = ~0; - IntClear5 = ~0; - unmask_irq(irq); - } - irq_exit(cpu, irq); +static void enable_irq2(unsigned int irq) +{ + unsigned long flags; - /* unmasking and bottom half handling is done magically for us. */ + save_and_cli(flags); + if(irq == 2 || irq == 3) { + IntEnable1 = 0x00000000; + IntEnable2 = 0xfffff000; + IntEnable3 = 0x00000000; + IntEnable4 = 0x00000000; + IntClear1 = 0xffffffff; + IntClear2 = 0xffffffff; + IntClear3 = 0xffffffff; + IntClear4 = 0xffffffff; + IntClear5 = 0xffffffff; + } + restore_flags(flags); } -/* - * Idea is to put all interrupts - * in a single table and differenciate them just by number. - */ -int setup_nino_irq(int irq, struct irqaction *new) +static unsigned int startup_irq2(unsigned int irq) { - int shared = 0; - struct irqaction *old, **p; - unsigned long flags; + enable_irq2(irq); - p = irq_action + irq; - if ((old = *p) != NULL) { - /* Can't share interrupts unless both agree to */ - if (!(old->flags & new->flags & SA_SHIRQ)) - return -EBUSY; + return 0; /* Never anything pending */ +} - /* Can't share interrupts unless both are same type */ - if ((old->flags ^ new->flags) & SA_INTERRUPT) - return -EBUSY; +static void disable_irq2(unsigned int irq) +{ + unsigned long flags; - /* add new interrupt at end of irq queue */ - do { - p = &old->next; - old = *p; - } while (old); - shared = 1; - } - if (new->flags & SA_SAMPLE_RANDOM) - rand_initialize_irq(irq); + save_and_cli(flags); + IntEnable1 = 0x00000000; + IntEnable2 = 0x00000000; + IntEnable3 = 0x00000000; + IntEnable4 = 0x00000000; + IntClear1 = 0xffffffff; + IntClear2 = 0xffffffff; + IntClear3 = 0xffffffff; + IntClear4 = 0xffffffff; + IntClear5 = 0xffffffff; + restore_flags(flags); +} - save_and_cli(flags); - *p = new; +#define shutdown_irq2 disable_irq2 +#define mask_and_ack_irq2 disable_irq2 - if (!shared) { - unmask_irq(irq); - } - restore_flags(flags); - return 0; +static void end_irq2(unsigned int irq) +{ + if(!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS))) + enable_irq2(irq); } -int request_irq(unsigned int irq, - void (*handler) (int, void *, struct pt_regs *), - unsigned long irqflags, - const char *devname, - void *dev_id) +static struct hw_interrupt_type irq2_type = { + "IRQ2", + startup_irq2, + shutdown_irq2, + enable_irq2, + disable_irq2, + mask_and_ack_irq2, + end_irq2, + NULL +}; + +void irq2_dispatch(struct pt_regs *regs) { - int retval; - struct irqaction *action; + int irq = -1; - if (irq >= NR_IRQS) - return -EINVAL; - if (!handler) - return -EINVAL; + if(IntStatus2 & 0xfffff000) { + irq = 2; + goto done; + } + if(IntStatus2 & 0xfffff000) { + irq = 3; + goto done; + } - action = (struct irqaction *) kmalloc(sizeof(struct irqaction), GFP_KERNEL); - if (!action) - return -ENOMEM; + /* if irq == -1, then the interrupt has already been cleared */ + if (irq == -1) { + IntClear1 = 0xffffffff; + IntClear3 = 0xffffffff; + IntClear4 = 0xffffffff; + IntClear5 = 0xffffffff; + goto end; + } - action->handler = handler; - action->flags = irqflags; - action->mask = 0; - action->name = devname; - action->next = NULL; - action->dev_id = dev_id; +done: + do_IRQ(irq, regs); - retval = setup_nino_irq(irq, action); +end: + return; +} - if (retval) - kfree(action); - return retval; +void irq_bad(struct pt_regs *regs) +{ + /* This should never happen */ + printk("Invalid interrupt, spinning...\n"); + printk(" CAUSE register = 0x%08lx\n", regs->cp0_cause); + printk("STATUS register = 0x%08lx\n", regs->cp0_status); + printk(" EPC register = 0x%08lx\n", regs->cp0_epc); + while(1); } -void free_irq(unsigned int irq, void *dev_id) +void __init nino_irq_setup(void) { - struct irqaction *action, **p; - unsigned long flags; + unsigned int i; - if (irq >= NR_IRQS) { - printk(KERN_CRIT __FUNCTION__ ": trying to free IRQ%d\n", irq); - return; - } - for (p = irq + irq_action; (action = *p) != NULL; p = &action->next) { - if (action->dev_id != dev_id) - continue; + /* Disable interrupts */ + IntEnable1 = 0x00000000; + IntEnable2 = 0x00000000; + IntEnable3 = 0x00000000; + IntEnable4 = 0x00000000; + IntEnable5 = 0x00000000; + IntEnable6 = 0x00000000; - /* Found it - now free it */ - save_and_cli(flags); - *p = action->next; - if (!irq[irq_action]) - mask_irq(irq); - restore_flags(flags); - kfree(action); - return; - } - printk(KERN_CRIT __FUNCTION__ ": trying to free free IRQ%d\n", irq); -} + /* Clear interrupts */ + IntClear1 = 0xffffffff; + IntClear2 = 0xffffffff; + IntClear3 = 0xffffffff; + IntClear4 = 0xffffffff; + IntClear5 = 0xffffffff; -unsigned long probe_irq_on(void) -{ - /* TODO */ - return 0; -} + /* Change location of exception vector table */ + change_cp0_status(ST0_BEV, 0); -int probe_irq_off(unsigned long irqs) -{ - /* TODO */ - return 0; + /* Initialize IRQ vector table */ + init_generic_irq(); + + /* Initialize hardware IRQ structure */ + for (i = 0; i < 16; i++) { + hw_irq_controller *handler = NULL; + if (i == 0) + handler = &irq4_type; + else if (i > 1 && i < 4) + handler = &irq2_type; + else + handler = NULL; + + irq_desc[i].status = IRQ_DISABLED; + irq_desc[i].action = 0; + irq_desc[i].depth = 1; + irq_desc[i].handler = handler; + } + + /* Set up the external interrupt exception vector */ + set_except_vector(0, ninoIRQ); } +void (*irq_setup)(void); + void __init init_IRQ(void) { - irq_setup(); +#ifdef CONFIG_REMOTE_DEBUG + extern void breakpoint(void); + extern void set_debug_traps(void); + + printk("Wait for gdb client connection ...\n"); + set_debug_traps(); + breakpoint(); +#endif + + /* Invoke board-specific irq setup */ + irq_setup(); } Index: setup.c =================================================================== RCS file: /cvsroot/linux-mips/linux/arch/mips/philips/nino/setup.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- setup.c 2001/06/22 02:29:32 1.1.1.1 +++ setup.c 2001/10/26 22:30:51 1.2 @@ -9,79 +9,44 @@ * * Interrupt and exception initialization for Philips Nino. */ -#include <linux/console.h> #include <linux/init.h> -#include <linux/interrupt.h> -#include <linux/mc146818rtc.h> #include <linux/sched.h> #include <asm/addrspace.h> -#include <asm/gdb-stub.h> +#include <asm/io.h> #include <asm/irq.h> -#include <asm/wbflush.h> +#include <asm/reboot.h> +#include <asm/time.h> #include <asm/tx3912.h> - -extern struct rtc_ops nino_rtc_ops; - -extern void nino_wait(void); -extern void setup_nino_reset_vectors(void); -extern asmlinkage void nino_handle_int(void); -extern int setup_nino_irq(int, struct irqaction *); -void (*board_time_init) (struct irqaction * irq); - -#ifdef CONFIG_REMOTE_DEBUG -extern void set_debug_traps(void); -extern void breakpoint(void); -static int remote_debug = 0; -#endif -static void __init nino_irq_setup(void) +void nino_machine_restart(char *command) { - unsigned int tmp; - - /* Turn all interrupts off */ - IntEnable1 = 0; - IntEnable2 = 0; - IntEnable3 = 0; - IntEnable4 = 0; - IntEnable5 = 0; - IntEnable6 = 0; + static void (*back_to_prom)(void) = (void (*)(void)) 0xbfc00000; - /* Clear all interrupts */ - IntClear1 = 0xffffffff; - IntClear2 = 0xffffffff; - IntClear3 = 0xffffffff; - IntClear4 = 0xffffffff; - IntClear5 = 0xffffffff; - IntClear6 = 0xffffffff; + /* Reboot */ + back_to_prom(); +} - /* - * Enable only the interrupts for the UART and negative - * edge (1-to-0) triggered multi-function I/O pins. - */ - change_cp0_status(ST0_BEV, 0); - tmp = read_32bit_cp0_register(CP0_STATUS); - change_cp0_status(ST0_IM, tmp | IE_IRQ2 | IE_IRQ4); +void nino_machine_halt(void) +{ + printk("Nino halted.\n"); + while(1); +} - /* Register the global interrupt handler */ - set_except_vector(0, nino_handle_int); +void nino_machine_power_off(void) +{ + printk("Nino halted. Please turn off power.\n"); + while(1); +} -#ifdef CONFIG_REMOTE_DEBUG - if (remote_debug) { - set_debug_traps(); - breakpoint(); - } -#endif +static void __init nino_board_init() +{ + /* Nothing for now */ } -static __init void nino_time_init(struct irqaction *irq) +static __init void nino_time_init(void) { unsigned int scratch = 0; - /* - * Enable periodic interrupts - */ - setup_nino_irq(0, irq); - RTCperiodTimer = PER_TIMER_COUNT; RTCtimerControl = TIM_ENPERTIMER; IntEnable5 |= INT5_PERIODICINT; @@ -89,32 +54,39 @@ scratch = inl(TX3912_CLK_CTRL_BASE); scratch |= TX3912_CLK_CTRL_ENTIMERCLK; outl(scratch, TX3912_CLK_CTRL_BASE); +} - /* Enable all interrupts */ - IntEnable6 |= INT6_GLOBALEN | INT6_PERIODICINT; +extern int setup_irq(unsigned int irq, struct irqaction *irqaction); + +static __init void nino_timer_setup(struct irqaction *irq) +{ + setup_irq(0, irq); + + /* Enable all hardware interrupts */ + set_cp0_status(IE_IRQ5 | IE_IRQ4 | IE_IRQ3 | + IE_IRQ2 | IE_IRQ1 | IE_IRQ0); + + /* Enable all the high priority interrupts */ + IntEnable6 = (INT6_GLOBALEN | 0xffff); + } +extern void nino_irq_setup(void); +extern void nino_wait(void); + void __init nino_setup(void) { irq_setup = nino_irq_setup; + mips_io_port_base = KSEG1ADDR(0xb0c00000); board_time_init = nino_time_init; - - /* Base address to use for PC type I/O accesses */ - mips_io_port_base = KSEG1ADDR(0xB0C00000); + board_timer_setup = nino_timer_setup; - setup_nino_reset_vectors(); + _machine_restart = nino_machine_restart; + _machine_halt = nino_machine_halt; + _machine_power_off = nino_machine_power_off; - /* Function called during process idle (cpu_idle) */ cpu_wait = nino_wait; - -#ifdef CONFIG_FB - conswitchp = &dummy_con; -#endif -#ifdef CONFIG_REMOTE_DEBUG - remote_debug = 1; -#endif - - rtc_ops = &nino_rtc_ops; + nino_board_init(); } Index: time.c =================================================================== RCS file: /cvsroot/linux-mips/linux/arch/mips/philips/nino/time.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- time.c 2001/06/22 02:29:32 1.1.1.1 +++ time.c 2001/10/26 22:30:51 1.2 @@ -19,6 +19,7 @@ #include <linux/string.h> #include <linux/mm.h> #include <linux/interrupt.h> +#include <linux/time.h> #include <linux/timex.h> #include <linux/delay.h> #include <asm/tx3912.h> @@ -28,6 +29,9 @@ static struct timeval xbase; +void (*board_time_init)(void) = NULL; +void (*board_timer_setup)(struct irqaction *irq) = NULL; + #define USECS_PER_JIFFY (1000000/HZ) /* @@ -200,8 +204,6 @@ static struct irqaction irq0 = {timer_interrupt, SA_INTERRUPT, 0, "timer", NULL, NULL}; -void (*board_time_init) (struct irqaction * irq); - int __init time_init(void) { struct timeval starttime; @@ -210,7 +212,8 @@ starttime.tv_usec = 0; do_settimeofday(&starttime); - board_time_init(&irq0); + board_time_init(); + board_timer_setup(&irq0); return 0; } --- reset.c DELETED --- |