IRQ2-4 number to use on mpc83xx?

Joakim Tjernlund joakim.tjernlund at transmode.se
Wed Sep 24 06:18:13 EST 2008


On Tue, 2008-09-23 at 13:08 +0200, Joakim Tjernlund wrote:
> On Tue, 2008-09-23 at 11:08 +0200, Andre Schwarz wrote:
> > I can only tell how I do on MPC834x :
> > 
> > Table 8-6. IVEC/CVEC/MVEC Field Definition
> > 
> > Interrupt ID Number         Interrupt Meaning
> > 17                                           IRQ1
> > 18                                           IRQ2
> > 19                                           IRQ3
> > 20                                           IRQ4
> > 21                                           IRQ5
> > 22                                           IRQ6
> > 23                                           IRQ7
> > 48                                           IRQ0
> > 
> > 
> > Given this I can use this dts section for PCI devices connected @ IRQ0
> > and IRQ1
> > 
> > interrupt-map = <0x5800 0 0 1 &ipic 0x30 0x8
> >                                  0x6000 0 0 1 &ipic 0x11 0x8
> >                                  0x6000 0 0 2 &ipic 0x11 0x8>;
> > 
> > You should be able to use IRQ-Nr 18-20 for IRQ2-4.
> 
> Yes, that makes sense. Thanks.
> 
>  Jocke

OK, finally figured it out, see below, but I get a SEGV if I use 
IRQ_TYPE_EDGE_FALLING as below. IRQ_TYPE_EDGE_FALLING works.

        info->irq = irq_create_mapping(NULL, 19); /* IRQ3 */
	printk(KERN_ERR "IRQ map from %d to %ld\n", 19, info->irq);
	info->irq_flags = IRQ_TYPE_EDGE_FALLING;
	pdev = platform_device_register_simple("uio_irq", 3, r, 0);
	if (IS_ERR(pdev)) {
		ret = PTR_ERR(pdev);
		printk("uio_irq: simple returned :%d\n", ret);
		goto err_out;
	}
	if ((ret = uio_register_device(&pdev->dev, info))) {
		printk("uio_register_device: returned :%d\n", ret);
		goto err_out;
	}

The SEGV is in kernel/irq/manage.c, around line 375. Both
desc->chip->enable and desc->chip->startup are NULL:

		if (!(desc->status & IRQ_NOAUTOEN)) {
			desc->depth = 0;
			desc->status &= ~IRQ_DISABLED;
			if (desc->chip->startup)
				desc->chip->startup(irq);
			else
				desc->chip->enable(irq);
		} else

What am I missing? Kernel is 2.6.25

 Jocke



More information about the Linuxppc-dev mailing list