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::242; helo=mail-wr0-x242.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr0-x242.google.com (mail-wr0-x242.google.com [IPv6:2a00:1450:400c:c0c::242]) (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 AF65D221786B1 for ; Thu, 30 Nov 2017 10:54:11 -0800 (PST) Received: by mail-wr0-x242.google.com with SMTP id z34so7656763wrz.10 for ; Thu, 30 Nov 2017 10:58:37 -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; bh=5VZgtmna198xpWrsZHcDrePcWNyObGzdXEe32hondT4=; b=XAHHYIy6qV+ZqVbt9yRK84Jx/hHVzU/qkdpzbReMy9ZlN8YrZlQRXVGN3bTxby7knd lA6CO3KFNyDhOkj/1tQx7ZrhP+UwPDlYLzg0HxpxwGHpCEEuvGh55Xv1PqyCkOe0rTGh 7TgIgzVsxCidZQ13C9xguGRtvkn6nT5lgcddU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=5VZgtmna198xpWrsZHcDrePcWNyObGzdXEe32hondT4=; b=cxNQzEBwsLFkmDAAzCh4MvYL38r/X9D9EjejZeaG0wA/KMpWZKc26yTtGDzBN9sADY qoQOcFkB8D6rgaepJVKrG1El+Q5riRPCDgXogonr+7FWlTtVJiADmBc8IRRcsUobyO0g 9Dw5KudnRQpJRibyxdhFxtBlQ3BYVWnqW0rbkhF94oz5vAxeR6vDZaE5XrTAghTHCuTD 1CkXhhpFkUF0uPgy334MyyU1hy1xbge8a4dYHhssCoUAIN0shPKhOCITLI7gd2Qhhub+ VGd4fvifNhlkDQIi9RsuLoe60y1t0qXNcGeMX+OPvb9QEtRbmFe6fFwqEbIllJH3bYuQ ZcRw== X-Gm-Message-State: AJaThX4C2Hthxhgp7x9nV3NWLOJiYDzZT8qCjy9rVOI/q5qMRS7HexH9 9obuZekjyZNF8bdlT3s8MigiJpNrZYk= X-Google-Smtp-Source: AGs4zMaBGy0g9XbNv7gvIavX9JCDTQIHMadg0UoqrVZwPNYwWOeJfrJD6P34FIeR3VMCADif1HAYwQ== X-Received: by 10.223.172.115 with SMTP id v106mr3006320wrc.195.1512068315556; Thu, 30 Nov 2017 10:58:35 -0800 (PST) Received: from localhost.localdomain ([105.150.171.234]) by smtp.gmail.com with ESMTPSA id d17sm2430784wrc.14.2017.11.30.10.58.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Nov 2017 10:58:34 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Cc: leif.lindholm@linaro.org, Pipat Methavanitpong , Ard Biesheuvel Date: Thu, 30 Nov 2017 18:58:28 +0000 Message-Id: <20171130185828.21277-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 Subject: [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: Thu, 30 Nov 2017 18:54:12 -0000 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 --- 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