On 03/05/11(Tue) 22:24, Mark Kettenis wrote: > > Date: Tue, 26 Apr 2011 18:29:16 +0530 > > From: Martin Pieuchot <mpieuc...@nolizard.org> > > > > The following diff adds support for dfs. It requires my precedent patch > > about GPIOs. I don't have a machine with a MPC7448 so it's only tested > > with a MPC7447A. > > > > I'm also interested in various device-tree dumps for further development. > > If you can send me yours, contact me off list. > > > > Comments ? > > Looks good! Unfortunately the G4 mini (which has the MPC7447A) > doesn't support this.
Can you send me your device-tree dump? If it's really a MPC7447A (not a MPC7447) then the processor has the HID1 register and supports DFS2. So the question is "how to change the core voltage". > Just two comments: > > > Index: dev/dfs.c > > [...] > > + > > +#include <sys/param.h> > > +#include <sys/filedesc.h> > > Why do you need to include <sys/filedesc.h> for? Its needed by <sys/sysctl.h>, otherwise I get a "struct filedesc" not declared warning. Should I include an other file instead? > > > +#include <sys/sysctl.h> > > + > > +#include <machine/cpu.h> > > +#include <machine/autoconf.h> > > +#include <macppc/pci/macobio.h> > > + > > +#define DFS2 (1 << 22) /* Divide-by-Two */ > > +#define DFS4 (1 << 23) /* Divide-by-Four (MPC7448 Specific) */ > > + > > +extern int perflevel; > > +static int voltage; > > You should store the voltage inside a softc (pointed out by miod@). ok. > > [...] > > + > > + printf(": Dynamic Frequency Switching, speeds: "); > > + printf("%d, %d", ppc_maxfreq, ppc_maxfreq / 2); > > We typically use pure lower case for stuff that shows up in dmesg. > And I'm not sure the "Dynamic Frequency Switching" part really adds > useful information. Perhaps just change this in: > > > + printf(": speeds: %d, %d", ppc_maxfreq, ppc_maxfreq / 2); New patch coming.