From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.151; helo=mga17.intel.com; envelope-from=hao.a.wu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 4F2002063E2E8 for ; Wed, 2 May 2018 19:45:10 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 May 2018 19:45:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,356,1520924400"; d="scan'208";a="225344266" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga005.fm.intel.com with ESMTP; 02 May 2018 19:45:09 -0700 Received: from FMSMSX109.amr.corp.intel.com (10.18.116.9) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 2 May 2018 19:45:09 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx109.amr.corp.intel.com (10.18.116.9) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 2 May 2018 19:45:08 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.240]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.179]) with mapi id 14.03.0319.002; Thu, 3 May 2018 10:45:07 +0800 From: "Wu, Hao A" To: Haojian Zhuang , "edk2-devel@lists.01.org" CC: "Ni, Ruiyu" , "Dong, Eric" , "Ard Biesheuvel" , Leif Lindholm , "Zeng, Star" Thread-Topic: [edk2] [PATCH 1/1] MdeModulePkg/Sd: append CMD12 for multiple blocks Thread-Index: AQHT3rEqLVNOebUG3kmzDGtActbdr6QdUnxQ Date: Thu, 3 May 2018 02:45:06 +0000 Message-ID: References: <1524893045-2958-1-git-send-email-haojian.zhuang@linaro.org> In-Reply-To: <1524893045-2958-1-git-send-email-haojian.zhuang@linaro.org> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH 1/1] MdeModulePkg/Sd: append CMD12 for multiple blocks X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 May 2018 02:45:11 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Haojian, Sorry for the delayed response. As far as I know, we enabled the auto CMD12 feature within: SdMmcExecTrb(), MdeModulePkg\Bus\Pci\SdMmcPciHcDxe\SdMmcPciHci.c // // Only SD memory card needs to use AUTO CMD12 feature. // if (Private->Slot[Trb->Slot].CardType =3D=3D SdCardType) { if (BlkCount > 1) { TransMode |=3D BIT2; } } So I think the explicitly sending CMD12 in SdRwMultiBlocks() is not needed. Have you met problems when using SdRwMultiBlocks()? Could you help to provide detailed device information when you meet the problem? Thanks in advance. Best Regards, Hao Wu > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > Haojian Zhuang > Sent: Saturday, April 28, 2018 1:24 PM > To: edk2-devel@lists.01.org > Cc: Ni, Ruiyu; Dong, Eric; Ard Biesheuvel; Leif Lindholm; Haojian Zhuang;= Zeng, > Star > Subject: [edk2] [PATCH 1/1] MdeModulePkg/Sd: append CMD12 for multiple > blocks >=20 > Send CMD12 to stop transimission for accessing multiple blocks. It's > required by SD Card protocol. >=20 > Cc: Star Zeng > Cc: Eric Dong > Cc: Ruiyu Ni > Cc: Leif Lindholm > Cc: Ard Biesheuvel > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Haojian Zhuang > --- > MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c | 35 > +++++++++++++++++++++++++++++++++++ > 1 file changed, 35 insertions(+) >=20 > diff --git a/MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c > b/MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c > index 516c3e704288..64259f99f9bc 100644 > --- a/MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c > +++ b/MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c > @@ -426,6 +426,36 @@ Error: > return Status; > } >=20 > +EFI_STATUS > +SdStopTrans ( > + IN SD_DEVICE *Device > + ) > +{ > + EFI_STATUS Status; > + EFI_SD_MMC_PASS_THRU_PROTOCOL *PassThru; > + EFI_SD_MMC_COMMAND_BLOCK SdMmcCmdBlk; > + EFI_SD_MMC_STATUS_BLOCK SdMmcStatusBlk; > + EFI_SD_MMC_PASS_THRU_COMMAND_PACKET Packet; > + > + PassThru =3D Device->Private->PassThru; > + > + ZeroMem (&SdMmcCmdBlk, sizeof (SdMmcCmdBlk)); > + ZeroMem (&SdMmcStatusBlk, sizeof (SdMmcStatusBlk)); > + ZeroMem (&Packet, sizeof (Packet)); > + > + Packet.SdMmcCmdBlk =3D &SdMmcCmdBlk; > + Packet.SdMmcStatusBlk =3D &SdMmcStatusBlk; > + Packet.Timeout =3D SD_GENERIC_TIMEOUT; > + > + SdMmcCmdBlk.CommandIndex =3D SD_STOP_TRANSMISSION; > + SdMmcCmdBlk.CommandType =3D SdMmcCommandTypeAc; > + SdMmcCmdBlk.ResponseType =3D SdMmcResponseTypeR1b; > + SdMmcCmdBlk.CommandArgument =3D 0; > + > + Status =3D PassThru->PassThru (PassThru, Device->Slot, &Packet, NULL); > + return Status; > +} > + > /** > Read/write multiple blocks through sync or async I/O request. >=20 > @@ -555,6 +585,11 @@ Error: > } > } >=20 > + if (EFI_ERROR (Status)) { > + return Status; > + } > + > + Status =3D SdStopTrans (Device); > return Status; > } >=20 > -- > 2.7.4 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel