From: Chris Studholme <cvs@cs.utoronto.ca>
To: linuxppc-dev@lists.linuxppc.org
Subject: pismo upgraded to 750fx not detected correctly
Date: Thu, 12 Jun 2003 16:05:24 -0400 (EDT) [thread overview]
Message-ID: <Pine.LNX.4.44.0306121603120.1349-100000@ike> (raw)
Hi all,
I have a Powerbook G3 (Pismo) 400MHz that I've been running Linux on for
almost 3 years now. It has been working great, but to ensure that it
continues to serve me well, I purchased the Powerlogix BlueChip G3 900MHz
upgrade <http://www.powerlogix.com/products2/bcg3pismo/index.html>. The
machine still runs Linux ok, but I have a few problems.
First off, the new processor is an IBM 750FX, but it is recognized as a
740/750.
$ cat /proc/cpuinfo
cpu : 740/750
temperature : 20 C (uncalibrated)
clock : 550MHz
revision : 2.2 (pvr 0008 0202)
bogomips : 1795.68
machine : PowerBook3,1
motherboard : PowerBook3,1 MacRISC2 MacRISC Power Macintosh
detected as : 70 (PowerBook Pismo)
pmac flags : 00000007
L2 cache : 1024K unified
memory : 256MB
pmac-generation : NewWorld
I believe pvr should be 7000 0202. Also, the clock speed is 900MHz, not
550MHz. I have verified, using some numerical cpu bound programs I have,
that this machine is running at least twice as fast as it did before the
upgrade. Also, note that the bogomips value seems to imply the machine is
actually running at 900MHz. Finally, the L2 cache is now only 512K, but
included on the processor die running at 900MHz.
I don't know the linux source that well, but it looks to me like these
values are being read from the open firmware and not from the cpu
directly. Is there a way I can alter linux to double check the values and
correct them if the firmware is wrong? As a first stab at the problem, I
made the following change to arch/ppc/kernel/cputable.c (in 2.4.20-ben10):
*** cputable.c.orig Tue May 27 16:38:20 2003
--- cputable.c Tue May 27 16:42:14 2003
***************
*** 161,166 ****
--- 161,175 ----
32, 32,
__setup_cpu_750fx
},
+ { /* 750FX (Powerlogix Pismo upgrade) */
+ 0xffffffff, 0x00080202, "750FX",
+ CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_CAN_DOZE | CPU_FTR_USE_TB |
+ CPU_FTR_L2CR | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_CAN_NAP |
+ CPU_FTR_DUAL_PLL_750FX | CPU_FTR_HAS_HIGH_BATS,
+ COMMON_PPC,
+ 32, 32,
+ __setup_cpu_750fx
+ },
{ /* 740/750 (L2CR bit need fixup for 740) */
0xffff0000, 0x00080000, "740/750",
CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_CAN_DOZE | CPU_FTR_USE_TB |
This corrects cpuinfo slightly, but is obviously not a very good solution.
$ cat /proc/cpuinfo
cpu : 750FX
temperature : 20 C (uncalibrated)
clock : 550MHz
revision : 2.2 (pvr 0008 0202)
bogomips : 1795.68
machine : PowerBook3,1
motherboard : PowerBook3,1 MacRISC2 MacRISC Power Macintosh
detected as : 70 (PowerBook Pismo)
pmac flags : 0000000f
L2 cache : 1024K unified
memory : 256MB
pmac-generation : NewWorld
Also, note that MacOS also fails to correctly detect the cpu and clock
speed. To get the correct values and fiddle with the 750fx's fancy
features (like clock speed scaling), I had to install a tool developed by
Powerlogix called CPU Director
<http://www.powerlogix.com/support2/cpudirector/index.html>.
My motivation for this work is not just to get cpuinfo to display the
correct data, but to get cpufreq working on this machine. With the
following patch to arch/ppc/platforms/pmac_cpufreq.c I think I've come
close.
*** pmac_cpufreq.c.orig Wed May 21 23:33:27 2003
--- pmac_cpufreq.c Thu Jun 12 14:22:22 2003
***************
*** 19,25 ****
#include <asm/cputable.h>
#include <asm/time.h>
! #undef DEBUG_FREQ
extern void low_choose_750fx_pll(int pll);
extern void low_sleep_handler(void);
--- 19,25 ----
#include <asm/cputable.h>
#include <asm/time.h>
! #define DEBUG_FREQ
extern void low_choose_750fx_pll(int pll);
extern void low_sleep_handler(void);
***************
*** 304,309 ****
--- 304,318 ----
has_freq_ctl = 1;
cpufreq_uses_pmu = 1;
}
+ /* Else check for Pismo/Powerlogix 900 */
+ else if (machine_is_compatible("PowerBook3,1")) {
+ printk("CPUFREQ: pismo detected\n");
+ cur_freq = 900000;
+ low_freq = 400000;
+ hi_freq = 900000;
+ cpufreq_uses_pmu = 0;
+ has_freq_ctl = 1;
+ }
/* Else check for 750FX */
else if (PVR_VER(mfspr(PVR)) == 0x7000) {
if (get_property(cpunode, "dynamic-power-step", NULL) == NULL)
After boot with this change, I get:
$ cat /proc/cpuinfo
cpu : 750FX
temperature : 20 C (uncalibrated)
clock : 900MHz
revision : 2.2 (pvr 0008 0202)
bogomips : 1795.68
machine : PowerBook3,1
motherboard : PowerBook3,1 MacRISC2 MacRISC Power Macintosh
detected as : 70 (PowerBook Pismo)
pmac flags : 0000000f
L2 cache : 1024K unified
memory : 256MB
pmac-generation : NewWorld
$ cat /proc/cpufreq
minimum CPU frequency - maximum CPU frequency - policy
CPU 0 400000 kHz ( 44 %) - 900000 kHz (100 %) - performance
Now, I can try to change processor speed as follows:
# echo -n "0:0:0:powersave" > /proc/cpufreq
# cat /proc/cpuinfo
cpu : 750FX
temperature : 24 C (uncalibrated)
clock : 400MHz
revision : 2.2 (pvr 0008 0202)
bogomips : 798.08
machine : PowerBook3,1
motherboard : PowerBook3,1 MacRISC2 MacRISC Power Macintosh
detected as : 70 (PowerBook Pismo)
pmac flags : 0000000f
L2 cache : 1024K unified
memory : 256MB
pmac-generation : NewWorld
# cat /proc/cpufreq
minimum CPU frequency - maximum CPU frequency - policy
CPU 0 400000 kHz ( 44 %) - 400000 kHz ( 44 %) - powersave
And to return to top speed:
# echo -n "0:900000:900000:performance" > /proc/cpufreq
# cat /proc/cpuinfo
cpu : 750FX
temperature : 39 C (uncalibrated)
clock : 900MHz
revision : 2.2 (pvr 0008 0202)
bogomips : 1795.68
machine : PowerBook3,1
motherboard : PowerBook3,1 MacRISC2 MacRISC Power Macintosh
detected as : 70 (PowerBook Pismo)
pmac flags : 0000000f
L2 cache : 1024K unified
memory : 256MB
pmac-generation : NewWorld
# cat /proc/cpufreq
minimum CPU frequency - maximum CPU frequency - policy
CPU 0 900000 kHz (100 %) - 900000 kHz (100 %) - performance
Relevent lines from `dmesg` are:
Memory BAT mapping: BAT2=256Mb, BAT3=0Mb, residual: 0Mb
Total memory = 256MB; using 512kB for hash table (at c0280000)
Linux version 2.4.20-ben10 (cvs@achilles) (gcc version 2.95.4 20011002 (Debian prerelease)) #10 Thu May 29 16:51:37 EDT
Found Uninorth memory controller & host bridge, revision: 7
Mapped at 0xfdffc000
Found a Keylargo mac-io controller, rev: 3, mapped at 0xfdf7c000
Processor NAP mode on idle enabled.
PowerMac motherboard: PowerBook Pismo
CPU HID1 : 0x92000000
.. other stuff ..
Initializing RT netlink socket
Thermal assist unit using timers, shrink_timer: 200 jiffies
CPUFREQ: pismo detected
Starting kswapd
.. other stuff ..
Linux Kernel Card Services 3.1.22
options: [pci] [cardbus] [pm]
Yenta IRQ list 0000, PCI irq58
Socket status: 30000086
HID1, before: 92000000
HID1, after: 92010000
Calibrating delay loop... 897.84 BogoMIPS
HID1, before: 92010000
HID1, after: 92000000
Calibrating delay loop... 1795.68 BogoMIPS
Note that at low speed (400MHz), the bogomips value reported in cpuinfo is
as expected, but the debug message above seems to indicate a clock speed
of 450MHz.
Anyway, all this appeared quite nice, but it doesn't work. I wrote the
following little program to try to verify the cpu freq change:
#include <stdio.h>
#include <time.h>
int main() {
clock_t start,end;
int i,j;
do {
start = clock();
j = 0;
for (i=0; i<100*1000*1000; ++i) j+=i;
end = clock();
printf("%d\n",(int)(end-start));
} while (1);
return 0;
}
and compiled it without any optimization. Here's some sample output:
$ ./speed
1150000
1140000
1140000
1140000
1150000
1150000
1140000
1140000
1120000
1090000
1130000
1140000
1150000
These lines are output about one per second. I expect both the number and
the rate at which the lines are output to change by about a factor of 2
when the cpu freq changes; however, this does not happen.
At this point, I'm stuck. I hope you can provide comments and
suggestions. Please let me know if there is any more info I can provide
or if there is something else I should try. Thanks.
Chris.
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
next reply other threads:[~2003-06-12 20:05 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-06-12 20:05 Chris Studholme [this message]
2003-06-13 17:34 ` X engine over Video Controller Rupesh S
2003-06-15 15:12 ` Michel Dänzer
[not found] <200306130459.XAA18908@lists.linuxppc.org>
2003-06-13 5:44 ` pismo upgraded to 750fx not detected correctly Terry Greeniaus
2003-06-19 18:18 ` Chris Studholme
[not found] <200306200459.XAA31217@lists.linuxppc.org>
2003-06-20 5:53 ` Terry Greeniaus
2003-06-21 15:58 ` Chris Studholme
2003-06-22 9:49 ` Benjamin Herrenschmidt
2003-06-22 21:58 ` Terry Greeniaus
2003-06-23 6:01 ` Benjamin Herrenschmidt
2003-06-23 4:47 ` Chris Studholme
2003-06-23 8:27 ` Gabriel Paubert
2003-06-23 17:16 ` Chris Studholme
2003-06-24 8:18 ` Gabriel Paubert
2003-06-23 17:46 ` Benjamin Herrenschmidt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.44.0306121603120.1349-100000@ike \
--to=cvs@cs.utoronto.ca \
--cc=linuxppc-dev@lists.linuxppc.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).