From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-x22b.google.com (mail-pg0-x22b.google.com [IPv6:2607:f8b0:400e:c05::22b]) (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 8CF9581DBD for ; Sat, 12 Nov 2016 22:48:12 -0800 (PST) Received: by mail-pg0-x22b.google.com with SMTP id 3so37252189pgd.0 for ; Sat, 12 Nov 2016 22:48:16 -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=ypY6UjePbMal1ndKNkalIJXkTRol7Hn8fvRVcxZSsQQ=; b=iDdxU8GHfb+xu8Y0IZwl8YbH/WTlbGTsqFW+wInADgEuv4MZzp+GxQ6nSWgR4C6lu7 ErzB304Fo9U/SUoJKZWumCAvMyAYUAFlGpGz4jTpqQpbz9UGG0x5It9Kne/Msp7PA6XP zWQETJ1aGJPFcmr6003ZwZDauydsSE050uUiY= 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=ypY6UjePbMal1ndKNkalIJXkTRol7Hn8fvRVcxZSsQQ=; b=PfNH0iBfgBGusWcb4W+9uNTI90WlWgS7OuhDkFr2JQespm/ml+mM8UldT2Ku59Zb5/ je9q5kj4FKuoXoHeHp1AOJzmuGqlJczBfVXrxLr8eP9Jm9OW8d7YEBKOSkiv7mo4M+1P cDHEQ4tGJku/2p4EZsJ15PiSIRyf7LyI6un3P95MEW8+ocix5b/Wo+gJJW2bOMs1Y9Eg p74j5HINlDAPGq1RfeibaXw6P45fnlSLZpZeiIJ8+47C7ROq+gxZHivhHGmzQKvv9aKm +Kl9PoKXzAOTAU1P+XDZchUq5IgElRjCBznFYvEEFDXpHFyAvosklPDJD80d1EX289Ep EzGQ== X-Gm-Message-State: ABUngvflBvpzGxHwyBLh9uKZPvZDbt3U0FW1C1urND24gF3JS2Zko/ZNnzrJUK+2fD648sFW X-Received: by 10.99.6.134 with SMTP id 128mr58421945pgg.53.1479019696589; Sat, 12 Nov 2016 22:48:16 -0800 (PST) Received: from localhost.localdomain ([45.56.159.75]) by smtp.gmail.com with ESMTPSA id a66sm26198365pfa.64.2016.11.12.22.48.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 12 Nov 2016 22:48:16 -0800 (PST) From: Haojian Zhuang To: ryan.harkin@linaro.org, edk2-devel@lists.01.org, leif.lindholm@linaro.org, ard.biesheuvel@linaro.org Cc: Haojian Zhuang Date: Sun, 13 Nov 2016 14:47:51 +0800 Message-Id: <1479019678-12621-3-git-send-email-haojian.zhuang@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1479019678-12621-1-git-send-email-haojian.zhuang@linaro.org> References: <1479019678-12621-1-git-send-email-haojian.zhuang@linaro.org> Subject: [PATCH v5 2/9] 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: , X-List-Received-Date: Sun, 13 Nov 2016 06:48:12 -0000 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 Tested-by: Ryan Harkin Reviewed-by: Leif Lindholm --- EmbeddedPkg/Universal/MmcDxe/Mmc.h | 1 + EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) 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 -- 2.7.4