From: Jolly Shah <JOLLYS@xilinx.com>
To: Stephen Boyd <sboyd@kernel.org>,
"ard.biesheuvel@linaro.org" <ard.biesheuvel@linaro.org>,
"dmitry.torokhov@gmail.com" <dmitry.torokhov@gmail.com>,
"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
"hkallweit1@gmail.com" <hkallweit1@gmail.com>,
"keescook@chromium.org" <keescook@chromium.org>,
"linux-clk@vger.kernel.org" <linux-clk@vger.kernel.org>,
"mark.rutland@arm.com" <mark.rutland@arm.com>,
"matt@codeblueprint.co.uk" <matt@codeblueprint.co.uk>,
Michal Simek <michals@xilinx.com>,
"mingo@kernel.org" <mingo@kernel.org>,
"mturquette@baylibre.com" <mturquette@baylibre.com>,
"robh+dt@kernel.org" <robh+dt@kernel.org>,
"sboyd@codeaurora.org" <sboyd@codeaurora.org>,
"sudeep.holla@arm.com" <sudeep.holla@arm.com>
Cc: Rajan Vaja <RAJANV@xilinx.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
Tejas Patel <TEJASP@xilinx.com>,
Shubhrajyoti Datta <shubhraj@xilinx.com>
Subject: RE: [PATCH v9 10/10] drivers: clk: Add ZynqMP clock driver
Date: Tue, 17 Jul 2018 20:09:01 +0000 [thread overview]
Message-ID: <SN1PR02MB37589FF7DBAFBD0C070F690EB85C0@SN1PR02MB3758.namprd02.prod.outlook.com> (raw)
In-Reply-To: <153111401693.143105.16925315512459949259@swboyd.mtv.corp.google.com>
Hi Stephen,
Thanks for the review,
> -----Original Message-----
> From: Stephen Boyd [mailto:sboyd@kernel.org]
> Sent: Sunday, July 08, 2018 10:27 PM
> To: Jolly Shah <JOLLYS@xilinx.com>; ard.biesheuvel@linaro.org;
> dmitry.torokhov@gmail.com; gregkh@linuxfoundation.org;
> hkallweit1@gmail.com; keescook@chromium.org; linux-clk@vger.kernel.org;
> mark.rutland@arm.com; matt@codeblueprint.co.uk; Michal Simek
> <michals@xilinx.com>; mingo@kernel.org; mturquette@baylibre.com;
> robh+dt@kernel.org; sboyd@codeaurora.org; sudeep.holla@arm.com
> Cc: Rajan Vaja <RAJANV@xilinx.com>; linux-arm-kernel@lists.infradead.org;
> linux-kernel@vger.kernel.org; devicetree@vger.kernel.org; Jolly Shah
> <JOLLYS@xilinx.com>; Tejas Patel <TEJASP@xilinx.com>; Shubhrajyoti Datta
> <shubhraj@xilinx.com>; Jolly Shah <JOLLYS@xilinx.com>
> Subject: Re: [PATCH v9 10/10] drivers: clk: Add ZynqMP clock driver
>
> > +/**
> > + * zynqmp_pm_clock_get_parents() - Get the first 3 parents of clock for given
> id
> > + * @clock_id: Clock ID
> > + * @index: Parent index
> > + * @parents: 3 parents of the given clock
> > + *
> > + * This function is used to get 3 parents for the clock specified by
> > + * given clock ID.
> > + *
> > + * This API will return 3 parents with a single response. To get
> > + * other parents, master should call same API in loop with new
> > + * parent index till error is returned. E.g First call should have
> > + * index 0 which will return parents 0,1 and 2. Next call, index
> > + * should be 3 which will return parent 3,4 and 5 and so on.
> > + *
> > + * Return: Returns status, either success or error+reason
> > + */
> > +static int zynqmp_pm_clock_get_parents(u32 clock_id, u32 index, u32
> *parents)
> > +{
> > + struct zynqmp_pm_query_data qdata = {0};
> > + u32 ret_payload[PAYLOAD_ARG_CNT];
>
> What's the endianness of this payload? Is it little endian? Or do the
> eemi_ops convert to CPU native endianness?
Its little endian
> > +
> > +/**
> > + * zynqmp_clock_init() - Initialize zynqmp clocks
> > + *
> > + * Return: 0 on success else error code
> > + */
> > +static int __init zynqmp_clock_init(void)
> > +{
> > + int ret;
> > + struct device_node *np;
> > +
> > + np = of_find_compatible_node(NULL, NULL, "xlnx,zynqmp");
> > + if (!np)
> > + return -ENOENT;
> > + of_node_put(np);
> > +
> > + np = of_find_compatible_node(NULL, NULL, "xlnx,zynqmp-clk");
>
> Why can't this be a platform device driver?
Platform driver may probe later(an actually probing later in our case). This will results in clock get failure in clock consumer peripherals. So clock registration needs to be done earlier.
>
> > + m = rate_div / FRAC_DIV;
> > + f = rate_div % FRAC_DIV;
> > + m = clamp_t(u32, m, (PLL_FBDIV_MIN), (PLL_FBDIV_MAX));
> > + rate = parent_rate * m;
> > + frac = (parent_rate * f) / FRAC_DIV;
> > +
> > + ret = eemi_ops->clock_setdivider(clk_id, m);
> > + if (ret)
> > + pr_warn_once("%s() set divider failed for %s, ret = %d\n",
> > + __func__, clk_name, ret);
> > +
> > + data = (FRAC_DIV * f) / FRAC_DIV;
>
> Feels like there must be some macro for this idiom but I failed to find
> it. round_something()?
It was not needed. Removed in v10.
>
> > + pll->hw.init = &init;
> > + pll->clk_id = clk_id;
> > +
> > + hw = &pll->hw;
> > + ret = clk_hw_register(dev, hw);
> > + if (ret) {
> > + kfree(pll);
> > + return ERR_PTR(ret);
> > + }
> > +
> > + clk_hw_set_rate_range(hw, PS_PLL_VCO_MIN, PS_PLL_VCO_MAX);
>
> Why is this necessary?
This is range of rate supported by hardware for PLL.
>
> > + if (ret < 0)
> > + pr_err("%s:ERROR clk_set_rate_range failed %d\n", name, ret);
> > +
> > + return hw;
> > +}
Rest all comments taken care in v10 series(posted today).
Thanks,
Jolly Shah
next prev parent reply other threads:[~2018-07-17 20:09 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-20 17:40 [PATCH v9 00/10] drivers: Introduce firmware dnd clock river for ZynqMP core Jolly Shah
2018-06-20 17:40 ` [PATCH v9 01/10] dt-bindings: firmware: Add bindings for ZynqMP firmware Jolly Shah
2018-06-20 17:40 ` [PATCH v9 02/10] firmware: xilinx: Add Zynqmp firmware driver Jolly Shah
2018-06-20 17:40 ` [PATCH v9 03/10] firmware: xilinx: Add zynqmp IOCTL API for device control Jolly Shah
2018-06-20 17:40 ` [PATCH v9 04/10] firmware: xilinx: Add query data API Jolly Shah
2018-06-20 17:40 ` [PATCH v9 05/10] firmware: xilinx: Add clock APIs Jolly Shah
2018-07-09 5:31 ` Stephen Boyd
2018-06-20 17:40 ` [PATCH v9 06/10] firmware: xilinx: Add debugfs interface Jolly Shah
2018-06-20 17:40 ` [PATCH v9 07/10] firmware: xilinx: Add debugfs for IOCTL API Jolly Shah
2018-07-09 5:29 ` Stephen Boyd
2018-07-17 20:01 ` Jolly Shah
2018-06-20 17:40 ` [PATCH v9 08/10] firmware: xilinx: Add debugfs for query data API Jolly Shah
2018-06-20 17:40 ` [PATCH v9 09/10] dt-bindings: clock: Add bindings for ZynqMP clock driver Jolly Shah
2018-07-09 5:27 ` Stephen Boyd
2018-06-20 17:40 ` [PATCH v9 10/10] drivers: clk: Add " Jolly Shah
2018-07-09 5:26 ` Stephen Boyd
2018-07-17 20:09 ` Jolly Shah [this message]
2018-07-25 19:48 ` Stephen Boyd
2018-08-03 17:57 ` Jolly Shah
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=SN1PR02MB37589FF7DBAFBD0C070F690EB85C0@SN1PR02MB3758.namprd02.prod.outlook.com \
--to=jollys@xilinx.com \
--cc=RAJANV@xilinx.com \
--cc=TEJASP@xilinx.com \
--cc=ard.biesheuvel@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=hkallweit1@gmail.com \
--cc=keescook@chromium.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=matt@codeblueprint.co.uk \
--cc=michals@xilinx.com \
--cc=mingo@kernel.org \
--cc=mturquette@baylibre.com \
--cc=robh+dt@kernel.org \
--cc=sboyd@codeaurora.org \
--cc=sboyd@kernel.org \
--cc=shubhraj@xilinx.com \
--cc=sudeep.holla@arm.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
all inboxes | Powered by JetHome®