From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC][PATCH 1/2] ARM: OMAP4: clock: Add device tree support for AUXCLKs
Date: Tue, 9 Apr 2013 15:22:31 -0700 [thread overview]
Message-ID: <20130409222231.GS10155@atomide.com> (raw)
In-Reply-To: <20130409204900.GA8815@kahuna>
* Nishanth Menon <nm@ti.com> [130409 13:53]:
> I did try to have an implementation for cpufreq using clock nodes.
> unfortunately, device tree wont let me have arguments of strings :(
> So, I am unable to do clock = <&clk mpu_dpll>;
> instead, I am forced to do clock = <&clk 249>;
It seems that you should have a separate clock defines for each
clock instead. That way we can later on populate that with
the clock specific data.
> Here is an attempt on beagleXM - adds every clock node to the list.
> Tons of un-necessary prints added to give an idea - see log:
> http://pastebin.com/F9A2zSTr
>
> Would an cleaned up version be good enough as a step #1 of transition?
Well I would make it even simpler initially. Just a standard .dts
clock defined that gets parsed by drivers/clock/ driver that just
calls clk_add_alias(). Then the consumer driver can just do clk_get()
and and the right clock is found, see below.
> --- a/arch/arm/boot/dts/omap3.dtsi
> +++ b/arch/arm/boot/dts/omap3.dtsi
> @@ -73,6 +73,11 @@
> ti,hwmods = "counter_32k";
> };
>
> + clks: clocks {
> + compatible = "ti,clock";
> + #clock-cells = <1>;
> + };
> +
> intc: interrupt-controller at 48200000 {
> compatible = "ti,omap2-intc";
> interrupt-controller;
There should be a separate entry for each clock defined,
like auxclk1 in the USB case assuming the clock being used
is aux clock #1. I doubt that we want to map all the auxclks
as a single clock as they are separate clocks AFAIK.
> --- a/arch/arm/boot/dts/omap34xx.dtsi
> +++ b/arch/arm/boot/dts/omap34xx.dtsi
> @@ -23,6 +23,8 @@
> 600000 1350000
> >;
> clock-latency = <300000>; /* From legacy driver */
> + clocks = <&clks 249>; /* index to cpufreq_ck */
> + clock-names = "cpu";
> };
> };
> };
Then in the consumer driver you would just have:
clocks = <&auxclk1 0>;
for the USB case, then something else for the cpufreq driver.
> --- a/arch/arm/mach-omap2/cclock3xxx_data.c
> +++ b/arch/arm/mach-omap2/cclock3xxx_data.c
> @@ -22,6 +22,7 @@
> #include <linux/clk-private.h>
> #include <linux/list.h>
> #include <linux/io.h>
> +#include <linux/clk/ti.h>
>
> #include "soc.h"
> #include "iomap.h"
> @@ -3574,7 +3575,7 @@ int __init omap3xxx_clk_init(void)
> for (c = omap3xxx_clks; c < omap3xxx_clks + ARRAY_SIZE(omap3xxx_clks);
> c++)
> if (c->cpu & cpu_clkflg) {
> - clkdev_add(&c->lk);
> + ti_clk_node_add(&c->lk);
> if (!__clk_init(NULL, c->lk.clk))
> omap2_init_clk_hw_omap_clocks(c->lk.clk);
> }
AFAIK no need to tinkering with the clockxxxx_data.c files.
> --- /dev/null
> +++ b/drivers/clk/ti.c
> @@ -0,0 +1,100 @@
> +/*
> + * TI Clock node provider
> + *
> + * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
> + * Nishanth Menon
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + *
> + * This program is distributed "as is" WITHOUT ANY WARRANTY of any
> + * kind, whether express or implied; without even the implied warranty
> + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
> + */
> +#include <linux/kernel.h>
> +#include <linux/list.h>
> +#include <linux/clk-private.h>
> +#include <linux/clkdev.h>
> +#include <linux/io.h>
> +#include <linux/of.h>
> +#include <linux/clk/ti.h>
Then this can be just a minimal DT device driver that initially just
calls clk_add_alias() so the right clock is found when the driver
does clk_get(). Probably should be drivers/clock/omap/clk.c.
Regards,
Tony
next prev parent reply other threads:[~2013-04-09 22:22 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-19 14:26 [RFC][PATCH 0/2] Device tree support for OMAP4 SCRM clocks Roger Quadros
2013-03-19 14:26 ` [RFC][PATCH 1/2] ARM: OMAP4: clock: Add device tree support for AUXCLKs Roger Quadros
2013-03-19 14:30 ` Roger Quadros
2013-03-21 13:08 ` Rajendra Nayak
2013-03-21 13:54 ` Roger Quadros
2013-03-21 14:04 ` Rajendra Nayak
2013-03-21 14:11 ` Roger Quadros
2013-03-21 14:07 ` Roger Quadros
2013-03-26 10:23 ` [PATCH v2] " Roger Quadros
2013-04-02 8:23 ` Roger Quadros
2013-04-05 8:47 ` Roger Quadros
2013-04-05 8:48 ` Nishanth Menon
2013-04-05 8:50 ` Roger Quadros
2013-04-03 23:42 ` [RFC][PATCH 1/2] " Tony Lindgren
2013-04-04 5:20 ` Rajendra Nayak
2013-04-04 16:33 ` Tony Lindgren
2013-04-04 7:35 ` Roger Quadros
2013-04-04 16:41 ` Tony Lindgren
2013-04-05 10:39 ` Roger Quadros
2013-04-05 15:58 ` Tony Lindgren
2013-04-09 9:55 ` Roger Quadros
2013-04-09 16:49 ` Tony Lindgren
2013-04-09 17:43 ` Tony Lindgren
2013-04-09 20:49 ` Nishanth Menon
2013-04-09 21:54 ` Nishanth Menon
2013-04-10 11:04 ` Roger Quadros
2013-04-09 22:22 ` Tony Lindgren [this message]
2013-04-10 8:06 ` Mike Turquette
2013-04-10 10:55 ` Roger Quadros
2013-04-10 17:39 ` Nishanth Menon
2013-04-10 18:49 ` Tony Lindgren
2013-04-10 19:19 ` Nishanth Menon
2013-04-10 20:21 ` Tony Lindgren
2013-04-11 7:48 ` Roger Quadros
2013-04-11 9:04 ` Grygorii Strashko
2013-04-11 22:45 ` Nishanth Menon
2013-04-11 18:46 ` Mike Turquette
2013-04-11 22:40 ` Nishanth Menon
2013-04-05 17:56 ` Grygorii Strashko
2013-04-09 10:16 ` Roger Quadros
2013-03-19 14:27 ` [PATCH 2/2] ARM: dts: omap4-panda: Provide PHY clock information Roger Quadros
2013-03-19 14:28 ` [RFC][PATCH 0/2] Device tree support for OMAP4 SCRM clocks Roger Quadros
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130409222231.GS10155@atomide.com \
--to=tony@atomide.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).