From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Nelson Date: Sat, 24 Mar 2012 15:36:14 -0700 Subject: [U-Boot] [PATCH] i.MX: fsl_esdhc: allow use with cache enabled. In-Reply-To: <4F646C92.3060000@denx.de> References: <1330814276-2425-1-git-send-email-eric.nelson@boundarydevices.com> <4F646C92.3060000@denx.de> Message-ID: <4F6E4C5E.4030007@boundarydevices.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Stefano, Sorry I let this linger. On 03/17/2012 03:50 AM, Stefano Babic wrote: > On 03/03/2012 23:37, Eric Nelson wrote: >> Signed-off-by: Eric Nelson >> --- > > Hi Eric, > > I have added Andy in CC as MMC Maintainer > >> drivers/mmc/fsl_esdhc.c | 12 +++++++++++- >> 1 files changed, 11 insertions(+), 1 deletions(-) >> >> diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c >> index a2f35e3..8e4bcef 100644 >> --- a/drivers/mmc/fsl_esdhc.c >> +++ b/drivers/mmc/fsl_esdhc.c >> @@ -190,6 +190,8 @@ static int esdhc_setup_data(struct mmc *mmc, struct mmc_data *data) >> esdhc_clrsetbits32(®s->wml, WML_RD_WML_MASK, wml_value); >> esdhc_write32(®s->dsaddr, (u32)data->dest); >> } else { >> + flush_dcache_range((ulong)data->src,(ulong)data->src+data->blocks*data->blocksize); > > This breaks PowerPC boards. > Can you tell me how? AFAIK, blocksize needs to be a multiple of 512 so this should be cache-safe with any cacheline size. >> + >> if (wml_value> WML_WR_WML_MAX) >> wml_value = WML_WR_WML_MAX_VAL; >> if ((esdhc_read32(®s->prsstat)& PRSSTAT_WPSPL) == 0) { >> @@ -249,7 +251,12 @@ static int esdhc_setup_data(struct mmc *mmc, struct mmc_data *data) >> return 0; >> } >> >> - >> +static void check_and_invalidate_dcache_range(struct mmc_cmd *cmd, struct mmc_data *data) { >> + unsigned start = data->dest ; > > A cast is missing, a warning is generated. > Yep. I recognized that right **after** I hit ... If you can give me some guidance on the comment above, I'll address with a V2. Regards, Eric