|
86 | 86 |
|
87 | 87 | /* sdhci-omap controller flags */
|
88 | 88 | #define SDHCI_OMAP_REQUIRE_IODELAY BIT(0)
|
| 89 | +#define SDHCI_OMAP_SPECIAL_RESET BIT(1) |
89 | 90 |
|
90 | 91 | struct sdhci_omap_data {
|
91 | 92 | u32 offset;
|
@@ -779,15 +780,35 @@ static void sdhci_omap_set_uhs_signaling(struct sdhci_host *host,
|
779 | 780 | sdhci_omap_start_clock(omap_host);
|
780 | 781 | }
|
781 | 782 |
|
| 783 | +#define MMC_TIMEOUT_US 20000 /* 20000 micro Sec */ |
782 | 784 | static void sdhci_omap_reset(struct sdhci_host *host, u8 mask)
|
783 | 785 | {
|
784 | 786 | struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
|
785 | 787 | struct sdhci_omap_host *omap_host = sdhci_pltfm_priv(pltfm_host);
|
| 788 | + unsigned long limit = MMC_TIMEOUT_US; |
| 789 | + unsigned long i = 0; |
786 | 790 |
|
787 | 791 | /* Don't reset data lines during tuning operation */
|
788 | 792 | if (omap_host->is_tuning)
|
789 | 793 | mask &= ~SDHCI_RESET_DATA;
|
790 | 794 |
|
| 795 | + if (omap_host->flags & SDHCI_OMAP_SPECIAL_RESET) { |
| 796 | + sdhci_writeb(host, mask, SDHCI_SOFTWARE_RESET); |
| 797 | + while ((!(sdhci_readb(host, SDHCI_SOFTWARE_RESET) & mask)) && |
| 798 | + (i++ < limit)) |
| 799 | + udelay(1); |
| 800 | + i = 0; |
| 801 | + while ((sdhci_readb(host, SDHCI_SOFTWARE_RESET) & mask) && |
| 802 | + (i++ < limit)) |
| 803 | + udelay(1); |
| 804 | + |
| 805 | + if (sdhci_readb(host, SDHCI_SOFTWARE_RESET) & mask) |
| 806 | + dev_err(mmc_dev(host->mmc), |
| 807 | + "Timeout waiting on controller reset in %s\n", |
| 808 | + __func__); |
| 809 | + return; |
| 810 | + } |
| 811 | + |
791 | 812 | sdhci_reset(host, mask);
|
792 | 813 | }
|
793 | 814 |
|
@@ -900,10 +921,12 @@ static const struct sdhci_omap_data k2g_data = {
|
900 | 921 |
|
901 | 922 | static const struct sdhci_omap_data am335_data = {
|
902 | 923 | .offset = 0x200,
|
| 924 | + .flags = SDHCI_OMAP_SPECIAL_RESET, |
903 | 925 | };
|
904 | 926 |
|
905 | 927 | static const struct sdhci_omap_data am437_data = {
|
906 | 928 | .offset = 0x200,
|
| 929 | + .flags = SDHCI_OMAP_SPECIAL_RESET, |
907 | 930 | };
|
908 | 931 |
|
909 | 932 | static const struct sdhci_omap_data dra7_data = {
|
|
0 commit comments