Re: macppc: support for Dynamic Frequency Switching

2011-05-16 Thread Martin Pieuchot
On 15/05/11(Sun) 21:24, Stuart Henderson wrote: On 2011/05/15 15:56, Martin Pieuchot wrote: Updated diff, now looking for oks for the driver and the manpage. This diff doesn't include the cpu.c/cpu.h part Right. Here's the complete diff. I've also fixed the typo you told me. Index:

Re: macppc: support for Dynamic Frequency Switching

2011-05-15 Thread Martin Pieuchot
On 04/05/11(Wed) 20:29, Miod Vallat wrote: Speaking of DELAY()... it is implemented using the processor internal counter register. Is this register impacted by frequency changes? If so, shouldn't you update the computed ns_per_tick delay() constant? Reading the doc again, it's said

Re: macppc: support for Dynamic Frequency Switching

2011-05-15 Thread Kenneth R Westerback
On Sun, May 15, 2011 at 03:56:16PM +0530, Martin Pieuchot wrote: On 04/05/11(Wed) 20:29, Miod Vallat wrote: Speaking of DELAY()... it is implemented using the processor internal counter register. Is this register impacted by frequency changes? If so, shouldn't you update the computed

Re: macppc: support for Dynamic Frequency Switching

2011-05-15 Thread Stuart Henderson
On 2011/05/15 15:56, Martin Pieuchot wrote: Updated diff, now looking for oks for the driver and the manpage. This diff doesn't include the cpu.c/cpu.h part

Re: macppc: support for Dynamic Frequency Switching

2011-05-05 Thread Martin Pieuchot
On 04/05/11(Wed) 20:29, Miod Vallat wrote: Speaking of DELAY()... it is implemented using the processor internal counter register. Is this register impacted by frequency changes? If so, shouldn't you update the computed ns_per_tick delay() constant? Reading the doc again, it's said

Re: macppc: support for Dynamic Frequency Switching

2011-05-04 Thread Martin Pieuchot
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

Re: macppc: support for Dynamic Frequency Switching

2011-05-04 Thread Stuart Henderson
On 2011/05/04 16:11, Martin Pieuchot wrote: 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

Re: macppc: support for Dynamic Frequency Switching

2011-05-04 Thread Martin Pieuchot
On 03/05/11(Tue) 20:37, Miod Vallat wrote: Index: dev/dfs.c +static int voltage; There is no reason for this variable to be global. You should put it in your device' softc instead. Ok, new diff below. +int +dfs_match(struct device *parent, void *arg, void *aux) +{ + struct

Re: macppc: support for Dynamic Frequency Switching

2011-05-04 Thread Kenneth R Westerback
On Wed, May 04, 2011 at 11:58:16AM +0100, Stuart Henderson wrote: On 2011/05/04 16:11, Martin Pieuchot wrote: 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)

Re: macppc: support for Dynamic Frequency Switching

2011-05-04 Thread Miod Vallat
Speaking of DELAY()... it is implemented using the processor internal counter register. Is this register impacted by frequency changes? If so, shouldn't you update the computed ns_per_tick delay() constant? Reading the doc again, it's said that the time base register is clocked at

Re: macppc: support for Dynamic Frequency Switching

2011-05-03 Thread Miod Vallat
You can check if your machine supports it by looking for the cpu-vcore-select node in your openfirmware dump: $ eeprom -p |grep vcore FWIW, the only known (to us) systems with that node are: PowerBook4,3 PowerBook6,5 PowerBook6,7 PowerBook6,8 as reported on

Re: macppc: support for Dynamic Frequency Switching

2011-05-03 Thread Mark Kettenis
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

Re: macppc: support for Dynamic Frequency Switching

2011-05-03 Thread Miod Vallat
Index: dev/dfs.c +static int voltage; There is no reason for this variable to be global. You should put it in your device' softc instead. +int +dfs_match(struct device *parent, void *arg, void *aux) +{ + struct confargs *ca = aux; + uint16_t cpu; + + if (strcmp(ca-ca_name,

Re: macppc: support for Dynamic Frequency Switching

2011-05-03 Thread Miod Vallat
+ 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:

Re: macppc: support for Dynamic Frequency Switching

2011-04-27 Thread Martin Pieuchot
On 27/04/11(Wed) 12:41, Martin Pieuchot wrote: On 26/04/11(Tue) 18:29, Martin Pieuchot wrote: 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