From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=fail (domain: intel.com, ip: , mailfrom: tien.hock.loh@intel.com) Received: from mga02.intel.com (mga02.intel.com []) by groups.io with SMTP; Mon, 27 May 2019 02:31:53 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 May 2019 02:31:52 -0700 X-ExtLoop1: 1 Received: from pg-nx11.altera.com ([10.104.4.26]) by orsmga008.jf.intel.com with ESMTP; 27 May 2019 02:31:51 -0700 From: "Loh, Tien Hock" To: devel@edk2.groups.io, thloh85@gmail.com Cc: "Tien Hock, Loh" , Leif Lindholm , Ard Biesheuvel Subject: [PATCH v2 3/7] EmbeddedPkg: Send command when MMC ask for response Date: Mon, 27 May 2019 17:30:24 +0800 Message-Id: <1558949428-190715-4-git-send-email-tien.hock.loh@intel.com> X-Mailer: git-send-email 2.2.2 In-Reply-To: <1558949428-190715-1-git-send-email-tien.hock.loh@intel.com> References: <1558949428-190715-1-git-send-email-tien.hock.loh@intel.com> From: "Tien Hock, Loh" Send command when MMC ask for response in DwEmmcReceiveResponse, and command is a pending command (eg. DMA needs to be set up first) Signed-off-by: "Tien Hock, Loh" Cc: Leif Lindholm Cc: Ard Biesheuvel --- EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c index fd3a5bf685..c44e310c04 100644 --- a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c +++ b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c @@ -400,6 +400,8 @@ DwEmmcSendCommand ( mDwEmmcCommand = Cmd; mDwEmmcArgument = Argument; } else { + mDwEmmcCommand = Cmd; + mDwEmmcArgument = Argument; Status = SendCommand (Cmd, Argument); } return Status; @@ -412,10 +414,15 @@ DwEmmcReceiveResponse ( IN UINT32* Buffer ) { + EFI_STATUS Status = EFI_SUCCESS; + if (Buffer == NULL) { return EFI_INVALID_PARAMETER; } + if(IsPendingReadCommand (mDwEmmcCommand) || IsPendingWriteCommand(mDwEmmcCommand)) + Status = SendCommand (mDwEmmcCommand, mDwEmmcArgument); + if ( (Type == MMC_RESPONSE_TYPE_R1) || (Type == MMC_RESPONSE_TYPE_R1b) || (Type == MMC_RESPONSE_TYPE_R3) @@ -429,7 +436,7 @@ DwEmmcReceiveResponse ( Buffer[2] = MmioRead32 (DWEMMC_RESP2); Buffer[3] = MmioRead32 (DWEMMC_RESP3); } - return EFI_SUCCESS; + return Status; } VOID -- 2.19.0