mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/3] mci: imx-esdhc: Fix WML setting for layerscape PBL
@ 2023-12-13 14:57 Sascha Hauer
  2023-12-13 14:57 ` [PATCH 2/3] mci: imx-esdhc-pbl: ls1046a: Add missing ESDHC_FLAG_MULTIBLK_NO_INT Sascha Hauer
  2023-12-13 14:57 ` [PATCH 3/3] mci: imx-esdhc-pbl: fix prediv setting Sascha Hauer
  0 siblings, 2 replies; 3+ messages in thread
From: Sascha Hauer @ 2023-12-13 14:57 UTC (permalink / raw)
  To: Barebox List

For the Layerscape PBL to correctly work in PBL we have to configure the
read watermark level to 0x80 aka one full block of 512 bytes (0x80 * sizeof(u32))

With the current value of 0x10 the ESDHC will signal data available, but
we are only allowed to read 0x10 words. After that we would have to wait
for data being ready again, but sdhci_rx_pio() does not do that.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/mci/imx-esdhc-common.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/mci/imx-esdhc-common.c b/drivers/mci/imx-esdhc-common.c
index 3c1ff98824..3d93889143 100644
--- a/drivers/mci/imx-esdhc-common.c
+++ b/drivers/mci/imx-esdhc-common.c
@@ -59,19 +59,14 @@ static int esdhc_setup_data(struct fsl_esdhc_host *host, struct mci_data *data,
 	u32 wml_value;
 
 	wml_value = data->blocksize / 4;
+	if (wml_value > 0x80)
+		wml_value = 0x80;
 
-	if (data->flags & MMC_DATA_READ) {
-		if (wml_value > 0x10)
-			wml_value = 0x10;
-
+	if (data->flags & MMC_DATA_READ)
 		esdhc_clrsetbits32(host, IMX_SDHCI_WML, WML_RD_WML_MASK, wml_value);
-	} else {
-		if (wml_value > 0x80)
-			wml_value = 0x80;
-
+	else
 		esdhc_clrsetbits32(host, IMX_SDHCI_WML, WML_WR_WML_MASK,
 					wml_value << 16);
-	}
 
 	host->sdhci.sdma_boundary = 0;
 
-- 
2.39.2




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-12-13 14:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-13 14:57 [PATCH 1/3] mci: imx-esdhc: Fix WML setting for layerscape PBL Sascha Hauer
2023-12-13 14:57 ` [PATCH 2/3] mci: imx-esdhc-pbl: ls1046a: Add missing ESDHC_FLAG_MULTIBLK_NO_INT Sascha Hauer
2023-12-13 14:57 ` [PATCH 3/3] mci: imx-esdhc-pbl: fix prediv setting Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox