From patchwork Tue Nov 8 15:21:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 81339 Delivered-To: patch@linaro.org Received: by 10.140.97.165 with SMTP id m34csp1603844qge; Tue, 8 Nov 2016 07:21:57 -0800 (PST) X-Received: by 10.99.178.6 with SMTP id x6mr19518743pge.63.1478618517298; Tue, 08 Nov 2016 07:21:57 -0800 (PST) Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id s186si37457959pgb.265.2016.11.08.07.21.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Nov 2016 07:21:57 -0800 (PST) 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 B011081D7D; Tue, 8 Nov 2016 07:21:53 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-pf0-x22f.google.com (mail-pf0-x22f.google.com [IPv6:2607:f8b0:400e:c00::22f]) (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 5EE3781D69 for ; Tue, 8 Nov 2016 07:21:52 -0800 (PST) Received: by mail-pf0-x22f.google.com with SMTP id i88so109006565pfk.2 for ; Tue, 08 Nov 2016 07:21:55 -0800 (PST) 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=NsplYOOKYKQxk7AFp2RmmM2LO/hI1CWOQP6X+2csN2g=; b=OMCQI+53T7jWkU7Iq0gNfVMVaLoouwgluYSxHHf/blFpV4yLHFPt977Qj1P5nwnFcl TImAiKW8aJpf0X/eU84DhebKjIzlYf4vnz3bINHnrFqwkIMhVEsKTf0tZhj2xFtLzFp3 2KTfEMI+CtFr0XXmhBxcVI+cEWxoAEsqfuaPU= 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=NsplYOOKYKQxk7AFp2RmmM2LO/hI1CWOQP6X+2csN2g=; b=DB+t0ijSWL8NB401ofJCmGcHhAhr8ujmocrXTE/R5J+xYVVvTvxQxiaPAItCLH51Yd K44IngJhLfI/oQAwUDulqLFouYFByH4UrnT5b17YHLCv0fdB4HVSCS4u8DhpqJ0ECeru TWDKOGTdc8j+7+irdPqirbSz/yhz/tPZZ3xJS2uxhzlE1AClNMBpnj67QbcAZPM90O9j hq9QXc3RnefhpEpyfBQvLcqn1ggbZgBpYOneY3QWWdyhmk7Yy83ctAczl1sFSkfcWFi8 jw+5rn5r/miHJ7qUTIvd86z/7RRmX3LbS0edyXYnesW01lKx2RNipBk+hzaF7IDpiyMJ ijIg== X-Gm-Message-State: ABUngvfxzy5d/6T9GwChFwtlezVw6A2qJkjn5WC5qfX+4zQGrOocMwVotIwbe7520VPgTTwk X-Received: by 10.98.14.82 with SMTP id w79mr24035873pfi.153.1478618515309; Tue, 08 Nov 2016 07:21:55 -0800 (PST) Received: from localhost.localdomain ([45.56.159.76]) by smtp.gmail.com with ESMTPSA id g10sm7971804pac.14.2016.11.08.07.21.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 08 Nov 2016 07:21:54 -0800 (PST) From: Haojian Zhuang To: ryan.harkin@linaro.org, edk2-devel@lists.01.org, leif.lindholm@linaro.org, ard.biesheuvel@linaro.org Date: Tue, 8 Nov 2016 23:21:07 +0800 Message-Id: <1478618476-12608-3-git-send-email-haojian.zhuang@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1478618476-12608-1-git-send-email-haojian.zhuang@linaro.org> References: <1478618476-12608-1-git-send-email-haojian.zhuang@linaro.org> Subject: [edk2] [PATCH v4 02/11] MmcDxe: move ECSD into CardInfo structure X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: 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(-) -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Leif Lindholm diff --git a/EmbeddedPkg/Universal/MmcDxe/Mmc.h b/EmbeddedPkg/Universal/MmcDxe/Mmc.h index 46a156c..4f132c6 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 3f72b7f..578fcb6 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