devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chaotian Jing <chaotian.jing@mediatek.com>
To: Julien Thierry <julien.thierry@arm.com>
Cc: Ulf Hansson <ulf.hansson@linaro.org>,
	Mark Rutland <mark.rutland@arm.com>,
	devicetree@vger.kernel.org, srv_heupstream@mediatek.com,
	Catalin Marinas <catalin.marinas@arm.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Will Deacon <will.deacon@arm.com>,
	linux-kernel@vger.kernel.org, yong mao <yong.mao@mediatek.com>,
	Phong LE <ple@baylibre.com>, Rob Herring <robh+dt@kernel.org>,
	linux-mediatek@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	Matthias Brugger <matthias.bgg@gmail.com>,
	linux-mmc@vger.kernel.org, Heiner Kallweit <hkallweit1@gmail.com>
Subject: Re: [PATCH v4 05/12] mmc: mediatek: add pad_tune0 support
Date: Wed, 11 Oct 2017 09:26:57 +0800	[thread overview]
Message-ID: <1507685217.19789.14.camel@mhfsdcap03> (raw)
In-Reply-To: <afac6efe-d721-acae-6c07-adf4cfff962d@arm.com>

On Tue, 2017-10-10 at 17:57 +0100, Julien Thierry wrote:
> Hi,
> 
> On 10/10/17 10:30, Chaotian Jing wrote:
> > from mt2701, the register of PAD_TUNE has been phased out,
> > while there is a new register of PAD_TUNE0
> > 
> > Signed-off-by: Chaotian Jing <chaotian.jing@mediatek.com>
> > ---
> >   drivers/mmc/host/mtk-sd.c | 69 ++++++++++++++++++++++++++++++++++-------------
> >   1 file changed, 51 insertions(+), 18 deletions(-)
> > 
> > diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c
> > index ab2fbbb..0dc45b3 100644
> > --- a/drivers/mmc/host/mtk-sd.c
> > +++ b/drivers/mmc/host/mtk-sd.c
> > @@ -75,6 +75,7 @@
> >   #define MSDC_PATCH_BIT   0xb0
> >   #define MSDC_PATCH_BIT1  0xb4
> >   #define MSDC_PAD_TUNE    0xec
> > +#define MSDC_PAD_TUNE0   0xf0
> >   #define PAD_DS_TUNE      0x188
> >   #define PAD_CMD_TUNE     0x18c
> >   #define EMMC50_CFG0      0x208
> > @@ -301,6 +302,7 @@ struct msdc_save_para {
> >   struct mtk_mmc_compatible {
> >   	u8 clk_div_bits;
> >   	bool hs400_tune; /* only used for MT8173 */
> > +	bool pad_tune0;
> 
> You only use this to decide whether to use MDSC_PAD_TUNE or 
> MSDC_PAD_TUNE0 as tune regs.
> 
> Couldn't this field directly be a 'u32' that is either MDSC_PAD_TUNE or 
> MDSC_PAD_TUNE0 rather than a bool?
> 
Thx, will change to "u32 pad_tune_reg;" at next version.
> >   };
> >   
> >   struct msdc_tune_para {
> > @@ -362,21 +364,25 @@ struct msdc_host {
> >   static const struct mtk_mmc_compatible mt8135_compat = {
> >   	.clk_div_bits = 8,
> >   	.hs400_tune = false,
> > +	.pad_tune0 = false,
> 
> and here we could have (field could be renamed accordingly of course):
> 
> 	.pad_tune0 = MDSC_PAD_TUNE,
> 
> >   };
> >   
> >   static const struct mtk_mmc_compatible mt8173_compat = {
> >   	.clk_div_bits = 8,
> >   	.hs400_tune = true,
> > +	.pad_tune0 = false,
> >   };
> >   
> >   static const struct mtk_mmc_compatible mt2701_compat = {
> >   	.clk_div_bits = 12,
> >   	.hs400_tune = false,
> > +	.pad_tune0 = true,
> 
> here:
> 	.pad_tune0 = MDSC_PAD_TUNE0,
> 
> >   };
> >   
> >   static const struct mtk_mmc_compatible mt2712_compat = {
> >   	.clk_div_bits = 12,
> >   	.hs400_tune = false,
> > +	.pad_tune0 = true,
> >   };
> >   
> >   static const struct of_device_id msdc_of_ids[] = {
> > @@ -581,6 +587,10 @@ static void msdc_set_mclk(struct msdc_host *host, unsigned char timing, u32 hz)
> >   	u32 flags;
> >   	u32 div;
> >   	u32 sclk;
> > +	u32 tune_reg = MSDC_PAD_TUNE;
> > +
> > +	if (host->dev_comp->pad_tune0)
> > +		tune_reg = MSDC_PAD_TUNE0;
> 
> And this would not be needed here nor in the other functions, it could 
> just be replaced by host->dev_comp->pad_tune0.
> 
> Thanks,
> 



  reply	other threads:[~2017-10-11  1:26 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-10  9:30 [PATCH v4 00/13] mmc: mediatek: add support of mt2701/mt2712 Chaotian Jing
2017-10-10  9:30 ` [PATCH v4 01/12] mmc: dt-bindings: Add reg/source_cg/latch-ck for Mediatek MMC bindings Chaotian Jing
2017-10-10 10:45   ` Ulf Hansson
2017-10-10  9:30 ` [PATCH v4 03/12] arm64: dts: mt8173: remove "mediatek,mt8135-mmc" from mmc nodes Chaotian Jing
     [not found]   ` <1507627831-29323-4-git-send-email-chaotian.jing-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2017-10-10 10:49     ` Ulf Hansson
2017-10-10 11:06       ` Matthias Brugger
2017-10-10 11:10         ` Ulf Hansson
2017-10-10 11:11           ` Matthias Brugger
2017-10-10  9:30 ` [PATCH v4 04/12] mmc: mediatek: make hs400_tune_response only for mt8173 Chaotian Jing
2017-10-10  9:30 ` [PATCH v4 05/12] mmc: mediatek: add pad_tune0 support Chaotian Jing
2017-10-10 16:57   ` Julien Thierry
2017-10-11  1:26     ` Chaotian Jing [this message]
2017-10-10  9:30 ` [PATCH v4 06/12] mmc: mediatek: add async fifo and data tune support Chaotian Jing
2017-10-10  9:30 ` [PATCH v4 07/12] mmc: mediatek: add busy_check support Chaotian Jing
2017-10-10  9:30 ` [PATCH v4 08/12] mmc: mediatek: add stop_clk fix and enhance_rx support Chaotian Jing
     [not found] ` <1507627831-29323-1-git-send-email-chaotian.jing-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2017-10-10  9:30   ` [PATCH v4 02/12] mmc: mediatek: add support of mt2701/mt2712 Chaotian Jing
2017-10-10  9:30   ` [PATCH v4 09/12] mmc: mediatek: add support of source_cg clock Chaotian Jing
2017-10-10  9:30 ` [PATCH v4 10/12] mmc: mediatek: add latch-ck support Chaotian Jing
2017-10-10  9:30 ` [PATCH v4 11/12] mmc: mediatek: improve eMMC hs400 mode read performance Chaotian Jing
2017-10-10  9:30 ` [PATCH v4 12/12] mmc: mediatek: perfer to use rise edge latching for cmd line Chaotian Jing

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1507685217.19789.14.camel@mhfsdcap03 \
    --to=chaotian.jing@mediatek.com \
    --cc=catalin.marinas@arm.com \
    --cc=devicetree@vger.kernel.org \
    --cc=hkallweit1@gmail.com \
    --cc=julien.thierry@arm.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=matthias.bgg@gmail.com \
    --cc=ple@baylibre.com \
    --cc=robh+dt@kernel.org \
    --cc=srv_heupstream@mediatek.com \
    --cc=ulf.hansson@linaro.org \
    --cc=will.deacon@arm.com \
    --cc=yong.mao@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).