From patchwork Tue Jul 19 07:37:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 72266 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp530798qga; Tue, 19 Jul 2016 00:37:49 -0700 (PDT) X-Received: by 10.66.124.136 with SMTP id mi8mr1875583pab.26.1468913869437; Tue, 19 Jul 2016 00:37:49 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id ap9si31397208pad.30.2016.07.19.00.37.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Jul 2016 00:37:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 5CCAB1A1E24; Tue, 19 Jul 2016 00:38:38 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-pa0-x229.google.com (mail-pa0-x229.google.com [IPv6:2607:f8b0:400e:c03::229]) (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 202361A1E1F for ; Tue, 19 Jul 2016 00:38:37 -0700 (PDT) Received: by mail-pa0-x229.google.com with SMTP id ks6so4594307pab.0 for ; Tue, 19 Jul 2016 00:37:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=bzaGWaqCafaom3T9kv7H5y91xdhBNUWyqCT5t9c54Ro=; b=Zk9KlxqOvccCon7NoLaHiVgk57BFZtsWbj9PNkK+NG6BzDBIjsI2Vz4V3ToiZ6htLF NNoiQT9/9ShYvqHzfufIehVRW8z8v7wf50Qlk0GNncLqoncs7+RjprrJdjcYSog0naJ/ oza5XqOeZU4Ux5pjdaiHNGoWRBLEWKm1avmoE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=bzaGWaqCafaom3T9kv7H5y91xdhBNUWyqCT5t9c54Ro=; b=FOfT82JI9pk4M7K5fVkGii17/xt0Fp2TQ3c7k0CFs18k7iN2yd6FNmpZJEn9Zsuu/r Vk6D36rVO665LC/BTGFlQ+ATEWIGzZryJ9IjhX8yB7XGZF1GL8Y6q/Boy/pxhaezRVs5 0718FLZiswfJCuLNuxTWGb1PEmrn1QSaHUjliouzUnQ4WrPid0RPFv8Ju8z3SE1zE7oG fVFxQYEWBPXWdumJn0ByXmpzW/uaervKg5V7OKmPq5HidSF4fZREg8jdGHgEM3JzKfVn +yuXaipXpwFl6zIqc05u/nkd6AModc+HPFfAfQVUJO1goS2f86xoEYHIjLwFOh04dh3E 11Dw== X-Gm-Message-State: ALyK8tIaSP4e+yVDwDJhC33IoWXOGQmrmCEZv5rYyxWWgbt4DQu64WG9rhkG3GcR9t7peSAO X-Received: by 10.66.189.104 with SMTP id gh8mr62882976pac.125.1468913866980; Tue, 19 Jul 2016 00:37:46 -0700 (PDT) Received: from localhost.localdomain ([45.56.152.53]) by smtp.gmail.com with ESMTPSA id 3sm2417608pfe.81.2016.07.19.00.37.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 19 Jul 2016 00:37:46 -0700 (PDT) From: Haojian Zhuang To: feng.tian@intel.com Date: Tue, 19 Jul 2016 15:37:39 +0800 Message-Id: <1468913859-30442-1-git-send-email-haojian.zhuang@linaro.org> X-Mailer: git-send-email 1.9.1 Subject: [edk2] [PATCH] EmmcBlockIo: fix to get CSD data X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Haojian Zhuang , edk2-devel@lists.01.org, guodong.xu@linaro.org, leif.lindholm@linaro.org, ard.biesheuvel@linaro.org MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" The CSD structure is a 128-bit structure. But EmmcGetCsd() only loads 120 bits with 8-bit offset. Now fix it. Signed-off-by: Haojian Zhuang --- MdeModulePkg/Bus/Sd/EmmcDxe/EmmcBlockIo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 1.9.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/MdeModulePkg/Bus/Sd/EmmcDxe/EmmcBlockIo.c b/MdeModulePkg/Bus/Sd/EmmcDxe/EmmcBlockIo.c index fc705e1..fe85627 100644 --- a/MdeModulePkg/Bus/Sd/EmmcDxe/EmmcBlockIo.c +++ b/MdeModulePkg/Bus/Sd/EmmcDxe/EmmcBlockIo.c @@ -191,9 +191,9 @@ EmmcGetCsd ( Status = PassThru->PassThru (PassThru, Device->Slot, &Packet, NULL); if (!EFI_ERROR (Status)) { // - // For details, refer to SD Host Controller Simplified Spec 3.0 Table 2-12. + // Copy 128bit data for CSD structure. // - CopyMem (((UINT8*)Csd) + 1, &SdMmcStatusBlk.Resp0, sizeof (EMMC_CSD) - 1); + CopyMem ((VOID*)Csd, &SdMmcStatusBlk.Resp0, sizeof (EMMC_CSD)); } return Status;