devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Turquette <mturquette@linaro.org>
To: Tero Kristo <t-kristo@ti.com>,
	linux-omap@vger.kernel.org, paul@pwsan.com, tony@atomide.com,
	rnayak@ti.com, nm@ti.com
Cc: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org
Subject: Re: [PATCHv6 01/45] CLK: TI: Add DPLL clock support
Date: Tue, 10 Sep 2013 15:09:08 -0700	[thread overview]
Message-ID: <20130910220908.11074.36005@quantum> (raw)
In-Reply-To: <1377782197-10611-2-git-send-email-t-kristo@ti.com>

Quoting Tero Kristo (2013-08-29 06:15:53)
> The OMAP clock driver now supports DPLL clock type. This patch also
> adds support for DT DPLL nodes.
> 
> Signed-off-by: Tero Kristo <t-kristo@ti.com>

Tero,

Overall this patch is really great. Some minor comments below.

> diff --git a/Documentation/devicetree/bindings/clock/ti/dpll.txt b/Documentation/devicetree/bindings/clock/ti/dpll.txt
> new file mode 100644
> index 0000000..83c21c6
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/clock/ti/dpll.txt
> @@ -0,0 +1,68 @@
> +Binding for Texas Instruments DPLL clock.
> +
> +This binding uses the common clock binding[1].  It assumes a
> +register-mapped DPLL with usually two selectable input clocks
> +(reference clock and bypass clock), with digital phase locked
> +loop logic for multiplying the input clock to a desired output
> +clock. This clock also typically supports different operation
> +modes (locked, low power stop etc.) This binding has several
> +sub-types, which effectively result in slightly different setup
> +for the actual DPLL clock.
> +
> +[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
> +
> +Required properties:
> +- compatible : shall be one of:
> +               "ti,omap4-dpll-x2-clock",
> +               "ti,omap3-dpll-clock",
> +               "ti,omap3-dpll-core-clock",
> +               "ti,omap3-dpll-per-clock",
> +               "ti,omap3-dpll-per-j-type-clock",
> +               "ti,omap4-dpll-clock",
> +               "ti,omap4-dpll-core-clock",
> +               "ti,omap4-dpll-m4xen-clock",
> +               "ti,omap4-dpll-j-type-clock",
> +               "ti,omap4-dpll-no-gate-clock",
> +               "ti,omap4-dpll-no-gate-j-type-clock",
> +
> +- #clock-cells : from common clock binding; shall be set to 0.
> +- clocks : link phandles of parent clocks, first entry lists reference clock
> +  and second entry bypass clock
> +- reg : address and length of the register set for controlling the DPLL.
> +  It contains the information of registers in the same order as described by
> +  reg-names.
> +- reg-names : array of the register names for controlling the device, sorted
> +  in the same order as the reg property.
> +       "control" - contains the control register base address
> +        "idlest" - contains the idle status register base address
> +        "autoidle" - contains the autoidle register base address
> +        "mult-div1" - contains the multiplier / divider register base address
> +
> +Optional properties:
> +- ti,modes : available modes for the DPLL, bitmask of:
> +  0x02 - DPLL supports low power stop mode
> +  0x20 - DPLL can be put to low power bypass mode
> +  0x80 - DPLL can be put to lock mode (running)

Any particular reason to use a bitmask here versus flags/DT properties?
Something like

Optional properties:
low-power-stop : DPLL supports low power stop mode, gating output
low-power-bypass : DPLL output matches rate of parent bypass clock
lock : DPLL locks in programmed rate

Is there ever a time when a DPLL does not support the locked state? We
can probably remove that from binding entirely.

> +  Other values currently unsupported.
> +- ti,clkdm-name : clockdomain name for the DPLL

What does this mean? I thought that the clockdomain data would not go
into the clock binding?

> diff --git a/drivers/clk/ti/dpll.c b/drivers/clk/ti/dpll.c
> new file mode 100644
> index 0000000..3f4236d
> --- /dev/null
> +++ b/drivers/clk/ti/dpll.c
> @@ -0,0 +1,476 @@
> +/*
> + * OMAP DPLL clock support
> + *
> + * Copyright (C) 2013 Texas Instruments, Inc.
> + *
> + * Tero Kristo <t-kristo@ti.com>
> + *
> + * 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/clk-provider.h>
> +#include <linux/slab.h>
> +#include <linux/err.h>
> +#include <linux/of.h>
> +#include <linux/of_address.h>
> +#include <linux/clk/ti.h>
> +
> +static const struct clk_ops dpll_m4xen_ck_ops = {
> +       .enable         = &omap3_noncore_dpll_enable,
> +       .disable        = &omap3_noncore_dpll_disable,
> +       .recalc_rate    = &omap4_dpll_regm4xen_recalc,
> +       .round_rate     = &omap4_dpll_regm4xen_round_rate,
> +       .set_rate       = &omap3_noncore_dpll_set_rate,
> +       .get_parent     = &omap2_init_dpll_parent,
> +};
> +
> +static const struct clk_ops dpll_core_ck_ops = {
> +       .recalc_rate    = &omap3_dpll_recalc,
> +       .get_parent     = &omap2_init_dpll_parent,
> +};
> +
> +static const struct clk_ops omap3_dpll_core_ck_ops = {
> +       .init           = &omap2_init_clk_clkdm,
> +       .get_parent     = &omap2_init_dpll_parent,
> +       .recalc_rate    = &omap3_dpll_recalc,
> +       .round_rate     = &omap2_dpll_round_rate,
> +};
> +
> +static const struct clk_ops dpll_ck_ops = {
> +       .enable         = &omap3_noncore_dpll_enable,
> +       .disable        = &omap3_noncore_dpll_disable,
> +       .recalc_rate    = &omap3_dpll_recalc,
> +       .round_rate     = &omap2_dpll_round_rate,
> +       .set_rate       = &omap3_noncore_dpll_set_rate,
> +       .get_parent     = &omap2_init_dpll_parent,
> +       .init           = &omap2_init_clk_clkdm,
> +};
> +
> +static const struct clk_ops dpll_no_gate_ck_ops = {
> +       .recalc_rate    = &omap3_dpll_recalc,
> +       .get_parent     = &omap2_init_dpll_parent,
> +       .round_rate     = &omap2_dpll_round_rate,
> +       .set_rate       = &omap3_noncore_dpll_set_rate,
> +};
> +
> +static const struct clk_ops omap3_dpll_ck_ops = {
> +       .init           = &omap2_init_clk_clkdm,
> +       .enable         = &omap3_noncore_dpll_enable,
> +       .disable        = &omap3_noncore_dpll_disable,
> +       .get_parent     = &omap2_init_dpll_parent,
> +       .recalc_rate    = &omap3_dpll_recalc,
> +       .set_rate       = &omap3_noncore_dpll_set_rate,
> +       .round_rate     = &omap2_dpll_round_rate,
> +};
> +
> +static const struct clk_ops omap3_dpll_per_ck_ops = {
> +       .init           = &omap2_init_clk_clkdm,
> +       .enable         = &omap3_noncore_dpll_enable,
> +       .disable        = &omap3_noncore_dpll_disable,
> +       .get_parent     = &omap2_init_dpll_parent,
> +       .recalc_rate    = &omap3_dpll_recalc,
> +       .set_rate       = &omap3_dpll4_set_rate,
> +       .round_rate     = &omap2_dpll_round_rate,
> +};
> +
> +static const struct clk_ops dpll_x2_ck_ops = {
> +       .recalc_rate    = &omap3_clkoutx2_recalc,
> +};

No .set_parent ops for any of the DPLLs? How do you handle bypassing
them? Are you using another mux clock that is the parent of the DPLL, or
just open-coding the bypass stuff?

Regards,
Mike

  reply	other threads:[~2013-09-10 22:09 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-29 13:15 [PATCHv6 00/45] OMAP CCF DT conversion Tero Kristo
2013-08-29 13:15 ` [PATCHv6 01/45] CLK: TI: Add DPLL clock support Tero Kristo
2013-09-10 22:09   ` Mike Turquette [this message]
     [not found]   ` <1377782197-10611-2-git-send-email-t-kristo-l0cyMroinI0@public.gmane.org>
2013-09-17 16:09     ` Tony Lindgren
2013-08-29 13:15 ` [PATCHv6 02/45] CLK: TI: add DT alias clock registration mechanism Tero Kristo
2013-08-29 13:15 ` [PATCHv6 03/45] CLK: TI: add autoidle support Tero Kristo
2013-08-29 13:15 ` [PATCHv6 04/45] CLK: TI: add support for OMAP gate clock Tero Kristo
2013-08-29 13:15 ` [PATCHv6 05/45] CLK: TI: add support for clockdomain binding Tero Kristo
2013-08-29 13:15 ` [PATCHv6 06/45] ARM: dts: omap4 clock data Tero Kristo
2013-08-29 13:15 ` [PATCHv6 07/45] CLK: TI: add omap4 clock init file Tero Kristo
2013-08-29 13:16 ` [PATCHv6 08/45] ARM: OMAP4: remove old clock data and link in new clock init code Tero Kristo
2013-08-29 13:16 ` [PATCHv6 09/45] ARM: dts: omap5 clock data Tero Kristo
2013-08-29 13:16 ` [PATCHv6 10/45] CLK: TI: add omap5 clock init file Tero Kristo
2013-08-29 13:16 ` [PATCHv6 11/45] CLK: TI: omap5: Initialize USB_DPLL at boot Tero Kristo
2013-08-29 13:16 ` [PATCHv6 12/45] ARM: dts: dra7 clock data Tero Kristo
2013-08-29 13:16 ` [PATCHv6 13/45] ARM: dts: clk: Add apll related clocks Tero Kristo
2013-08-29 13:16 ` [PATCHv6 14/45] ARM: dts: DRA7: Change apll_pcie_m2_ck to fixed factor clock Tero Kristo
2013-08-29 13:16 ` [PATCHv6 15/45] ARM: dts: DRA7: Add PCIe related clock nodes Tero Kristo
2013-08-29 13:16 ` [PATCHv6 16/45] CLK: TI: DRA7: Add APLL support Tero Kristo
2013-08-29 13:16 ` [PATCHv6 17/45] CLK: TI: add dra7 clock init file Tero Kristo
2013-08-29 13:16 ` [PATCHv6 18/45] CLK: DT: add support for set-rate-parent flag Tero Kristo
2013-08-29 13:16 ` [PATCHv6 19/45] ARM: dts: am33xx clock data Tero Kristo
2013-08-29 13:16 ` [PATCHv6 20/45] CLK: TI: add am33xx clock init file Tero Kristo
2013-08-29 13:16 ` [PATCHv6 21/45] ARM: AM33xx: remove old clock data and link in new clock init code Tero Kristo
2013-08-29 13:16 ` [PATCHv6 22/45] CLK: TI: add interface clock support for OMAP3 Tero Kristo
2013-08-29 13:16 ` [PATCHv6 23/45] ARM: OMAP: hwmod: fix an incorrect clk type cast with _get_clkdm Tero Kristo
2013-08-29 13:16 ` [PATCHv6 24/45] ARM: OMAP3: hwmod: initialize clkdm from clkdm_name Tero Kristo
2013-08-29 13:16 ` [PATCHv6 25/45] ARM: dts: omap3 clock data Tero Kristo
2013-08-29 13:16 ` [PATCHv6 26/45] CLK: TI: add omap3 clock init file Tero Kristo
2013-08-29 13:16 ` [PATCHv6 27/45] ARM: dts: AM35xx clock data Tero Kristo
2013-08-29 13:16 ` [PATCHv6 28/45] ARM: dts: AM35xx: use DT " Tero Kristo
2013-08-29 13:16 ` [PATCHv6 29/45] ARM: OMAP3: use DT clock init if DT data is available Tero Kristo
2013-08-29 13:16 ` [PATCHv6 30/45] ARM: dts: am43xx clock data Tero Kristo
2013-08-29 13:16 ` [PATCHv6 31/45] ARM: OMAP2+: Add support to parse 'main_clk' info from DT Tero Kristo
2013-08-29 13:16 ` [PATCHv6 32/45] ARM: OMAP2+: Add support to parse optional clk " Tero Kristo
2013-08-29 13:16 ` [PATCHv6 33/45] ARM: OMAP2+: hwmod: fix opt_clk handling with DT Tero Kristo
2013-08-29 13:16 ` [PATCHv6 34/45] ARM: OMAP2+: timer: fix boot crash with DT only boot and DT clocks Tero Kristo
2013-08-29 13:16 ` [PATCHv6 35/45] ARM: OMAP4: dts: Add main and optional clock data into DT Tero Kristo
2013-08-29 13:16 ` [PATCHv6 36/45] ARM: dts: omap3: " Tero Kristo
2013-08-29 13:16 ` [PATCHv6 37/45] ARM: OMAP3: hwmod_data: remove main and optional clock info from hwmod Tero Kristo
2013-08-29 13:16 ` [PATCHv6 38/45] ARM: OMAP2+: omap_device: use dev pointer to optimize code Tero Kristo
2013-08-29 13:16 ` [PATCHv6 39/45] ARM: OMAP2+: omap_device: no need to add a clock dev for aliases Tero Kristo
2013-08-29 13:16 ` [PATCHv6 40/45] ARM: OMAP2+: omap_device: use dt aware clk_get to lookup clk Tero Kristo
2013-08-29 13:16 ` [PATCHv6 41/45] ARM: dts: omap5: Add main and optional clock data into DT Tero Kristo
2013-08-29 13:16 ` [PATCHv6 42/45] ARM: dts: am335x: " Tero Kristo
2013-08-29 13:16 ` [PATCHv6 43/45] ARM: dts: DRA7: link in clock DT data Tero Kristo
2013-08-29 13:16 ` [PATCHv6 44/45] ARM: OMAP: DRA7: Enable clock init Tero Kristo
2013-08-29 13:16 ` [PATCHv6 45/45] ARM: dts: dra7: Add main and optional clock data into DT Tero Kristo

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=20130910220908.11074.36005@quantum \
    --to=mturquette@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=paul@pwsan.com \
    --cc=rnayak@ti.com \
    --cc=t-kristo@ti.com \
    --cc=tony@atomide.com \
    /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).