Skip to contentSkip to conversation

clk: ti: dra7xx: Reset the mcasp3_ahclkx_mux clock value

PATCH In review Keerthy 2 participants 3 messages Sep 6, 2017

Subsystems (2)
lore
Share & tools
lore

Keerthy

author
#0 lore raw

PATCH 1/1 clk: ti: dra7xx: Reset the mcasp3_ahclkx_mux clock value

Reset the mcasp3_ahclkx_mux to abe_24m_fclk. This is needed in case of kexec where the reset values might be wiped off.

---
 drivers/clk/ti/clk-7xx.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/clk/ti/clk-7xx.c +8 -1
index 9fd6043..2c3a36c 100644
@@ -312,7 +312,7 @@
 int __init dra7xx_dt_clk_init(void)
 {
 	int rc;
-	struct clk *dpll_ck, *hdcp_ck;
+	struct clk *dpll_ck, *hdcp_ck, *mcasp3_ahclkx_ck, *abe_ck;
 
 	ti_dt_clocks_register(dra7xx_clks);
 
@@ -338,5 +338,12 @@ int __init dra7xx_dt_clk_init(void)
 	if (rc)
 		pr_err("%s: failed to set dss_deshdcp_clk\n", __func__);
 
+	mcasp3_ahclkx_ck = clk_get_sys(NULL, "mcasp3_ahclkx_mux");
+	abe_ck = clk_get_sys(NULL, "abe_24m_fclk");
+	rc = clk_set_parent(mcasp3_ahclkx_ck, abe_ck);
+	if (rc)
+		pr_err("%s: failed to set parent for mcasp3_ahclkx_mux\n",
+		       __func__);
+
 	return rc;
 }
Signature · 1 line
1.9.1
#1 lore raw


Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

Quoted 4 lines · Keerthy

Reset the mcasp3_ahclkx_mux to abe_24m_fclk. This is needed in case of kexec where the reset values might be wiped off.

Why not do this in DT with the assigned-clock-xyz properties available?

-Tero

Quoted 31 lines
---
  drivers/clk/ti/clk-7xx.c | 9 ++++++++-
  1 file changed, 8 insertions(+), 1 deletion(-)
drivers/clk/ti/clk-7xx.c +8 -1
index 9fd6043..2c3a36c 100644
@@ -312,7 +312,7 @@
  int __init dra7xx_dt_clk_init(void)
  {
  	int rc;
-	struct clk *dpll_ck, *hdcp_ck;
+	struct clk *dpll_ck, *hdcp_ck, *mcasp3_ahclkx_ck, *abe_ck;
 
  	ti_dt_clocks_register(dra7xx_clks);
 
@@ -338,5 +338,12 @@ int __init dra7xx_dt_clk_init(void)
  	if (rc)
  		pr_err("%s: failed to set dss_deshdcp_clk\n", __func__);
 
+	mcasp3_ahclkx_ck = clk_get_sys(NULL, "mcasp3_ahclkx_mux");
+	abe_ck = clk_get_sys(NULL, "abe_24m_fclk");
+	rc = clk_set_parent(mcasp3_ahclkx_ck, abe_ck);
+	if (rc)
+		pr_err("%s: failed to set parent for mcasp3_ahclkx_mux\n",
+		       __func__);
+
  	return rc;
  }
author
#2 lore raw
Quoted 7 lines · Tero Kristo
Quoted 4 lines · Keerthy

Reset the mcasp3_ahclkx_mux to abe_24m_fclk. This is needed in case of kexec where the reset values might be wiped off.

Why not do this in DT with the assigned-clock-xyz properties available?

Works for me. I will send a v2 with your suggested-by.

Thanks,
Keerthy

Quoted 32 lines

-Tero

Quoted 28 lines
---
  drivers/clk/ti/clk-7xx.c | 9 ++++++++-
  1 file changed, 8 insertions(+), 1 deletion(-)
drivers/clk/ti/clk-7xx.c +1 -1
index 9fd6043..2c3a36c 100644
@@ -312,7 +312,7 @@
  int __init dra7xx_dt_clk_init(void)
  {
      int rc;
-    struct clk *dpll_ck, *hdcp_ck;
+    struct clk *dpll_ck, *hdcp_ck, *mcasp3_ahclkx_ck, *abe_ck;
        ti_dt_clocks_register(dra7xx_clks);
  @@ -338,5 +338,12 @@ int __init dra7xx_dt_clk_init(void)
      if (rc)
          pr_err("%s: failed to set dss_deshdcp_clk\n", __func__);

+ mcasp3_ahclkx_ck = clk_get_sys(NULL, "mcasp3_ahclkx_mux");

drivers/clk/ti/clk-7xx.c +6 -0
+    abe_ck = clk_get_sys(NULL, "abe_24m_fclk");
+    rc = clk_set_parent(mcasp3_ahclkx_ck, abe_ck);
+    if (rc)
+        pr_err("%s: failed to set parent for mcasp3_ahclkx_mux\n",
+               __func__);
+
      return rc;
  }