Commit cf204fa7 authored by Paul Mundt's avatar Paul Mundt

sh: Derive calibrate_delay lpj from clk fwk.

All CPUs must have a sensible cpu_clk definition these days, which we can
safely use for deriving the preset loops_per_jiffy. The only odd one out
is SH-5, which hasn't been hammered in to the framework yet.

Based on the ST patch.
Signed-off-by: default avatarFrancesco Virlinzi <francesco.virlinzi@st.com>
Signed-off-by: default avatarCarl Shaw <carl.shaw@st.com>
Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent 4eb5845d
...@@ -25,6 +25,7 @@ config SUPERH32 ...@@ -25,6 +25,7 @@ config SUPERH32
config SUPERH64 config SUPERH64
def_bool y if CPU_SH5 def_bool y if CPU_SH5
select GENERIC_CALIBRATE_DELAY
config ARCH_DEFCONFIG config ARCH_DEFCONFIG
string string
...@@ -57,7 +58,7 @@ config GENERIC_IRQ_PROBE ...@@ -57,7 +58,7 @@ config GENERIC_IRQ_PROBE
def_bool y def_bool y
config GENERIC_CALIBRATE_DELAY config GENERIC_CALIBRATE_DELAY
def_bool y bool
config GENERIC_IOMAP config GENERIC_IOMAP
bool bool
......
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
#include <linux/debugfs.h> #include <linux/debugfs.h>
#include <linux/crash_dump.h> #include <linux/crash_dump.h>
#include <linux/mmzone.h> #include <linux/mmzone.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/page.h> #include <asm/page.h>
...@@ -180,6 +182,24 @@ static inline void __init reserve_crashkernel(void) ...@@ -180,6 +182,24 @@ static inline void __init reserve_crashkernel(void)
{} {}
#endif #endif
#ifndef CONFIG_GENERIC_CALIBRATE_DELAY
void __cpuinit calibrate_delay(void)
{
struct clk *clk = clk_get(NULL, "cpu_clk");
if (IS_ERR(clk))
panic("Need a sane CPU clock definition!");
loops_per_jiffy = (clk_get_rate(clk) >> 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);
}
#endif
void __init __add_active_range(unsigned int nid, unsigned long start_pfn, void __init __add_active_range(unsigned int nid, unsigned long start_pfn,
unsigned long end_pfn) unsigned long end_pfn)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment