From patchwork Fri Feb 26 09:27:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 62973 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp608503lbc; Fri, 26 Feb 2016 01:28:20 -0800 (PST) X-Received: by 10.98.89.215 with SMTP id k84mr689996pfj.66.1456478900372; Fri, 26 Feb 2016 01:28:20 -0800 (PST) Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id y1si18762790pfi.229.2016.02.26.01.28.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Feb 2016 01:28:20 -0800 (PST) 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 D04FB1A1E15; Fri, 26 Feb 2016 01:28:24 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-oi0-x22d.google.com (mail-oi0-x22d.google.com [IPv6:2607:f8b0:4003:c06::22d]) (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 3C9001A1E0D for ; Fri, 26 Feb 2016 01:28:24 -0800 (PST) Received: by mail-oi0-x22d.google.com with SMTP id m82so58253727oif.1 for ; Fri, 26 Feb 2016 01:28:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=message-id:from:to:cc:subject:date:in-reply-to:references :mime-version; bh=US++Kc7cYEl+VuV3zY8g05NK0TwzJq9dNmzBHX6Mpvw=; b=RBXP+LNStvA2nMNTy1hNgMQZYO+5k+BW78egVpWuKeKbMW7aPFSkaQRznwwN01P609 PHishODyJemHYM70qvWeqYAaN0AqlAPYnRAInF0NFJP9crxXLAOMSsOLwGQa2V2QnKZ/ cs+IrhmJpLx5YrMAhBjivUxaeTaNoNsnmmCg4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:from:to:cc:subject:date:in-reply-to :references:mime-version; bh=US++Kc7cYEl+VuV3zY8g05NK0TwzJq9dNmzBHX6Mpvw=; b=JJDIwUgtuken/Af5Rq72r/ccghcHgJeqPjYK7BKpOoHfMLcnqlEmDVOJuwCAsQQ7rx 38FIUUiaV3Vqe5Tm7cVcKeEQUIzEbqWdl0dYCwikTkhCZk/yuh7dnZVY7XSzxey50x+L bbK+IjCYYTbmWEmk1PWi2WIrgZPrto/SpZ6cgHIH3JuBKX5UFsVwnJaNLGr3VH1vutv+ A1dk3pF9hIOIl4tZc0+XxfXVoGzsPzoFlRNd6q1dB2HN6voXXT68H8nRAHvjZ7/fkh9H wFj5dpFHYlLrosYEca+fR8f+eOajVWOGjW67OjgGQuXha6Ihh70U0RX7YfsAggSRrP4h 5RGA== X-Gm-Message-State: AD7BkJK7lWaeluAhzF5slHD7cCjUT6Nv2xe9zUZeGYlGIO0lPVkfkxXHdJXGCLfLEAnwmOmB X-Received: by 10.202.231.205 with SMTP id e196mr374739oih.124.1456478898720; Fri, 26 Feb 2016 01:28:18 -0800 (PST) Received: from mail.hotmail.com (blu004-wss1s2.hotmail.com. [134.170.2.217]) by smtp.gmail.com with ESMTPSA id v6sm8204698oer.10.2016.02.26.01.28.17 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 26 Feb 2016 01:28:17 -0800 (PST) Received: from BLU437-SMTP102 ([134.170.2.215]) by BLU004-WSS1S2.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.23008); Fri, 26 Feb 2016 01:28:16 -0800 X-TMN: [Naj9pwhusjX7lMHDaeAuIlIr3BP3g9Od] Message-ID: From: Haojian Zhuang To: edk2-devel@lists.01.org, leif.lindholm@linaro.org, ard.biesheuvel@linaro.org Date: Fri, 26 Feb 2016 17:27:49 +0800 X-Mailer: git-send-email 1.9.1 In-Reply-To: <1456478876-23434-1-git-send-email-haojian.zhuang@linaro.org> References: <1456478876-23434-1-git-send-email-haojian.zhuang@linaro.org> X-OriginalArrivalTime: 26 Feb 2016 09:28:14.0354 (UTC) FILETIME=[0473CF20:01D17078] MIME-Version: 1.0 Cc: Haojian Zhuang Subject: [edk2] [PATCH 2/9] MmcDxe: move ECSD into CardInfo structure X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , 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