netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@kernel.org>
To: Matthew Gerlach <matthew.gerlach@altera.com>,
	dinguyen@kernel.org, linux-clk@vger.kernel.org,
	linux-kernel@vger.kernel.org, mturquette@baylibre.com,
	netdev@vger.kernel.org, richardcochran@gmail.com
Cc: Niravkumar L Rabara <niravkumar.l.rabara@intel.com>,
	Teh Wen Ping <wen.ping.teh@intel.com>,
	Matthew Gerlach <matthew.gerlach@altera.com>
Subject: Re: [PATCH v4 RESEND] clk: socfpga: agilex: add support for the Intel Agilex5
Date: Tue, 06 May 2025 13:52:53 -0700	[thread overview]
Message-ID: <1f9856930efce8b52f3abbc17fb4d3ca@kernel.org> (raw)
In-Reply-To: <20250417145238.31657-1-matthew.gerlach@altera.com>

Quoting Matthew Gerlach (2025-04-17 07:52:38)
> From: Niravkumar L Rabara <niravkumar.l.rabara@intel.com>
> 
> Add support for Intel's SoCFPGA Agilex5 platform. The clock manager
> driver for the Agilex5 is very similar to the Agilex platform, so
> it is reusing most of the Agilex clock driver code.
> 
> Signed-off-by: Teh Wen Ping <wen.ping.teh@intel.com>
> Reviewed-by: Dinh Nguyen <dinguyen@kernel.org>
> Signed-off-by: Niravkumar L Rabara <niravkumar.l.rabara@intel.com>
> Signed-off-by: Matthew Gerlach <matthew.gerlach@altera.com>
> ---
> Changes in v4:
> - Add .index to clk_parent_data.

It's useful to link to the previous round with lore links. Please do it
next time.

> 
> Changes in v3:
> - Used different name for stratix10_clock_data pointer.
> - Used a single function call, devm_platform_ioremap_resource().
> - Used only .name in clk_parent_data.
> 
> Stephen suggested to use .fw_name or .index, But since the changes are on top
> of existing driver and current driver code is not using clk_hw and removing
> .name and using .fw_name and/or .index resulting in parent clock_rate &
> recalc_rate to 0.
> 
> diff --git a/drivers/clk/socfpga/clk-agilex.c b/drivers/clk/socfpga/clk-agilex.c
> index 8dd94f64756b..a5ed2a22426e 100644
> --- a/drivers/clk/socfpga/clk-agilex.c
> +++ b/drivers/clk/socfpga/clk-agilex.c
> @@ -334,6 +336,375 @@ static const struct stratix10_gate_clock agilex_gate_clks[] = {
>           10, 0, 0, 0, 0, 0, 4},
>  };
>  
> +static const struct clk_parent_data agilex5_pll_mux[] = {
> +       { .name = "osc1", .index = AGILEX5_OSC1, },
> +       { .name = "cb-intosc-hs-div2-clk", .index = AGILEX5_CB_INTOSC_HS_DIV2_CLK, },
> +       { .name = "f2s-free-clk", .index = AGILEX5_F2S_FREE_CLK, },
> +};
> +
> +static const struct clk_parent_data agilex5_boot_mux[] = {
> +       { .name = "osc1", .index = AGILEX5_OSC1, },
> +       { .name = "cb-intosc-hs-div2-clk", .index = AGILEX5_CB_INTOSC_HS_DIV2_CLK, },
> +};
> +
> +static const struct clk_parent_data agilex5_core0_free_mux[] = {
> +       { .name = "main_pll_c1", .index = AGILEX5_MAIN_PLL_C1_CLK, },
> +       { .name = "peri_pll_c0", .index = AGILEX5_MAIN_PLL_C0_CLK, },

The index doesn't work this way. The number indicates which index in the
DT node's 'clocks' property to use as the parent. It doesn't indicate
which index in this clk provider to use. I don't see any 'clocks'
property in the binding for this compatible "intel,agilex5-clkmgr", so
this doesn't make any sense either.

If you can't use clk_hw pointers then just stick to the old way of doing
it with string names and no struct clk_parent_data usage.

> +       { .name = "osc1", .index = AGILEX5_OSC1, },
> +       { .name = "cb-intosc-hs-div2-clk", .index = AGILEX5_CB_INTOSC_HS_DIV2_CLK, },
> +       { .name = "f2s-free-clk", .index = AGILEX5_F2S_FREE_CLK, },
> +};
> +

  parent reply	other threads:[~2025-05-06 20:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-17 14:52 [PATCH v4 RESEND] clk: socfpga: agilex: add support for the Intel Agilex5 Matthew Gerlach
2025-05-04 21:34 ` Gerlach, Matthew
2025-05-04 22:16   ` Dinh Nguyen
2025-05-06 20:52 ` Stephen Boyd [this message]
2025-05-08 22:10   ` Matthew Gerlach

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=1f9856930efce8b52f3abbc17fb4d3ca@kernel.org \
    --to=sboyd@kernel.org \
    --cc=dinguyen@kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthew.gerlach@altera.com \
    --cc=mturquette@baylibre.com \
    --cc=netdev@vger.kernel.org \
    --cc=niravkumar.l.rabara@intel.com \
    --cc=richardcochran@gmail.com \
    --cc=wen.ping.teh@intel.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).