[PATCH v6 6/7] mmc: renesas-sdhi: Add SDHI quirks for R-Car H3 and RZ/G2H

Biju Das biju.das.jz at bp.renesas.com
Tue Nov 3 11:18:38 CET 2020


Hi Jaehoon Chung,

Thanks for the feedback.

> Subject: Re: [PATCH v6 6/7] mmc: renesas-sdhi: Add SDHI quirks for R-Car H3
> and RZ/G2H
> 
> Hi,
> 
> On 11/3/20 1:16 AM, Biju Das wrote:
> > Add SDHI quirks for R-Car H3 and RZ/G2H SoC.
> 
> Does it needs to use quirks? IMO, Using fixup for each SoC is better than
> quirks.

This work is based on linux[1]. For maintainability we want to make u-boot code similar to linux, so that in future if there
is any improvement in linux we can port here easily.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/mmc/host/renesas_sdhi_core.c?h=v5.10-rc2#n886

Regards,
Biju

> 
> Best Regards,
> Jaehoon Chung
> 
> >
> > Signed-off-by: Biju Das <biju.das.jz at bp.renesas.com>
> > Reviewed-by: Lad Prabhakar <prabhakar.mahadev-
> lad.rj at bp.renesas.com>
> > ---
> >  v6: New patch. Quirks using soc_device_match.
> > ---
> >  drivers/mmc/renesas-sdhi.c | 37
> ++++++++++++++++++++++++++++++++++++-
> >  1 file changed, 36 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/mmc/renesas-sdhi.c b/drivers/mmc/renesas-sdhi.c
> > index 0e4a44d973..e19daf8bf8 100644
> > --- a/drivers/mmc/renesas-sdhi.c
> > +++ b/drivers/mmc/renesas-sdhi.c
> > @@ -875,6 +875,16 @@ static const struct renesas_sdhi_quirks
> sdhi_quirks_4tap_nohs400 = {
> >  	.hs400_4taps = true,
> >  };
> >
> > +static const struct renesas_sdhi_quirks sdhi_quirks_4tap = {
> > +	.hs400_4taps = true,
> > +	.hs400_bad_taps = BIT(2) | BIT(3) | BIT(6) | BIT(7), };
> > +
> > +static const struct renesas_sdhi_quirks sdhi_quirks_r8a7795_es30 = {
> > +	.hs400_bad_taps = BIT(2) | BIT(3) | BIT(6) | BIT(7),
> > +	.hs400_calib_table = r8a7795_calib_table, };
> > +
> >  static const struct renesas_sdhi_quirks sdhi_quirks_r8a7796_es12 = {
> >  	.hs400_4taps = true,
> >  	.hs400_bad_taps = BIT(2) | BIT(3) | BIT(6) | BIT(7), @@ -916,6
> > +926,30 @@ static const struct soc_attr sdhi_quirks_match[]  = {
> >  	{ .soc_id = "r8a774b1",
> >  	  .data = &sdhi_quirks_r8a77965
> >  	},
> > +	{ .soc_id = "r8a774e1",
> > +	  .revision = "ES2.0",
> > +	  .data = &sdhi_quirks_4tap
> > +	},
> > +	{ .soc_id = "r8a774e1",
> > +	  .revision = "ES3.0",
> > +	  .data = &sdhi_quirks_r8a7795_es30
> > +	},
> > +	{ .soc_id = "r8a7795",
> > +	  .revision = "ES1.0",
> > +	  .data = &sdhi_quirks_4tap_nohs400_b17_dtrend
> > +	},
> > +	{ .soc_id = "r8a7795",
> > +	  .revision = "ES1.1",
> > +	  .data = &sdhi_quirks_4tap_nohs400_b17_dtrend
> > +	},
> > +	{ .soc_id = "r8a7795",
> > +	  .revision = "ES2.0",
> > +	  .data = &sdhi_quirks_4tap
> > +	},
> > +	{ .soc_id = "r8a7795",
> > +	  .revision = "ES3.0",
> > +	  .data = &sdhi_quirks_r8a7795_es30
> > +	},
> >  	{ .soc_id = "r8a7796",
> >  	  .revision = "ES1.0",
> >  	  .data = &sdhi_quirks_4tap_nohs400_b17_dtrend
> > @@ -965,7 +999,8 @@ static void renesas_sdhi_add_quirks(struct
> tmio_sd_plat *plat,
> >  		if (quirks == &sdhi_quirks_r8a7796_es12 ||
> >  		    quirks == &sdhi_quirks_r8a77965)
> >  			priv->adjust_hs400_offset = 3;
> > -		else if (quirks == &sdhi_quirks_r8a7796_es13)
> > +		else if (quirks == &sdhi_quirks_r8a7796_es13 ||
> > +			 quirks == &sdhi_quirks_r8a7795_es30)
> >  			priv->adjust_hs400_offset = 0;
> >  	}
> >  }
> >



More information about the U-Boot mailing list