Port-macppc archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: snapper does not work on PowerBook5,6



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

On Oct 15, 2010, at 6:22 PM, Frank Wille wrote:

Michael wrote:

[..cardbus..]
Ok, so we either don't enable some interrupts or we enable the wrong
ones for whatever reason.
Which interrupts does snapper use on your machine?

Looks like 30 for state changes, 1 for output and 2 for input. Irq 1 and 2
look strange because all other interrupts are in a region above 20.

OF shows the same.

That looks right, my iBook uses the same:
interrupts      0000001e 00000001 00000001 00000000 00000002 00000000

Please check if the
interrupt the cardbus bridge uses matches the interrupt register and
the OF node. It wouldn't be the first time that one of them is lying.

Pcidump shows the same interrupt (53) as in dmesg. The cardbus memory and
i/o regions look a bit strange, but maybe that's ok when no card is
inserted?

   CardBus memory region 0:
     base register:  0xfffff000
     limit register: 0x00000000
   CardBus memory region 1:
     base register:  0xfffff000
     limit register: 0x00000000
   CardBus I/O region 0:
     base register:  0xfffffffc
     limit register: 0x00000000
   CardBus I/O region 1:
     base register:  0xfffffffc
     limit register: 0x00000000
   Interrupt line: 0x35
   Interrupt pin: 0x01 (pin A)

Looks the same here except for the different interrupt - the Pismo uses 0x3a.

You may want to sprinkle some printf()s over arch/powerpc/pic/ pic_openpic.c and friends to verify that the right interrupts are being enabled, aren't blocked elsewhere, are the right type ( as in edge vs. level triggered ) etc.

The interrupt map in OF doesn't seem right to me:

ff9a0458: /pci@f2000000/cardbus@13

#address-cells          00000003 ........ ........ ........     3
#interrupt-cells        00000001 ........ ........ ........     1
#size-cells             00000002 ........ ........ ........     2
#socket                 00000001 ........ ........ ........   ....
#sockets                00000001 ........ ........ ........   ....
#windows                00000007 ........ ........ ........   ....
AAPL,slot-name          50432043 61726400 ........ ........   PC Card.
AAPL,zoomed-video
adapter-caps            00000000 ........ ........ ........   ....
assigned-addresses      81009844 00000000 00008010 00000000
...D............
           0010:       00000004 81009898 00000000 00008000
................
           0020:       00000000 00000010 82009810 00000000
................
0030: a0004000 00000000 00001000 ........ ..@.........
cardcode                12180001 ........ ........ ........   ....
class-code              00060700 ........ ........ ........   ....
cntl-ind-caps           00000000 ........ ........ ........   ....
compatible 70636931 3034632c 61633536 00...... "pci104c,ac56"
           000d:       63617264 6275732d 62726964 676500..
"cardbus-bridge"
           001c:       00...... ........ ........ ........   ""
device-id               0000ac56 ........ ........ ........   ...V
device_type 63617264 62757300 ........ ........ "cardbus"
devsel-speed            00000001 ........ ........ ........   ....
interrupt-map           00000000 00000000 00000000 00000001
................
           0010:       ff979fe0 00009800 00000000 00000000
................
           0020:       00000001 00000000 00000000 00000000
................
           0030:       00000002 ff979fe0 00009800 00000000
................
           0040:       00000000 00000001 00000000 00000000
................
           0050:       00000000 00000003 ff979fe0 00009800
................
           0060:       00000000 00000000 00000001 00000000
................
           0070:       00000000 00000000 00000004 ff979fe0
................
           0080:       00009800 00000000 00000000 00000001
................
           0090:       00000800 00000000 00000000 00000001
................
           00a0:       ff979fe0 00009800 00000000 00000000
................
           00b0:       00000001 00000800 00000000 00000000
................
           00c0:       00000002 ff979fe0 00009800 00000000
................
           00d0:       00000000 00000001 00000800 00000000
................
           00e0:       00000000 00000003 ff979fe0 00009800
................
           00f0:       00000000 00000000 00000001 00000800
................
           0100:       00000000 00000000 00000004 ff979fe0
................
           0110:       00009800 00000000 00000000 00000001
................
           0120:       00001000 00000000 00000000 00000001
................
           0130:       ff979fe0 00009800 00000000 00000000
................
           0140:       00000001 00001000 00000000 00000000
................
           0150:       00000002 ff979fe0 00009800 00000000
................
           0160:       00000000 00000001 00001000 00000000
................
           0170:       00000000 00000003 ff979fe0 00009800
................
           0180:       00000000 00000000 00000001 00001000
................
           0190:       00000000 00000000 00000004 ff979fe0
................
           01a0:       00009800 00000000 00000000 00000001
................
           01b0:       00001800 00000000 00000000 00000001
................
           01c0:       ff979fe0 00009800 00000000 00000000
................
           01d0:       00000001 00001800 00000000 00000000
................
           01e0:       00000002 ff979fe0 00009800 00000000
................
           01f0:       00000000 00000001 00001800 00000000
................
           0200:       00000000 00000003 ff979fe0 00009800
................
           0210:       00000000 00000000 00000001 00001800
................
           0220:       00000000 00000000 00000004 ff979fe0
................
           0230:       00009800 00000000 00000000 00000001
................
interrupt-map-mask      00001800 00000000 00000000 00000007
................
interrupt-routing       00000000 ........ ........ ........   ....
interrupts              00000001 ........ ........ ........   ....
model                   54584e2c 50434958 5858582d 303000..
"TXN,PCIXXXX-00"
name 63617264 62757300 ........ ........ "cardbus"
ranges                  82000000 00000000 90000000 82000000
................
           0010:       00000000 90000000 00000000 10000000
................
           0020:       81000000 00000000 00000000 81000000
................
           0030:       00000000 00000000 00000000 00008000
................
reg                     00009800 00000000 00000000 00000000
................
           0010:       00000000 02009810 00000000 00000000
................
           0020:       00000000 00001000 01009844 00000000
...........D....
           0030:       00000000 00000000 00000004 21009898
............!...
           0040:       00000000 00000000 00000000 00000010
................
release-level           000007cb ........ ........ ........   ....
reserved-segment        90000000 ........ ........ ........   ....
revision-id             00000000 ........ ........ ........   ....
slot-names              00000000 ........ ........ ........   ....
status-change-int-caps  000000f0 ........ ........ ........   ....
status-change-report-caps
                       000000f0 ........ ........ ........   ....
vcc-levels              00000004 00000700 00000703 00000705
................
           0010:       0000030c ........ ........ ........   ....
vendor-id               0000104c ........ ........ ........   ...L

Looks almost the same here.

Looking at the OF tree I should use the "name" or "compatible"
property for
"audio-gpio" and "reg" for "AAPL,address". But the contents of "reg"
is not
the final address and has probably to be added to some base address of
obio?

It /should/ be relative to obio/gpio although sometimes it's relative
to obio. The whole thing is a mess thanks to Apple being inconsistent
even withing a single OF variant - my iBook has some gpios with
addresses relative to obio and others - on the same parent node -
relative to obio/gpio and the code tries to guess which one it is. So
please leave existing functionality intact no matter how insane it
looks, it's there for a reason.

Ok!

I have just committed a modified deq.c, which matches the PowerBook5,6
codec, while leaving the existing functionality intact. :)

Thanks :)

On my iBook the gpio node has an address of 0x50 which is relative to
obio. Some of its child nodes have addresses < 0x50 which we treat as
relative to gpio, others have offsets > 0x50 which we treat as
relative to obio. This works on my iBook G4, it may or may not work on
other machines with different variants of this insanity.

Ok. I think I have already seen that in the gpio code of obio.c.

I wonder why the hell they couldn't just pick one addressing scheme and stick with it or at lease be consistent within the same OF tree.

That's great! I hope I didn't break anything now. Can you also test
with my
patched ofwboot?

I will. Do you have a beige G3 to confirm?

No, unfortunately not. Besides the new PowerBook I have only a PowerMac G4
(400) and a Mac Mini.

All UniNorth machines, as far as NetBSD is concerned there's little difference between them.

have fun
Michael
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)

iQEVAwUBTLjplspnzkX8Yg2nAQKDUAf9H+rXyaueypC6dfDF1B4GzaOZMOFkVC3R
Sy75hTTQu2WwaFqavE3Dk1lQ+ObGl+vxqX+qNiyaZUPF+RlF1oW/Kj1FYClW/87r
V6vhjYax8y2XC6V/d6hyG1xGHVeBbHH7VqxNpfcPNdssjwQfOu/acfSP4xe/kouB
EqrrvL/hisTNYu/xjHiyz6lXjVEd8gBCmv7G8VtuMW5rKA9PdcYmGySe0yNcuLwj
A5qqJfo73q43Us1BHXOIRxyIaaZMcAl8W8aJuMDNHGyX9V4cxZrMv08vPWvCRTzq
Vwvjrn43q7kSsnc1rL2eHQFZAS8ESkE08eypJbAL9bR4jL/M7uZ51A==
=bc4V
-----END PGP SIGNATURE-----


Home | Main Index | Thread Index | Old Index