[PATCH] Alchemy: override loops_per_jiffy detection

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The loops_per_jiffy detection in generic calibrate_delay is a bit off
(by ~0.5% usually); calculate the correct value based on detected core
clock.  BogoMIPS value will now reflect cpu core clock correctly.

(Blatantly stolen from the SH port).

Signed-off-by: Manuel Lauss <manuel.lauss@xxxxxxxxx>
---
 arch/mips/Kconfig                |    2 +-
 arch/mips/alchemy/common/setup.c |   11 +++++++++++
 2 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 3ca0fe1..56c8139 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -700,7 +700,7 @@ config GENERIC_HWEIGHT
 
 config GENERIC_CALIBRATE_DELAY
 	bool
-	default y
+	default y if !MACH_ALCHEMY
 
 config GENERIC_CLOCKEVENTS
 	bool
diff --git a/arch/mips/alchemy/common/setup.c b/arch/mips/alchemy/common/setup.c
index 3f036b3..5ea7e1a 100644
--- a/arch/mips/alchemy/common/setup.c
+++ b/arch/mips/alchemy/common/setup.c
@@ -74,6 +74,17 @@ void __init plat_mem_setup(void)
 	iomem_resource.end = IOMEM_RESOURCE_END;
 }
 
+void __cpuinit calibrate_delay(void)
+{
+	loops_per_jiffy = (get_au1x00_speed() >> 1) / HZ;
+
+	printk(KERN_INFO "Calibrating delay loop (skipped)... "
+			 "%lu.%02lu BogoMIPS PRESET (lpj=%lu)\n",
+			 loops_per_jiffy/(500000/HZ),
+			 (loops_per_jiffy/(5000/HZ)) % 100,
+			 loops_per_jiffy);
+}
+
 #if defined(CONFIG_64BIT_PHYS_ADDR)
 /* This routine should be valid for all Au1x based boards */
 phys_t __fixup_bigphys_addr(phys_t phys_addr, phys_t size)
-- 
1.6.3.3



[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux