From patchwork Tue Mar 22 12:48:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 64164 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp2041074lbc; Tue, 22 Mar 2016 05:48:37 -0700 (PDT) X-Received: by 10.98.74.74 with SMTP id x71mr53852086pfa.25.1458650917431; Tue, 22 Mar 2016 05:48:37 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id 13si7124486pft.59.2016.03.22.05.48.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Mar 2016 05:48:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id BCAD71A1FDE; Tue, 22 Mar 2016 05:49:00 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-pf0-x22c.google.com (mail-pf0-x22c.google.com [IPv6:2607:f8b0:400e:c00::22c]) (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 088381A1FDE for ; Tue, 22 Mar 2016 05:49:00 -0700 (PDT) Received: by mail-pf0-x22c.google.com with SMTP id x3so310337043pfb.1 for ; Tue, 22 Mar 2016 05:48:36 -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:in-reply-to:references; bh=US++Kc7cYEl+VuV3zY8g05NK0TwzJq9dNmzBHX6Mpvw=; b=dXlunfQta0WFm5dgNPMpstH5Cz3ylAtFVcdWSyioFYEinL+5IauQa91lUUw7Tt/RAF uQbWayx7jr0MvlAyXPCMccQvI3S8kkbcvm8TWf6vWvTjz3TMeT0B9E2geVtTr1pMLnKA 7zCtA1AkCCARNoiO/4usBOlyX/ZOSjxFuvRGQ= 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:in-reply-to :references; bh=US++Kc7cYEl+VuV3zY8g05NK0TwzJq9dNmzBHX6Mpvw=; b=GEgluCpu0TMvQhOL2lyyleQ1PYIZmZHv2SZjPS0a8QrY3SevlUuXeyiZz5ZdS6dVIW hWOYKNd/6aioGe4je1qVLpAyE1cdmsGkz4Nr5QpfCb5n5xGaElGv7rmgMCDrZ81VVJK+ 7Po5BG5mxXaCpinqPkCot8ohmXWwMwVsqk1ZokcmW/FXBWN6Zf+kkek/Ph63+MML4VVs 4z/wfq6hDCsY/whOBO8Sjql47zNbApr8TERosWQq2nlHqUqBoYsCZ2CAPcnSHnp7KMhZ zSs35CGy+uDHpvoN4qID2qWH9f96jQRDD5Y9IP1xXWJPy656YH8A5cjMbdGeK357lb9G EfTA== X-Gm-Message-State: AD7BkJLhcKZZuDZSzJq49qTHeSy1PWMs0OXqkYUmaZZQvMT3DHXBmeKpmq1YxqMU25YLihXU X-Received: by 10.98.10.29 with SMTP id s29mr47388230pfi.166.1458650913324; Tue, 22 Mar 2016 05:48:33 -0700 (PDT) Received: from localhost.localdomain ([104.237.91.127]) by smtp.gmail.com with ESMTPSA id 9sm48245982pft.44.2016.03.22.05.48.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 22 Mar 2016 05:48:31 -0700 (PDT) From: Haojian Zhuang To: ryan.harkin@linaro.org, edk2-devel@lists.01.org, leif.lindholm@linaro.org, ard.biesheuvel@linaro.org Date: Tue, 22 Mar 2016 20:48:14 +0800 Message-Id: <1458650901-7229-3-git-send-email-haojian.zhuang@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1458650901-7229-1-git-send-email-haojian.zhuang@linaro.org> References: <1458650901-7229-1-git-send-email-haojian.zhuang@linaro.org> Subject: [edk2] [PATCH v2 2/9] MmcDxe: move ECSD into CardInfo structure X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Haojian Zhuang MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" Since ECSD also describes the information of card, move it into structure CardInfo. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang --- EmbeddedPkg/Universal/MmcDxe/Mmc.h | 1 + EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) -- 1.9.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/EmbeddedPkg/Universal/MmcDxe/Mmc.h b/EmbeddedPkg/Universal/MmcDxe/Mmc.h index 46a156c..f4e0aa0 100644 --- a/EmbeddedPkg/Universal/MmcDxe/Mmc.h +++ b/EmbeddedPkg/Universal/MmcDxe/Mmc.h @@ -138,6 +138,7 @@ typedef struct { OCR OCRData; CID CIDData; CSD CSDData; + UINT32 ECSD[128]; // MMC V4 extended card specific } CARD_INFO; typedef struct _MMC_HOST_INSTANCE { diff --git a/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c b/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c index 0b0a044..3531fb4 100644 --- a/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c +++ b/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c @@ -39,7 +39,6 @@ EmmcIdentificationMode ( EFI_BLOCK_IO_MEDIA *Media; EFI_STATUS Status; UINT32 RCA; - UINT32 ECSD[128]; Host = MmcHostInstance->MmcHost; Media = MmcHostInstance->BlockIo.Media; @@ -91,7 +90,7 @@ EmmcIdentificationMode ( DEBUG ((EFI_D_ERROR, "EmmcIdentificationMode(): ECSD fetch error, Status=%r.\n", Status)); } - Status = Host->ReadBlockData (Host, 0, 512, ECSD); + Status = Host->ReadBlockData (Host, 0, 512, (UINT32 *)&(MmcHostInstance->CardInfo.ECSD)); if (EFI_ERROR (Status)) { DEBUG ((EFI_D_ERROR, "EmmcIdentificationMode(): ECSD read error, Status=%r.\n", Status)); return Status; @@ -104,7 +103,7 @@ EmmcIdentificationMode ( Media->LogicalBlocksPerPhysicalBlock = 1; Media->IoAlign = 4; // Compute last block using bits [215:212] of the ECSD - Media->LastBlock = ECSD[EMMC_ECSD_SIZE_OFFSET] - 1; // eMMC isn't supposed to report this for + Media->LastBlock = MmcHostInstance->CardInfo.ECSD[EMMC_ECSD_SIZE_OFFSET] - 1; // eMMC isn't supposed to report this for // Cards <2GB in size, but the model does. // Setup card type