@@ -156,6 +156,7 @@ struct sdhci_am654_data {
156
156
157
157
#define SDHCI_AM654_QUIRK_FORCE_CDTEST BIT(0)
158
158
#define SDHCI_AM654_QUIRK_SUPPRESS_V1P8_ENA BIT(1)
159
+ #define SDHCI_AM654_QUIRK_DISABLE_HS400 BIT(2)
159
160
};
160
161
161
162
struct window {
@@ -765,6 +766,7 @@ static int sdhci_am654_init(struct sdhci_host *host)
765
766
{
766
767
struct sdhci_pltfm_host * pltfm_host = sdhci_priv (host );
767
768
struct sdhci_am654_data * sdhci_am654 = sdhci_pltfm_priv (pltfm_host );
769
+ struct device * dev = mmc_dev (host -> mmc );
768
770
u32 ctl_cfg_2 = 0 ;
769
771
u32 mask ;
770
772
u32 val ;
@@ -820,6 +822,12 @@ static int sdhci_am654_init(struct sdhci_host *host)
820
822
if (ret )
821
823
goto err_cleanup_host ;
822
824
825
+ if (sdhci_am654 -> quirks & SDHCI_AM654_QUIRK_DISABLE_HS400 &&
826
+ host -> mmc -> caps2 & (MMC_CAP2_HS400 | MMC_CAP2_HS400_ES )) {
827
+ dev_info (dev , "HS400 mode not supported on this silicon revision, disabling it\n" );
828
+ host -> mmc -> caps2 &= ~(MMC_CAP2_HS400 | MMC_CAP2_HS400_ES );
829
+ }
830
+
823
831
ret = __sdhci_add_host (host );
824
832
if (ret )
825
833
goto err_cleanup_host ;
@@ -883,6 +891,12 @@ static int sdhci_am654_get_of_property(struct platform_device *pdev,
883
891
return 0 ;
884
892
}
885
893
894
+ static const struct soc_device_attribute sdhci_am654_descope_hs400 [] = {
895
+ { .family = "AM62PX" , .revision = "SR1.0" },
896
+ { .family = "AM62PX" , .revision = "SR1.1" },
897
+ { /* sentinel */ }
898
+ };
899
+
886
900
static const struct of_device_id sdhci_am654_of_match [] = {
887
901
{
888
902
.compatible = "ti,am654-sdhci-5.1" ,
@@ -970,6 +984,10 @@ static int sdhci_am654_probe(struct platform_device *pdev)
970
984
if (ret )
971
985
return dev_err_probe (dev , ret , "parsing dt failed\n" );
972
986
987
+ soc = soc_device_match (sdhci_am654_descope_hs400 );
988
+ if (soc )
989
+ sdhci_am654 -> quirks |= SDHCI_AM654_QUIRK_DISABLE_HS400 ;
990
+
973
991
host -> mmc_host_ops .start_signal_voltage_switch = sdhci_am654_start_signal_voltage_switch ;
974
992
host -> mmc_host_ops .execute_tuning = sdhci_am654_execute_tuning ;
975
993
0 commit comments