From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-x22a.google.com (mail-wm0-x22a.google.com [IPv6:2a00:1450:400c:c09::22a]) (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 138AD81D37 for ; Tue, 8 Nov 2016 12:27:10 -0800 (PST) Received: by mail-wm0-x22a.google.com with SMTP id p190so269438593wmp.1 for ; Tue, 08 Nov 2016 12:27:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=z0jVHgTIX2m1qoCbvGSg5aiP16GqNlfYOC+ek6LgoSs=; b=KBRkAoCyba2SxWEKbgXaeM9bvpCSQNUXlS6QRh360hj1kzfBVdTaAF5OYjugshvDTg Ka0Y9L1eKan1bm0CGa5K0haPJm+v8tLkZUo8xJeORsErrbfRq4Yk+P2fb55QQoxwx6+q 10d47EZi1YsLOBH27fDDCXszSaDiQTQOKbTZg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=z0jVHgTIX2m1qoCbvGSg5aiP16GqNlfYOC+ek6LgoSs=; b=CnSTyhROG1KdU+8kXep8uwrY8ZzoMA5oZnHqlImz4KmzObTRDjc2NWq+1CtTS7Rvyj Mo2lCNScXQ+tjRRGpXbOf5ywXtcd+Acz/qODLQ4RnqbqpKKO8ZBpNKej7MlwlAvfvUnR v0sptFXS77JURoj02VcFKtgqV5cM4cUmh9tM6YKdotrUN0z3ATB3OAtFmSxtcR/1mdcI qIabSe4SuLM8/x1aOw2OXtakeFCJJfvyRwnFvWqkYY6wXigwsV7wD7k8RlfMO/518IPy mqGNwvWH8rgS6qzdzaMThyKO7TJ6BENzbGvc23JjAcR8ttnploGrwSOf3+adLqSNor3y LU7w== X-Gm-Message-State: ABUngvctAKCrfRuf1NIjnbkS2SluGr37Mb9M1X+74Uu/7TprndLVBJqsDzPxTrSnAF/zCRUY X-Received: by 10.194.28.33 with SMTP id y1mr3133423wjg.229.1478636831287; Tue, 08 Nov 2016 12:27:11 -0800 (PST) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id r7sm25539696wjp.43.2016.11.08.12.27.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Nov 2016 12:27:10 -0800 (PST) Date: Tue, 8 Nov 2016 20:27:08 +0000 From: Leif Lindholm To: Haojian Zhuang Cc: ryan.harkin@linaro.org, edk2-devel@lists.01.org, ard.biesheuvel@linaro.org Message-ID: <20161108202708.GJ27644@bivouac.eciton.net> References: <1478618476-12608-1-git-send-email-haojian.zhuang@linaro.org> <1478618476-12608-3-git-send-email-haojian.zhuang@linaro.org> MIME-Version: 1.0 In-Reply-To: <1478618476-12608-3-git-send-email-haojian.zhuang@linaro.org> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [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: , X-List-Received-Date: Tue, 08 Nov 2016 20:27:10 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Nov 08, 2016 at 11:21:07PM +0800, Haojian Zhuang wrote: > Since ECSD also describes the information of card, move it into > structure CardInfo. I like the fact that you have split out the "move ECSD to CARD_INFO" and "declare ECSD structure", to keep the two logically separate modifications apart. However, it would be better if "declare ECSD structure" followed directly after this one. > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Haojian Zhuang 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 >