Skip to content
Snippets Groups Projects
Commit ab467c51 authored by Roy Zang's avatar Roy Zang Committed by Kumar Gala
Browse files

fsl_esdhc: Only modify the field we are changing in WML


When we set the read or write watermark in WML we should maintain the
rest of the register as is, rather than using some hard coded value.

Signed-off-by: default avatarRoy Zang <tie-fei.zang@freescale.com>
Acked-by: default avatarStefano Babic <sbabic@denx.de>
Signed-off-by: default avatarKumar Gala <galak@kernel.crashing.org>
parent 48bb3bb5
No related branches found
No related tags found
No related merge requests found
...@@ -110,8 +110,7 @@ static int esdhc_setup_data(struct mmc *mmc, struct mmc_data *data) ...@@ -110,8 +110,7 @@ static int esdhc_setup_data(struct mmc *mmc, struct mmc_data *data)
if (wml_value > 0x10) if (wml_value > 0x10)
wml_value = 0x10; wml_value = 0x10;
wml_value = 0x100000 | wml_value; esdhc_clrsetbits32(&regs->wml, WML_RD_WML_MASK, wml_value);
esdhc_write32(&regs->dsaddr, (u32)data->dest); esdhc_write32(&regs->dsaddr, (u32)data->dest);
} else { } else {
if (wml_value > 0x80) if (wml_value > 0x80)
...@@ -120,12 +119,12 @@ static int esdhc_setup_data(struct mmc *mmc, struct mmc_data *data) ...@@ -120,12 +119,12 @@ static int esdhc_setup_data(struct mmc *mmc, struct mmc_data *data)
printf("\nThe SD card is locked. Can not write to a locked card.\n\n"); printf("\nThe SD card is locked. Can not write to a locked card.\n\n");
return TIMEOUT; return TIMEOUT;
} }
wml_value = wml_value << 16 | 0x10;
esdhc_clrsetbits32(&regs->wml, WML_WR_WML_MASK,
wml_value << 16);
esdhc_write32(&regs->dsaddr, (u32)data->src); esdhc_write32(&regs->dsaddr, (u32)data->src);
} }
esdhc_write32(&regs->wml, wml_value);
esdhc_write32(&regs->blkattr, data->blocks << 16 | data->blocksize); esdhc_write32(&regs->blkattr, data->blocks << 16 | data->blocksize);
/* Calculate the timeout period for data transactions */ /* Calculate the timeout period for data transactions */
......
...@@ -133,6 +133,8 @@ ...@@ -133,6 +133,8 @@
#define WML 0x2e044 #define WML 0x2e044
#define WML_WRITE 0x00010000 #define WML_WRITE 0x00010000
#define WML_RD_WML_MASK 0xff
#define WML_WR_WML_MASK 0xff0000
#define BLKATTR 0x2e004 #define BLKATTR 0x2e004
#define BLKATTR_CNT(x) ((x & 0xffff) << 16) #define BLKATTR_CNT(x) ((x & 0xffff) << 16)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment