linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Status of PCI-PCI bridge on UMAX S900
@ 2000-12-25  3:03 jingai
  0 siblings, 0 replies; 16+ messages in thread
From: jingai @ 2000-12-25  3:03 UTC (permalink / raw)
  To: debian-powerpc, linuxppc-dev


Hello, I am just curious if anyone is working on getting the PCI-PCI
bridge code working for the UMAX S900 (similar to 9500, but
obviously different enough to break the code).  The problem is this:
all cards not in slots 1-2 are assigned an IRQ of 1, which is
obviously wrong.  I'm not sure why slot 3 does not work, however,
unless the code just thinks the PCI bridge *is* slot 3 (which it does
appear to be that way).

If no one is currently attempting to fix it, but someone would like to,
here is all of the relevant info I can think of.  Thanks in advance for
any help.

Location of the pci bridge in /proc is:

/proc/device-tree/bandit/pci-bridge/AAPL,interrupts

colour:/home/jingai# lspci
00:0b.0 Host bridge: Apple Computer Inc. Bandit PowerPC host bridge (rev
03)
00:0d.0 Unknown mass storage controller: Promise Technology, Inc. 20267
(rev 02)
00:0e.0 USB Controller: OPTi Inc. 82C861 (rev 10)
00:0f.0 PCI bridge: Digital Equipment Corporation DECchip 21052 (rev 01)
00:10.0 Class ff00: Apple Computer Inc. Grand Central I/O (rev 02)
01:01.0 VGA compatible controller: ATI Technologies Inc Rage 128 RE
01:02.0 Ethernet controller: 3Com Corporation 3c905C-TX [Fast Etherlink]
(rev 30)

colour:/home/jingai# lspci -vv
00:0b.0 Host bridge: Apple Computer Inc. Bandit PowerPC host bridge (rev
03)
        Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr-
Stepping- SERR- FastB2B-
        Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort+ >SERR- <PERR-
        Latency: 32, cache line size 08

00:0d.0 Unknown mass storage controller: Promise Technology, Inc. 20267
(rev 02)
        Subsystem: Promise Technology, Inc.: Unknown device 4d33
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B-
        Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR-
        Latency: 32
        Interrupt: pin A routed to IRQ 23
        Region 0: I/O ports at 2070 [size=8]
        Region 1: I/O ports at 2060 [size=4]
        Region 2: I/O ports at 2050 [size=8]
        Region 3: I/O ports at 2040 [size=4]
        Region 4: I/O ports at 2000 [size=64]
        Region 5: Memory at 88020000 (32-bit, non-prefetchable) [size=128K]
        Expansion ROM at 88010000 [disabled] [size=64K]
        Capabilities: [58] Power Management version 1
                Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
PME(D0-,D1-,D2-,D3hot-,D3cold-)
                Status: D0 PME-Enable- DSel=0 DScale=0 PME-

00:0e.0 USB Controller: OPTi Inc. 82C861 (rev 10) (prog-if 10 [OHCI])
        Subsystem: OPTi Inc. 82C861
        Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B-
        Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR+
        Latency: 32, cache line size 08
        Interrupt: pin A routed to IRQ 24
        Region 0: Memory at 88000000 (32-bit, non-prefetchable) [size=4K]

00:0f.0 PCI bridge: Digital Equipment Corporation DECchip 21052 (rev 01)
(prog-if 00 [Normal decode])
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B-
        Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR-
        Latency: 32, cache line size 08
        Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
        I/O behind bridge: 00001000-00001fff
        Memory behind bridge: 80800000-87ffffff
        BridgeCtl: Parity- SERR- NoISA+ VGA- MAbort- >Reset- FastB2B-

00:10.0 Class ff00: Apple Computer Inc. Grand Central I/O (rev 02)
        Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr-
Stepping- SERR- FastB2B-
        Status: Cap- 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR+
        Latency: 32, cache line size 08
        Region 0: Memory at f3000000 (32-bit, non-prefetchable) [size=128K]

01:01.0 VGA compatible controller: ATI Technologies Inc Rage 128 RE
(prog-if 00 [VGA])
        Subsystem: Unknown device b530:0408
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping+ SERR- FastB2B-
        Status: Cap+ 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR-
        Latency: 32 (2000ns min), cache line size 08
        Interrupt: pin A routed to IRQ 1
        Region 0: Memory at 84000000 (32-bit, prefetchable) [size=64M]
        Region 1: I/O ports at 1000 [size=256]
        Region 2: Memory at 80804000 (32-bit, non-prefetchable) [size=16K]
        Expansion ROM at 80840000 [disabled] [size=128K]
        Capabilities: [5c] Power Management version 1
                Flags: PMEClk- DSI- D1+ D2- AuxCurrent=0mA
PME(D0-,D1-,D2-,D3hot-,D3cold-)
                Status: D0 PME-Enable- DSel=0 DScale=0 PME-

01:02.0 Ethernet controller: 3Com Corporation 3c905C-TX [Fast Etherlink]
(rev 30)
        Subsystem: 3Com Corporation 3C905C-TX Fast Etherlink for PC
Management NIC
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr-
Stepping- SERR- FastB2B-
        Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR-
        Latency: 32 (2500ns min, 2500ns max), cache line size 08
        Interrupt: pin A routed to IRQ 1
        Region 0: I/O ports at 1400 [size=128]
        Region 1: Memory at 80800000 (32-bit, non-prefetchable) [size=128]
        Expansion ROM at 80820000 [disabled] [size=128K]
        Capabilities: [dc] Power Management version 2
                Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA
PME(D0+,D1+,D2+,D3hot+,D3cold-)
                Status: D0 PME-Enable+ DSel=0 DScale=2 PME-


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

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

* Re: Status of PCI-PCI bridge on UMAX S900
       [not found] <j-jvNB.A.O4F.4jrR6@murphy>
@ 2000-12-27 10:06 ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 16+ messages in thread
From: Benjamin Herrenschmidt @ 2000-12-27 10:06 UTC (permalink / raw)
  To: jingai, debian-powerpc, linuxppc-dev


>Hello, I am just curious if anyone is working on getting the PCI-PCI
>bridge code working for the UMAX S900 (similar to 9500, but
>obviously different enough to break the code).  The problem is this:
>all cards not in slots 1-2 are assigned an IRQ of 1, which is
>obviously wrong.  I'm not sure why slot 3 does not work, however,
>unless the code just thinks the PCI bridge *is* slot 3 (which it does
>appear to be that way).
>
>If no one is currently attempting to fix it, but someone would like to,
>here is all of the relevant info I can think of.  Thanks in advance for
>any help.

I had no time to fix that yet. email me in a couple of weeks, I'll have
finished moving and my boxes will be back up.

Note that it's not similar to the 9500, the 9500 has 2 host bridges while
you have only one with a PCI<->PCI bridge, the interrupt problem appear
to be specific to this configuration on an oldworld machine.

If you want to give it a look by yourself, the code that gets the
interrupt numbers is in arch/ppc/prom.c. Look at the bits that use the
"AAPL,interrupt" property and modify it slightly so that when it can't
find it, it looks for the parent.

Ben.


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

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

* Re: Status of PCI-PCI bridge on UMAX S900
  2000-12-28  4:05 jingai
@ 2000-12-28 14:13 ` Chas Williams
  0 siblings, 0 replies; 16+ messages in thread
From: Chas Williams @ 2000-12-28 14:13 UTC (permalink / raw)
  To: jingai; +Cc: Benjamin Herrenschmidt, debian-powerpc, linuxppc-dev


just a short followup to the message i sent to debian-powerpc, i applied the
following diff and was able to move my usb board to the other side of the
umax/s900 bridge w/o any ill effect:

--- prom.c.000  Thu Dec 28 08:43:12 2000
+++ prom.c      Thu Dec 28 09:06:16 2000
@@ -1563,8 +1563,8 @@
        }

        ip = (int *) get_property(np, "AAPL,interrupts", &l);
-       if (ip == 0)
-               ip = (int *) get_property(np, "interrupts", &l);
+       if (ip == 0 && np->parent != NULL)
+               ip = (int *) get_property(np->parent, "AAPL,interrupts", &l);
        if (ip != 0) {
                np->intrs = (struct interrupt_info *) mem_start;
                np->n_intrs = l / sizeof(int);

lspci, now shows:

01:00.0 VGA compatible controller: ATI Technologies Inc Rage 128 RE (prog-if 00 [VGA])
        Subsystem: Unknown device b530:0408
        Flags: bus master, stepping, medium devsel, latency 32, IRQ 25
        Memory at 84000000 (32-bit, prefetchable) [size=64M]
        I/O ports at 1000 [size=256]
        Memory at 80804000 (32-bit, non-prefetchable) [size=16K]
        Expansion ROM at 80820000 [disabled] [size=128K]
        Capabilities: <available only to root>

01:01.0 USB Controller: OPTi Inc. 82C861 (rev 10) (prog-if 10 [OHCI])
        Subsystem: OPTi Inc.: Unknown device c861
        Flags: bus master, medium devsel, latency 32, IRQ 25
        Memory at 80800000 (32-bit, non-prefetchable) [size=4K]

on a related, note, shouldnt the 'right' code be:

	ip = (int *) get_property(np, "interrupts", &l);
	if (ip > 0)
	{
		/* find and assign interrupt -- see above */
	}

pci boards should only get an interrupt if they have the interrupt property
(which seems to be the number of interrupts, not the interrupt number)

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

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

* Re: Re: Status of PCI-PCI bridge on UMAX S900
@ 2000-12-29  0:16 jingai
  2000-12-29 15:09 ` Chas Williams
  0 siblings, 1 reply; 16+ messages in thread
From: jingai @ 2000-12-29  0:16 UTC (permalink / raw)
  To: debian-powerpc, linuxppc-dev


> just a short followup to the message i sent to debian-powerpc, i applied
> the following diff and was able to move my usb board to the other side of
the
>
> umax/s900 bridge w/o any ill effect:
>
> --- prom.c.000  Thu Dec 28 08:43:12 2000
> +++ prom.c      Thu Dec 28 09:06:16 2000
> @@ -1563,8 +1563,8 @@
>         }
>
>         ip = (int *) get_property(np, "AAPL,interrupts", &l);
> -       if (ip == 0)
> -               ip = (int *) get_property(np, "interrupts", &l);
> +       if (ip == 0 && np->parent != NULL)
> +               ip = (int *) get_property(np->parent, "AAPL,interrupts",
> &l);
>         if (ip != 0) {
>                 np->intrs = (struct interrupt_info *) mem_start;
>                 np->n_intrs = l / sizeof(int);

Doh!  I didn't even think to check if the second get_property() call
was returning > 0.. this fixes it!  Thanks bunches for spotting that!

> on a related, note, shouldnt the 'right' code be:
>
>     ip = (int *) get_property(np, "interrupts", &l);
>     if (ip > 0)
>     {
>         /* find and assign interrupt -- see above */
>     }
>
> pci boards should only get an interrupt if they have the interrupt
> property (which seems to be the number of interrupts, not the interrupt
number)

Seems correct to me, but I'm no kernel guru, so I'll let someone else
answer
authoritatively.

-j


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

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

* Re: Status of PCI-PCI bridge on UMAX S900
  2000-12-29  0:16 Re: Status of PCI-PCI bridge on UMAX S900 jingai
@ 2000-12-29 15:09 ` Chas Williams
  2001-01-04 19:19   ` Tibor Pausz
  0 siblings, 1 reply; 16+ messages in thread
From: Chas Williams @ 2000-12-29 15:09 UTC (permalink / raw)
  To: jingai; +Cc: debian-powerpc, linuxppc-dev


In message <200012290016.SAA25126@lists.linuxppc.org>,jingai writes:
>Doh!  I didn't even think to check if the second get_property() call
>was returning > 0.. this fixes it!  Thanks bunches for spotting that!

it seems like someone was confused about the meaning of the 'interrupts'
property when they wrote prom.c.  its basically the number of interrupts
supported by this pci device.  interpret_dbdma_props() also has the
same confusion, so the following would be a more complete patch to
prom.c.  note that it checks to see if a pci node has an interrupt
property before assigning one, otherwise devices on the far side of
a pci bridge (that shares interrupts) would be assigned interrupts
when they dont need them.


--- prom.c.000	Thu Dec 28 08:43:12 2000
+++ prom.c	Fri Dec 29 10:05:54 2000
@@ -1562,9 +1562,12 @@
 		return mem_start;
 	}

+	if ((ip = (int *) get_property(np, "interrupts", &l)) == 0)
+		return mem_start;
+
 	ip = (int *) get_property(np, "AAPL,interrupts", &l);
-	if (ip == 0)
-		ip = (int *) get_property(np, "interrupts", &l);
+	if (ip == 0 && np->parent != NULL)
+		ip = (int *) get_property(np->parent, "AAPL,interrupts", &l);
 	if (ip != 0) {
 		np->intrs = (struct interrupt_info *) mem_start;
 		np->n_intrs = l / sizeof(int);
@@ -1615,9 +1618,12 @@
 	if (use_of_interrupt_tree)
 		return mem_start;

+	if ((ip = (int *) get_property(np, "interrupts", &l)) == 0)
+		return mem_start;
+
 	ip = (int *) get_property(np, "AAPL,interrupts", &l);
-	if (ip == 0)
-		ip = (int *) get_property(np, "interrupts", &l);
+	if (ip == 0 && np->parent != NULL)
+		ip = (int *) get_property(np->parent, "AAPL,interrupts", &l);
 	if (ip != 0) {
 		np->intrs = (struct interrupt_info *) mem_start;
 		np->n_intrs = l / sizeof(int);

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

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

* Re: Status of PCI-PCI bridge on UMAX S900
  2000-12-29 15:09 ` Chas Williams
@ 2001-01-04 19:19   ` Tibor Pausz
  2001-01-04 20:41     ` Benjamin Herrenschmidt
  2001-01-04 22:26     ` Chas Williams
  0 siblings, 2 replies; 16+ messages in thread
From: Tibor Pausz @ 2001-01-04 19:19 UTC (permalink / raw)
  To: Chas Williams, jingai; +Cc: debian-powerpc, linuxppc-dev


On Fre, 29. Dez 2000, Chas Williams <chas@cmf.nrl.navy.mil> wrote:

>In message <200012290016.SAA25126@lists.linuxppc.org>,jingai writes:
>>Doh!  I didn't even think to check if the second get_property() call
>>was returning > 0.. this fixes it!  Thanks bunches for spotting that!
>
>it seems like someone was confused about the meaning of the 'interrupts'
>property when they wrote prom.c.  its basically the number of interrupts
>supported by this pci device.  interpret_dbdma_props() also has the
>same confusion, so the following would be a more complete patch to
>prom.c.  note that it checks to see if a pci node has an interrupt
>property before assigning one, otherwise devices on the far side of
>a pci bridge (that shares interrupts) would be assigned interrupts
>when they dont need them.

Today I tried your patch. Well, I breaks the hole interrupt stuff.
Now, even Mesh has trouble with interrupts (kernel crash), the
console=ttyS0 doesn't work so no output from the booting ...

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

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

* Re: Status of PCI-PCI bridge on UMAX S900
  2001-01-04 19:19   ` Tibor Pausz
@ 2001-01-04 20:41     ` Benjamin Herrenschmidt
  2001-01-04 20:57       ` David Edelsohn
  2001-01-04 22:48       ` jingai
  2001-01-04 22:26     ` Chas Williams
  1 sibling, 2 replies; 16+ messages in thread
From: Benjamin Herrenschmidt @ 2001-01-04 20:41 UTC (permalink / raw)
  To: Tibor Pausz, linuxppc-dev


>>it seems like someone was confused about the meaning of the 'interrupts'
>>property when they wrote prom.c.  its basically the number of interrupts
>>supported by this pci device.  interpret_dbdma_props() also has the
>>same confusion, so the following would be a more complete patch to
>>prom.c.  note that it checks to see if a pci node has an interrupt
>>property before assigning one, otherwise devices on the far side of
>>a pci bridge (that shares interrupts) would be assigned interrupts
>>when they dont need them.
>
>Today I tried your patch. Well, I breaks the hole interrupt stuff.
>Now, even Mesh has trouble with interrupts (kernel crash), the
>console=ttyS0 doesn't work so no output from the booting ...

The "interrupts" property can have various meanings depending on the OF
version, I suggest you don't mess with it. Just check that if you find no
AAPL,interrupts, and that pmac_newworld == 0, then look for parent
AAPL,interrupts.

Ben.


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

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

* Re: Status of PCI-PCI bridge on UMAX S900
  2001-01-04 20:41     ` Benjamin Herrenschmidt
@ 2001-01-04 20:57       ` David Edelsohn
  2001-01-04 21:17         ` Benjamin Herrenschmidt
  2001-01-04 22:48       ` jingai
  1 sibling, 1 reply; 16+ messages in thread
From: David Edelsohn @ 2001-01-04 20:57 UTC (permalink / raw)
  To: Tibor Pausz; +Cc: Benjamin Herrenschmidt, linuxppc-dev


>>>>> Benjamin Herrenschmidt writes:

Ben> The "interrupts" property can have various meanings depending on the OF
Ben> version, I suggest you don't mess with it. Just check that if you find no
Ben> AAPL,interrupts, and that pmac_newworld == 0, then look for parent
Ben> AAPL,interrupts.

	"interrupts" property is well-defined in the OF spec for each
device-tree node, but I do not think that prom.c currently has enough
parsing ability to handle the complexity or makes too many assumption.
And it does not need to fully parse that property, as Ben suggests.

David

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

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

* Re: Status of PCI-PCI bridge on UMAX S900
  2001-01-04 20:57       ` David Edelsohn
@ 2001-01-04 21:17         ` Benjamin Herrenschmidt
  2001-01-04 21:19           ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 16+ messages in thread
From: Benjamin Herrenschmidt @ 2001-01-04 21:17 UTC (permalink / raw)
  To: David Edelsohn, linuxppc-dev


>	"interrupts" property is well-defined in the OF spec for each
>device-tree node, but I do not think that prom.c currently has enough
>parsing ability to handle the complexity or makes too many assumption.
>And it does not need to fully parse that property, as Ben suggests.

I didn't say it wasn't well defined ;) I said it's usage by Apple is not.

prom.c has an interrupt tree parser that is used only on newworld macs
(they have a valid interrupt tree) and only when booting via Open
Firmware (booting via MacOS kills too much infos from the device tree to
be able to parse the interrupt tree any more).

I think it's also used on CHRP.

Ben.


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

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

* Re: Status of PCI-PCI bridge on UMAX S900
  2001-01-04 21:17         ` Benjamin Herrenschmidt
@ 2001-01-04 21:19           ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 16+ messages in thread
From: Benjamin Herrenschmidt @ 2001-01-04 21:19 UTC (permalink / raw)
  To: David Edelsohn, linuxppc-dev


>>	"interrupts" property is well-defined in the OF spec for each
>>device-tree node, but I do not think that prom.c currently has enough
>>parsing ability to handle the complexity or makes too many assumption.
>>And it does not need to fully parse that property, as Ben suggests.
>
>I didn't say it wasn't well defined ;) I said it's usage by Apple is not.

Hrm.. in fact, it looks like _I_ was not very clear, sorry


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

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

* Re: Status of PCI-PCI bridge on UMAX S900
  2001-01-04 19:19   ` Tibor Pausz
  2001-01-04 20:41     ` Benjamin Herrenschmidt
@ 2001-01-04 22:26     ` Chas Williams
  2001-01-05 19:51       ` Tibor Pausz
  1 sibling, 1 reply; 16+ messages in thread
From: Chas Williams @ 2001-01-04 22:26 UTC (permalink / raw)
  To: Tibor Pausz; +Cc: jingai, debian-powerpc, linuxppc-dev


In message <19341129125123.15815@mail.server.uni-frankfurt.de>,Tibor Pausz writ
es:
>Today I tried your patch. Well, I breaks the hole interrupt stuff.
>Now, even Mesh has trouble with interrupts (kernel crash), the
>console=ttyS0 doesn't work so no output from the booting ...

i was wrong about the checking for the interrupts property before
allocating an interrupt. the correct patch follows:

--- prom.c.000	Thu Dec 28 08:43:12 2000
+++ prom.c	Tue Jan  2 09:18:53 2001
@@ -1563,8 +1563,8 @@
 	}

 	ip = (int *) get_property(np, "AAPL,interrupts", &l);
-	if (ip == 0)
-		ip = (int *) get_property(np, "interrupts", &l);
+	if (ip == 0 && np->parent != NULL)
+		ip = (int *) get_property(np->parent, "AAPL,interrupts", &l);
 	if (ip != 0) {
 		np->intrs = (struct interrupt_info *) mem_start;
 		np->n_intrs = l / sizeof(int);
@@ -1616,8 +1616,8 @@
 		return mem_start;

 	ip = (int *) get_property(np, "AAPL,interrupts", &l);
-	if (ip == 0)
-		ip = (int *) get_property(np, "interrupts", &l);
+	if (ip == 0 && np->parent != NULL)
+		ip = (int *) get_property(np->parent, "AAPL,interrupts", &l);
 	if (ip != 0) {
 		np->intrs = (struct interrupt_info *) mem_start;
 		np->n_intrs = l / sizeof(int);

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

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

* Re: Re: Status of PCI-PCI bridge on UMAX S900
  2001-01-04 20:41     ` Benjamin Herrenschmidt
  2001-01-04 20:57       ` David Edelsohn
@ 2001-01-04 22:48       ` jingai
  2001-01-04 22:53         ` David Edelsohn
  1 sibling, 1 reply; 16+ messages in thread
From: jingai @ 2001-01-04 22:48 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev


> The "interrupts" property can have various meanings depending on the OF
> version, I suggest you don't mess with it. Just check that if you find no
> AAPL,interrupts, and that pmac_newworld == 0, then look for parent
> AAPL,interrupts.

So, then does the following patch seem valid?  If so, I'd appreciate it if
others with different macs (newworld and oldworld) could try it and let
me know if it breaks anything...

..and if not, how would one go about getting this into the official trees?


--- prom.c.old  Wed Jan  3 20:31:59 2001
+++ prom.c      Thu Jan  4 17:44:02 2001
@@ -1564,8 +1564,15 @@
        }

        ip = (int *) get_property(np, "AAPL,interrupts", &l);
-       if (ip == 0)
+       if (ip == 0) {
+           /* hack to force a look at the parent node for interrupts on
+            * oldworld macs with funky PCI<->PCI bridges (ie, UMAX S900)
+            */
+           if (!pmac_newworld && np->parent != NULL)
+               ip = (int *) get_property(np->parent, "AAPL,interrupts",
&l);
+           else
                ip = (int *) get_property(np, "interrupts", &l);
+       }
        if (ip != 0) {
                np->intrs = (struct interrupt_info *) mem_start;
                np->n_intrs = l / sizeof(int);
@@ -1617,8 +1624,15 @@
                return mem_start;

        ip = (int *) get_property(np, "AAPL,interrupts", &l);
-       if (ip == 0)
+       if (ip == 0) {
+           /* hack to force a look at the parent node for interrupts on
+            * oldworld macs with funky PCI<->PCI bridges (ie, UMAX S900)
+            */
+           if (!pmac_newworld && np->parent != NULL)
+               ip = (int *) get_property(np->parent, "AAPL,interrupts",
&l);
+           else
                ip = (int *) get_property(np, "interrupts", &l);
+       }
        if (ip != 0) {
                np->intrs = (struct interrupt_info *) mem_start;
                np->n_intrs = l / sizeof(int);
@@ -1774,8 +1788,15 @@
                return mem_start;

        ip = (int *) get_property(np, "AAPL,interrupts", &l);
-       if (ip == 0)
+       if (ip == 0) {
+           /* hack to force a look at the parent node for interrupts on
+            * oldworld macs with funky PCI<->PCI bridges (ie, UMAX S900)
+            */
+           if (!pmac_newworld && np->parent != NULL)
+               ip = (int *) get_property(np->parent, "AAPL,interrupts",
&l);
+           else
                ip = (int *) get_property(np, "interrupts", &l);
+       }
        if (ip != 0) {
                np->intrs = (struct interrupt_info *) mem_start;
                np->n_intrs = l / sizeof(int);


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

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

* Re: Status of PCI-PCI bridge on UMAX S900
  2001-01-04 22:48       ` jingai
@ 2001-01-04 22:53         ` David Edelsohn
  2001-01-05 12:58           ` jingai
  0 siblings, 1 reply; 16+ messages in thread
From: David Edelsohn @ 2001-01-04 22:53 UTC (permalink / raw)
  To: jingai; +Cc: Benjamin Herrenschmidt, linuxppc-dev


	Do you only need to look at the immediate parent and not the
entire ancestor tree?

David

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

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

* Re: Re: Status of PCI-PCI bridge on UMAX S900
  2001-01-04 22:53         ` David Edelsohn
@ 2001-01-05 12:58           ` jingai
  2001-01-05 14:24             ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 16+ messages in thread
From: jingai @ 2001-01-05 12:58 UTC (permalink / raw)
  To: David Edelsohn; +Cc: linuxppc-dev


>     Do you only need to look at the immediate parent and not the
> entire ancestor tree?

My guess would be probably, to be thorough.  But I'm no kernel
expert, so anyone else have any comments?

Although (again just guessing), I don't think many (if any) systems
will have more than one PCI controller, or more than one bridge
chip for that matter...

Regards,
Jonathan

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

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

* Re: Re: Status of PCI-PCI bridge on UMAX S900
  2001-01-05 12:58           ` jingai
@ 2001-01-05 14:24             ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 16+ messages in thread
From: Benjamin Herrenschmidt @ 2001-01-05 14:24 UTC (permalink / raw)
  To: jingai; +Cc: David Edelsohn, linuxppc-dev


>
>My guess would be probably, to be thorough.  But I'm no kernel
>expert, so anyone else have any comments?
>
>Although (again just guessing), I don't think many (if any) systems
>will have more than one PCI controller, or more than one bridge
>chip for that matter...

The best solution is probably to cleanup the current parsing mecanism in
prom.c to clearly separate the 3 cases:

 - Real OF with interrupt tree (CHRP, newworld mac booting via OF). This
one is already more or less separate.

 - OldWorld macs (booted either via OF or BootX/miBoot)

 - Newworld macs booted via BootX/miBoot


Only the second case should iterate the AAPL,interrupts parents, and in
this case, all parents should be iterated up to the top of the tree in
case of cascaded bridges. For now, your patch may be enough, I'll look
into cleaning all that up myself. The only "tricky" case is NewWorld macs
booted via BootX/miBoot. Those machine should use the OF interrupt tree.
Unfortunately, MacOS screws it up (we no longer have access to the
phandle's, and so can't follow the interrupt-parent links). So we rely on
other types of infos left by MacOS, but those seem to occasionally be
different on older newworld macs and core99 machines.


Ben.


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

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

* Re: Status of PCI-PCI bridge on UMAX S900
  2001-01-04 22:26     ` Chas Williams
@ 2001-01-05 19:51       ` Tibor Pausz
  0 siblings, 0 replies; 16+ messages in thread
From: Tibor Pausz @ 2001-01-05 19:51 UTC (permalink / raw)
  To: Chas Williams; +Cc: jingai, linuxppc-dev


On Don, 4. Jan 2001, Chas Williams <chas@cmf.nrl.navy.mil> wrote:

>i was wrong about the checking for the interrupts property before
>allocating an interrupt. the correct patch follows:

It doesn't no longer crash the machine, but my ISDN card doesn't
get a correct interrupt. Excatly the some stuff w/o the patch.

Well, I didn't know if the ISDN card works at all. So I swapped
the SCSI card and the ISDN card. The ISDN card crashes now the machine,
but without the ISDN card the SCSI cards fine behind the PCI bridge :-)

I don't have any problem (yet), hdparm cache trough put around 30MB/s.

(it's a SYM 53c875 card)

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

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

end of thread, other threads:[~2001-01-05 19:51 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-12-29  0:16 Re: Status of PCI-PCI bridge on UMAX S900 jingai
2000-12-29 15:09 ` Chas Williams
2001-01-04 19:19   ` Tibor Pausz
2001-01-04 20:41     ` Benjamin Herrenschmidt
2001-01-04 20:57       ` David Edelsohn
2001-01-04 21:17         ` Benjamin Herrenschmidt
2001-01-04 21:19           ` Benjamin Herrenschmidt
2001-01-04 22:48       ` jingai
2001-01-04 22:53         ` David Edelsohn
2001-01-05 12:58           ` jingai
2001-01-05 14:24             ` Benjamin Herrenschmidt
2001-01-04 22:26     ` Chas Williams
2001-01-05 19:51       ` Tibor Pausz
  -- strict thread matches above, loose matches on Subject: below --
2000-12-28  4:05 jingai
2000-12-28 14:13 ` Chas Williams
     [not found] <j-jvNB.A.O4F.4jrR6@murphy>
2000-12-27 10:06 ` Benjamin Herrenschmidt
2000-12-25  3:03 jingai

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