diff options
| -rw-r--r-- | drivers/cpufreq/qoriq-cpufreq.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/drivers/cpufreq/qoriq-cpufreq.c b/drivers/cpufreq/qoriq-cpufreq.c index bfec1bcd3835..e2ea433a5f9c 100644 --- a/drivers/cpufreq/qoriq-cpufreq.c +++ b/drivers/cpufreq/qoriq-cpufreq.c | |||
| @@ -52,17 +52,27 @@ static u32 get_bus_freq(void) | |||
| 52 | { | 52 | { |
| 53 | struct device_node *soc; | 53 | struct device_node *soc; |
| 54 | u32 sysfreq; | 54 | u32 sysfreq; |
| 55 | struct clk *pltclk; | ||
| 56 | int ret; | ||
| 55 | 57 | ||
| 58 | /* get platform freq by searching bus-frequency property */ | ||
| 56 | soc = of_find_node_by_type(NULL, "soc"); | 59 | soc = of_find_node_by_type(NULL, "soc"); |
| 57 | if (!soc) | 60 | if (soc) { |
| 58 | return 0; | 61 | ret = of_property_read_u32(soc, "bus-frequency", &sysfreq); |
| 59 | 62 | of_node_put(soc); | |
| 60 | if (of_property_read_u32(soc, "bus-frequency", &sysfreq)) | 63 | if (!ret) |
| 61 | sysfreq = 0; | 64 | return sysfreq; |
| 65 | } | ||
| 62 | 66 | ||
| 63 | of_node_put(soc); | 67 | /* get platform freq by its clock name */ |
| 68 | pltclk = clk_get(NULL, "cg-pll0-div1"); | ||
| 69 | if (IS_ERR(pltclk)) { | ||
| 70 | pr_err("%s: can't get bus frequency %ld\n", | ||
| 71 | __func__, PTR_ERR(pltclk)); | ||
| 72 | return PTR_ERR(pltclk); | ||
| 73 | } | ||
| 64 | 74 | ||
| 65 | return sysfreq; | 75 | return clk_get_rate(pltclk); |
| 66 | } | 76 | } |
| 67 | 77 | ||
| 68 | static struct clk *cpu_to_clk(int cpu) | 78 | static struct clk *cpu_to_clk(int cpu) |
