linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* RE : MPC5200Lite and PCI card IRQ
@ 2004-06-02 14:21 Bertrand Baudet
  2004-06-04 20:41 ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 3+ messages in thread
From: Bertrand Baudet @ 2004-06-02 14:21 UTC (permalink / raw)
  To: linuxppc-dev


Well,

I have the answer to my question:
Yes, the IRQ is automatically unmasked with the IRQ# from the PCI conf.

In fact the INT A of the PCI is linked to the IRQ0 of the MPC5200.

I'm trying to add a SATA PCI card (with Sii3112 chipset).

But it looks like in ide-probe.c if hwif->irq is set to 0, the IRQ is not
set. Unfortunately, in the case of the MPC5200, the IRQ0 has a value of 0.
Which disable the device.

After commenting out:
/*
if (!hwif->irq) {
	if (!(hwif->irq = ide_default_irq(hwif->io_ports[IDE_DATA_OFFSET])))
      {
              printk("%s: DISABLED, NO IRQ\n", hwif->name);
              return (hwif->present = 0);
      }
}
*/
the SATA card works properly.


Can someone correct me if I'm wrong: setting 0 to hwif->irq means that
there is no IRQ# defined. Right?



Regards,
Bertrand

-----Message d'origine-----
De : owner-linuxppc-dev@lists.linuxppc.org [mailto:owner-linuxppc-dev@lists.linuxppc.org] De la part de Bertrand Baudet
Envoyé : mercredi 2 juin 2004 11:20
À : linuxppc-dev@lists.linuxppc.org
Objet : MPC5200Lite and PCI card IRQ


Hi,

I'm trying to plug a PCI card on my MPC5200Lite board but I have some
trouble enabling the IRQ.

>From U-Boot, I'm setting the interruption line to IRQ 49. By default,
the interruption line is set to 0.

But when the driver is loaded, it doesn't look like the IRQ is unmasked.
The IRQ# is reported by the driver but when I look at /proc/interrupt,
I have:
           CPU0
49:          0  MPC5xxx Edge


What needs to be done in order to have the IRQ automatically enabled for
the
PCI card installed? (using linux kernel from DENX devel cvs)

Actually, how does it work? When the PCI driver probes the devices, will
it
enable the IRQ set for the PCI device? Or is it the driver for this PCI
card
that needs to enable the IRQ?

I tried to enable the IRQ once the drive reports the IRQ# by calling
enable_irq directly, but I'm getting a "enable_irq(49) unbalanced"




Regards,
Bertrand


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: RE : MPC5200Lite and PCI card IRQ
  2004-06-02 14:21 RE : MPC5200Lite and PCI card IRQ Bertrand Baudet
@ 2004-06-04 20:41 ` Benjamin Herrenschmidt
  2004-06-04 20:44   ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 3+ messages in thread
From: Benjamin Herrenschmidt @ 2004-06-04 20:41 UTC (permalink / raw)
  To: Bertrand Baudet; +Cc: linuxppc-dev list


On Wed, 2004-06-02 at 09:21, Bertrand Baudet wrote:
> Well,
>
> I have the answer to my question:
> Yes, the IRQ is automatically unmasked with the IRQ# from the PCI conf.
>
> In fact the INT A of the PCI is linked to the IRQ0 of the MPC5200.
>
> I'm trying to add a SATA PCI card (with Sii3112 chipset).
>
> But it looks like in ide-probe.c if hwif->irq is set to 0, the IRQ is not
> set. Unfortunately, in the case of the MPC5200, the IRQ0 has a value of 0.
> Which disable the device.

This is a none bug of some old drivers. 0 should be replaced by the
arch-defined NO_IRQ constant, which on ppc can conveniently by set
to -1. In the meantime, just hack around :)

> After commenting out:
> /*
> if (!hwif->irq) {
> 	if (!(hwif->irq = ide_default_irq(hwif->io_ports[IDE_DATA_OFFSET])))
>       {
>               printk("%s: DISABLED, NO IRQ\n", hwif->name);
>               return (hwif->present = 0);
>       }
> }
> */
> the SATA card works properly.
>
>
> Can someone correct me if I'm wrong: setting 0 to hwif->irq means that
> there is no IRQ# defined. Right?

Yes, and it's an incorrect assumption of the IDE code.
>
>
> Regards,
> Bertrand
>
> -----Message d'origine-----
> De : owner-linuxppc-dev@lists.linuxppc.org [mailto:owner-linuxppc-dev@lists.linuxppc.org] De la part de Bertrand Baudet
> Envoyé : mercredi 2 juin 2004 11:20
> À : linuxppc-dev@lists.linuxppc.org
> Objet : MPC5200Lite and PCI card IRQ
>
>
> Hi,
>
> I'm trying to plug a PCI card on my MPC5200Lite board but I have some
> trouble enabling the IRQ.
>
> >From U-Boot, I'm setting the interruption line to IRQ 49. By default,
> the interruption line is set to 0.
>
> But when the driver is loaded, it doesn't look like the IRQ is unmasked.
> The IRQ# is reported by the driver but when I look at /proc/interrupt,
> I have:
>            CPU0
> 49:          0  MPC5xxx Edge
>
>
> What needs to be done in order to have the IRQ automatically enabled for
> the
> PCI card installed? (using linux kernel from DENX devel cvs)
>
> Actually, how does it work? When the PCI driver probes the devices, will
> it
> enable the IRQ set for the PCI device? Or is it the driver for this PCI
> card
> that needs to enable the IRQ?
>
> I tried to enable the IRQ once the drive reports the IRQ# by calling
> enable_irq directly, but I'm getting a "enable_irq(49) unbalanced"
>
>
>
>
> Regards,
> Bertrand
>
>
--
Benjamin Herrenschmidt <benh@kernel.crashing.org>


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: RE : MPC5200Lite and PCI card IRQ
  2004-06-04 20:41 ` Benjamin Herrenschmidt
@ 2004-06-04 20:44   ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 3+ messages in thread
From: Benjamin Herrenschmidt @ 2004-06-04 20:44 UTC (permalink / raw)
  To: Bertrand Baudet; +Cc: linuxppc-dev list


> This is a none bug of some old drivers. 0 should be replaced by the
            ^^^^
   can't type today ... "known" of course

> arch-defined NO_IRQ constant, which on ppc can conveniently by set
> to -1. In the meantime, just hack around :)


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-06-04 20:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-02 14:21 RE : MPC5200Lite and PCI card IRQ Bertrand Baudet
2004-06-04 20:41 ` Benjamin Herrenschmidt
2004-06-04 20:44   ` Benjamin Herrenschmidt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).