[U-Boot] [PATCH] i.MX: fsl_esdhc: allow use with cache enabled.

Stefano Babic sbabic at denx.de
Sat Mar 17 11:50:58 CET 2012


On 03/03/2012 23:37, Eric Nelson wrote:
> Signed-off-by: Eric Nelson <eric.nelson at boundarydevices.com>
> ---

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(&regs->wml, WML_RD_WML_MASK, wml_value);
>  		esdhc_write32(&regs->dsaddr, (u32)data->dest);
>  	} else {
> +                flush_dcache_range((ulong)data->src,(ulong)data->src+data->blocks*data->blocksize);

This breaks PowerPC boards.

> +
>  		if (wml_value > WML_WR_WML_MAX)
>  			wml_value = WML_WR_WML_MAX_VAL;
>  		if ((esdhc_read32(&regs->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.

> +	unsigned size = roundup(ARCH_DMA_MINALIGN,data->blocks*data->blocksize);
> +	unsigned end = start+size ;
> +	invalidate_dcache_range(start,end)

This also breaks PowerPC boards.

Best regards,
Stefano Babic

-- 
=====================================================================
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
=====================================================================


More information about the U-Boot mailing list