From: Sascha Hauer <s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
To: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
Rob Herring <rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>,
Sascha Hauer <kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [RFC 8/8] dt/arm: versatile add clock parsing
Date: Wed, 9 Nov 2011 10:31:47 +0100 [thread overview]
Message-ID: <20111109093147.GZ16886@pengutronix.de> (raw)
In-Reply-To: <1320801583-12774-9-git-send-email-grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
On Tue, Nov 08, 2011 at 06:19:43PM -0700, Grant Likely wrote:
> Signed-off-by: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
> ---
> arch/arm/boot/dts/versatile-ab.dts | 37 ++++++++++++++++++++++++++++++++
> arch/arm/boot/dts/versatile-pb.dts | 2 +
> arch/arm/mach-versatile/core.c | 37 +------------------------------
> arch/arm/mach-versatile/versatile_dt.c | 33 ++++++++++++++++++++++++++++
> 4 files changed, 74 insertions(+), 35 deletions(-)
>
> diff --git a/arch/arm/boot/dts/versatile-ab.dts b/arch/arm/boot/dts/versatile-ab.dts
> index 0b32925..cb8a49e 100644
> --- a/arch/arm/boot/dts/versatile-ab.dts
> +++ b/arch/arm/boot/dts/versatile-ab.dts
> @@ -19,6 +19,35 @@
> reg = <0x0 0x08000000>;
> };
>
> + clocks {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + ref24_clk: clock0 {
> + compatible = "fixed-clock";
> + #clock-cells = <1>;
> + clock-frequency = <24000000>;
> + clock-output-names = "ref";
> + };
> +
> + sp804_clk: clock1 {
> + compatible = "fixed-clock";
> + #clock-cells = <1>;
> + clock-frequency = <1000000>;
> + clock-output-names = "ref";
> + };
> +
> + osc4_clk: clock3 {
> + compatible = "ics,icst307";
> + #clock-cells = <1>;
> + ref = <24000>;
> + vco-max = <200000>;
> + vd-range = <12 519>;
> + rd-range = <3 129>;
> + clock-output-names = "osc4";
> + };
The registers needed to access osc4 are missing here. This probably
means that osc4 cannot be specified in the clocks node but has to
be sorted into the bus structure of the SoC.
> +
> static void __init versatile_dt_init(void)
> {
> + struct device_node *node;
> + struct clk *clk;
> + int rc;
> +
> + for_each_compatible_node(node, NULL, "fixed-clock") {
> + u32 rate;
> + if (of_property_read_u32(node, "clock-frequency", &rate))
> + continue;
> +
> + clk = kzalloc(sizeof(*clk), GFP_KERNEL);
> + if (!clk)
> + panic("out of memory\n");
> + clk->rate = rate;
> +
> + rc = of_clk_add_provider(node, versatile_dt_clk_get, clk);
> + if (rc) {
> + kfree(clk);
> + pr_err("error adding fixed clk %s\n", node->name);
> + }
> + }
> +
Well this is obviously just a quick hack to get something working. I
just want to add the note here that Mikes current patches require to
register the clock tree top-down. This may be hard to archieve as the
clocks are somewhere in the devicetree (sorted by bus topology and not
by clock topology). So we either need more thinking in the clock
framework to overcome the top-down registration or more thinking here
in the registration of the clocks.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
prev parent reply other threads:[~2011-11-09 9:31 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-09 1:19 [RFC 0/8] Initial DT clock bindings Grant Likely
2011-11-09 1:19 ` [RFC 1/8] gpio/microblaze: Eliminate duplication of of_get_named_gpio_flags() Grant Likely
2011-12-21 10:22 ` Michal Simek
2012-01-04 18:30 ` Grant Likely
[not found] ` <20120104183057.GU15503-e0URQFbLeQY2iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
2012-01-05 7:28 ` Michal Simek
[not found] ` <1320801583-12774-1-git-send-email-grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
2011-11-09 1:19 ` [RFC 2/8] gpio/powerpc: " Grant Likely
2011-11-09 1:19 ` [RFC 4/8] of: Add device tree selftests Grant Likely
2011-11-09 1:19 ` [RFC 5/8] of: Add of_property_match_string() to find index into a string list Grant Likely
2011-11-09 1:19 ` [RFC 6/8] of: add clock providers Grant Likely
[not found] ` <1320801583-12774-7-git-send-email-grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
2011-11-09 2:49 ` Rob Herring
2011-11-14 2:14 ` Richard Zhao
2011-11-16 19:06 ` Grant Likely
2011-11-09 9:13 ` Sascha Hauer
[not found] ` <20111109091328.GY16886-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2011-11-09 11:23 ` Cousson, Benoit
[not found] ` <4EBA62AD.3000407-l0cyMroinI0@public.gmane.org>
2011-11-09 11:49 ` Sascha Hauer
[not found] ` <20111109114936.GL16886-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2011-11-11 19:57 ` Cousson, Benoit
2011-11-16 22:12 ` Grant Likely
2011-11-18 7:48 ` Sascha Hauer
2011-11-09 13:59 ` Rob Herring
[not found] ` <4EBA8735.902-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2011-11-11 19:50 ` Cousson, Benoit
2011-11-09 13:31 ` Rob Herring
2011-11-21 15:37 ` Shawn Guo
[not found] ` <20111121153716.GA16417-+NayF8gZjK2ctlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2011-11-30 19:38 ` Grant Likely
2011-12-01 6:34 ` Shawn Guo
2011-11-09 18:39 ` Tony Lindgren
2011-11-09 1:19 ` [RFC 7/8] arm/clkdev: lookup clocks from OF " Grant Likely
2011-11-09 2:36 ` Rob Herring
2011-11-16 18:54 ` Grant Likely
2011-11-09 1:19 ` [RFC 3/8] of: create of_phandle_args to simplify return of phandle parsing data Grant Likely
2011-11-14 3:59 ` Shawn Guo
[not found] ` <20111114035908.GA10236-+NayF8gZjK2ctlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2011-11-16 18:47 ` Grant Likely
2011-11-21 15:50 ` Shawn Guo
2011-11-09 1:19 ` [RFC 8/8] dt/arm: versatile add clock parsing Grant Likely
[not found] ` <1320801583-12774-9-git-send-email-grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
2011-11-09 9:31 ` Sascha Hauer [this message]
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=20111109093147.GZ16886@pengutronix.de \
--to=s.hauer-bicnvbalz9megne8c9+irq@public.gmane.org \
--cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
--cc=grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org \
--cc=kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.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).