Port-macppc archive

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

Re: 7447A DFS support for PowerBook G4



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

Hello,

On Oct 9, 2010, at 2:32 PM, Frank Wille wrote:

here is a small patch for macppc/dev/obio.c, which enables cpu speed control for 7447A PowerBooks. In contrast to other Intrepid-based PowerBooks, which
can change the cpu speed with two GPIO registers (frequency-gpio and
voltage-gpio), this one uses the DFS2 bit of the 7447A's HID1 register to
halve the frequency.

This is a special feature of the 7447A called Dynamic Frequency Switching. The 7448 even has an additional DFS4 bit to divide the frequency by 4 (are
there any popular systems equipped with 7448?).

For the user it is completely transparent. There is no difference to other PowerBooks. Just compile a kernel with option OBIO_SPEED_CONTROL and use the machdep.cpu_speed sysctl to configure the cpu into half or full speed.

Problems to be resolved until I commit the patch:

1. What I don't like is reading/writing to HID1 within obio.c. This should probably go into powerpc/oea/cpu_subr.c? I'm open to any suggestion about a
cleaner implementation.

This should go into cpu-specific code since it has nothing whatsoever to do with obio. Both should provide an interface that powerd can understand ( yes, I need to do that for obio ;) ) And just to make things worse there is nothing to prevent a given machine to have both.

2. What about multiple cpus? Do systems with two 7447A exist? The DFS2 bit
would have to be set for both. I don't know how do to it yet.

Probably, at least there should be SMP-capable CPUs which support DFS.

3. The PowerBook starts with DFS2 set (i.e. half speed). So the cpu- speed is calculated wrong. Should that be fixed somehow? For example by taking the status of DFS2 into account and double the measured frequency when set?

Is it always halved or is the divider somehow machine- or CPU model dependent?

have fun
Michael

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

iQEVAwUBTLDWAMpnzkX8Yg2nAQKMuQf+KfPLH7RCh2eYLVgZke7PvpDZKbksXx4P
/23+ZqOVSGXSWxSP9guqdnvqIm9QB0F+wWT63E4aMfkGyt90Is/n+euPafr1Irem
83upbblPzNUGDJY3+PGT+21PNGjPcAqZlg/Ch81Zyve7IAyN76F12yW/mAfpO+n2
muuwZ+BxlQ9S1liubgJNkIwGFqf1fp2LQRYNrOK+kAAyQtTBVKglfi74tPwc67cQ
+1+dIq6MduWeljV+phVx65/lAjmfzKUOsVD7o/1sVcwT/ePMRlnJzKQVJbHDzomD
29anTUWw4p3+2DD3w4D09ctemENIcqp8/KWmvyWKx2uirhMs2dE4Qg==
=3P48
-----END PGP SIGNATURE-----


Home | Main Index | Thread Index | Old Index