From: Abel Vesa <abel.vesa@nxp.com>
To: Jacky Bai <ping.bai@nxp.com>
Cc: shawnguo@kernel.org, robh+dt@kernel.org, sboyd@kernel.org,
s.hauer@pengutronix.de, p.zabel@pengutronix.de,
kernel@pengutronix.de, linux-imx@nxp.com,
devicetree@vger.kernel.org
Subject: Re: [PATCH v3 7/9] clk: imx: Update the pfdv2 for 8ulp specific support
Date: Tue, 14 Sep 2021 14:35:36 +0300 [thread overview]
Message-ID: <YUCJCCUomffNm/cf@ryzen> (raw)
In-Reply-To: <20210914065208.3582128-8-ping.bai@nxp.com>
On 21-09-14 14:52:06, Jacky Bai wrote:
> On i.MX8ULP, the 'CLK_SET_RATE_PARENT' flag should NOT be
> set and according to the laest RM, the PFD divider value range
> seems will be changed in the future, so update the pfdv2 to
> include the specific support for i.MX8ULP.
>
> Signed-off-by: Jacky Bai <ping.bai@nxp.com>
Reviewed-by: Abel Vesa <abel.vesa@nxp.com>
> ---
> v3 changs: no
> ---
> drivers/clk/imx/clk-imx7ulp.c | 16 ++++++++--------
> drivers/clk/imx/clk-pfdv2.c | 9 ++++++---
> drivers/clk/imx/clk.h | 9 +++++++--
> 3 files changed, 21 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/clk/imx/clk-imx7ulp.c b/drivers/clk/imx/clk-imx7ulp.c
> index ba50d6db8097..b6e45e77ee39 100644
> --- a/drivers/clk/imx/clk-imx7ulp.c
> +++ b/drivers/clk/imx/clk-imx7ulp.c
> @@ -82,16 +82,16 @@ static void __init imx7ulp_clk_scg1_init(struct device_node *np)
> hws[IMX7ULP_CLK_SPLL] = imx_clk_hw_pllv4(IMX_PLLV4_IMX7ULP, "spll", "spll_pre_div", base + 0x600);
>
> /* APLL PFDs */
> - hws[IMX7ULP_CLK_APLL_PFD0] = imx_clk_hw_pfdv2("apll_pfd0", "apll", base + 0x50c, 0);
> - hws[IMX7ULP_CLK_APLL_PFD1] = imx_clk_hw_pfdv2("apll_pfd1", "apll", base + 0x50c, 1);
> - hws[IMX7ULP_CLK_APLL_PFD2] = imx_clk_hw_pfdv2("apll_pfd2", "apll", base + 0x50c, 2);
> - hws[IMX7ULP_CLK_APLL_PFD3] = imx_clk_hw_pfdv2("apll_pfd3", "apll", base + 0x50c, 3);
> + hws[IMX7ULP_CLK_APLL_PFD0] = imx_clk_hw_pfdv2(IMX_PFDV2_IMX7ULP, "apll_pfd0", "apll", base + 0x50c, 0);
> + hws[IMX7ULP_CLK_APLL_PFD1] = imx_clk_hw_pfdv2(IMX_PFDV2_IMX7ULP, "apll_pfd1", "apll", base + 0x50c, 1);
> + hws[IMX7ULP_CLK_APLL_PFD2] = imx_clk_hw_pfdv2(IMX_PFDV2_IMX7ULP, "apll_pfd2", "apll", base + 0x50c, 2);
> + hws[IMX7ULP_CLK_APLL_PFD3] = imx_clk_hw_pfdv2(IMX_PFDV2_IMX7ULP, "apll_pfd3", "apll", base + 0x50c, 3);
>
> /* SPLL PFDs */
> - hws[IMX7ULP_CLK_SPLL_PFD0] = imx_clk_hw_pfdv2("spll_pfd0", "spll", base + 0x60C, 0);
> - hws[IMX7ULP_CLK_SPLL_PFD1] = imx_clk_hw_pfdv2("spll_pfd1", "spll", base + 0x60C, 1);
> - hws[IMX7ULP_CLK_SPLL_PFD2] = imx_clk_hw_pfdv2("spll_pfd2", "spll", base + 0x60C, 2);
> - hws[IMX7ULP_CLK_SPLL_PFD3] = imx_clk_hw_pfdv2("spll_pfd3", "spll", base + 0x60C, 3);
> + hws[IMX7ULP_CLK_SPLL_PFD0] = imx_clk_hw_pfdv2(IMX_PFDV2_IMX7ULP, "spll_pfd0", "spll", base + 0x60C, 0);
> + hws[IMX7ULP_CLK_SPLL_PFD1] = imx_clk_hw_pfdv2(IMX_PFDV2_IMX7ULP, "spll_pfd1", "spll", base + 0x60C, 1);
> + hws[IMX7ULP_CLK_SPLL_PFD2] = imx_clk_hw_pfdv2(IMX_PFDV2_IMX7ULP, "spll_pfd2", "spll", base + 0x60C, 2);
> + hws[IMX7ULP_CLK_SPLL_PFD3] = imx_clk_hw_pfdv2(IMX_PFDV2_IMX7ULP, "spll_pfd3", "spll", base + 0x60C, 3);
>
> /* PLL Mux */
> hws[IMX7ULP_CLK_APLL_PFD_SEL] = imx_clk_hw_mux_flags("apll_pfd_sel", base + 0x508, 14, 2, apll_pfd_sels, ARRAY_SIZE(apll_pfd_sels), CLK_SET_RATE_PARENT | CLK_SET_PARENT_GATE);
> diff --git a/drivers/clk/imx/clk-pfdv2.c b/drivers/clk/imx/clk-pfdv2.c
> index 9cba83521988..42505669cdfb 100644
> --- a/drivers/clk/imx/clk-pfdv2.c
> +++ b/drivers/clk/imx/clk-pfdv2.c
> @@ -200,8 +200,8 @@ static const struct clk_ops clk_pfdv2_ops = {
> .is_enabled = clk_pfdv2_is_enabled,
> };
>
> -struct clk_hw *imx_clk_hw_pfdv2(const char *name, const char *parent_name,
> - void __iomem *reg, u8 idx)
> +struct clk_hw *imx_clk_hw_pfdv2(enum imx_pfdv2_type type, const char *name,
> + const char *parent_name, void __iomem *reg, u8 idx)
> {
> struct clk_init_data init;
> struct clk_pfdv2 *pfd;
> @@ -223,7 +223,10 @@ struct clk_hw *imx_clk_hw_pfdv2(const char *name, const char *parent_name,
> init.ops = &clk_pfdv2_ops;
> init.parent_names = &parent_name;
> init.num_parents = 1;
> - init.flags = CLK_SET_RATE_GATE | CLK_SET_RATE_PARENT;
> + if (type == IMX_PFDV2_IMX7ULP)
> + init.flags = CLK_SET_RATE_GATE | CLK_SET_RATE_PARENT;
> + else
> + init.flags = CLK_SET_RATE_GATE;
>
> pfd->hw.init = &init;
>
> diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h
> index a9bcfee7a75b..45be7ba23fae 100644
> --- a/drivers/clk/imx/clk.h
> +++ b/drivers/clk/imx/clk.h
> @@ -47,6 +47,11 @@ enum imx_pllv4_type {
> IMX_PLLV4_IMX8ULP,
> };
>
> +enum imx_pfdv2_type {
> + IMX_PFDV2_IMX7ULP,
> + IMX_PFDV2_IMX8ULP,
> +};
> +
> /* NOTE: Rate table should be kept sorted in descending order. */
> struct imx_pll14xx_rate_table {
> unsigned int rate;
> @@ -220,8 +225,8 @@ struct clk_hw *imx_clk_hw_gate_exclusive(const char *name, const char *parent,
> struct clk_hw *imx_clk_hw_pfd(const char *name, const char *parent_name,
> void __iomem *reg, u8 idx);
>
> -struct clk_hw *imx_clk_hw_pfdv2(const char *name, const char *parent_name,
> - void __iomem *reg, u8 idx);
> +struct clk_hw *imx_clk_hw_pfdv2(enum imx_pfdv2_type type, const char *name,
> + const char *parent_name, void __iomem *reg, u8 idx);
>
> struct clk_hw *imx_clk_hw_busy_divider(const char *name, const char *parent_name,
> void __iomem *reg, u8 shift, u8 width,
> --
> 2.26.2
>
next prev parent reply other threads:[~2021-09-14 11:35 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-14 6:51 [PATCH v3 0/9] Add imx8ulp clock & reset driver support Jacky Bai
2021-09-14 6:52 ` [PATCH v3 1/9] dt-bindings: clock: Add imx8ulp clock support Jacky Bai
2021-09-14 11:25 ` Abel Vesa
2021-09-14 13:11 ` Jacky Bai
2021-09-14 15:30 ` Abel Vesa
2021-09-20 21:44 ` Rob Herring
2021-09-14 6:52 ` [PATCH v3 2/9] clk: imx: Update the pllv4 to support imx8ulp Jacky Bai
2021-09-14 11:29 ` Abel Vesa
2021-09-14 6:52 ` [PATCH v3 3/9] clk: imx: Update the compsite driver " Jacky Bai
2021-09-14 11:30 ` Abel Vesa
2021-09-14 6:52 ` [PATCH v3 4/9] clk: imx: disable i.mx7ulp composite clock during initialization Jacky Bai
2021-09-14 11:32 ` Abel Vesa
2021-09-14 6:52 ` [PATCH v3 5/9] clk: imx: Add 'CLK_SET_RATE_NO_REPARENT' for composite-7ulp Jacky Bai
2021-09-14 11:33 ` Abel Vesa
2021-09-14 6:52 ` [PATCH v3 6/9] clk: imx: disable the pfd when set pfdv2 clock rate Jacky Bai
2021-09-14 11:34 ` Abel Vesa
2021-09-14 6:52 ` [PATCH v3 7/9] clk: imx: Update the pfdv2 for 8ulp specific support Jacky Bai
2021-09-14 11:35 ` Abel Vesa [this message]
2021-09-14 6:52 ` [PATCH v3 8/9] clk: imx: Add clock driver for imx8ulp Jacky Bai
2021-09-14 11:55 ` Abel Vesa
2021-09-14 6:52 ` [PATCH v3 9/9] clk: imx: Add the pcc reset controller support on imx8ulp Jacky Bai
2021-09-14 12:09 ` Abel Vesa
2021-09-14 13:07 ` Jacky Bai
2021-09-14 15:19 ` Abel Vesa
2021-09-14 11:17 ` [PATCH v3 0/9] Add imx8ulp clock & reset driver support Abel Vesa
2021-09-16 6:46 ` Abel Vesa
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=YUCJCCUomffNm/cf@ryzen \
--to=abel.vesa@nxp.com \
--cc=devicetree@vger.kernel.org \
--cc=kernel@pengutronix.de \
--cc=linux-imx@nxp.com \
--cc=p.zabel@pengutronix.de \
--cc=ping.bai@nxp.com \
--cc=robh+dt@kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=sboyd@kernel.org \
--cc=shawnguo@kernel.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).