From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c0c::244; helo=mail-wr0-x244.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr0-x244.google.com (mail-wr0-x244.google.com [IPv6:2a00:1450:400c:c0c::244]) (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 7D12621A10968 for ; Fri, 1 Dec 2017 04:55:29 -0800 (PST) Received: by mail-wr0-x244.google.com with SMTP id h1so9997313wre.12 for ; Fri, 01 Dec 2017 04:59:55 -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=DmDFRfAj42iqpN7EFfPKs00MuOIC8ObnhOOHEJGwCQM=; b=VzrIJ2XmgWIGXdjTTopxodZDSOH5mmLqfVXaMkJ97VhMHNkJK59oonRwPxKogoNaji FCTFCmcqz78dkptoUr5XQpnYEm0yZya03xBJWiKq6lxLv7M6cdz7CYuxNuZCLxui1iwi ymDFjbbn40I4P5Kw7Nvl0hi6sXciPGZueQQMw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=DmDFRfAj42iqpN7EFfPKs00MuOIC8ObnhOOHEJGwCQM=; b=dYA1YtfumGGHpCyOmmSlW7vwEhPcA/FhsnyQTh+vluvGT3jR/96rbfV3RtboyEpe+g crQbJbkP1Gy4gyELeXSEGiZJWcxnrvD+q/Saccb9wzub+l9Xht02xBc77IoPbB3/+pv5 OgQIiCI7GqSG78r4ChTT6A4cKGdtL79ueTTpxd2Mos5CkJRAbnqyHOKwryZe2kNBrif8 P/BIJbincd7asnYaaxGC8DU+YnxbO2hija1sB7lYXXXTmbd9eY2GDpHu4e4WI8mPu1wb Bs+doWqD9b/69tF1Jjtp8S6wmsmcFlDCSF9VLOKMH1MUIcoTpAEWaX2f/XMSP4/IkHin zF4Q== X-Gm-Message-State: AJaThX4tPJWuTECP/n9qIh3dq8TnLaunLomyna9Z/IGd2rqo579ryTVt I9FaiVw9sWtTxsozuAxX88YvpCz7EW0= X-Google-Smtp-Source: AGs4zMY8MfVyTFqq4NvuRMVjeWBYPA7wW/lTgq7ef26ROMVgSzzeo8sm8Xf5JovdM/8sd5EpaExq7Q== X-Received: by 10.223.163.216 with SMTP id m24mr5237317wrb.107.1512133194502; Fri, 01 Dec 2017 04:59:54 -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 o7sm4202491wra.15.2017.12.01.04.59.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Dec 2017 04:59:53 -0800 (PST) Date: Fri, 1 Dec 2017 12:59:51 +0000 From: Leif Lindholm To: Ard Biesheuvel Cc: edk2-devel@lists.01.org, Pipat Methavanitpong Message-ID: <20171201125951.efmavq6olsxsawa7@bivouac.eciton.net> References: <20171130185828.21277-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 In-Reply-To: <20171130185828.21277-1-ard.biesheuvel@linaro.org> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [PATCH edk2-platforms] Silicon/Fip006Dxe: map NOR_FLASH_INFO FSR flag with instance flag X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Dec 2017 12:55:29 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Nov 30, 2017 at 06:58:28PM +0000, Ard Biesheuvel wrote: > From: Pipat Methavanitpong > > Now that we incorporated NorFlashInfoLib into the Fip006Dxe driver, > replace the code that explicitly enables flag status register polling > for Micron NOR flash with a test of the flags field provided by > NorFlashInfoLib, which carries the same information. > > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Pipat Methavanitpong > Signed-off-by: Ard Biesheuvel Reviewed-by: Leif Lindholm > --- > Silicon/Socionext/SynQuacer/Drivers/Fip006Dxe/NorFlashDxe.c | 22 +++++++------------- > 1 file changed, 8 insertions(+), 14 deletions(-) > > diff --git a/Silicon/Socionext/SynQuacer/Drivers/Fip006Dxe/NorFlashDxe.c b/Silicon/Socionext/SynQuacer/Drivers/Fip006Dxe/NorFlashDxe.c > index a521b1f3d167..8d6bca8739d0 100644 > --- a/Silicon/Socionext/SynQuacer/Drivers/Fip006Dxe/NorFlashDxe.c > +++ b/Silicon/Socionext/SynQuacer/Drivers/Fip006Dxe/NorFlashDxe.c > @@ -1129,6 +1129,7 @@ NorFlashCreateInstance ( > { > EFI_STATUS Status; > NOR_FLASH_INSTANCE* Instance; > + NOR_FLASH_INFO *FlashInfo; > UINT8 JedecId[3]; > > ASSERT(NorFlashInstance != NULL); > @@ -1157,23 +1158,15 @@ NorFlashCreateInstance ( > NorFlashReset (Instance); > > NorFlashReadID (Instance, JedecId); > + Status = NorFlashGetInfo (JedecId, &FlashInfo, FALSE); > + if (EFI_ERROR (Status)) { > + goto FreeInstance; > + } > > - DEBUG_CODE_BEGIN (); > - { > - NOR_FLASH_INFO *FlashInfo; > - > - Status = NorFlashGetInfo (JedecId, &FlashInfo, FALSE); > - if (EFI_ERROR (Status)) { > - goto FreeInstance; > - } > - > - NorFlashPrintInfo (FlashInfo); > - FreePool (FlashInfo); > - } > - DEBUG_CODE_END (); > + NorFlashPrintInfo (FlashInfo); > > Instance->Flags = 0; > - if (JedecId[0] == NOR_FLASH_ID_STMICRO) { > + if (FlashInfo->Flags & NOR_FLASH_WRITE_FSR) { > Instance->Flags = NOR_FLASH_POLL_FSR; > } > > @@ -1198,6 +1191,7 @@ NorFlashCreateInstance ( > } > > *NorFlashInstance = Instance; > + FreePool (FlashInfo); > return EFI_SUCCESS; > > FreeInstance: > -- > 2.11.0 >