[U-Boot] [PATCH V2] fsl: esdhc: consolidate fsl_esdhc_cfg structure

york sun york.sun at nxp.com
Tue Mar 29 02:33:42 CEST 2016


On 03/15/2016 03:14 AM, Peng Fan wrote:
> We can use phys_addr_to for esdhc_base to discard
> the #ifdef.
> 
> Signed-off-by: Peng Fan <van.freenix at gmail.com>
> Cc: York Sun <york.sun at nxp.com>
> Cc: Yangbo Lu <yangbo.lu at nxp.com>
> Cc: Eric Nelson <eric at nelint.com>
> Cc: Fabio Estevam <fabio.estevam at nxp.com>
> Cc: Pantelis Antoniou <panto at antoniou-consulting.com>
> Cc: Tom Rini <trini at konsulko.com>
> ---
> 
> V2:
>  Split this patch from the V1 patch set.
> 
>  include/fsl_esdhc.h | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/include/fsl_esdhc.h b/include/fsl_esdhc.h
> index 073048f..fa760a5 100644
> --- a/include/fsl_esdhc.h
> +++ b/include/fsl_esdhc.h
> @@ -168,11 +168,7 @@
>  #define ESDHC_VENDORSPEC_VSELECT 0x00000002 /* Use 1.8V */
>  
>  struct fsl_esdhc_cfg {
> -#ifdef CONFIG_FSL_LAYERSCAPE
> -	u64	esdhc_base;
> -#else
> -	u32	esdhc_base;
> -#endif
> +	phys_addr_t esdhc_base;
>  	u32	sdhc_clk;
>  	u8	max_bus_width;
>  	struct mmc_config cfg;
> 

Peng,

I thought this change is trivial and should be OK. But it turns out this change
brings comping warning to many PPC boards

drivers/mmc/fsl_esdhc.c:184:27: warning: cast to pointer from integer of
different size [-Wint-to-pointer-cast]

For assignment like this

struct fsl_esdhc *regs = (struct fsl_esdhc *)cfg->esdhc_base;

The phys_addr is not u32 for many targets.

York



More information about the U-Boot mailing list