From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c0c::22b; helo=mail-wr0-x22b.google.com; envelope-from=haojian.zhuang@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr0-x22b.google.com (mail-wr0-x22b.google.com [IPv6:2a00:1450:400c:c0c::22b]) (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 5048F203B85BD for ; Wed, 9 May 2018 02:56:53 -0700 (PDT) Received: by mail-wr0-x22b.google.com with SMTP id h5-v6so11148421wrm.4 for ; Wed, 09 May 2018 02:56:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=WV+v6TXzOVSAy76EMDVRo4FxGkZBue2vrvbufrFFZZ4=; b=QL+wcBKwsNaL2/did5oE17IrmQHwNYQuMEnMIPAEHPLBOuWqZ/zdCVUSD17gw1DG+K viEsXbsa9irUVynbIzVyedvmDnwemub293XICRL3WLgeqq0tAYSHXnQv62bwQ97cP+JZ DBt7DvNBToVef5odvQt66GD5WwrFDDAjUvfXQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=WV+v6TXzOVSAy76EMDVRo4FxGkZBue2vrvbufrFFZZ4=; b=pSTqbm8+Hc4/BnGKnIUy0Jv953sL6hFxiv253FCEX5A+Ot/gHkpkm4eFRcwEHDJlFi ioB+Cutq+s7Y7kH0fvKAcFlRJ4w+tgGKQDTYWuNW+njHW9241LiuaCLvKq+Kczea32Ko rl9uEzyisn/4c2sFLVm47LxFKpEru3QDVW+NHY11An3Wj+kCc8iddSilFYzYhvWsMpqD l/jZmRGehpze5uHJOm48sYqxgt8VuvFE8DV7cUP6tU4rj9kGuUx0NUsVbkQLg7V5/qkL 3kLv4FBj2qlrg7m1yn90HFRk/OyA5qvWnR+YdfM6T2zt1MsLpOjC8eLGIDukNyqoMlKK tItA== X-Gm-Message-State: ALQs6tDAoppBfYuRbdWOmLNsIjwTs2w6jJVcqGkY5VLHwH47MEubQ8Ew u3forHaq3rz6D8wgmiiBHfplXJytrjGu5nOHpzwILA== X-Google-Smtp-Source: AB8JxZqw6b8HthXxpAKr3W9aCCtlikUPgCDEQobznZScT98ftmbu2KUufL6ObNrzI2nHPqurSyVLcuykRiF4povGfhc= X-Received: by 2002:adf:e181:: with SMTP id k1-v6mr37135132wri.111.1525859811882; Wed, 09 May 2018 02:56:51 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.150.22 with HTTP; Wed, 9 May 2018 02:56:51 -0700 (PDT) In-Reply-To: References: <1524893045-2958-1-git-send-email-haojian.zhuang@linaro.org> From: Haojian Zhuang Date: Wed, 9 May 2018 17:56:51 +0800 Message-ID: To: "Wu, Hao A" Cc: "edk2-devel@lists.01.org" , "Ni, Ruiyu" , "Dong, Eric" , Ard Biesheuvel , Leif Lindholm , "Zeng, Star" 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: Wed, 09 May 2018 09:56:53 -0000 Content-Type: text/plain; charset="UTF-8" Hi Hao, OK. I tried to enable auto stop command in Designware MMC driver. So this patch could be ignored. Thanks Haojian On 3 May 2018 at 10:45, Wu, Hao A wrote: > 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 == SdCardType) { > if (BlkCount > 1) { > TransMode |= 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 >> >> Send CMD12 to stop transimission for accessing multiple blocks. It's >> required by SD Card protocol. >> >> 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(+) >> >> 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; >> } >> >> +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 = Device->Private->PassThru; >> + >> + ZeroMem (&SdMmcCmdBlk, sizeof (SdMmcCmdBlk)); >> + ZeroMem (&SdMmcStatusBlk, sizeof (SdMmcStatusBlk)); >> + ZeroMem (&Packet, sizeof (Packet)); >> + >> + Packet.SdMmcCmdBlk = &SdMmcCmdBlk; >> + Packet.SdMmcStatusBlk = &SdMmcStatusBlk; >> + Packet.Timeout = SD_GENERIC_TIMEOUT; >> + >> + SdMmcCmdBlk.CommandIndex = SD_STOP_TRANSMISSION; >> + SdMmcCmdBlk.CommandType = SdMmcCommandTypeAc; >> + SdMmcCmdBlk.ResponseType = SdMmcResponseTypeR1b; >> + SdMmcCmdBlk.CommandArgument = 0; >> + >> + Status = PassThru->PassThru (PassThru, Device->Slot, &Packet, NULL); >> + return Status; >> +} >> + >> /** >> Read/write multiple blocks through sync or async I/O request. >> >> @@ -555,6 +585,11 @@ Error: >> } >> } >> >> + if (EFI_ERROR (Status)) { >> + return Status; >> + } >> + >> + Status = SdStopTrans (Device); >> return Status; >> } >> >> -- >> 2.7.4 >> >> _______________________________________________ >> edk2-devel mailing list >> edk2-devel@lists.01.org >> https://lists.01.org/mailman/listinfo/edk2-devel