Skip to contentSkip to conversation

mmc: cv1800b: Add transmit tap delay config to fix write error

PATCH In review Kongyang Liu 2 participants 3 messages Apr 16, 2024 – Apr 17, 2024 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: cv1800b: Add transmit tap delay config to fix write error

Currently, only the receive delay is configured while the transmit delay is not set, which may result in errors when writing to the file. This issue can be resolved by setting PHY_TX_SRC_INVERT to SDHCI_PHY_TX_RX_DLY.

---

 drivers/mmc/cv1800b_sdhci.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/mmc/cv1800b_sdhci.c +3 -1
index 2275c53777..a50f4cff0d 100644
@@ -12,6 +12,8 @@
 #define MMC_MAX_CLOCK        375000000
 #define TUNE_MAX_PHCODE      128
 
+#define PHY_TX_SRC_INVERT  BIT(8)
+
 struct cv1800b_sdhci_plat {
 	struct mmc_config cfg;
 	struct mmc mmc;
@@ -19,7 +21,7 @@ struct cv1800b_sdhci_plat {
 
 static void cv1800b_set_tap_delay(struct sdhci_host *host, u16 tap)
 {
-	sdhci_writel(host, tap << 16, SDHCI_PHY_TX_RX_DLY);
+	sdhci_writel(host, PHY_TX_SRC_INVERT | tap << 16, SDHCI_PHY_TX_RX_DLY);
 }
 
 static void cv1800b_sdhci_reset(struct sdhci_host *host, u8 mask)
Signature · 1 line
2.41.0
Reviewed-by on v1 1/1
#1 lore raw

Hi,

Quoted 8 lines

-----Original Message-----
From: Kongyang Liu <[email protected]>
Sent: Tuesday, April 16, 2024 4:31 PM
To: [email protected]
Cc: Jaehoon Chung <[email protected]>; Leo Yu-Chi Liang <[email protected]>; Peng Fan <[email protected]>; Tom Rini <[email protected]>
Subject: [PATCH] mmc: cv1800b: Add transmit tap delay config to fix write error

Quoted 5 lines

Currently, only the receive delay is configured while the transmit delay is not set, which may result in errors when writing to the file. This issue can be resolved by setting PHY_TX_SRC_INVERT to SDHCI_PHY_TX_RX_DLY.

Best Regards,
Jaehoon Chung

Quoted 29 lines

---

 drivers/mmc/cv1800b_sdhci.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/mmc/cv1800b_sdhci.c +3 -2
index 2275c53777..a50f4cff0d 100644
@@ -12,6 +12,8 @@
 #define MMC_MAX_CLOCK        375000000
 #define TUNE_MAX_PHCODE      128
 
+#define PHY_TX_SRC_INVERT  BIT(8)
+
 struct cv1800b_sdhci_plat {
 	struct mmc_config cfg;
 	struct mmc mmc;
@@ -19,7 +21,7 @@ struct cv1800b_sdhci_plat {
 
 static void cv1800b_set_tap_delay(struct sdhci_host *host, u16 tap)
 {
-	sdhci_writel(host, tap << 16, SDHCI_PHY_TX_RX_DLY);
+	sdhci_writel(host, PHY_TX_SRC_INVERT | tap << 16, SDHCI_PHY_TX_RX_DLY);
 }
 
 static void cv1800b_sdhci_reset(struct sdhci_host *host, u8 mask)
--

2.41.0

Reviewed-by on v1 1/1
#2 lore raw
In reply to Kongyang Liu
Quoted 10 lines

-----Original Message-----
From: Kongyang Liu <[email protected]>
Sent: Tuesday, April 16, 2024 4:31 PM
To: [email protected]
Cc: Jaehoon Chung <[email protected]>; Leo Yu-Chi Liang <[email protected]>; Peng Fan <[email protected]>; Tom Rini <[email protected]>
Subject: [PATCH] mmc: cv1800b: Add transmit tap delay config to fix write error

Quoted 5 lines

Currently, only the receive delay is configured while the transmit delay is not set, which may result in errors when writing to the file. This issue can be resolved by setting PHY_TX_SRC_INVERT to SDHCI_PHY_TX_RX_DLY.

Best Regards,
Jaehoon Chung

Quoted 29 lines

---

 drivers/mmc/cv1800b_sdhci.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/mmc/cv1800b_sdhci.c +3 -2
index 2275c53777..a50f4cff0d 100644
@@ -12,6 +12,8 @@
 #define MMC_MAX_CLOCK        375000000
 #define TUNE_MAX_PHCODE      128
 
+#define PHY_TX_SRC_INVERT  BIT(8)
+
 struct cv1800b_sdhci_plat {
 	struct mmc_config cfg;
 	struct mmc mmc;
@@ -19,7 +21,7 @@ struct cv1800b_sdhci_plat {
 
 static void cv1800b_set_tap_delay(struct sdhci_host *host, u16 tap)
 {
-	sdhci_writel(host, tap << 16, SDHCI_PHY_TX_RX_DLY);
+	sdhci_writel(host, PHY_TX_SRC_INVERT | tap << 16, SDHCI_PHY_TX_RX_DLY);
 }
 
 static void cv1800b_sdhci_reset(struct sdhci_host *host, u8 mask)
--

2.41.0