Skip to contentSkip to conversation

mmc: sdhci-msm: detect if tassadar_dll is used by using core version

PATCH Superseded Dmitry Baryshkov 2 participants 4 messages Nov 11, 2020 – Nov 12, 2020

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: sdhci-msm: detect if tassadar_dll is used by using core version

Detect if tassadar_dll is required by using core version rather than just specifying it in the sdhci_msm_variant_info.

Cc Veerabhadrarao Badiganti <[email protected]>
---
 drivers/mmc/host/sdhci-msm.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)
drivers/mmc/host/sdhci-msm.c +5 -10
index 3451eb325513..dd67acab1660 100644
@@ -248,7 +248,6 @@ struct sdhci_msm_variant_ops {
 struct sdhci_msm_variant_info {
 	bool mci_removed;
 	bool restore_dll_config;
-	bool uses_tassadar_dll;
 	const struct sdhci_msm_variant_ops *var_ops;
 	const struct sdhci_msm_offset *offset;
 };
@@ -2154,18 +2153,11 @@ static const struct sdhci_msm_variant_info sdm845_sdhci_var = {
 	.offset = &sdhci_msm_v5_offset,
 };
 
-static const struct sdhci_msm_variant_info sm8250_sdhci_var = {
-	.mci_removed = true,
-	.uses_tassadar_dll = true,
-	.var_ops = &v5_var_ops,
-	.offset = &sdhci_msm_v5_offset,
-};
-
 static const struct of_device_id sdhci_msm_dt_match[] = {
 	{.compatible = "qcom,sdhci-msm-v4", .data = &sdhci_msm_mci_var},
 	{.compatible = "qcom,sdhci-msm-v5", .data = &sdhci_msm_v5_var},
 	{.compatible = "qcom,sdm845-sdhci", .data = &sdm845_sdhci_var},
-	{.compatible = "qcom,sm8250-sdhci", .data = &sm8250_sdhci_var},
+	{.compatible = "qcom,sm8250-sdhci", .data = &sdm845_sdhci_var},
 	{.compatible = "qcom,sc7180-sdhci", .data = &sdm845_sdhci_var},
 	{},
 };
@@ -2249,7 +2241,6 @@ static int sdhci_msm_probe(struct platform_device *pdev)
 	msm_host->restore_dll_config = var_info->restore_dll_config;
 	msm_host->var_ops = var_info->var_ops;
 	msm_host->offset = var_info->offset;
-	msm_host->uses_tassadar_dll = var_info->uses_tassadar_dll;
 
 	msm_offset = msm_host->offset;
 
@@ -2396,6 +2387,10 @@ static int sdhci_msm_probe(struct platform_device *pdev)
 	if (core_major == 1 && core_minor >= 0x49)
 		msm_host->updated_ddr_cfg = true;
 
+	if (core_major == 1 &&
+	    (core_minor == 0x6e || core_minor == 0x71 || core_minor == 0x72))
+		msm_host->uses_tassadar_dll = true;
+
 	ret = sdhci_msm_register_vreg(msm_host);
 	if (ret)
 		goto clk_disable;
Signature · 1 line
2.28.0
#1 lore raw
Quoted 28 lines · Dmitry Baryshkov

Detect if tassadar_dll is required by using core version rather than just specifying it in the sdhci_msm_variant_info.

Cc Veerabhadrarao Badiganti <[email protected]>
---
  drivers/mmc/host/sdhci-msm.c | 15 +++++----------
  1 file changed, 5 insertions(+), 10 deletions(-)
drivers/mmc/host/sdhci-msm.c +0 -4
index 3451eb325513..dd67acab1660 100644
@@ -248,7 +248,6 @@ struct sdhci_msm_variant_ops {
  struct sdhci_msm_variant_info {
  	bool mci_removed;
  	bool restore_dll_config;
-	bool uses_tassadar_dll;
  	const struct sdhci_msm_variant_ops *var_ops;
  	const struct sdhci_msm_offset *offset;
  };
@@ -2154,18 +2153,11 @@ static const struct sdhci_msm_variant_info sdm845_sdhci_var = {
  	.offset = &sdhci_msm_v5_offset,
  };
 
-static const struct sdhci_msm_variant_info sm8250_sdhci_var = {
-	.mci_removed = true,
-	.uses_tassadar_dll = true,

drivers/mmc/host/sdhci-msm.c static const struct sdhci_msm_variant_info sdm845_sdhci_var = { · line 2160

Quoted 10 lines
drivers/mmc/host/sdhci-msm.c +1 -5
-	.var_ops = &v5_var_ops,
-	.offset = &sdhci_msm_v5_offset,
-};
-
  static const struct of_device_id sdhci_msm_dt_match[] = {
  	{.compatible = "qcom,sdhci-msm-v4", .data = &sdhci_msm_mci_var},
  	{.compatible = "qcom,sdhci-msm-v5", .data = &sdhci_msm_v5_var},
  	{.compatible = "qcom,sdm845-sdhci", .data = &sdm845_sdhci_var},
-	{.compatible = "qcom,sm8250-sdhci", .data = &sm8250_sdhci_var},
+	{.compatible = "qcom,sm8250-sdhci", .data = &sdm845_sdhci_var},

Since you have made it 'uses_tassadar_dll' check generic, SM8250 should work with default compatible string (qcom,sdhci-msm-v5). We can drop the entry to SM8250 from this table.

Quoted 12 lines
drivers/mmc/host/sdhci-msm.c +0 -1
  	{.compatible = "qcom,sc7180-sdhci", .data = &sdm845_sdhci_var},
  	{},
  };
@@ -2249,7 +2241,6 @@ static int sdhci_msm_probe(struct platform_device *pdev)
  	msm_host->restore_dll_config = var_info->restore_dll_config;
  	msm_host->var_ops = var_info->var_ops;
  	msm_host->offset = var_info->offset;
-	msm_host->uses_tassadar_dll = var_info->uses_tassadar_dll;
 
  	msm_offset = msm_host->offset;
 

drivers/mmc/host/sdhci-msm.c static int sdhci_msm_probe(struct platform_device *pdev) · line 2393

Quoted 7 lines
drivers/mmc/host/sdhci-msm.c +4 -0
@@ -2396,6 +2387,10 @@ static int sdhci_msm_probe(struct platform_device *pdev)
  	if (core_major == 1 && core_minor >= 0x49)
  		msm_host->updated_ddr_cfg = true;
 
+	if (core_major == 1 &&
+	    (core_minor == 0x6e || core_minor == 0x71 || core_minor == 0x72))
+		msm_host->uses_tassadar_dll = true;
+

This new registers that got introduced for supporting this new DLL are present on all versions > 0x71 So we can update check as core_minor >= 0x71.

And i dont find any target with SDCC controller minor version 0x6e.So we can remove check for version 0x6e.

Quoted 3 lines
drivers/mmc/host/sdhci-msm.c +0 -0
  	ret = sdhci_msm_register_vreg(msm_host);
  	if (ret)
  		goto clk_disable;
#2 lore raw
Quoted 28 lines · Veerabhadrarao Badiganti
Quoted 25 lines · Dmitry Baryshkov

Detect if tassadar_dll is required by using core version rather than just specifying it in the sdhci_msm_variant_info.

Cc Veerabhadrarao Badiganti <[email protected]>
---
  drivers/mmc/host/sdhci-msm.c | 15 +++++----------
  1 file changed, 5 insertions(+), 10 deletions(-)
drivers/mmc/host/sdhci-msm.c +0 -1
index 3451eb325513..dd67acab1660 100644
@@ -248,7 +248,6 @@ struct sdhci_msm_variant_ops {
  struct sdhci_msm_variant_info {
      bool mci_removed;
      bool restore_dll_config;
-     bool uses_tassadar_dll;
      const struct sdhci_msm_variant_ops *var_ops;
      const struct sdhci_msm_offset *offset;
  };
@@ -2154,18 +2153,11 @@ static const struct sdhci_msm_variant_info sdm845_sdhci_var = {
      .offset = &sdhci_msm_v5_offset,
  };
 
Quoted 16 lines

drivers/mmc/host/sdhci-msm.c static const struct sdhci_msm_variant_info sdm845_sdhci_var = { · line 2160

Quoted 13 lines
drivers/mmc/host/sdhci-msm.c +1 -8
-static const struct sdhci_msm_variant_info sm8250_sdhci_var = {
-     .mci_removed = true,
-     .uses_tassadar_dll = true,
-     .var_ops = &v5_var_ops,
-     .offset = &sdhci_msm_v5_offset,
-};
-
  static const struct of_device_id sdhci_msm_dt_match[] = {
      {.compatible = "qcom,sdhci-msm-v4", .data = &sdhci_msm_mci_var},
      {.compatible = "qcom,sdhci-msm-v5", .data = &sdhci_msm_v5_var},
      {.compatible = "qcom,sdm845-sdhci", .data = &sdm845_sdhci_var},
-     {.compatible = "qcom,sm8250-sdhci", .data = &sm8250_sdhci_var},
+     {.compatible = "qcom,sm8250-sdhci", .data = &sdm845_sdhci_var},

Since you have made it 'uses_tassadar_dll' check generic, SM8250 should work with default compatible string (qcom,sdhci-msm-v5). We can drop the entry to SM8250 from this table.

Does SM8250 need restore_dll_config like sdm845/sc7180?

Quoted 23 lines
Quoted 12 lines
drivers/mmc/host/sdhci-msm.c +0 -1
      {.compatible = "qcom,sc7180-sdhci", .data = &sdm845_sdhci_var},
      {},
  };
@@ -2249,7 +2241,6 @@ static int sdhci_msm_probe(struct platform_device *pdev)
      msm_host->restore_dll_config = var_info->restore_dll_config;
      msm_host->var_ops = var_info->var_ops;
      msm_host->offset = var_info->offset;
-     msm_host->uses_tassadar_dll = var_info->uses_tassadar_dll;
 
      msm_offset = msm_host->offset;
 

drivers/mmc/host/sdhci-msm.c static int sdhci_msm_probe(struct platform_device *pdev) · line 2393

Quoted 7 lines
drivers/mmc/host/sdhci-msm.c +4 -0
@@ -2396,6 +2387,10 @@ static int sdhci_msm_probe(struct platform_device *pdev)
      if (core_major == 1 && core_minor >= 0x49)
              msm_host->updated_ddr_cfg = true;
 
+     if (core_major == 1 &&
+         (core_minor == 0x6e || core_minor == 0x71 || core_minor == 0x72))
+             msm_host->uses_tassadar_dll = true;
+

This new registers that got introduced for supporting this new DLL are present on all versions > 0x71
So we can update check as core_minor >= 0x71.

Quoted 2 lines

And i dont find any target with SDCC controller minor version 0x6e.So we can remove check for version 0x6e.

I was basing this patch on the published 4.19 tree, which checks for 0x6e. I'll drop it from v2.

Quoted 3 lines
Quoted 3 lines
drivers/mmc/host/sdhci-msm.c +0 -0
      ret = sdhci_msm_register_vreg(msm_host);
      if (ret)
              goto clk_disable;
Signature · 2 lines
With best wishes
Dmitry
#3 lore raw
Quoted 45 lines · Dmitry Baryshkov
Quoted 27 lines · Veerabhadrarao Badiganti
Quoted 25 lines · Dmitry Baryshkov

Detect if tassadar_dll is required by using core version rather than just specifying it in the sdhci_msm_variant_info.

Cc Veerabhadrarao Badiganti <[email protected]>
---
   drivers/mmc/host/sdhci-msm.c | 15 +++++----------
   1 file changed, 5 insertions(+), 10 deletions(-)
drivers/mmc/host/sdhci-msm.c +0 -1
index 3451eb325513..dd67acab1660 100644
@@ -248,7 +248,6 @@ struct sdhci_msm_variant_ops {
   struct sdhci_msm_variant_info {
       bool mci_removed;
       bool restore_dll_config;
-     bool uses_tassadar_dll;
       const struct sdhci_msm_variant_ops *var_ops;
       const struct sdhci_msm_offset *offset;
   };
@@ -2154,18 +2153,11 @@ static const struct sdhci_msm_variant_info sdm845_sdhci_var = {
       .offset = &sdhci_msm_v5_offset,
   };
 
Quoted 16 lines

drivers/mmc/host/sdhci-msm.c static const struct sdhci_msm_variant_info sdm845_sdhci_var = { · line 2160

Quoted 13 lines
drivers/mmc/host/sdhci-msm.c +1 -8
-static const struct sdhci_msm_variant_info sm8250_sdhci_var = {
-     .mci_removed = true,
-     .uses_tassadar_dll = true,
-     .var_ops = &v5_var_ops,
-     .offset = &sdhci_msm_v5_offset,
-};
-
   static const struct of_device_id sdhci_msm_dt_match[] = {
       {.compatible = "qcom,sdhci-msm-v4", .data = &sdhci_msm_mci_var},
       {.compatible = "qcom,sdhci-msm-v5", .data = &sdhci_msm_v5_var},
       {.compatible = "qcom,sdm845-sdhci", .data = &sdm845_sdhci_var},
-     {.compatible = "qcom,sm8250-sdhci", .data = &sm8250_sdhci_var},
+     {.compatible = "qcom,sm8250-sdhci", .data = &sdm845_sdhci_var},

Since you have made it 'uses_tassadar_dll' check generic, SM8250 should work with default compatible string (qcom,sdhci-msm-v5). We can drop the entry to SM8250 from this table.

Quoted 1 line

Does SM8250 need restore_dll_config like sdm845/sc7180?

No. Its not needed.

Quoted 23 lines
Quoted 23 lines
Quoted 12 lines
drivers/mmc/host/sdhci-msm.c +0 -1
       {.compatible = "qcom,sc7180-sdhci", .data = &sdm845_sdhci_var},
       {},
   };
@@ -2249,7 +2241,6 @@ static int sdhci_msm_probe(struct platform_device *pdev)
       msm_host->restore_dll_config = var_info->restore_dll_config;
       msm_host->var_ops = var_info->var_ops;
       msm_host->offset = var_info->offset;
-     msm_host->uses_tassadar_dll = var_info->uses_tassadar_dll;
 
       msm_offset = msm_host->offset;
 

drivers/mmc/host/sdhci-msm.c static int sdhci_msm_probe(struct platform_device *pdev) · line 2393

Quoted 7 lines
drivers/mmc/host/sdhci-msm.c +4 -0
@@ -2396,6 +2387,10 @@ static int sdhci_msm_probe(struct platform_device *pdev)
       if (core_major == 1 && core_minor >= 0x49)
               msm_host->updated_ddr_cfg = true;
 
+     if (core_major == 1 &&
+         (core_minor == 0x6e || core_minor == 0x71 || core_minor == 0x72))
+             msm_host->uses_tassadar_dll = true;
+

This new registers that got introduced for supporting this new DLL are present on all versions > 0x71
So we can update check as core_minor >= 0x71.

Quoted 4 lines
Quoted 2 lines

And i dont find any target with SDCC controller minor version 0x6e.So we can remove check for version 0x6e.

I was basing this patch on the published 4.19 tree, which checks for 0x6e. I'll drop it from v2.

Correct. In qcom downstream code, 0x6e version check was wrongly added.

Quoted 5 lines
Quoted 3 lines
Quoted 3 lines
drivers/mmc/host/sdhci-msm.c +0 -0
       ret = sdhci_msm_register_vreg(msm_host);
       if (ret)
               goto clk_disable;