void __init init_IRQ(void)
{
  int i;

  DANUBE_INT_DMSG("init_IRQ\n");

  board_be_handler = &danube_be_handler;

  init_generic_irq();

  /* mask all interrupt sources */
  *DANUBE_ICU_IM0_IER = 0;
  *DANUBE_ICU_IM1_IER = 0;
  *DANUBE_ICU_IM2_IER = 0;
  *DANUBE_ICU_IM3_IER = 0;
  *DANUBE_ICU_IM4_IER = 0;


  /* Now safe to set the exception vector. */
  set_except_vector(0, mipsIRQ);

  for (i = 0; i <= INT_NUM_IM4_IRL31; i++) {
    irq_desc[i].status	= IRQ_DISABLED;
    irq_desc[i].action	= 0;
    irq_desc[i].depth	= 1;
    irq_desc[i].handler	= &danube_irq_type;
  }

  set_c0_status(IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4 | IE_IRQ5);

#ifdef CONFIG_KGDB
  set_debug_traps();
  breakpoint();
#endif
}
Exemple #2
0
void __init init_IRQ(void)
{
	int i;

	init_generic_irq();

	switch (mips_machtype) {
	case MACH_LASAT_100:
		lasat_int_status = (void *)LASAT_INT_STATUS_REG_100;
		lasat_int_mask = (void *)LASAT_INT_MASK_REG_100;
		lasat_int_mask_shift = LASATINT_MASK_SHIFT_100;
		get_int_status = get_int_status_100;
		*lasat_int_mask = 0;
		break;
	case MACH_LASAT_200:
		lasat_int_status = (void *)LASAT_INT_STATUS_REG_200;
		lasat_int_mask = (void *)LASAT_INT_MASK_REG_200;
		lasat_int_mask_shift = LASATINT_MASK_SHIFT_200;
		get_int_status = get_int_status_200;
		*lasat_int_mask &= 0xffff;
		break;
	default:
		panic("init_IRQ: mips_machtype incorrect");
	}

	/* Now safe to set the exception vector. */
	set_except_vector(0, lasatIRQ);

	for (i = 0; i <= LASATINT_END; i++) {
		irq_desc[i].status	= IRQ_DISABLED;
		irq_desc[i].action	= 0;
		irq_desc[i].depth	= 1;
		irq_desc[i].handler	= &lasat_irq_type;
	}
}
Exemple #3
0
void __init init_IRQ(void)
{
	extern void __init init_generic_irq(void);

	init_generic_irq();
	irq_setup();
}
Exemple #4
0
void __init nino_irq_setup(void)
{
	extern asmlinkage void ninoIRQ(void);
	extern void init_generic_irq(void);

	unsigned int i;

	/* Disable all hardware interrupts */
	change_cp0_status(ST0_IM, 0x00);

	/* Clear interrupts */
	outl(0xffffffff, TX3912_INT1_CLEAR);
	outl(0xffffffff, TX3912_INT2_CLEAR);
	outl(0xffffffff, TX3912_INT3_CLEAR);
	outl(0xffffffff, TX3912_INT4_CLEAR);
	outl(0xffffffff, TX3912_INT5_CLEAR);

	/*
	 * Disable all PR31700 interrupts. We let the various
	 * device drivers in the system register themselves
	 * and set the proper hardware bits.
	 */
	outl(0x00000000, TX3912_INT1_ENABLE);
	outl(0x00000000, TX3912_INT2_ENABLE);
	outl(0x00000000, TX3912_INT3_ENABLE);
	outl(0x00000000, TX3912_INT4_ENABLE);
	outl(0x00000000, TX3912_INT5_ENABLE);

	/* Initialize IRQ vector table */
	init_generic_irq();

	/* Initialize IRQ action handlers */
	for (i = 0; i < 16; i++) {
		hw_irq_controller *handler = NULL;
		if (i == 0 || i == 3)
			handler		= &irq6_type;
		else
			handler		= &irq4_type;

		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);

	/* Enable high priority interrupts */
	outl(TX3912_INT6_ENABLE_GLOBALEN | TX3912_INT6_ENABLE_HIGH_PRIORITY,
		TX3912_INT6_ENABLE);

	/* Enable all interrupts */
	change_cp0_status(ST0_IM, ALLINTS);
}
Exemple #5
0
void __init init_IRQ(void)
{
	memset(irq_desc, 0, sizeof(irq_desc));

	init_generic_irq();
	mips_cpu_irq_init(MIPS_CPU_IRQ_BASE);
	init_vr41xx_icu_irq();
	init_vr41xx_giuint_irq();

	set_except_vector(0, vr41xx_handle_interrupt);
}
Exemple #6
0
void __init init_IRQ(void)
{
	int i;
        unsigned long flags;

        memset(irq_desc, 0, sizeof(irq_desc));
        set_except_vector(0, it8172_IRQ);

	init_generic_irq();

	/* mask all interrupts */
	it8172_hw0_icregs->lb_mask  = 0xffff;
	it8172_hw0_icregs->lpc_mask = 0xffff;
	it8172_hw0_icregs->pci_mask = 0xffff;
	it8172_hw0_icregs->nmi_mask = 0xffff;

	/* make all interrupts level triggered */
	it8172_hw0_icregs->lb_trigger  = 0;
	it8172_hw0_icregs->lpc_trigger = 0;
	it8172_hw0_icregs->pci_trigger = 0;
	it8172_hw0_icregs->nmi_trigger = 0;

	/* active level setting */
	/* uart, keyboard, and mouse are active high */
	it8172_hw0_icregs->lpc_level = (0x10 | 0x2 | 0x1000);
	it8172_hw0_icregs->lb_level |= 0x20;

	/* keyboard and mouse are edge triggered */
	it8172_hw0_icregs->lpc_trigger |= (0x2 | 0x1000); 


#if 0
	// Enable this piece of code to make internal USB interrupt
	// edge triggered.
	it8172_hw0_icregs->pci_trigger |= 
		(1 << (IT8172_USB_IRQ - IT8172_PCI_DEV_IRQ_BASE));
	it8172_hw0_icregs->pci_level &= 
		~(1 << (IT8172_USB_IRQ - IT8172_PCI_DEV_IRQ_BASE));
#endif

	for (i = 0; i <= IT8172_LAST_IRQ; i++) {
		irq_desc[i].handler = &it8172_irq_type;
	}
	irq_desc[MIPS_CPU_TIMER_IRQ].handler = &cp0_irq_type;
	set_cp0_status(ALLINTS_NOTIMER);

#ifdef CONFIG_REMOTE_DEBUG
	/* If local serial I/O used for debug port, enter kgdb at once */
	puts("Waiting for kgdb to connect...");
	set_debug_traps();
	breakpoint(); 
#endif
}
Exemple #7
0
void __init init_IRQ(void)
{
	set_except_vector(0, mipsIRQ);
	init_generic_irq();
	init_i8259_irqs();

#ifdef CONFIG_REMOTE_DEBUG
	if (remote_debug) {
		set_debug_traps();
		breakpoint();
	}
#endif
}
Exemple #8
0
void __init init_IRQ(void)
{
	int i;

	set_except_vector(0, ev96100IRQ);
	init_generic_irq();

	for (i = 0; i < 8; i++) {
		irq_desc[i].status	= IRQ_DISABLED;
		irq_desc[i].action	= 0;
		irq_desc[i].depth	= 1;
		irq_desc[i].handler	= &ev96100_irq_type;
	}
}
void __init init_IRQ(void)
{
#ifdef CONFIG_KGDB
	extern void breakpoint(void);
	extern void set_debug_traps(void);

	printk("Wait for gdb client connection ...\n");
	set_debug_traps();
	breakpoint();
#endif
	/* set up default irq controller */
	init_generic_irq();

	/* invoke board-specific irq setup */
	irq_setup();
}
/*
 * On systems with i8259-style interrupt controllers we assume for
 * driver compatibility reasons interrupts 0 - 15 to be the i8259
 * interrupts even if the hardware uses a different interrupt numbering.
 */
void __init init_IRQ (void)
{
	int i;

	set_except_vector(0, jazz_handle_int);

	init_generic_irq();
	init_i8259_irqs();			/* Integrated i8259  */
#if 0
	init_jazz_irq();

	/* Actually we've got more interrupts to handle ...  */
	for (i = PCIMT_IRQ_INT2; i <= PCIMT_IRQ_ETHERNET; i++) {
		irq_desc[i].status     = IRQ_DISABLED;
		irq_desc[i].action     = 0;
		irq_desc[i].depth      = 1;
		irq_desc[i].handler    = &pciasic_irq_type;
	}
#endif
}
Exemple #11
0
void __init init_IRQ(void)
{
	int i;

        /*
         * Mask out all interrupt
	 */
	clear_cp0_status(0x0000ff00);

	/* Now safe to set the exception vector. */
	set_except_vector(0, mipsIRQ);

	init_generic_irq();

	for (i = 0; i <= SEADINT_END; i++) {
		irq_desc[i].status	= IRQ_DISABLED;
		irq_desc[i].action	= NULL;
		irq_desc[i].depth	= 1;
		irq_desc[i].lock	= SPIN_LOCK_UNLOCKED;
		irq_desc[i].handler	= &sead_irq_type;
	}
}
Exemple #12
0
void __init init_IRQ(void)
{
	unsigned int irq;

	init_generic_irq();
	/* Install our interrupt handler, then clear and disable all
	 * CRIME and MACE interrupts. */
	crime_write(0, CRIME_INT_MASK);
	crime_write(0, CRIME_HARD_INT);
	crime_write(0, CRIME_SOFT_INT);
	mace_perif_ctrl_write(0, istat);
	mace_perif_ctrl_write(0, imask);
	set_except_vector(0, ip32_handle_int);

	for (irq = 0; irq <= IP32_IRQ_MAX; irq++) {
		hw_irq_controller *controller;

		if (irq == IP32_R4K_TIMER_IRQ)
			controller = &ip32_cpu_interrupt;
		else if (irq <= MACE_PCI_BRIDGE_IRQ && irq >= MACE_VID_IN1_IRQ)
			controller = &ip32_mace_interrupt;
		else if (irq <= MACEPCI_SHARED2_IRQ && irq >= MACEPCI_SCSI0_IRQ)
			controller = &ip32_macepci_interrupt;
		else if (irq <= CRIME_VICE_IRQ && irq >= CRIME_GBE0_IRQ)
			controller = &ip32_crime_interrupt;
		else
			controller = &ip32_maceisa_interrupt;

		irq_desc[irq].status = IRQ_DISABLED;
		irq_desc[irq].action = 0;
		irq_desc[irq].depth = 0;
		irq_desc[irq].handler = controller;
	}
	setup_irq(CRIME_MEMERR_IRQ, &memerr_irq);
	setup_irq(CRIME_CPUERR_IRQ, &cpuerr_irq);

#define ALLINTS (IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4 | IE_IRQ5)
	change_c0_status(ST0_IM, ALLINTS);
}
Exemple #13
0
void __init init_IRQ(void)
{
	int i;
	unsigned long cp0_status;

	cp0_status = read_32bit_cp0_register(CP0_STATUS);
	memset(irq_desc, 0, sizeof(irq_desc));
	set_except_vector(0, au1000_IRQ);

	init_generic_irq();
	
	/* 
	 * Setup high priority interrupts on int_request0; low priority on
	 * int_request1
	 */
	for (i = 0; i <= NR_IRQS; i++) {
		switch (i) {
			case AU1000_MAC0_DMA_INT:
			case AU1000_MAC1_DMA_INT:
				setup_local_irq(i, INTC_INT_HIGH_LEVEL, 0);
				irq_desc[i].handler = &level_irq_type;
				break;
			default: /* active high, level interrupt */
				setup_local_irq(i, INTC_INT_HIGH_LEVEL, 1);
				irq_desc[i].handler = &level_irq_type;
				break;
		}
	}

	set_cp0_status(ALLINTS);
#ifdef CONFIG_REMOTE_DEBUG
	/* If local serial I/O used for debug port, enter kgdb at once */
	puts("Waiting for kgdb to connect...");
	set_debug_traps();
	breakpoint(); 
#endif
}
void __init init_IRQ(void)
{
	/*
	 * Clear all of the interrupts while we change the able around a bit.
	 * int-handler is not on bootstrap
	 */
	clear_c0_status(ST0_IM);

	/* Sets the first-level interrupt dispatcher. */
	set_except_vector(0, big_sur_handle_int);
	init_generic_irq();

	mips_cpu_irq_init(0);
	big_sur_irq_init();

#ifdef CONFIG_REMOTE_DEBUG
	printk("start kgdb ...\n");
	set_debug_traps();
	breakpoint();	/* you may move this line to whereever you want :-) */
#endif
#ifdef CONFIG_GDB_CONSOLE
	register_gdb_console();
#endif
}
void __init init_IRQ(void)
{
	int i;
	unsigned long cp0_status;
	au1xxx_irq_map_t *imp;
	extern au1xxx_irq_map_t au1xxx_irq_map[];
	extern int au1xxx_nr_irqs;

	cp0_status = read_c0_status();
	memset(irq_desc, 0, sizeof(irq_desc));
	set_except_vector(0, au1000_IRQ);

	init_generic_irq();

	for (i = 0; i <= AU1000_MAX_INTR; i++) {
		/* default is active high, level interrupt */
		setup_local_irq(i, INTC_INT_HIGH_LEVEL, 0);
		irq_desc[i].handler = &level_irq_type;
	}

	/* Now set up the irq mapping for the board.
	*/
	imp = au1xxx_irq_map;
	for (i=0; i<au1xxx_nr_irqs; i++) {

		setup_local_irq(imp->im_irq, imp->im_type, imp->im_request);

		switch (imp->im_type) {

		case INTC_INT_HIGH_LEVEL:
			irq_desc[imp->im_irq].handler = &level_irq_type;
			break;

		case INTC_INT_LOW_LEVEL:
			irq_desc[imp->im_irq].handler = &level_irq_type;
			break;

		case INTC_INT_RISE_EDGE:
			irq_desc[imp->im_irq].handler = &rise_edge_irq_type;
			break;

		case INTC_INT_FALL_EDGE:
			irq_desc[imp->im_irq].handler = &fall_edge_irq_type;
			break;

		case INTC_INT_RISE_AND_FALL_EDGE:
			irq_desc[imp->im_irq].handler = &either_edge_irq_type;
			break;

		default:
			panic("Unknown au1xxx irq map");
			break;
		}
		imp++;
	}

	set_c0_status(ALLINTS);

	/* Board specific IRQ initialization.
	*/
	if (board_init_irq)
		(*board_init_irq)();

#ifdef CONFIG_KGDB
	/* If local serial I/O used for debug port, enter kgdb at once */
	puts("Waiting for kgdb to connect...");
	set_debug_traps();
	breakpoint();
#endif
}
Exemple #16
0
void __init init_IRQ(void)
{
    int i;
    unsigned long cp0_status;
    extern char except_vec0_au1000;

    cp0_status = read_32bit_cp0_register(CP0_STATUS);
    memset(irq_desc, 0, sizeof(irq_desc));
    set_except_vector(0, au1000_IRQ);

    init_generic_irq();

    for (i = 0; i <= AU1000_MAX_INTR; i++) {
        switch (i) {
        case AU1000_UART0_INT:
        case AU1000_UART3_INT:
#ifdef CONFIG_MIPS_PB1000
        case AU1000_UART1_INT:
        case AU1000_UART2_INT:

        case AU1000_SSI0_INT:
        case AU1000_SSI1_INT:
#endif

#ifdef CONFIG_MIPS_PB1100
        case AU1000_UART1_INT:

        case AU1000_SSI0_INT:
        case AU1000_SSI1_INT:
#endif
        case AU1000_DMA_INT_BASE:
        case AU1000_DMA_INT_BASE+1:
        case AU1000_DMA_INT_BASE+2:
        case AU1000_DMA_INT_BASE+3:
        case AU1000_DMA_INT_BASE+4:
        case AU1000_DMA_INT_BASE+5:
        case AU1000_DMA_INT_BASE+6:
        case AU1000_DMA_INT_BASE+7:

        case AU1000_IRDA_TX_INT:
        case AU1000_IRDA_RX_INT:

        case AU1000_MAC0_DMA_INT:
#ifdef CONFIG_MIPS_PB1000
        case AU1000_MAC1_DMA_INT:
#endif
#ifdef CONFIG_MIPS_PB1500
        case AU1000_MAC1_DMA_INT:
#endif
        case AU1500_GPIO_204:

            setup_local_irq(i, INTC_INT_HIGH_LEVEL, 0);
            irq_desc[i].handler = &level_irq_type;
            break;

#ifdef CONFIG_MIPS_PB1000
        case AU1000_GPIO_15:
#endif
        case AU1000_USB_HOST_INT:
#ifdef CONFIG_MIPS_PB1500
        case AU1000_PCI_INTA:
        case AU1000_PCI_INTB:
        case AU1000_PCI_INTC:
        case AU1000_PCI_INTD:
        case AU1500_GPIO_201:
        case AU1500_GPIO_202:
        case AU1500_GPIO_203:
        case AU1500_GPIO_205:
        case AU1500_GPIO_207:
#endif

#ifdef CONFIG_MIPS_PB1100
        case AU1000_GPIO_9: // PCMCIA Card Fully_Interted#
        case AU1000_GPIO_10: // PCMCIA_STSCHG#
        case AU1000_GPIO_11: // PCMCIA_IRQ#
        case AU1000_GPIO_13: // DC_IRQ#
        case AU1000_GPIO_23: // 2-wire SCL
#endif
            setup_local_irq(i, INTC_INT_LOW_LEVEL, 0);
            irq_desc[i].handler = &level_irq_type;
            break;
        case AU1000_ACSYNC_INT:
        case AU1000_AC97C_INT:
        case AU1000_TOY_INT:
        case AU1000_TOY_MATCH0_INT:
        case AU1000_TOY_MATCH1_INT:
        case AU1000_USB_DEV_SUS_INT:
        case AU1000_USB_DEV_REQ_INT:
        case AU1000_RTC_INT:
        case AU1000_RTC_MATCH0_INT:
        case AU1000_RTC_MATCH1_INT:
        case AU1000_RTC_MATCH2_INT:
            setup_local_irq(i, INTC_INT_RISE_EDGE, 0);
            irq_desc[i].handler = &rise_edge_irq_type;
            break;

        // Careful if you change match 2 request!
        // The interrupt handler is called directly
        // from the low level dispatch code.
        case AU1000_TOY_MATCH2_INT:
            setup_local_irq(i, INTC_INT_RISE_EDGE, 1);
            irq_desc[i].handler = &rise_edge_irq_type;
            break;
        default: /* active high, level interrupt */
            setup_local_irq(i, INTC_INT_HIGH_LEVEL, 0);
            irq_desc[i].handler = &level_irq_type;
            break;
        }
    }

    set_cp0_status(ALLINTS);
#ifdef CONFIG_REMOTE_DEBUG
    /* If local serial I/O used for debug port, enter kgdb at once */
    puts("Waiting for kgdb to connect...");
    set_debug_traps();
    breakpoint();
#endif
}
Exemple #17
0
void __init init_IRQ(void)
{
	int i;

	/* Init local mask --> irq tables. */
	for (i = 0; i < 256; i++) {
		if (i & 0x80) {
			lc0msk_to_irqnr[i] = SGINT_LOCAL0 + 7;
			lc1msk_to_irqnr[i] = SGINT_LOCAL1 + 7;
			lc2msk_to_irqnr[i] = SGINT_LOCAL2 + 7;
			lc3msk_to_irqnr[i] = SGINT_LOCAL3 + 7;
		} else if (i & 0x40) {
			lc0msk_to_irqnr[i] = SGINT_LOCAL0 + 6;
			lc1msk_to_irqnr[i] = SGINT_LOCAL1 + 6;
			lc2msk_to_irqnr[i] = SGINT_LOCAL2 + 6;
			lc3msk_to_irqnr[i] = SGINT_LOCAL3 + 6;
		} else if (i & 0x20) {
			lc0msk_to_irqnr[i] = SGINT_LOCAL0 + 5;
			lc1msk_to_irqnr[i] = SGINT_LOCAL1 + 5;
			lc2msk_to_irqnr[i] = SGINT_LOCAL2 + 5;
			lc3msk_to_irqnr[i] = SGINT_LOCAL3 + 5;
		} else if (i & 0x10) {
			lc0msk_to_irqnr[i] = SGINT_LOCAL0 + 4;
			lc1msk_to_irqnr[i] = SGINT_LOCAL1 + 4;
			lc2msk_to_irqnr[i] = SGINT_LOCAL2 + 4;
			lc3msk_to_irqnr[i] = SGINT_LOCAL3 + 4;
		} else if (i & 0x08) {
			lc0msk_to_irqnr[i] = SGINT_LOCAL0 + 3;
			lc1msk_to_irqnr[i] = SGINT_LOCAL1 + 3;
			lc2msk_to_irqnr[i] = SGINT_LOCAL2 + 3;
			lc3msk_to_irqnr[i] = SGINT_LOCAL3 + 3;
		} else if (i & 0x04) {
			lc0msk_to_irqnr[i] = SGINT_LOCAL0 + 2;
			lc1msk_to_irqnr[i] = SGINT_LOCAL1 + 2;
			lc2msk_to_irqnr[i] = SGINT_LOCAL2 + 2;
			lc3msk_to_irqnr[i] = SGINT_LOCAL3 + 2;
		} else if (i & 0x02) {
			lc0msk_to_irqnr[i] = SGINT_LOCAL0 + 1;
			lc1msk_to_irqnr[i] = SGINT_LOCAL1 + 1;
			lc2msk_to_irqnr[i] = SGINT_LOCAL2 + 1;
			lc3msk_to_irqnr[i] = SGINT_LOCAL3 + 1;
		} else if (i & 0x01) {
			lc0msk_to_irqnr[i] = SGINT_LOCAL0 + 0;
			lc1msk_to_irqnr[i] = SGINT_LOCAL1 + 0;
			lc2msk_to_irqnr[i] = SGINT_LOCAL2 + 0;
			lc3msk_to_irqnr[i] = SGINT_LOCAL3 + 0;
		} else {
			lc0msk_to_irqnr[i] = 0;
			lc1msk_to_irqnr[i] = 0;
			lc2msk_to_irqnr[i] = 0;
			lc3msk_to_irqnr[i] = 0;
		}
	}

	/* Mask out all interrupts. */
	sgint->imask0 = 0;
	sgint->imask1 = 0;
	sgint->cmeimask0 = 0;
	sgint->cmeimask1 = 0;

	set_except_vector(0, indyIRQ);

	init_generic_irq();
	/* init CPU irqs */
	mips_cpu_irq_init(SGINT_CPU);

	for (i = SGINT_LOCAL0; i < SGI_INTERRUPTS; i++) {
		hw_irq_controller *handler;

		if (i < SGINT_LOCAL1)
			handler		= &ip22_local0_irq_type;
		else if (i < SGINT_LOCAL2)
			handler		= &ip22_local1_irq_type;
		else if (i < SGINT_LOCAL3)
			handler		= &ip22_local2_irq_type;
		else
			handler		= &ip22_local3_irq_type;

		irq_desc[i].status	= IRQ_DISABLED;
		irq_desc[i].action	= 0;
		irq_desc[i].depth	= 1;
		irq_desc[i].handler	= handler;
	}

	/* vector handler. this register the IRQ as non-sharable */
	setup_irq(SGI_LOCAL_0_IRQ, &local0_cascade);
	setup_irq(SGI_LOCAL_1_IRQ, &local1_cascade);
	setup_irq(SGI_BUSERR_IRQ, &buserr);

	/* cascade in cascade. i love Indy ;-) */
	setup_irq(SGI_MAP_0_IRQ, &map0_cascade);
#ifdef USE_LIO3_IRQ
	setup_irq(SGI_MAP_1_IRQ, &map1_cascade);
#endif

#ifdef CONFIG_EISA
	if (ip22_is_fullhouse())	/* Only Indigo-2 has EISA stuff */
	        ip22_eisa_init ();
#endif
}
Exemple #18
0
void __init init_IRQ(void)
{
	int i;

	sgi_i2regs = (struct sgi_int2_regs *) (KSEG1 + SGI_INT2_BASE);
	sgi_i3regs = (struct sgi_int3_regs *) (KSEG1 + SGI_INT3_BASE);

	/* Init local mask --> irq tables. */
	for (i = 0; i < 256; i++) {
		if (i & 0x80) {
			lc0msk_to_irqnr[i] = SGINT_LOCAL0 + 7;
			lc1msk_to_irqnr[i] = SGINT_LOCAL1 + 7;
			lc2msk_to_irqnr[i] = SGINT_LOCAL2 + 7;
			lc3msk_to_irqnr[i] = SGINT_LOCAL3 + 7;
		} else if (i & 0x40) {
			lc0msk_to_irqnr[i] = SGINT_LOCAL0 + 6;
			lc1msk_to_irqnr[i] = SGINT_LOCAL1 + 6;
			lc2msk_to_irqnr[i] = SGINT_LOCAL2 + 6;
			lc3msk_to_irqnr[i] = SGINT_LOCAL3 + 6;
		} else if (i & 0x20) {
			lc0msk_to_irqnr[i] = SGINT_LOCAL0 + 5;
			lc1msk_to_irqnr[i] = SGINT_LOCAL1 + 5;
			lc2msk_to_irqnr[i] = SGINT_LOCAL2 + 5;
			lc3msk_to_irqnr[i] = SGINT_LOCAL3 + 5;
		} else if (i & 0x10) {
			lc0msk_to_irqnr[i] = SGINT_LOCAL0 + 4;
			lc1msk_to_irqnr[i] = SGINT_LOCAL1 + 4;
			lc2msk_to_irqnr[i] = SGINT_LOCAL2 + 4;
			lc3msk_to_irqnr[i] = SGINT_LOCAL3 + 4;
		} else if (i & 0x08) {
			lc0msk_to_irqnr[i] = SGINT_LOCAL0 + 3;
			lc1msk_to_irqnr[i] = SGINT_LOCAL1 + 3;
			lc2msk_to_irqnr[i] = SGINT_LOCAL2 + 3;
			lc3msk_to_irqnr[i] = SGINT_LOCAL3 + 3;
		} else if (i & 0x04) {
			lc0msk_to_irqnr[i] = SGINT_LOCAL0 + 2;
			lc1msk_to_irqnr[i] = SGINT_LOCAL1 + 2;
			lc2msk_to_irqnr[i] = SGINT_LOCAL2 + 2;
			lc3msk_to_irqnr[i] = SGINT_LOCAL3 + 2;
		} else if (i & 0x02) {
			lc0msk_to_irqnr[i] = SGINT_LOCAL0 + 1;
			lc1msk_to_irqnr[i] = SGINT_LOCAL1 + 1;
			lc2msk_to_irqnr[i] = SGINT_LOCAL2 + 1;
			lc3msk_to_irqnr[i] = SGINT_LOCAL3 + 1;
		} else if (i & 0x01) {
			lc0msk_to_irqnr[i] = SGINT_LOCAL0 + 0;
			lc1msk_to_irqnr[i] = SGINT_LOCAL1 + 0;
			lc2msk_to_irqnr[i] = SGINT_LOCAL2 + 0;
			lc3msk_to_irqnr[i] = SGINT_LOCAL3 + 0;
		} else {
			lc0msk_to_irqnr[i] = 0;
			lc1msk_to_irqnr[i] = 0;
			lc2msk_to_irqnr[i] = 0;
			lc3msk_to_irqnr[i] = 0;
		}
	}

	/* Indy uses an INT3, Indigo2 uses an INT2 */
	if (sgi_guiness) {
		ioc_icontrol = &sgi_i3regs->ints;
		ioc_timers = &sgi_i3regs->timers;
		ioc_tclear = &sgi_i3regs->tclear;
	} else {
		ioc_icontrol = &sgi_i2regs->ints;
		ioc_timers = &sgi_i2regs->timers;
		ioc_tclear = &sgi_i2regs->tclear;
	}

	/* Mask out all interrupts. */
	ioc_icontrol->imask0 = 0;
	ioc_icontrol->imask1 = 0;
	ioc_icontrol->cmeimask0 = 0;
	ioc_icontrol->cmeimask1 = 0;

	set_except_vector(0, indyIRQ);

	init_generic_irq();
	/* init CPU irqs */
	mips_cpu_irq_init(SGINT_CPU);

	for (i = SGINT_LOCAL0; i < SGINT_END; i++) {
		hw_irq_controller *handler;

		if (i < SGINT_LOCAL1)
			handler		= &ip22_local0_irq_type;
		else if (i < SGINT_LOCAL2)
			handler		= &ip22_local1_irq_type;
		else if (i < SGINT_LOCAL3)
			handler		= &ip22_local2_irq_type;
		else
			handler		= &ip22_local3_irq_type;

		irq_desc[i].status	= IRQ_DISABLED;
		irq_desc[i].action	= 0;
		irq_desc[i].depth	= 1;
		irq_desc[i].handler	= handler;
	}

	/* vector handler. this register the IRQ as non-sharable */
	setup_irq(SGI_LOCAL_0_IRQ, &local0_cascade);
	setup_irq(SGI_LOCAL_1_IRQ, &local1_cascade);
	setup_irq(SGI_BUSERR_IRQ, &buserr);

	/* cascade in cascade. i love Indy ;-) */
	setup_irq(SGI_MAP_0_IRQ, &map0_cascade);
#ifdef I_REALLY_NEED_THIS_IRQ
	setup_irq(SGI_MAP_1_IRQ, &map1_cascade);
#endif
#ifdef CONFIG_IP22_EISA
	if (!sgi_guiness)	/* Only Indigo-2 have EISA stuff */
	        ip22_eisa_init ();
#endif
}
Exemple #19
0
void __init init_IRQ(void)
{
	int i;
	unsigned long cp0_status;
	au1xxx_irq_map_t *imp;
	extern au1xxx_irq_map_t au1xxx_irq_map[];
	extern au1xxx_irq_map_t au1xxx_ic0_map[];
	extern int au1xxx_nr_irqs;
	extern int au1xxx_ic0_nr_irqs;

	cp0_status = read_c0_status();
	memset(irq_desc, 0, sizeof(irq_desc));
	set_except_vector(0, au1000_IRQ);

	init_generic_irq();

	/* Initialize interrupt controllers to a safe state.
	*/
	au_writel(0xffffffff, IC0_CFG0CLR);
	au_writel(0xffffffff, IC0_CFG1CLR);
	au_writel(0xffffffff, IC0_CFG2CLR);
	au_writel(0xffffffff, IC0_MASKCLR);
	au_writel(0xffffffff, IC0_ASSIGNSET);
	au_writel(0xffffffff, IC0_WAKECLR);
	au_writel(0xffffffff, IC0_SRCSET);
	au_writel(0xffffffff, IC0_FALLINGCLR);
	au_writel(0xffffffff, IC0_RISINGCLR);
	au_writel(0x00000000, IC0_TESTBIT);

	au_writel(0xffffffff, IC1_CFG0CLR);
	au_writel(0xffffffff, IC1_CFG1CLR);
	au_writel(0xffffffff, IC1_CFG2CLR);
	au_writel(0xffffffff, IC1_MASKCLR);
	au_writel(0xffffffff, IC1_ASSIGNSET);
	au_writel(0xffffffff, IC1_WAKECLR);
	au_writel(0xffffffff, IC1_SRCSET);
	au_writel(0xffffffff, IC1_FALLINGCLR);
	au_writel(0xffffffff, IC1_RISINGCLR);
	au_writel(0x00000000, IC1_TESTBIT);

	/* Initialize IC0, which is fixed per processor.
	*/
	imp = au1xxx_ic0_map;
	for (i=0; i<au1xxx_ic0_nr_irqs; i++) {
		setup_local_irq(imp->im_irq, imp->im_type, imp->im_request);
		imp++;
	}

	/* Now set up the irq mapping for the board.
	*/
	imp = au1xxx_irq_map;
	for (i=0; i<au1xxx_nr_irqs; i++) {
		setup_local_irq(imp->im_irq, imp->im_type, imp->im_request);
		imp++;
	}

	set_c0_status(ALLINTS);

	/* Board specific IRQ initialization.
	*/
	if (board_init_irq)
		(*board_init_irq)();

#ifdef CONFIG_KGDB
	/* If local serial I/O used for debug port, enter kgdb at once */
	puts("Waiting for kgdb to connect...");
	set_debug_traps();
	breakpoint();
#endif
}