From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-x233.google.com (mail-wm0-x233.google.com [IPv6:2a00:1450:400c:c09::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id ED0C321967BE1 for ; Thu, 8 Jun 2017 09:54:06 -0700 (PDT) Received: by mail-wm0-x233.google.com with SMTP id x70so81406034wme.0 for ; Thu, 08 Jun 2017 09:55:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=9bV0pfVDsMYeLunrxv+3H7YJK73QgPv1NeU3yF2F7SE=; b=UBHsjyWnWCE1Tnc01DJNCikk9spFoQpndknwb2CjstWkeXO7flpvFJ6MXWQnnFJrZE Km8sRByTE6syH+Hv9nPI7gWnL20ANCQtc1HqV0k9eOK62B/W7t2fo41SaUH1mDPyqN1z c24VFfVeo8XDsP9LUB740R99ExK9fQwKKb0Ng= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=9bV0pfVDsMYeLunrxv+3H7YJK73QgPv1NeU3yF2F7SE=; b=dO6AlH4gRTQ+7p5W4rmtmpWJVPaY0RT+Jvcyph+s+8pBWonOcic/FjmzuRFMIcC6CS KTHDiJ8qLkr/BG4kgIP2hiWa8aJrS9gaJehx0eAsobUdSCRZ9d+MLcy0fPfZieGZPdQy Tydaqux1UGvvcwtXQrNtX6eCbZs3SEIm0eopXjiBTgPsrH80K5n7BVA0dIGw5And/XAj eeU3wHnmVA8RSsioRCfVAPAUgYo2xCzbODt56jzxv1QQiTYk31RuatJsHf5PdKz66mOE /zsIxQBskZd3XJTiEkWEV9wrI2pzF3GRmER+JYwVWdunhqUuJAK64K+U6cayrJRNZ0Jb DacA== X-Gm-Message-State: AODbwcB4cpXnsE/IuZjlQK8FwStWKOPM+FG5fHOmVj1pYxaHcnoRR0RN h71nxvmruWQtop1M X-Received: by 10.28.103.193 with SMTP id b184mr4631494wmc.25.1496940914929; Thu, 08 Jun 2017 09:55:14 -0700 (PDT) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id i64sm7650355wmd.33.2017.06.08.09.55.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Jun 2017 09:55:14 -0700 (PDT) Date: Thu, 8 Jun 2017 17:55:12 +0100 From: Leif Lindholm To: Haojian Zhuang Cc: Jun Nie , edk2-devel@lists.01.org, jason.liu@linaro.org, shawn.guo@linaro.org Message-ID: <20170608165512.GB26676@bivouac.eciton.net> References: <1496909547-16085-1-git-send-email-jun.nie@linaro.org> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [PATCH] EmbeddedPkg/MmcDxe: Add non-DDR timing mode support X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jun 2017 16:54:07 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Jun 08, 2017 at 04:39:44PM +0800, Haojian Zhuang wrote: > On 2017/6/8 16:12, Jun Nie wrote: > >Only DDR mode is support for 8bit mode currently. Add > >non-DDR case when configuring ECSD. > > > >Contributed-under: TianoCore Contribution Agreement 1.0 > >Signed-off-by: Jun Nie > >--- > > EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c | 5 ++++- > > 1 file changed, 4 insertions(+), 1 deletion(-) > > > >diff --git a/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c b/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c > >index 574a77e..5c0d7e7 100644 > >--- a/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c > >+++ b/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c > >@@ -286,7 +286,10 @@ InitializeEmmcDevice ( > > } > > Status = Host->SetIos (Host, BusClockFreq, 8, TimingMode[Idx]); > > if (!EFI_ERROR (Status)) { > >- Status = EmmcSetEXTCSD (MmcHostInstance, EXTCSD_BUS_WIDTH, EMMC_BUS_WIDTH_DDR_8BIT); > >+ if (Idx < 2) > > It's better to avoid hardcoded value at here. Maybe you can use switch & > case on TimingMode array at here. Yes, that would also work. Indeed, if any other possible values than EMMC_BUS_WIDTH_DDR_8BIT or EMMC_BUS_WIDTH_8BIT could be likely in the future, that would be the preferable solution. Regards, Leif > >+ Status = EmmcSetEXTCSD (MmcHostInstance, EXTCSD_BUS_WIDTH, EMMC_BUS_WIDTH_DDR_8BIT); > >+ else > >+ Status = EmmcSetEXTCSD (MmcHostInstance, EXTCSD_BUS_WIDTH, EMMC_BUS_WIDTH_8BIT); > > if (EFI_ERROR (Status)) { > > DEBUG ((DEBUG_ERROR, "InitializeEmmcDevice(): Failed to set EXTCSD bus width, Status:%r\n", Status)); > > } > > > > Best Regards > Haojian > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel