From: Leif Lindholm <leif.lindholm@linaro.org>
To: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com>
Cc: Jun Nie <jun.nie@linaro.org>,
Haojian Zhuang <haojian.zhuang@linaro.org>,
"ard.biesheuvel@linaro.org" <ard.biesheuvel@linaro.org>,
"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Subject: Re: [PATCH] SD/eMMC : Fix Command Argument for SD/eMMC R/W operation.
Date: Wed, 23 Jan 2019 15:04:10 +0000 [thread overview]
Message-ID: <20190123150410.emsih5kfrdiksma4@bivouac.eciton.net> (raw)
In-Reply-To: <VI1PR04MB468520B7B4F4F154168E14918E980@VI1PR04MB4685.eurprd04.prod.outlook.com>
Well, if we don't hear back, I can just commit it anyway before the
end of the week. One question/comment inline below:
On Tue, Jan 22, 2019 at 04:29:50AM +0000, Meenakshi Aggarwal wrote:
> Hi Jun, Haojian,
>
> Please review the patch.
>
> Thanks,
> Meenakshi
>
> > -----Original Message-----
> > From: Leif Lindholm <leif.lindholm@linaro.org>
> > Sent: Thursday, January 17, 2019 4:54 PM
> > To: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com>
> > Cc: ard.biesheuvel@linaro.org; edk2-devel@lists.01.org; Jun Nie
> > <jun.nie@linaro.org>; Haojian Zhuang <haojian.zhuang@linaro.org>
> > Subject: Re: [PATCH] SD/eMMC : Fix Command Argument for SD/eMMC R/W
> > operation.
> >
> > Jun, Haojian - any comments?
> >
> > On Wed, Jan 16, 2019 at 06:51:36PM +0530, Meenakshi Aggarwal wrote:
> > > Issue : SD read failure for high capacity cards e.g. 64 GB i Reason :
> > > Command argument value exceeds 32 bit for block number 0x3787FFF and
> > > cant be fit into 32 bit wide SD host controller register.
> > >
> > > Fix :
> > > AccessMode bits [29:30] of OCR is a valid definition to calculate data
> > > address for eMMC cards.
> > >
> > > For SD cards, data address is calculated on the basis of card capacity
> > > status bit[30] of OCR.
> > >
> > > Contributed-under: TianoCore Contribution Agreement 1.1
> > > Signed-off-by: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com>
> > > ---
> > > EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c | 19 ++++++++++++++-----
> > > 1 file changed, 14 insertions(+), 5 deletions(-)
> > >
> > > diff --git a/EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c
> > > b/EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c
> > > index a2b9232..625a59e 100644
> > > --- a/EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c
> > > +++ b/EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c
> > > @@ -148,12 +148,21 @@ MmcTransferBlock (
> > > MmcHostInstance = MMC_HOST_INSTANCE_FROM_BLOCK_IO_THIS (This);
> > > MmcHost = MmcHostInstance->MmcHost;
> > >
> > > - //Set command argument based on the card access mode (Byte mode or
> > > Block mode)
> > > - if ((MmcHostInstance->CardInfo.OCRData.AccessMode &
> > MMC_OCR_ACCESS_MASK) ==
> > > - MMC_OCR_ACCESS_SECTOR) {
> > > - CmdArg = Lba;
> > > + if (MmcHostInstance->CardInfo.CardType != EMMC_CARD) {
> > > + //Set command argument based on the card capacity (SDSC or SDXC/SDHC)
> > > + if (MmcHostInstance->CardInfo.OCRData.AccessMode & BIT1) {
What is BIT1? Can we add a #define for it?
(The comment _nearly_ but not quite explains it to me.)
/
Leif
> > > + CmdArg = Lba;
> > > + } else {
> > > + CmdArg = Lba * This->Media->BlockSize;
> > > + }
> > > } else {
> > > - CmdArg = Lba * This->Media->BlockSize;
> > > + //Set command argument based on the card access mode (Byte mode or
> > Block mode)
> > > + if ((MmcHostInstance->CardInfo.OCRData.AccessMode &
> > MMC_OCR_ACCESS_MASK) ==
> > > + MMC_OCR_ACCESS_SECTOR) {
> > > + CmdArg = Lba;
> > > + } else {
> > > + CmdArg = Lba * This->Media->BlockSize;
> > > + }
> > > }
> > >
> > > Status = MmcHost->SendCommand (MmcHost, Cmd, CmdArg);
> > > --
> > > 1.9.1
> > >
next prev parent reply other threads:[~2019-01-23 15:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-16 13:21 [PATCH] SD/eMMC : Fix Command Argument for SD/eMMC R/W operation Meenakshi Aggarwal
2019-01-17 11:23 ` Leif Lindholm
2019-01-22 4:29 ` Meenakshi Aggarwal
2019-01-23 15:04 ` Leif Lindholm [this message]
2019-01-24 14:05 ` [PATCH v2] " Meenakshi Aggarwal
2019-01-29 4:43 ` Meenakshi Aggarwal
2019-01-30 4:26 ` Meenakshi Aggarwal
2019-01-30 17:49 ` Leif Lindholm
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-list 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=20190123150410.emsih5kfrdiksma4@bivouac.eciton.net \
--to=devel@edk2.groups.io \
/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