[PATCH 3/5] mmc: zynq_sdhci: disable ITAPDLYENA for zero itap_delay

Steffen Dirkwinkel lists at steffen.cc
Fri Feb 23 15:06:11 CET 2024


From: Steffen Dirkwinkel <s.dirkwinkel at beckhoff.com>

This ports a change from arm-trusted-firmware:
commit: fe1fa205fca4d1dd4a1b1755942956dbca65d573 in arm-trusted-firmware
(https://github.com/ARM-software/arm-trusted-firmware/commit/fe1fa205fca4d1dd4a1b1755942956dbca65d573)
The OTAPDLYENA change from there will be in another commit.

We shouldn't have different behavior for u-boot-SPL and u-boot so let's
use the same logic here.

Message from arm-trusted-firmware:
plat: zynqmp: Disable ITAPDLYENA bit for zero ITAP delay

This patch disable the ITAPDLYENA bit for ITAP delay value zero.
As per IP design, it is recommended to disable the ITAPDLYENA bit
before auto-tuning.
Also disable OTAPDLYENA bit always as there is one issue in RTL
where SD0_OTAPDLYENA has been wrongly connected to both SD0 and SD1
controllers. Hence it is recommended to disable OTAPDLYENA bit always
for both the controllers.

Signed-off-by: Steffen Dirkwinkel <s.dirkwinkel at beckhoff.com>
---

 drivers/mmc/zynq_sdhci.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/zynq_sdhci.c b/drivers/mmc/zynq_sdhci.c
index d4845245b2a..79bb8ba66d9 100644
--- a/drivers/mmc/zynq_sdhci.c
+++ b/drivers/mmc/zynq_sdhci.c
@@ -287,8 +287,13 @@ static inline int arasan_zynqmp_set_in_tapdelay(u32 node_id, u32 itap_delay)
 		if (ret)
 			return ret;
 
-		ret = zynqmp_mmio_write(SD_ITAP_DLY, SD0_ITAPDLYENA << shift,
-					SD0_ITAPDLYENA << shift);
+		if (itap_delay == 0)
+			ret = zynqmp_mmio_write(SD_ITAP_DLY, SD0_ITAPDLYENA << shift,
+						0);
+		else
+			ret = zynqmp_mmio_write(SD_ITAP_DLY, SD0_ITAPDLYENA << shift,
+						SD0_ITAPDLYENA << shift);
+
 		if (ret)
 			return ret;
 
-- 
2.39.2



More information about the U-Boot mailing list