public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Varadarajan Narayanan <varadarajan.narayanan@oss.qualcomm.com>
To: Simon Glass <sjg@chromium.org>
Cc: rayagonda.kokatanur@broadcom.com, trini@konsulko.com,
	casey.connolly@linaro.org, neil.armstrong@linaro.org,
	sumit.garg@kernel.org, peng.fan@nxp.com, jh80.chung@samsung.com,
	lukma@denx.de, tien.fong.chee@altera.com,
	tingting.meng@altera.com, anshuld@ti.com,
	alif.zakuan.yuslaimi@altera.com, alice.guo@nxp.com,
	quentin.schulz@cherry.de, ilias.apalodimas@linaro.org,
	mkorpershoek@kernel.org, h-salunke@ti.com, alchark@gmail.com,
	dario.binacchi@amarulasolutions.com, ye.li@nxp.com,
	andre.przywara@arm.com, dinesh.maniyam@altera.com,
	luca.weiss@fairphone.com, danila@jiaxyga.com,
	aswin.murugan@oss.qualcomm.com,
	balaji.selvanathan@oss.qualcomm.com, adrian@mainlining.org,
	n-francis@ti.com, wens@kernel.org, jamie.gibbons@microchip.com,
	justin@tidylabs.net, ycliang@andestech.com,
	david.wronek@mainlining.org, james.hilliard1@gmail.com,
	richard.genoud@bootlin.com, michael@amarulasolutions.com,
	philip.molloy@analog.com, sughosh.ganu@arm.com,
	u-boot@lists.denx.de, u-boot-qcom@groups.io
Subject: Re: [PATCH v3 02/10] clk/qcom: add initial clock driver for ipq5210
Date: Mon, 20 Apr 2026 12:10:38 +0530	[thread overview]
Message-ID: <aeXKZvVE6ViBz0Az@hu-varada-blr.qualcomm.com> (raw)
In-Reply-To: <CAFLszTj=iQO73XC8+d83Um8sw-QPd0ceTDLN6zU53GDD8B3aSQ@mail.gmail.com>

On Fri, Apr 17, 2026 at 08:52:10AM +1200, Simon Glass wrote:
> Hi Varadarajan,
>
> On 2026-04-16T05:39:18, Varadarajan Narayanan
> <varadarajan.narayanan@oss.qualcomm.com> wrote:
> > clk/qcom: add initial clock driver for ipq5210
> >
> > Add initial set of clocks and resets for enabling U-Boot on ipq5210
> > based RDP platforms.
> >
> > Signed-off-by: Varadarajan Narayanan <varadarajan.narayanan@oss.qualcomm.com>
> >
> > drivers/clk/qcom/Kconfig         |  8 ++++
> >  drivers/clk/qcom/Makefile        |  1 +
> >  drivers/clk/qcom/clock-ipq5210.c | 97 ++++++++++++++++++++++++++++++++++++++++
> >  3 files changed, 106 insertions(+)
>
> > +#include <dm/device-internal.h>
>
> Is this needed?

Will remove.

> > +static ulong ipq5210_set_rate(struct clk *clk, ulong rate)
> > +{
> > +     struct msm_clk_priv *priv = dev_get_priv(clk->dev);
> > +
> > +     switch (clk->id) {
> > +     case GCC_QUPV3_WRAP_SE1_CLK:
> > +             clk_rcg_set_rate_mnd(priv->base, priv->data->clks[clk->id].cbcr_reg,
>
> cbcr_reg is a bit confusing since that name suggests a CBCR register -
> see the ipq5424 driver which uses 'reg'. What do you think about using
> reg consistently, or maybe add a comment explaining this?

ipq5424 used GATE_CLK (defined in drivers/clk/qcom/clock-qcom.h).
That has been deprecated and ipq5210 uses GATE_CLK_POLLED. Hence
the difference.

> > +static int ipq5210_enable(struct clk *clk)
> > +{
> > +     struct msm_clk_priv *priv = dev_get_priv(clk->dev);
> > +
> > +     if (priv->data->num_clks <= clk->id) {
> > +             debug("%s: unknown clk id %lu\n", __func__, clk->id);
> > +             return 0;
> > +     }
>
> Shouldn't the comparison be <  ?

No, this check is right. The clock id defines range from zero to the
highest_id. So num_clks will get set to highest_id + 1. So a clock id of
highest_id + 1 is invalid.

> Also, should return an error, not 0.

Ok.

> > +     qcom_gate_clk_en(priv, clk->id);
> > +
> > +     return 0;
>
> Should return any error from qcom_gate_clk_en()

Ok.

Thanks
Varada

  reply	other threads:[~2026-04-20  7:45 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-16  5:39 [PATCH v3 00/10] Qualcomm IPQ5210 SoC bringup Varadarajan Narayanan
2026-04-16  5:39 ` [PATCH v3 01/10] dts: ipq5210-rdp504-u-boot: add override dtsi Varadarajan Narayanan
2026-04-16  5:39 ` [PATCH v3 02/10] clk/qcom: add initial clock driver for ipq5210 Varadarajan Narayanan
2026-04-16 20:52   ` Simon Glass
2026-04-20  6:40     ` Varadarajan Narayanan [this message]
2026-04-16  5:39 ` [PATCH v3 03/10] pinctrl: qcom: Add ipq5210 pinctrl driver Varadarajan Narayanan
2026-04-16 20:53   ` Simon Glass
2026-04-16  5:39 ` [PATCH v3 04/10] misc: qcom_geni: Add minicore support Varadarajan Narayanan
2026-04-16 20:53   ` Simon Glass
2026-04-16  5:39 ` [PATCH v3 05/10] spl: Include SMEM driver in SPL Varadarajan Narayanan
2026-04-16  5:39 ` [PATCH v3 06/10] mach-snapdragon: Add initial support for IPQ5210 SPL Varadarajan Narayanan
2026-04-16 20:53   ` Simon Glass
2026-04-17  4:22   ` Balaji Selvanathan
2026-04-16  5:39 ` [PATCH v3 07/10] mach-snapdragon: spl: Update SMEM with boot details Varadarajan Narayanan
2026-04-16 20:54   ` Simon Glass
2026-04-16  5:39 ` [PATCH v3 08/10] mach-snapdragon: Add commands to create wrapper ELF Varadarajan Narayanan
2026-04-16 20:54   ` Simon Glass
2026-04-16  5:39 ` [PATCH v3 09/10] configs: add qcom_ipq5210_mmc_defconfig Varadarajan Narayanan
2026-04-16  5:39 ` [PATCH v3 10/10] doc: board/qualcomm: Update RDP build instructions Varadarajan Narayanan
2026-04-16 20:54   ` Simon Glass

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=aeXKZvVE6ViBz0Az@hu-varada-blr.qualcomm.com \
    --to=varadarajan.narayanan@oss.qualcomm.com \
    --cc=adrian@mainlining.org \
    --cc=alchark@gmail.com \
    --cc=alice.guo@nxp.com \
    --cc=alif.zakuan.yuslaimi@altera.com \
    --cc=andre.przywara@arm.com \
    --cc=anshuld@ti.com \
    --cc=aswin.murugan@oss.qualcomm.com \
    --cc=balaji.selvanathan@oss.qualcomm.com \
    --cc=casey.connolly@linaro.org \
    --cc=danila@jiaxyga.com \
    --cc=dario.binacchi@amarulasolutions.com \
    --cc=david.wronek@mainlining.org \
    --cc=dinesh.maniyam@altera.com \
    --cc=h-salunke@ti.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=james.hilliard1@gmail.com \
    --cc=jamie.gibbons@microchip.com \
    --cc=jh80.chung@samsung.com \
    --cc=justin@tidylabs.net \
    --cc=luca.weiss@fairphone.com \
    --cc=lukma@denx.de \
    --cc=michael@amarulasolutions.com \
    --cc=mkorpershoek@kernel.org \
    --cc=n-francis@ti.com \
    --cc=neil.armstrong@linaro.org \
    --cc=peng.fan@nxp.com \
    --cc=philip.molloy@analog.com \
    --cc=quentin.schulz@cherry.de \
    --cc=rayagonda.kokatanur@broadcom.com \
    --cc=richard.genoud@bootlin.com \
    --cc=sjg@chromium.org \
    --cc=sughosh.ganu@arm.com \
    --cc=sumit.garg@kernel.org \
    --cc=tien.fong.chee@altera.com \
    --cc=tingting.meng@altera.com \
    --cc=trini@konsulko.com \
    --cc=u-boot-qcom@groups.io \
    --cc=u-boot@lists.denx.de \
    --cc=wens@kernel.org \
    --cc=ycliang@andestech.com \
    --cc=ye.li@nxp.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