]> nv-tegra.nvidia Code Review - linux-2.6.git/commitdiff
MIPS: Alchemy: override loops_per_jiffy detection
authorManuel Lauss <manuel.lauss@googlemail.com>
Thu, 27 Aug 2009 17:21:18 +0000 (19:21 +0200)
committerRalf Baechle <ralf@linux-mips.org>
Thu, 17 Sep 2009 18:07:51 +0000 (20:07 +0200)
loops_per_jiffy depends on coreclk speed;  preset it instead of
letting the kernel waste precious microseconds trying to approximate it.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/alchemy/common/setup.c

index 3f036b3d400e3077da869ad20021378101f26811..6184baa56786703af2ef195cf9ee77318cace225 100644 (file)
@@ -27,6 +27,7 @@
 
 #include <linux/init.h>
 #include <linux/ioport.h>
+#include <linux/jiffies.h>
 #include <linux/module.h>
 #include <linux/pm.h>
 
@@ -53,6 +54,9 @@ void __init plat_mem_setup(void)
        printk(KERN_INFO "(PRId %08x) @ %lu.%02lu MHz\n", read_c0_prid(),
               est_freq / 1000000, ((est_freq % 1000000) * 100) / 1000000);
 
+       /* this is faster than wasting cycles trying to approximate it */
+       preset_lpj = (est_freq >> 1) / HZ;
+
        _machine_restart = au1000_restart;
        _machine_halt = au1000_halt;
        pm_power_off = au1000_power_off;