]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] /proc/cpuinfo fixes for G5
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Wed, 3 Mar 2004 08:10:01 +0000 (00:10 -0800)
committerDave Kleikamp <jfs.adm@hostme.bitkeeper.com>
Wed, 3 Mar 2004 08:10:01 +0000 (00:10 -0800)
This adds a "timbase" entry in /proc/cpuinfo like p/iSeries that
provides the CPU timebase frequency.  It is using by a all sort of
performance analysis tools we are hacking in house.

It also remove a useless bit about the l2 cache that was copied over
from ppc32.

arch/ppc64/kernel/pmac_setup.c
arch/ppc64/kernel/pmac_time.c

index 69f501db01e8a55519c67ab7265c6723400dbbe3..52f0b8940504e43bff064428d56d46a14c41afb6 100644 (file)
@@ -95,6 +95,7 @@ void __pmac pmac_show_cpuinfo(struct seq_file *m)
                                        PMAC_MB_INFO_MODEL, 0);
        unsigned int mbflags = pmac_call_feature(PMAC_FTR_GET_MB_INFO, NULL,
                                                 PMAC_MB_INFO_FLAGS, 0);
+       extern unsigned long ppc_tb_freq;
 
        if (pmac_call_feature(PMAC_FTR_GET_MB_INFO, NULL, PMAC_MB_INFO_NAME,
                              (long)&mbname) != 0)
@@ -127,20 +128,11 @@ void __pmac pmac_show_cpuinfo(struct seq_file *m)
        seq_printf(m, "detected as\t: %d (%s)\n", mbmodel, mbname);
        seq_printf(m, "pmac flags\t: %08x\n", mbflags);
 
-       /* Checks "l2cr-value" property in the registry */
-       np = find_devices("cpus");      
-       if (np == 0)
-               np = find_type_devices("cpu");  
-       if (np != 0) {
-               unsigned int *l2cr = (unsigned int *)
-                       get_property(np, "l2cr-value", NULL);
-               if (l2cr != 0) {
-                       seq_printf(m, "l2cr override\t: 0x%x\n", *l2cr);
-               }
-       }
-
        /* Indicate newworld */
        seq_printf(m, "pmac-generation\t: NewWorld\n");
+
+       /* Indicate timebase value */
+       seq_printf(m, "timebase\t: %lu\n", ppc_tb_freq);
 }
 
 
index 0681da70e81d5360e8e799659e885b5413e596b2..c87e2f4dc66b6c32ea3763fdc2279f3ec8518fc3 100644 (file)
@@ -39,6 +39,8 @@
 
 extern void setup_default_decr(void);
 
+extern unsigned long ppc_tb_freq;
+
 /* Apparently the RTC stores seconds since 1 Jan 1904 */
 #define RTC_OFFSET     2082844800
 
@@ -151,6 +153,7 @@ void __init pmac_calibrate_decr(void)
        tb_to_us = mulhwu_scale_factor(freq, 1000000);
        div128_by_32( 1024*1024, 0, tb_ticks_per_sec, &divres );
        tb_to_xs = divres.result_low;
+       ppc_tb_freq = freq;
 
        setup_default_decr();
 }