013-mmc-xenon_sdhci-remove-wait_dat0-SDHCI-OP.patch 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. From 0f3466f52fbacce67e147b9234e6323edff26a6d Mon Sep 17 00:00:00 2001
  2. From: Robert Marko <[email protected]>
  3. Date: Fri, 11 Mar 2022 19:14:07 +0100
  4. Subject: [PATCH] mmc: xenon_sdhci: remove wait_dat0 SDHCI OP
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. Generic SDHCI driver received support for checking the busy status by
  9. polling the DAT[0] level instead of waiting for the worst MMC switch time.
  10. Unfortunately, it appears that this does not work for Xenon controllers
  11. despite being a part of the standard SDHCI registers and the Armada 3720
  12. datasheet itself telling that BIT(20) is useful for detecting the DAT[0]
  13. busy signal.
  14. I have tried increasing the timeout value, but I have newer managed to
  15. catch DAT_LEVEL bits change from 0 at all.
  16. This issue appears to hit most if not all SoC-s supported by Xenon driver,
  17. at least A3720, A8040 and CN9130 have non working eMMC currently.
  18. So, until a better solution is found drop the wait_dat0 OP for Xenon.
  19. I was able to only test it on A3720, but it should work for others as well.
  20. Fixes: 40e6f52454fc ("drivers: mmc: Add wait_dat0 support for sdhci driver")
  21. Signed-off-by: Robert Marko <[email protected]>
  22. Reviewed-by: Marek Behún <[email protected]>
  23. Reviewed-by: Jaehoon Chung <[email protected]>
  24. Reviewed-by: Stefan Roese <[email protected]>
  25. ---
  26. drivers/mmc/xenon_sdhci.c | 7 ++++++-
  27. 1 file changed, 6 insertions(+), 1 deletion(-)
  28. --- a/drivers/mmc/xenon_sdhci.c
  29. +++ b/drivers/mmc/xenon_sdhci.c
  30. @@ -439,6 +439,8 @@ static const struct sdhci_ops xenon_sdhc
  31. .set_ios_post = xenon_sdhci_set_ios_post
  32. };
  33. +static struct dm_mmc_ops xenon_mmc_ops;
  34. +
  35. static int xenon_sdhci_probe(struct udevice *dev)
  36. {
  37. struct xenon_sdhci_plat *plat = dev_get_plat(dev);
  38. @@ -452,6 +454,9 @@ static int xenon_sdhci_probe(struct udev
  39. host->mmc->dev = dev;
  40. upriv->mmc = host->mmc;
  41. + xenon_mmc_ops = sdhci_ops;
  42. + xenon_mmc_ops.wait_dat0 = NULL;
  43. +
  44. /* Set quirks */
  45. host->quirks = SDHCI_QUIRK_WAIT_SEND_CMD | SDHCI_QUIRK_32BIT_DMA_ADDR;
  46. @@ -568,7 +573,7 @@ U_BOOT_DRIVER(xenon_sdhci_drv) = {
  47. .id = UCLASS_MMC,
  48. .of_match = xenon_sdhci_ids,
  49. .of_to_plat = xenon_sdhci_of_to_plat,
  50. - .ops = &sdhci_ops,
  51. + .ops = &xenon_mmc_ops,
  52. .bind = xenon_sdhci_bind,
  53. .probe = xenon_sdhci_probe,
  54. .remove = xenon_sdhci_remove,