Port-powerpc archive

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

Re: 7447A DFS support for PowerBook G4



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

Now I cleaned up the patch and solved all the open points.

1. Now there are two new functions in cpu_subr.c: cpu_get_dfs() and
cpu_set_dfs(), which work for 7447A and 7448 cpus (the latter also supports
DFS4).

2. Multiple cpus are supported through xcall(9). The DFS bits will always be
the same on all cpus.

3. When cpu speed is measured then the current DFS setting is taken into
account to display the maximum frequency.

The new patch can be downloaded from:
  ftp://ftp.netbsd.org/pub/NetBSD/misc/phx/macppc/DFS/dfs.diff

When there are no objections I will commit the patch in the following days.

-- 
Frank Wille



Home | Main Index | Thread Index | Old Index