* [U-Boot] [PATCH 3/3] fsl_esdhc: Only modify the field we are changing in WML
@ 2010-03-19 18:56 Kumar Gala
2010-03-20 17:59 ` Stefano Babic
0 siblings, 1 reply; 3+ messages in thread
From: Kumar Gala @ 2010-03-19 18:56 UTC (permalink / raw)
To: u-boot
From: Roy Zang <tie-fei.zang@freescale.com>
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 <tie-fei.zang@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
* This patch supercededs (fsl_esdhc: Only modify WML[WR] field)
drivers/mmc/fsl_esdhc.c | 8 +++-----
include/fsl_esdhc.h | 2 ++
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
index 999b581..c7b7e84 100644
--- a/drivers/mmc/fsl_esdhc.c
+++ b/drivers/mmc/fsl_esdhc.c
@@ -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,11 @@ 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 */
diff --git a/include/fsl_esdhc.h b/include/fsl_esdhc.h
index 5f02018..f9ae15a 100644
--- a/include/fsl_esdhc.h
+++ b/include/fsl_esdhc.h
@@ -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)
--
1.6.0.6
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH 3/3] fsl_esdhc: Only modify the field we are changing in WML
2010-03-19 18:56 [U-Boot] [PATCH 3/3] fsl_esdhc: Only modify the field we are changing in WML Kumar Gala
@ 2010-03-20 17:59 ` Stefano Babic
2010-03-21 17:09 ` Kumar Gala
0 siblings, 1 reply; 3+ messages in thread
From: Stefano Babic @ 2010-03-20 17:59 UTC (permalink / raw)
To: u-boot
Kumar Gala wrote:
> From: Roy Zang <tie-fei.zang@freescale.com>
>
> 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 <tie-fei.zang@freescale.com>
> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
> ---
> * This patch supercededs (fsl_esdhc: Only modify WML[WR] field)
Hi,
> + esdhc_clrsetbits32(®s->wml, WML_WR_WML_MASK, wml_value << 16);
Line too long.
Tested successfully on mx51evk.
Acked-by: Stefano Babic <sbabic@denx.de>
Regards,
Stefano
--
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH 3/3] fsl_esdhc: Only modify the field we are changing in WML
2010-03-20 17:59 ` Stefano Babic
@ 2010-03-21 17:09 ` Kumar Gala
0 siblings, 0 replies; 3+ messages in thread
From: Kumar Gala @ 2010-03-21 17:09 UTC (permalink / raw)
To: u-boot
On Mar 20, 2010, at 12:59 PM, Stefano Babic wrote:
> Kumar Gala wrote:
>> From: Roy Zang <tie-fei.zang@freescale.com>
>>
>> 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 <tie-fei.zang@freescale.com>
>> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
>> ---
>> * This patch supercededs (fsl_esdhc: Only modify WML[WR] field)
>
> Hi,
>
>> + esdhc_clrsetbits32(®s->wml, WML_WR_WML_MASK, wml_value << 16);
>
> Line too long.
>
> Tested successfully on mx51evk.
>
> Acked-by: Stefano Babic <sbabic@denx.de>
>
> Regards,
> Stefano
Thanks, will fix the line length in my git tree commit.
- k
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-03-21 17:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-19 18:56 [U-Boot] [PATCH 3/3] fsl_esdhc: Only modify the field we are changing in WML Kumar Gala
2010-03-20 17:59 ` Stefano Babic
2010-03-21 17:09 ` Kumar Gala
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.