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 22, 2010, at 1:13 PM, Frank Wille wrote:

Also this driver rarely checks the return values of functions calls. This was the main reason we were looking for my audio problem for such a long
time (read below) ...

There was a time when bus_space_map() on macppc couldn't fail since it neither kept track of mappings nor actually mapped anything - PCI space is BAT-mapped to bus address == physical address.

At least that verifies that the interrupt is enabled and working.
Leaves the question why they don't fire on your hardware - I need to
stare at the code for a bit, maybe it's something trivial like having
to explicitly clear them before use or something.

I found it!

After compiling a kernel with DEBUG I noticed that bus_space_map() failed, when mapping the DMA channel registers (one of those return values, which
should have been checked ;).

The reason that it fails can be found in the OF tree for i2s:

---8<---
ff9859b0: /pci@f2000000/mac-io@17/i2s@0

#address-cells          00000001 ........ ........ ........     1
AAPL,address            80010000 ........ ........ ........   ....
built-in
device_type             69327300 ........ ........ ........   "i2s"
name                    69327300 ........ ........ ........   "i2s"
ranges
reg                     00000000 00005000 00000000 00000a00
......P.........

--------------------------------------------------------------------------------


ff985ba8: /pci@f2000000/mac-io@17/i2s@0/i2s-a@10000

built-in
compatible              69327362 757300.. ........ ........   "i2sbus"
device_type 736f756e 64627573 00...... ........ "soundbus"
interrupt-parent        ff981a58 ........ ........ ........   ...X
interrupts              0000001e 00000001 00000001 00000000
................
           0010:       00000002 00000000 ........ ........   ........
name                    6932732d 6100.... ........ ........   "i2s-a"
[...]
reg                     00010000 00001000 00008000 00000100
................
           0010:       00008100 00000100 ........ ........   ........

---8<---

The driver is using the "reg" property of "i2s@0", but it should use the
child's "i2s-a@10000" reg.

OUCH. Thank you Apple for screwing us over once more.

I have found an OF dump from a MacMini in the archives, and there both "reg"
properties were identical. So a solution could be to just use the
reg-property of the child (soundbus) for all models?

Can somebody confirm that this is ok? Or would it break any other model?

On my iBook G4 the properties are not identical but i2s merely contains two more ranges than i2s-a, looks like two more sets of DBDMA registers. To be safe we should probably check the reg property on i2s for bogus and use i2s-a if it is - I bet there are models out there where always using i2s-a breaks stuff.

BTW, when using the correct property, sound works fine on my PowerBook. I
get interrupts and everything... :)

Yay :)

have fun
Michael

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

iQEVAwUBTMIHgMpnzkX8Yg2nAQLTeAgAiBGIf6VDZEcBxZJR+naqeKkWuw5oySx5
7wVfgzBPX9V43d1+Dj/sKoL4q9+RDpq6j+iyyLTCXc2I4DcZD4HkSJWw4XepwzfF
oqifrkFopXkOJb4T476y6/fqk02YM7dd2b/cAwI+s+AB+KTuY/MqIGCJxGETTw+K
JKYU88xTeGj6Ww8FbMLwmcGWl6eAzCRzZLIw38dG/t0JO30Ef3ETt3FDyDk88ewx
R6Z6FHcGBgojmwi5Pf+XosZ56sB6A0Dfs786q2Wg4qJZytQl5Znp3KgwOSLxAm5H
8b/kejDGQUND/46ZTx0K/Fa06lJMM5fCLDuHDYGpktIjrH4BMuQZ7A==
=Karb
-----END PGP SIGNATURE-----


Home | Main Index | Thread Index | Old Index