* Newer laptops & CPU speed
@ 2005-03-14 2:33 Benjamin Herrenschmidt
2005-03-15 14:03 ` Joerg Dorchain
0 siblings, 1 reply; 5+ messages in thread
From: Benjamin Herrenschmidt @ 2005-03-14 2:33 UTC (permalink / raw)
To: debian-powerpc@lists.debian.org, linuxppc-dev list
Hi !
It seems the new laptops are booting with CPU set to low
speed. /proc/cpuinfo outputs the wrong fequency (thinks it's high speed)
but bogomips shows that it's running at about half speed. This patch
against 2.6.11 (will not apply on 2.6.10) adds proper cpufreq support so
that the boot speed is recognized (fixing /proc/cpuinfo output) and so
you can acutally use cpufreq interface & utilities to switch to full
speed (I recommend powernowd).
This is completely untested as I don't have access to any of those new
models yet, so I'm waiting for some feedback before submitting upstream.
Ben.
Index: linux-work/arch/ppc/platforms/pmac_cpufreq.c
===================================================================
--- linux-work.orig/arch/ppc/platforms/pmac_cpufreq.c 2005-03-13 18:23:11.000000000 +1100
+++ linux-work/arch/ppc/platforms/pmac_cpufreq.c 2005-03-14 13:32:36.000000000 +1100
@@ -464,20 +464,22 @@
u32 *reg;
struct cpufreq_driver *driver = &pmac_cpufreq_driver;
- /* OF only reports the high frequency */
- hi_freq = cur_freq;
- low_freq = cur_freq/2;
- driver->get = dfs_get_cpu_speed;
- cur_freq = driver->get(0);
-
+ /* Look for voltage GPIO */
volt_gpio_np = of_find_node_by_name(NULL, "cpu-vcore-select");
+ reg = (u32 *)get_property(volt_gpio_np, "reg", NULL);
+ voltage_gpio = *reg;
if (!volt_gpio_np){
printk(KERN_ERR "cpufreq: missing cpu-vcore-select gpio\n");
return 1;
}
- reg = (u32 *)get_property(volt_gpio_np, "reg", NULL);
- voltage_gpio = *reg;
+ /* OF only reports the high frequency */
+ hi_freq = cur_freq;
+ low_freq = cur_freq/2;
+
+ /* Read actual frequency from CPU */
+ driver->get = dfs_get_cpu_speed;
+ cur_freq = driver->get(0);
set_speed_proc = dfs_set_cpu_speed;
return 0;
@@ -492,7 +494,7 @@
* - iBook2 500/600 (PMU based, 400Mhz & 500/600Mhz)
* - iBook2 700 (CPU based, 400Mhz & 700Mhz, support low voltage)
* - Recent MacRISC3 laptops
- * - iBook G4s and PowerBook G4s with 7447A CPUs
+ * - All new machines with 7447A CPUs
*/
static int __init pmac_cpufreq_setup(void)
{
@@ -513,11 +515,10 @@
goto out;
cur_freq = (*value) / 1000;
- /* Check for 7447A based iBook G4 or PowerBook */
- if (machine_is_compatible("PowerBook6,5") ||
- machine_is_compatible("PowerBook6,4") ||
- machine_is_compatible("PowerBook5,5") ||
- machine_is_compatible("PowerBook5,4")) {
+ /* Check for 7447A based MacRISC3 */
+ if (machine_is_compatible("MacRISC3") &&
+ get_property(cpunode, "dynamic-power-step", NULL) &&
+ PVR_VER(mfspr(SPRN_PVR)) == 0x8003) {
pmac_cpufreq_init_7447A(cpunode);
/* Check for other MacRISC3 machines */
} else if (machine_is_compatible("PowerBook3,4") ||
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Newer laptops & CPU speed
2005-03-14 2:33 Newer laptops & CPU speed Benjamin Herrenschmidt
@ 2005-03-15 14:03 ` Joerg Dorchain
2005-03-15 23:35 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 5+ messages in thread
From: Joerg Dorchain @ 2005-03-15 14:03 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev list, debian-powerpc@lists.debian.org
[-- Attachment #1: Type: text/plain, Size: 1074 bytes --]
On Mon, Mar 14, 2005 at 01:33:42PM +1100, Benjamin Herrenschmidt wrote:
> It seems the new laptops are booting with CPU set to low
> speed. /proc/cpuinfo outputs the wrong fequency (thinks it's high speed)
> but bogomips shows that it's running at about half speed. This patch
> against 2.6.11 (will not apply on 2.6.10) adds proper cpufreq support so
> that the boot speed is recognized (fixing /proc/cpuinfo output) and so
> you can acutally use cpufreq interface & utilities to switch to full
> speed (I recommend powernowd).
>
> This is completely untested as I don't have access to any of those new
> models yet, so I'm waiting for some feedback before submitting upstream.
My ibook G4 boots at low speed. /proc/cpuinfo shows 666MHz and a smiliar
bogomips value. Nevertheless, the cpu frequency scaler works, i.e. set
it to performance to be at high speed after boot up, or, as I currently
do, use the userspace governor and powernowd. All this is without your
patch (Did not try it yet, my ibook lacks internet) on linus' 2.6.11.
Bye,
Joerg
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Newer laptops & CPU speed
2005-03-15 14:03 ` Joerg Dorchain
@ 2005-03-15 23:35 ` Benjamin Herrenschmidt
2005-03-16 7:20 ` Joerg Dorchain
0 siblings, 1 reply; 5+ messages in thread
From: Benjamin Herrenschmidt @ 2005-03-15 23:35 UTC (permalink / raw)
To: Joerg Dorchain; +Cc: linuxppc-dev list, debian-powerpc@lists.debian.org
> My ibook G4 boots at low speed. /proc/cpuinfo shows 666MHz and a smiliar
> bogomips value. Nevertheless, the cpu frequency scaler works, i.e. set
> it to performance to be at high speed after boot up, or, as I currently
> do, use the userspace governor and powernowd. All this is without your
> patch (Did not try it yet, my ibook lacks internet) on linus' 2.6.11.
Sure, I already had support for some models :) The patch extends it to
all present and future models that are MacRISC3 and have a 7447A CPU.
Ben.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Newer laptops & CPU speed
2005-03-15 23:35 ` Benjamin Herrenschmidt
@ 2005-03-16 7:20 ` Joerg Dorchain
0 siblings, 0 replies; 5+ messages in thread
From: Joerg Dorchain @ 2005-03-16 7:20 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev list, debian-powerpc@lists.debian.org
[-- Attachment #1: Type: text/plain, Size: 685 bytes --]
On Wed, Mar 16, 2005 at 10:35:35AM +1100, Benjamin Herrenschmidt wrote:
> > My ibook G4 boots at low speed. /proc/cpuinfo shows 666MHz and a smiliar
> > bogomips value. Nevertheless, the cpu frequency scaler works, i.e. set
> > it to performance to be at high speed after boot up, or, as I currently
> > do, use the userspace governor and powernowd. All this is without your
> > patch (Did not try it yet, my ibook lacks internet) on linus' 2.6.11.
>
> Sure, I already had support for some models :) The patch extends it to
> all present and future models that are MacRISC3 and have a 7447A CPU.
When I remember my usbstick tonight, I'll give it a try.
Bye,
Joerg
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Newer laptops & CPU speed
@ 2005-03-24 15:25 Daniele Lacamera
0 siblings, 0 replies; 5+ messages in thread
From: Daniele Lacamera @ 2005-03-24 15:25 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev list, debian-powerpc@lists.debian.org
> Hi !
>
> It seems the new laptops are booting with CPU set to low
> speed. /proc/cpuinfo outputs the wrong fequency (thinks it's high
speed)
> but bogomips shows that it's running at about half speed. This patch
> against 2.6.11 (will not apply on 2.6.10) adds proper cpufreq support
so
> that the boot speed is recognized (fixing /proc/cpuinfo output) and so
> you can acutally use cpufreq interface & utilities to switch to full
> speed (I recommend powernowd).
> This is completely untested as I don't have access to any of those new
> models yet, so I'm waiting for some feedback before submitting
upstream.
> Ben.
[patch follows]
Ben,
your patch seems to be working very well on my new 1.5GHz 12" pbook.
Bogomips more than doubled in /proc/cpuinfo, from about 700 to 1495.04.
Thanks.
--
Daniele Lacamera
root{at}danielinux.net
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2005-03-24 15:30 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-14 2:33 Newer laptops & CPU speed Benjamin Herrenschmidt
2005-03-15 14:03 ` Joerg Dorchain
2005-03-15 23:35 ` Benjamin Herrenschmidt
2005-03-16 7:20 ` Joerg Dorchain
-- strict thread matches above, loose matches on Subject: below --
2005-03-24 15:25 Daniele Lacamera
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).