fsl_esdhc: Only modify the field we are changing in WML
PATCH v2 1/1 fsl_esdhc: Only modify the field we are changing in WML
From: Roy Zang <[email protected]>
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.
---
* Fixed line length
drivers/mmc/fsl_esdhc.c | 9 ++++----- include/fsl_esdhc.h | 2 ++ 2 files changed, 6 insertions(+), 5 deletions(-)
drivers/mmc/fsl_esdhc.c +4 -5
@@ -110,8 +110,7 @@ static int esdhc_setup_data(struct mmc *mmc, struct mmc_data *data)if (wml_value >0x10 ) wml_value =0x10 ; - wml_value =0x100000 | wml_value; - +esdhc_clrsetbits32 (®s->wml,WML_RD_WML_MASK , wml_value);esdhc_write32 (®s->dsaddr, (u32 )data->dest); }else {if (wml_value >0x80 )
@@ -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" );return TIMEOUT ; } - wml_value = wml_value <<16 |0x10 ; + +esdhc_clrsetbits32 (®s->wml,WML_WR_WML_MASK , + wml_value <<16 );esdhc_write32 (®s->dsaddr, (u32 )data->src); } -esdhc_write32 (®s->wml, wml_value); -esdhc_write32 (®s->blkattr, data->blocks <<16 | data->blocksize);/* Calculate the timeout period for data transactions */
include/fsl_esdhc.h +2 -0
@@ -133,6 +133,8 @@#define WML 0x2e044#define WML_WRITE 0x00010000 +#define WML_RD_WML_MASK 0xff +#define WML_WR_WML_MASK 0xff0000#define BLKATTR 0x2e004#define BLKATTR_CNT (x) ((x & 0xffff) << 16)
Signature · 1 line
1.6.0.6
PATCH v2 1/1 fsl_esdhc: Only modify the field we are changing in WML
Quoted 18 lines
-----Original Message-----
From: Kumar Gala [mailto:galak at kernel.crashing.org]
Sent: Monday, March 22, 2010 2:12 AM
To: u-boot at lists.denx.de
Cc: Zang Roy-R61911
Subject: [PATCH v2]fsl_esdhc: Only modify the field we are changing in WMLFrom: Roy Zang <[email protected]>
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 Roy Zang <[email protected]>Acked-by Stefano Babic <[email protected]>Signed-off-by Kumar Gala <[email protected]>
Quoted 6 lines
---
* Fixed line lengthdrivers/mmc/fsl_esdhc.c | 9 ++++----- include/fsl_esdhc.h | 2 ++ 2 files changed, 6 insertions(+), 5 deletions(-)
Thanks.
I have posted this about one month ago:
http://lists.denx.de/pipermail/u-boot/2010-February/068020.html
Roy