From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.20; helo=mga02.intel.com; envelope-from=tien.hock.loh@intel.com; receiver=edk2-devel@lists.01.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (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 C6C46211D9175 for ; Thu, 14 Mar 2019 20:28:13 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Mar 2019 20:28:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,480,1544515200"; d="scan'208";a="140910197" Received: from kmsmsx154.gar.corp.intel.com ([172.21.73.14]) by FMSMGA003.fm.intel.com with ESMTP; 14 Mar 2019 20:28:11 -0700 Received: from pgsmsx110.gar.corp.intel.com ([169.254.13.245]) by KMSMSX154.gar.corp.intel.com ([169.254.12.175]) with mapi id 14.03.0415.000; Fri, 15 Mar 2019 11:27:17 +0800 From: "Loh, Tien Hock" To: "edk2-devel@lists.01.org" , "leif.lindholm@linaro.org" , "ard.biesheuvel@linaro.org" , "thloh85@gmail.com" Thread-Topic: [PATCH 1/1] SD : Continue setting up sd even if SD_HIGH_SPEED is not supported Thread-Index: AQHUyoR7cNo41ROBakm/13lNRo9fd6YMKMIg Date: Fri, 15 Mar 2019 03:27:17 +0000 Message-ID: References: <1550822283-26255-1-git-send-email-tien.hock.loh@intel.com> In-Reply-To: <1550822283-26255-1-git-send-email-tien.hock.loh@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZTRmYWM2MTktMDE3Ny00MGE3LWE3NzAtZjdiYzdkMjc4NWFjIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiZHA0cFp5YW40SG04cFoyek5zYjdGR3FzdEV2STFPWlA4WUJBNVc4SE1Ea3FaQUhBejFzWkVBOEtIMG9PbEpHRSJ9 x-originating-ip: [172.30.20.205] MIME-Version: 1.0 Subject: Re: [PATCH 1/1] SD : Continue setting up sd even if SD_HIGH_SPEED is not supported X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Mar 2019 03:28:14 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Leif, Ard, Any comments on this patch? Thanks Tien Hock -----Original Message----- From: Loh, Tien Hock=20 Sent: Friday, February 22, 2019 3:58 PM To: edk2-devel@lists.01.org; leif.lindholm@linaro.org; ard.biesheuvel@linar= o.org; thloh85@gmail.com Cc: Loh, Tien Hock Subject: [PATCH 1/1] SD : Continue setting up sd even if SD_HIGH_SPEED is n= ot supported From: "Loh, Tien Hock" If SD doesn't support SD_HIGH_SPEED, function should still continue to setu= p SD to go into 4 bits more if it is supported. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Loh Tien Hock --- EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c b/EmbeddedPkg= /Universal/MmcDxe/MmcIdentification.c index f661a0c..8fd5c31 100755 --- a/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c +++ b/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c @@ -474,18 +474,17 @@ InitializeSdMmcDevice ( =20 if (!(Buffer[3] & SD_HIGH_SPEED_SUPPORTED)) { DEBUG ((DEBUG_ERROR, "%a : High Speed not supported by Card %r\n", _= _FUNCTION__, Status)); - return Status; } + else { + Speed =3D SD_HIGH_SPEED; =20 - Speed =3D SD_HIGH_SPEED; - - /* SD Switch, Mode:1, Group:0, Value:1 */ - CmdArg =3D CreateSwitchCmdArgument(1, 0, 1); - Status =3D MmcHost->SendCommand (MmcHost, MMC_CMD6, CmdArg); - if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a (MMC_CMD6): Error and Status =3D %r\n", __F= UNCTION__, Status)); - return Status; - } else { + /* SD Switch, Mode:1, Group:0, Value:1 */ + CmdArg =3D CreateSwitchCmdArgument(1, 0, 1); + Status =3D MmcHost->SendCommand (MmcHost, MMC_CMD6, CmdArg); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a (MMC_CMD6): Error and Status =3D %r\n", _= _FUNCTION__, Status)); + return Status; + } else { Status =3D MmcHost->ReadBlockData (MmcHost, 0, SWITCH_CMD_DATA_LENGT= H, Buffer); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_ERROR, "%a (MMC_CMD6): ReadBlockData Error and Statu= s =3D %r\n", __FUNCTION__, Status)); @@ -495,6 +494,7 @@ InitializeSdMmcDev= ice ( if ((Buffer[4] & SWITCH_CMD_SUCCESS_MASK) !=3D 0x01000000) { DEBUG((DEBUG_ERROR, "Problem switching SD card into high-speed mod= e\n")); return Status; + } } } } -- 2.2.2