From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 8F6B01A1E60 for ; Mon, 10 Oct 2016 17:37:31 -0700 (PDT) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP; 10 Oct 2016 17:37:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,327,1473145200"; d="scan'208";a="178525929" Received: from orsmsx108.amr.corp.intel.com ([10.22.240.6]) by fmsmga004.fm.intel.com with ESMTP; 10 Oct 2016 17:37:30 -0700 Received: from orsmsx151.amr.corp.intel.com (10.22.226.38) by ORSMSX108.amr.corp.intel.com (10.22.240.6) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 10 Oct 2016 17:37:30 -0700 Received: from orsmsx113.amr.corp.intel.com ([169.254.9.161]) by ORSMSX151.amr.corp.intel.com ([10.22.226.38]) with mapi id 14.03.0248.002; Mon, 10 Oct 2016 17:37:30 -0700 From: "Kinney, Michael D" To: "Yao, Jiewen" , "edk2-devel@lists.01.org" , "Kinney, Michael D" CC: "Tian, Feng" , "Gao, Liming" , "Zeng, Star" , "Zhang, Chao B" Thread-Topic: [edk2] [PATCH] QuarkPlatformPkg/PlatformFlashAccessLib: Skip the update if content is same. Thread-Index: AQHSIik1gwpDEP6RfUy9kaovht40WKCiaiGA Date: Tue, 11 Oct 2016 00:37:30 +0000 Message-ID: References: <1476016341-8884-1-git-send-email-jiewen.yao@intel.com> In-Reply-To: <1476016341-8884-1-git-send-email-jiewen.yao@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNzViOGQwZjItNGEzYi00MjVkLThjNWQtNjZmNGEzNmM3ZDY0IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6InRZRVdHM2pMVVViMkRWdnNucnJFRnhQTnNrYkdJYVpneE5nYkdySlZPbHc9In0= x-originating-ip: [10.22.254.138] MIME-Version: 1.0 Subject: Re: [PATCH] QuarkPlatformPkg/PlatformFlashAccessLib: Skip the update if content is same. 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, 11 Oct 2016 00:37:31 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Jiewen, I have applied this patch on top of your FMP v2 series and verified that it= =20 skips erase/write of FLASH sectors that match in Galileo Gen 2 platform. Since this patch is against the new lib that is part of Quark specific caps= ule update, it should be integrated into an FMP v3 patch series after all FMP v= 2 feedback is received. Thanks, Mike > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Ji= ewen Yao > Sent: Sunday, October 9, 2016 5:32 AM > To: edk2-devel@lists.01.org > Cc: Tian, Feng ; Gao, Liming ;= Zeng, Star > ; Kinney, Michael D ; Zh= ang, Chao B > > Subject: [edk2] [PATCH] QuarkPlatformPkg/PlatformFlashAccessLib: Skip the= update if > content is same. >=20 > This is enhancement for PlatformFlashAccessLib to skip flash write > if the content is same in new image. >=20 > Cc: Michael D Kinney > Cc: Kelly Steele > Cc: Feng Tian > Cc: Star Zeng > Cc: Liming Gao > Cc: Chao Zhang > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Jiewen Yao > --- >=20 > QuarkPlatformPkg/Feature/Capsule/Library/PlatformFlashAccessLib/PlatformF= lashAccessLi > bDxe.c | 9 +++++++++ > 1 file changed, 9 insertions(+) >=20 > diff --git > a/QuarkPlatformPkg/Feature/Capsule/Library/PlatformFlashAccessLib/Platfor= mFlashAccess > LibDxe.c > b/QuarkPlatformPkg/Feature/Capsule/Library/PlatformFlashAccessLib/Platfor= mFlashAccess > LibDxe.c > index 3ad30b1..aeafb1b 100644 > --- > a/QuarkPlatformPkg/Feature/Capsule/Library/PlatformFlashAccessLib/Platfor= mFlashAccess > LibDxe.c > +++ > b/QuarkPlatformPkg/Feature/Capsule/Library/PlatformFlashAccessLib/Platfor= mFlashAccess > LibDxe.c > @@ -153,6 +153,15 @@ PerformFlashWrite( > // > SectorNum =3D Length / SPI_ERASE_SECTOR_SIZE; > for (Index =3D 0; Index < SectorNum; Index++){ > + if (CompareMem( > + (UINT8 *)(UINTN)(FlashAddress + mInternalFdAddress) + Index * > SPI_ERASE_SECTOR_SIZE, > + (UINT8 *)Buffer + Index * SPI_ERASE_SECTOR_SIZE, > + SPI_ERASE_SECTOR_SIZE) =3D=3D 0) { > + DEBUG((EFI_D_INFO, "Sector - 0x%x - skip\n", Index)); > + continue; > + } > + DEBUG((EFI_D_INFO, "Sector - 0x%x - update...\n", Index)); > + > Status =3D FlashFdErase ( > (UINTN)FlashAddress + Index * SPI_ERASE_SECTOR_SIZE > ); > -- > 2.7.4.windows.1 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel