aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/au1000/common/setup.c
diff options
context:
space:
mode:
authorSergei Shtylyov <sshtylyov@ru.mvista.com>2008-03-27 09:09:31 -0400
committerRalf Baechle <ralf@linux-mips.org>2008-04-01 10:46:34 -0400
commit758e285faca4db948ecddefb523007255b29cdb7 (patch)
tree530fb34442234b04afe0972d6765bbc7f17ba0f6 /arch/mips/au1000/common/setup.c
parentb1ec4c8e483d0d00d3114eafdb2c85c1cf3ed4ae (diff)
[MIPS] Alchemy: work around clock misdetection on early Au1000
Work around the CPU clock miscalculation on Au1000DA/HA/HB due the sys_cpupll register being write-only, i.e. actually do what the comment before cal_r4off() function advertised for years but the code failed at. This is achieved by just giving user a chance to define the clock explicitly in the board config. via CONFIG_SOC_AU1000_FREQUENCY option, defaulting to 396 MHz if the option is not given... The patch is based on the AMD's big unpublished patch, the issue seems to be an undocumented errata (or feature :-)... Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/au1000/common/setup.c')
-rw-r--r--arch/mips/au1000/common/setup.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/arch/mips/au1000/common/setup.c b/arch/mips/au1000/common/setup.c
index d885e3848ec6..9e4ab80caab6 100644
--- a/arch/mips/au1000/common/setup.c
+++ b/arch/mips/au1000/common/setup.c
@@ -57,7 +57,7 @@ void __init plat_mem_setup(void)
57{ 57{
58 struct cpu_spec *sp; 58 struct cpu_spec *sp;
59 char *argptr; 59 char *argptr;
60 unsigned long prid, cpupll, bclk = 1; 60 unsigned long prid, cpufreq, bclk = 1;
61 61
62 set_cpuspec(); 62 set_cpuspec();
63 sp = cur_cpu_spec[0]; 63 sp = cur_cpu_spec[0];
@@ -65,8 +65,15 @@ void __init plat_mem_setup(void)
65 board_setup(); /* board specific setup */ 65 board_setup(); /* board specific setup */
66 66
67 prid = read_c0_prid(); 67 prid = read_c0_prid();
68 cpupll = (au_readl(0xB1900060) & 0x3F) * 12; 68 if (sp->cpu_pll_wo)
69 printk("(PRId %08lx) @ %ldMHZ\n", prid, cpupll); 69#ifdef CONFIG_SOC_AU1000_FREQUENCY
70 cpufreq = CONFIG_SOC_AU1000_FREQUENCY / 1000000;
71#else
72 cpufreq = 396;
73#endif
74 else
75 cpufreq = (au_readl(SYS_CPUPLL) & 0x3F) * 12;
76 printk(KERN_INFO "(PRID %08lx) @ %ld MHz\n", prid, cpufreq);
70 77
71 bclk = sp->cpu_bclk; 78 bclk = sp->cpu_bclk;
72 if (bclk) 79 if (bclk)