From patchwork Thu Nov 30 18:58:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 120274 Delivered-To: patch@linaro.org Received: by 10.80.225.132 with SMTP id k4csp275561edl; Thu, 30 Nov 2017 11:00:33 -0800 (PST) X-Google-Smtp-Source: AGs4zMZ47zdglLhNKAhXPouG2ru5zbEr96ACxemIAYVYozFbdX6We1uCxlUjp2B7kcZ3I03FDtW/ X-Received: by 10.101.78.2 with SMTP id r2mr3378171pgt.320.1512068319415; Thu, 30 Nov 2017 10:58:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512068319; cv=none; d=google.com; s=arc-20160816; b=VPjasBuqlKAAZWgAEW7e9PDgwqz1KmysW0eaT4YWBYHX/jNaqTnwo9d+1M6805nKKk G3JKNnL+KTXOKxrmnp+W+Lfu/dxXAGFMqpyeiewaKtlu3U5GKA3Cnn8dDZ4hMbQprA+y OmGmR/cqismOvrlFw9SQymei8C27tOIj+cHpWp9yPQkDdV0sGsJyivwAXp8F6Oh4B3ME Ya/7AKKHt2SQwN9fA4PrIkazeCrQQu68Jy2eB6jolPfQZc11F8VHz1q2fB4s1W5uv4yx nvS/z+xaTCJ/0Wnm8THyMKBHqPH6r/UunjwZr8tR2N/5nalYw4qwApvURtuO0lV0ETz0 9Kpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=fzx2StzjlqviWAWLMrxAVAPJHWmzBQ0MU7+V/4SR3K0=; b=fVGhW0CdgfUmuI49a5G9jUz8wcp8STKBh5RyukWYU7WuUcaHqo4Dq0q3MVJ32gBxur PMo9tJXrQC2lEJZoZcfKGzJvRkPRT7eMIf9OQ+12wG+2V64N7uJGaZ2zXtggPIOf4Cuk QQlm4nPMqzA4RfZTI6Z/q12KsLpAoLiYMYBsWVjBVN0PTi7nksgSsGr2a2411B+Qr0pE fQg7o7YKyO4W8EDtvnmjZeXqhsdo9yutW2GvW/tcTo1jcdUgJhhFQ1zx1EbUD06iw2Yv 27oU6/hIpx3l8/OjtDuv3mGTz+uLYqVrKFlA9dep/j9/dlIQtyT0E/7rTc4vCgr4X6Zg yKKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=XAHHYIy6; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id o33si3547162plb.749.2017.11.30.10.58.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Nov 2017 10:58:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=XAHHYIy6; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 21F1F21A04E2F; Thu, 30 Nov 2017 10:54:13 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org 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-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 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: [edk2] [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: , Cc: leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" 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(-) -- 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Leif Lindholm 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: