Skip to content

Commit a7bcb1a

Browse files
Manuel Laussralfbaechle
authored andcommitted
MIPS: Alchemy: override loops_per_jiffy detection
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>
1 parent f7557dc commit a7bcb1a

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎arch/mips/alchemy/common/setup.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828
#include <linux/init.h>
2929
#include <linux/ioport.h>
30+
#include <linux/jiffies.h>
3031
#include <linux/module.h>
3132
#include <linux/pm.h>
3233

@@ -53,6 +54,9 @@ void __init plat_mem_setup(void)
5354
printk(KERN_INFO "(PRId %08x) @ %lu.%02lu MHz\n", read_c0_prid(),
5455
est_freq / 1000000, ((est_freq % 1000000) * 100) / 1000000);
5556

57+
/* this is faster than wasting cycles trying to approximate it */
58+
preset_lpj = (est_freq >> 1) / HZ;
59+
5660
_machine_restart = au1000_restart;
5761
_machine_halt = au1000_halt;
5862
pm_power_off = au1000_power_off;

0 commit comments

Comments
 (0)