diff options
| author | Gregory CLEMENT <gregory.clement@free-electrons.com> | 2014-09-02 04:15:17 -0400 |
|---|---|---|
| committer | Jason Cooper <jason@lakedaemon.net> | 2014-09-09 11:15:03 -0400 |
| commit | 5e1a63f5f548bb8a3967f00be2f0e1e04290c613 (patch) | |
| tree | 2878555f750315be3a51108b8dd16e8d19c61333 | |
| parent | 15917b16022427c53755abff4dc7051f3076dd7a (diff) | |
clk: mvebu: armada-370: Fix timer drift caused by the SSCG deviation
This commit activates the SSCG deviation correction for the Armada
370. It uses the optional function introduced by the commit "clk:
mvebu: Fix clk frequency value if SSCG is enabled".
Without this fix the deviation measured on a Mirabox was of a few
second each hour, whereas with this fix it was reduced at around
50ppm (around 4s per day).
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Tested-by: Leigh Brown <leigh@solinno.co.uk>
Link: https://lkml.kernel.org/r/1409645719-20003-3-git-send-email-gregory.clement@free-electrons.com
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
| -rw-r--r-- | drivers/clk/mvebu/armada-370.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/clk/mvebu/armada-370.c b/drivers/clk/mvebu/armada-370.c index bef198a83863..756f0f39d6a3 100644 --- a/drivers/clk/mvebu/armada-370.c +++ b/drivers/clk/mvebu/armada-370.c | |||
| @@ -23,6 +23,7 @@ | |||
| 23 | */ | 23 | */ |
| 24 | 24 | ||
| 25 | #define SARL 0 /* Low part [0:31] */ | 25 | #define SARL 0 /* Low part [0:31] */ |
| 26 | #define SARL_A370_SSCG_ENABLE BIT(10) | ||
| 26 | #define SARL_A370_PCLK_FREQ_OPT 11 | 27 | #define SARL_A370_PCLK_FREQ_OPT 11 |
| 27 | #define SARL_A370_PCLK_FREQ_OPT_MASK 0xF | 28 | #define SARL_A370_PCLK_FREQ_OPT_MASK 0xF |
| 28 | #define SARL_A370_FAB_FREQ_OPT 15 | 29 | #define SARL_A370_FAB_FREQ_OPT 15 |
| @@ -133,10 +134,17 @@ static void __init a370_get_clk_ratio( | |||
| 133 | } | 134 | } |
| 134 | } | 135 | } |
| 135 | 136 | ||
| 137 | static bool a370_is_sscg_enabled(void __iomem *sar) | ||
| 138 | { | ||
| 139 | return !(readl(sar) & SARL_A370_SSCG_ENABLE); | ||
| 140 | } | ||
| 141 | |||
| 136 | static const struct coreclk_soc_desc a370_coreclks = { | 142 | static const struct coreclk_soc_desc a370_coreclks = { |
| 137 | .get_tclk_freq = a370_get_tclk_freq, | 143 | .get_tclk_freq = a370_get_tclk_freq, |
| 138 | .get_cpu_freq = a370_get_cpu_freq, | 144 | .get_cpu_freq = a370_get_cpu_freq, |
| 139 | .get_clk_ratio = a370_get_clk_ratio, | 145 | .get_clk_ratio = a370_get_clk_ratio, |
| 146 | .is_sscg_enabled = a370_is_sscg_enabled, | ||
| 147 | .fix_sscg_deviation = kirkwood_fix_sscg_deviation, | ||
| 140 | .ratios = a370_coreclk_ratios, | 148 | .ratios = a370_coreclk_ratios, |
| 141 | .num_ratios = ARRAY_SIZE(a370_coreclk_ratios), | 149 | .num_ratios = ARRAY_SIZE(a370_coreclk_ratios), |
| 142 | }; | 150 | }; |
