public inbox for linux-clk@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/1] clk: tegra: set up proper EMC clock implementation for Tegra114
@ 2026-01-26 18:58 Svyatoslav Ryhel
  2026-01-26 18:58 ` [PATCH v1 1/1] " Svyatoslav Ryhel
  2026-03-02  7:50 ` [PATCH v1 0/1] " Svyatoslav Ryhel
  0 siblings, 2 replies; 4+ messages in thread
From: Svyatoslav Ryhel @ 2026-01-26 18:58 UTC (permalink / raw)
  To: Peter De Schrijver, Prashant Gaikwad, Michael Turquette,
	Stephen Boyd, Thierry Reding, Jonathan Hunter, Mikko Perttunen,
	Svyatoslav Ryhel
  Cc: linux-clk, linux-tegra, linux-kernel

Remove current emc and emc_mux clocks and replace them with the proper EMC
clock implementation for correct EMC driver support.

Part of previous patchset: https://lore.kernel.org/lkml/20251125120559.158860-1-clamor95@gmail.com/

Svyatoslav Ryhel (1):
  clk: tegra: set up proper EMC clock implementation for Tegra114

 drivers/clk/tegra/clk-tegra114.c | 39 ++++++++++++++++++++------------
 1 file changed, 25 insertions(+), 14 deletions(-)

-- 
2.51.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v1 1/1] clk: tegra: set up proper EMC clock implementation for Tegra114
  2026-01-26 18:58 [PATCH v1 0/1] clk: tegra: set up proper EMC clock implementation for Tegra114 Svyatoslav Ryhel
@ 2026-01-26 18:58 ` Svyatoslav Ryhel
  2026-03-27 15:10   ` Thierry Reding
  2026-03-02  7:50 ` [PATCH v1 0/1] " Svyatoslav Ryhel
  1 sibling, 1 reply; 4+ messages in thread
From: Svyatoslav Ryhel @ 2026-01-26 18:58 UTC (permalink / raw)
  To: Peter De Schrijver, Prashant Gaikwad, Michael Turquette,
	Stephen Boyd, Thierry Reding, Jonathan Hunter, Mikko Perttunen,
	Svyatoslav Ryhel
  Cc: linux-clk, linux-tegra, linux-kernel

Remove current emc and emc_mux clocks and replace them with the proper EMC
clock implementation for correct EMC driver support.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
---
 drivers/clk/tegra/clk-tegra114.c | 39 ++++++++++++++++++++------------
 1 file changed, 25 insertions(+), 14 deletions(-)

diff --git a/drivers/clk/tegra/clk-tegra114.c b/drivers/clk/tegra/clk-tegra114.c
index 8bde72aa5e68..853ef707654a 100644
--- a/drivers/clk/tegra/clk-tegra114.c
+++ b/drivers/clk/tegra/clk-tegra114.c
@@ -622,10 +622,6 @@ static const char *mux_plld_out0_plld2_out0[] = {
 };
 #define mux_plld_out0_plld2_out0_idx NULL
 
-static const char *mux_pllmcp_clkm[] = {
-	"pll_m_out0", "pll_c_out0", "pll_p_out0", "clk_m", "pll_m_ud",
-};
-
 static const struct clk_div_table pll_re_div_table[] = {
 	{ .val = 0, .div = 1 },
 	{ .val = 1, .div = 2 },
@@ -672,7 +668,6 @@ static struct tegra_clk tegra114_clks[tegra_clk_max] __initdata = {
 	[tegra_clk_csi] = { .dt_id = TEGRA114_CLK_CSI, .present = true },
 	[tegra_clk_i2c2] = { .dt_id = TEGRA114_CLK_I2C2, .present = true },
 	[tegra_clk_uartc] = { .dt_id = TEGRA114_CLK_UARTC, .present = true },
-	[tegra_clk_emc] = { .dt_id = TEGRA114_CLK_EMC, .present = true },
 	[tegra_clk_usb2] = { .dt_id = TEGRA114_CLK_USB2, .present = true },
 	[tegra_clk_usb3] = { .dt_id = TEGRA114_CLK_USB3, .present = true },
 	[tegra_clk_vde_8] = { .dt_id = TEGRA114_CLK_VDE, .present = true },
@@ -1048,14 +1043,7 @@ static __init void tegra114_periph_clk_init(void __iomem *clk_base,
 					     0, 82, periph_clk_enb_refcnt);
 	clks[TEGRA114_CLK_DSIB] = clk;
 
-	/* emc mux */
-	clk = clk_register_mux(NULL, "emc_mux", mux_pllmcp_clkm,
-			       ARRAY_SIZE(mux_pllmcp_clkm),
-			       CLK_SET_RATE_NO_REPARENT,
-			       clk_base + CLK_SOURCE_EMC,
-			       29, 3, 0, &emc_lock);
-
-	clk = tegra_clk_register_mc("mc", "emc_mux", clk_base + CLK_SOURCE_EMC,
+	clk = tegra_clk_register_mc("mc", "emc", clk_base + CLK_SOURCE_EMC,
 				    &emc_lock);
 	clks[TEGRA114_CLK_MC] = clk;
 
@@ -1321,6 +1309,26 @@ static int tegra114_reset_deassert(unsigned long id)
 	return 0;
 }
 
+static struct clk *tegra114_clk_src_onecell_get(struct of_phandle_args *clkspec,
+						void *data)
+{
+	struct clk_hw *hw;
+	struct clk *clk;
+
+	clk = of_clk_src_onecell_get(clkspec, data);
+	if (IS_ERR(clk))
+		return clk;
+
+	hw = __clk_get_hw(clk);
+
+	if (clkspec->args[0] == TEGRA114_CLK_EMC) {
+		if (!tegra124_clk_emc_driver_available(hw))
+			return ERR_PTR(-EPROBE_DEFER);
+	}
+
+	return clk;
+}
+
 static void __init tegra114_clock_init(struct device_node *np)
 {
 	struct device_node *node;
@@ -1368,7 +1376,10 @@ static void __init tegra114_clock_init(struct device_node *np)
 	tegra_init_special_resets(1, tegra114_reset_assert,
 				  tegra114_reset_deassert);
 
-	tegra_add_of_provider(np, of_clk_src_onecell_get);
+	tegra_add_of_provider(np, tegra114_clk_src_onecell_get);
+	clks[TEGRA114_CLK_EMC] = tegra124_clk_register_emc(clk_base, np,
+							   &emc_lock);
+
 	tegra_register_devclks(devclks, ARRAY_SIZE(devclks));
 
 	tegra_clk_apply_init_table = tegra114_clock_apply_init_table;
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v1 0/1] clk: tegra: set up proper EMC clock implementation for Tegra114
  2026-01-26 18:58 [PATCH v1 0/1] clk: tegra: set up proper EMC clock implementation for Tegra114 Svyatoslav Ryhel
  2026-01-26 18:58 ` [PATCH v1 1/1] " Svyatoslav Ryhel
@ 2026-03-02  7:50 ` Svyatoslav Ryhel
  1 sibling, 0 replies; 4+ messages in thread
From: Svyatoslav Ryhel @ 2026-03-02  7:50 UTC (permalink / raw)
  To: Peter De Schrijver, Prashant Gaikwad, Michael Turquette,
	Stephen Boyd, Thierry Reding, Jonathan Hunter, Mikko Perttunen,
	Svyatoslav Ryhel
  Cc: linux-clk, linux-tegra, linux-kernel

пн, 26 січ. 2026 р. о 20:58 Svyatoslav Ryhel <clamor95@gmail.com> пише:
>
> Remove current emc and emc_mux clocks and replace them with the proper EMC
> clock implementation for correct EMC driver support.
>
> Part of previous patchset: https://lore.kernel.org/lkml/20251125120559.158860-1-clamor95@gmail.com/
>
> Svyatoslav Ryhel (1):
>   clk: tegra: set up proper EMC clock implementation for Tegra114
>
>  drivers/clk/tegra/clk-tegra114.c | 39 ++++++++++++++++++++------------
>  1 file changed, 25 insertions(+), 14 deletions(-)
>

Hello there!

May this patch be picked if everyone is fine with it?

Best regards,
Svyatoslav R.

> --
> 2.51.0
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1 1/1] clk: tegra: set up proper EMC clock implementation for Tegra114
  2026-01-26 18:58 ` [PATCH v1 1/1] " Svyatoslav Ryhel
@ 2026-03-27 15:10   ` Thierry Reding
  0 siblings, 0 replies; 4+ messages in thread
From: Thierry Reding @ 2026-03-27 15:10 UTC (permalink / raw)
  To: Svyatoslav Ryhel
  Cc: Peter De Schrijver, Prashant Gaikwad, Michael Turquette,
	Stephen Boyd, Thierry Reding, Jonathan Hunter, Mikko Perttunen,
	linux-clk, linux-tegra, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 502 bytes --]

On Mon, Jan 26, 2026 at 08:58:18PM +0200, Svyatoslav Ryhel wrote:
> Remove current emc and emc_mux clocks and replace them with the proper EMC
> clock implementation for correct EMC driver support.
> 
> Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
> Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
> ---
>  drivers/clk/tegra/clk-tegra114.c | 39 ++++++++++++++++++++------------
>  1 file changed, 25 insertions(+), 14 deletions(-)

Acked-by: Thierry Reding <treding@nvidia.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-03-27 15:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-26 18:58 [PATCH v1 0/1] clk: tegra: set up proper EMC clock implementation for Tegra114 Svyatoslav Ryhel
2026-01-26 18:58 ` [PATCH v1 1/1] " Svyatoslav Ryhel
2026-03-27 15:10   ` Thierry Reding
2026-03-02  7:50 ` [PATCH v1 0/1] " Svyatoslav Ryhel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox