Subject: Re: 604e vs. 604ev (was Re: results of the IRC debug patch)
To: Allen Briggs <briggs@netbsd.org>
From: Tim Kelly <hockey@dialectronics.com>
List: port-macppc
Date: 12/05/2004 10:00:13
At 7:44 AM -0500 12/5/04, Tim Kelly wrote:
>I went ahead and extended the number of CPUs that have the MHz calculated
>to include anything from a 604 (which have the performance monitor
>registers) and newer that might be found on Apple hardware.

This needs to be added to the bottom of the cpu_subr.c patch

@@ -754,6 +771,8 @@
        delay(100000);
        cps = (mfspr(SPR_PMC1) * 10) + 4999;

+       mtspr(SPR_MMCR0, MMCR0_FC);
+
        aprint_normal("%lld.%02lld MHz", cps / 1000000, (cps / 10000) % 100);
 }

One minor oversight in the calculate CPU speed algorithm is to turn off the
performance monitor once the calculation is done. The docs also call for
sync instructions before and after mfspr and mtspr for performance monitor
accuracy, but I applied this and it made no difference in the calculated
speed.

tim