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.24; helo=mga09.intel.com; envelope-from=tien.hock.loh@intel.com; receiver=edk2-devel@lists.01.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (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 9BB2C21CAD9B2 for ; Wed, 24 Oct 2018 23:56:48 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Oct 2018 23:56:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,423,1534834800"; d="scan'208";a="268629400" Received: from pg-iccf0297.altera.com ([10.104.2.50]) by orsmga005.jf.intel.com with ESMTP; 24 Oct 2018 23:56:45 -0700 From: tien.hock.loh@intel.com To: edk2-devel@lists.01.org, thloh85@gmail.com Date: Thu, 25 Oct 2018 14:56:44 +0800 Message-Id: <1540450604-25982-1-git-send-email-tien.hock.loh@intel.com> X-Mailer: git-send-email 2.2.2 In-Reply-To: References: Subject: [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: Thu, 25 Oct 2018 06:56:48 -0000 From: "Loh, Tien Hock" If SD doesn't support SD_HIGH_SPEED, function should still continue to setup 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 ( 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 = SD_HIGH_SPEED; - Speed = SD_HIGH_SPEED; - - /* SD Switch, Mode:1, Group:0, Value:1 */ - CmdArg = CreateSwitchCmdArgument(1, 0, 1); - Status = MmcHost->SendCommand (MmcHost, MMC_CMD6, CmdArg); - if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a (MMC_CMD6): Error and Status = %r\n", __FUNCTION__, Status)); - return Status; - } else { + /* SD Switch, Mode:1, Group:0, Value:1 */ + CmdArg = CreateSwitchCmdArgument(1, 0, 1); + Status = MmcHost->SendCommand (MmcHost, MMC_CMD6, CmdArg); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a (MMC_CMD6): Error and Status = %r\n", __FUNCTION__, Status)); + return Status; + } else { Status = MmcHost->ReadBlockData (MmcHost, 0, SWITCH_CMD_DATA_LENGTH, Buffer); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_ERROR, "%a (MMC_CMD6): ReadBlockData Error and Status = %r\n", __FUNCTION__, Status)); @@ -495,6 +494,7 @@ InitializeSdMmcDevice ( if ((Buffer[4] & SWITCH_CMD_SUCCESS_MASK) != 0x01000000) { DEBUG((DEBUG_ERROR, "Problem switching SD card into high-speed mode\n")); return Status; + } } } } -- 2.2.2