Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From 1320fe9f83c69ae3676d6411ddd724a6ffebbeac Mon Sep 17 00:00:00 2001
- From: Nishanth Menon <nm@ti.com>
- Date: Fri, 15 Mar 2013 12:03:30 -0500
- Subject: [PATCH] ARM: OMAP3+: use cpu0-cpufreq driver in device tree
- supported boot
- With OMAP3+ and AM33xx supported SoC having defined CPU device tree
- entries with operating-points defined, we can now use the SoC
- generic cpufreq-cpu0 driver by registering appropriate device.
- OMAP clock nodes are not represented by device tree nodes yet.
- Once the OMAP device tree conversion is complete, we should
- have been able to do:
- clocks = <&dpll_mpu_ck>; or the SoC specific equivalent.
- However, since we are unable to do the same, use "cpufreq_ck"
- as an generic clock alias to point at the representative
- clock required for controlling CPU clock.
- As part of this change modify AM33xx clock data file to
- have cpufreq_ck clock to be generic. This way both omap-cpufreq
- and cpufreq-cpu0 drivers (based on device tree enabled boot support)
- will use the same clock alias.
- For platforms which get clock nodes converted into DT, they need to
- make a cpufreq_ck clock available.
- Once complete DT conversion is complete, cpufreq_ck DT clock nodes
- can be deleted with corresponding change in code.
- Inspired by patch: https://patchwork.kernel.org/patch/2067841/
- now made generic.
- Nyet-signed-off-by: Nishanth Menon <nm@ti.com>
- ---
- arch/arm/mach-omap2/board-generic.c | 37 +++++++++++++++++++++++++++++++++
- arch/arm/mach-omap2/cclock33xx_data.c | 2 +-
- 2 files changed, 38 insertions(+), 1 deletion(-)
- diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
- index afa509a..b32dd55 100644
- --- a/arch/arm/mach-omap2/board-generic.c
- +++ b/arch/arm/mach-omap2/board-generic.c
- @@ -11,6 +11,7 @@
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
- +#include <linux/clk.h>
- #include <linux/io.h>
- #include <linux/of_irq.h>
- #include <linux/of_platform.h>
- @@ -35,6 +36,40 @@ static struct of_device_id omap_dt_match_table[] __initdata = {
- { }
- };
- +static void omap_generic_cpufreq_init(void)
- +{
- + struct platform_device *pdev;
- + struct platform_device_info devinfo = { .name = "cpufreq-cpu0", };
- + char cpufreq_ck_name[] = "cpufreq_ck";
- + int r;
- +
- + if (!IS_ENABLED(CONFIG_GENERIC_CPUFREQ_CPU0))
- + return;
- +
- + pdev = platform_device_register_full(&devinfo);
- + if (IS_ERR(pdev)) {
- + pr_err("%s: failed to register %s device\n", __func__,
- + devinfo.name);
- + return;
- + }
- +
- + /*
- + * XXX: FIXME:
- + * OMAP clock nodes are still based off data files. When they get
- + * converted to DT entries, cpu node should have a clock node associated
- + * with it.
- + * We expect cpufreq to continue to work seamlessly when that takes
- + * place. When that takes place, remove the following code:
- + */
- + r = clk_add_alias(NULL, dev_name(&pdev->dev), cpufreq_ck_name,
- + &pdev->dev);
- + if (r) {
- + dev_err(&pdev->dev, "%s: clk add alias '%s' failed(%d)\n",
- + __func__, cpufreq_ck_name, r);
- + platform_device_unregister(pdev);
- + }
- +}
- +
- static void __init omap_generic_init(void)
- {
- omap_sdrc_init(NULL, NULL);
- @@ -49,6 +84,8 @@ static void __init omap_generic_init(void)
- omap4_panda_display_init_of();
- else if (of_machine_is_compatible("ti,omap4-sdp"))
- omap_4430sdp_display_init_of();
- +
- + omap_generic_cpufreq_init();
- }
- #ifdef CONFIG_SOC_OMAP2420
- diff --git a/arch/arm/mach-omap2/cclock33xx_data.c b/arch/arm/mach-omap2/cclock33xx_data.c
- index 476b820..262cee3 100644
- --- a/arch/arm/mach-omap2/cclock33xx_data.c
- +++ b/arch/arm/mach-omap2/cclock33xx_data.c
- @@ -852,7 +852,7 @@ static struct omap_clk am33xx_clks[] = {
- CLK(NULL, "dpll_core_m5_ck", &dpll_core_m5_ck, CK_AM33XX),
- CLK(NULL, "dpll_core_m6_ck", &dpll_core_m6_ck, CK_AM33XX),
- CLK(NULL, "dpll_mpu_ck", &dpll_mpu_ck, CK_AM33XX),
- - CLK("cpu0", NULL, &dpll_mpu_ck, CK_AM33XX),
- + CLK(NULL, "cpufreq_ck", &dpll_mpu_ck, CK_AM33XX),
- CLK(NULL, "dpll_mpu_m2_ck", &dpll_mpu_m2_ck, CK_AM33XX),
- CLK(NULL, "dpll_ddr_ck", &dpll_ddr_ck, CK_AM33XX),
- CLK(NULL, "dpll_ddr_m2_ck", &dpll_ddr_m2_ck, CK_AM33XX),
- --
- 1.7.9.5
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement