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 14, 2010, at 2:50 PM, Frank Wille wrote:

Michael wrote:

Do you see interrupts when reading or writing to /dev/audio?

Not at all. I have enabled SNAPPER_DEBUG and this is what happens when
reading:

trigger_input 0xd0057000 0xd0067000 0x1000
precision: 16
I2SSetDataWordSizeReg 0x00000000 -> 0x02000200
reg: 1, 1 96
I2SSetSerialFormatReg 0x6c01c193 -> 0x82190000

And when writing:

trigger_output 0xd0047000 0xd0057000 0x1000
precision: 16
I2SSetDataWordSizeReg 0x02000200 -> 0x02000200

Curiously the system freezes not immediately. I can even log in over the network and inspect everything. But as soon as I press a key on the console
where I typed "cat file > /dev/audio" it freezes.

No such problem when reading from /dev/audio, BTW.


The cardbus problem looks a bit like missing interrupts as well - you
should at the very least see an interrupt when inserting a card, even
if it doesn't attach.

No interrupt there as well.

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

Leaves the question what could cause /that/ - as far as I can see you
have a bog standard UniNorth OpenPIC which works just fine in
countless other machines. Wouldn't be the first time that Apple at
some point introduced variants that need special handling somewhere.

Maybe there is still a problem with the interrupts, but I think I found
another problem in snapper(4) through SNAPPER_DEBUG.
On initialization it prints:

audio0 at snapper0: full duplex, playback, capture
FCR(0x3c) 0x0x1803440<I2S0EN,I2S0CLKEN>
/gpio 0xff981cd0
0xff982290 modem-reset
0xff9823e8 modem-power
0xff982540 accelerometer-1
0xff982700 accelerometer-2
0xff9828c0 headphone-mute
0xff982a18 amp-mute
0xff982b68 hw-reset
0xff982cb8 linein-detect
0xff982e78 headphone-detect
0xff983048 cpu-vcore-select
0xff9831b0 extint-gpio1
0xff983390 programmer-switch
0xff983528 gpio4
headphone-mute 0x0
amp-mute 0x0
headphone-detect 0x0
headphone-detect active 0
headphone-detect intr ffffffff
audio-hw-reset 0x0
[...]

The addresses of the GPIOs are not detected. snapper_init() looks for
properties like "audio-gpio" and "AAPL,address" which do not exist here. And to make it worse, it doesn't even check the result! So snapper will
access address 0 with gpio_read/write... :)

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

Something completely different - a fairly recent ofwboot.xcf ( from
5.99.29 ) Just Works(tm) on my beige G3 ( with OF patches from an OSX
CD it would happily boot a NetBSD install CD ), to my utter surprise.
These machines had to be installed via floppy or network thanks to OF
bugs.

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?
For the record, it's:
boot ide1/@0:,\OFWBOOT.XCF;1 ide1/@0/netbsd
the kernel file name doesn't need to fit OF's insane syntax ( it's listed as NETBSD.;1 ) thanks to ofwboot being a little more clever.


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

iQEVAwUBTLerU8pnzkX8Yg2nAQJd2Qf/TUlxmA8ZxR3ZI0SyIB1d2Bdqb1Q+Qhyh
4GjuqDoFPaOnFyU+uGGjQPoEkNry3mC9jUiRXwig9/LvIo3hXONyPPYYaGxWn+dL
zMub5ma9EWgD8nJm+FDqV4N+NblDQresoMZ0ESj3BtIJJwjD0IZsq/eCxlPJRFO0
NTnYshRJ5cCTr/ITl3pKoueynhuBgB0avxSbDMid5zC0BS1ji4asancA5Lv0Y5k5
90kNhO37Dbmhy065AW3lc03RTgfos2Y0V9icwcWb7PXerNEJZXgzxOUr6O1OTC5l
jdMDX3Rpjx6bvxBmANhnlOwl67BGZTCUNOP68D6adRoDOkfyI9pROA==
=FR0V
-----END PGP SIGNATURE-----


Home | Main Index | Thread Index | Old Index