diff options
author | Ranjani Vaidyanathan <ra5478@freescale.com> | 2013-08-22 23:11:58 -0400 |
---|---|---|
committer | Nitin Garg <nitin.garg@freescale.com> | 2014-04-16 09:01:26 -0400 |
commit | d61ca35eddaf35fc8ea7c3b08183a06f8558a66d (patch) | |
tree | 4a42fb28c8396c4229e20984cb989b1b5d554684 | |
parent | 30951d6a084dc05092bdab8b086f912ff865fc55 (diff) |
ENGR00276593-3 [iMX6SL] - Add CPUFREQ support.
Add CPUFREQ support for iMX6SL.
Signed-off-by: Ranjani Vaidyanathan <ra5478@freescale.com>
-rw-r--r-- | arch/arm/boot/dts/imx6sl.dtsi | 5 | ||||
-rw-r--r-- | arch/arm/mach-imx/mach-imx6sl.c | 31 |
2 files changed, 34 insertions, 2 deletions
diff --git a/arch/arm/boot/dts/imx6sl.dtsi b/arch/arm/boot/dts/imx6sl.dtsi index 556a9f182d17..d043843ac96c 100644 --- a/arch/arm/boot/dts/imx6sl.dtsi +++ b/arch/arm/boot/dts/imx6sl.dtsi | |||
@@ -47,8 +47,9 @@ | |||
47 | 396000 1150000 | 47 | 396000 1150000 |
48 | >; | 48 | >; |
49 | clock-latency = <61036>; /* two CLK32 periods */ | 49 | clock-latency = <61036>; /* two CLK32 periods */ |
50 | clocks = <&clks 104>, <&clks 6>, <&clks 16>, | 50 | clocks = <&clks IMX6SL_CLK_ARM>, <&clks IMX6SL_CLK_PLL2_PFD2>, |
51 | <&clks 17>, <&clks 170>; | 51 | <&clks IMX6SL_CLK_STEP>, <&clks IMX6SL_CLK_PLL1_SW>, |
52 | <&clks IMX6SL_CLK_PLL1_SYS>; | ||
52 | clock-names = "arm", "pll2_pfd2_396m", "step", | 53 | clock-names = "arm", "pll2_pfd2_396m", "step", |
53 | "pll1_sw", "pll1_sys"; | 54 | "pll1_sw", "pll1_sys"; |
54 | arm-supply = <®_arm>; | 55 | arm-supply = <®_arm>; |
diff --git a/arch/arm/mach-imx/mach-imx6sl.c b/arch/arm/mach-imx/mach-imx6sl.c index 1613c0384811..0578373c9bfe 100644 --- a/arch/arm/mach-imx/mach-imx6sl.c +++ b/arch/arm/mach-imx/mach-imx6sl.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/irqchip.h> | 11 | #include <linux/irqchip.h> |
12 | #include <linux/of.h> | 12 | #include <linux/of.h> |
13 | #include <linux/of_platform.h> | 13 | #include <linux/of_platform.h> |
14 | #include <linux/opp.h> | ||
14 | #include <linux/regmap.h> | 15 | #include <linux/regmap.h> |
15 | #include <linux/mfd/syscon.h> | 16 | #include <linux/mfd/syscon.h> |
16 | #include <linux/mfd/syscon/imx6q-iomuxc-gpr.h> | 17 | #include <linux/mfd/syscon/imx6q-iomuxc-gpr.h> |
@@ -20,6 +21,10 @@ | |||
20 | #include "common.h" | 21 | #include "common.h" |
21 | #include "hardware.h" | 22 | #include "hardware.h" |
22 | 23 | ||
24 | static struct platform_device imx6sl_cpufreq_pdev = { | ||
25 | .name = "imx6-cpufreq", | ||
26 | }; | ||
27 | |||
23 | static void __init imx6sl_fec_init(void) | 28 | static void __init imx6sl_fec_init(void) |
24 | { | 29 | { |
25 | struct regmap *gpr; | 30 | struct regmap *gpr; |
@@ -53,6 +58,26 @@ static void __init imx6sl_init_machine(void) | |||
53 | imx6_pm_init(); | 58 | imx6_pm_init(); |
54 | } | 59 | } |
55 | 60 | ||
61 | static void __init imx6sl_opp_init(struct device *cpu_dev) | ||
62 | { | ||
63 | struct device_node *np; | ||
64 | |||
65 | np = of_find_node_by_path("/cpus/cpu@0"); | ||
66 | if (!np) { | ||
67 | pr_warn("failed to find cpu0 node\n"); | ||
68 | return; | ||
69 | } | ||
70 | |||
71 | cpu_dev->of_node = np; | ||
72 | if (of_init_opp_table(cpu_dev)) { | ||
73 | pr_warn("failed to init OPP table\n"); | ||
74 | goto put_node; | ||
75 | } | ||
76 | |||
77 | put_node: | ||
78 | of_node_put(np); | ||
79 | } | ||
80 | |||
56 | static void __init imx6sl_init_late(void) | 81 | static void __init imx6sl_init_late(void) |
57 | { | 82 | { |
58 | struct regmap *gpr; | 83 | struct regmap *gpr; |
@@ -68,6 +93,12 @@ static void __init imx6sl_init_late(void) | |||
68 | IMX6Q_GPR1_GINT_ASSERT); | 93 | IMX6Q_GPR1_GINT_ASSERT); |
69 | else | 94 | else |
70 | pr_err("failed to find fsl,imx6sl-iomux-gpr regmap\n"); | 95 | pr_err("failed to find fsl,imx6sl-iomux-gpr regmap\n"); |
96 | |||
97 | if (IS_ENABLED(CONFIG_ARM_IMX6_CPUFREQ)) { | ||
98 | imx6sl_opp_init(&imx6sl_cpufreq_pdev.dev); | ||
99 | platform_device_register(&imx6sl_cpufreq_pdev); | ||
100 | } | ||
101 | |||
71 | } | 102 | } |
72 | 103 | ||
73 | static void __init imx6sl_map_io(void) | 104 | static void __init imx6sl_map_io(void) |