From patchwork Fri Sep 8 18:23:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 112126 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp661040qgf; Fri, 8 Sep 2017 11:24:25 -0700 (PDT) X-Received: by 10.98.33.134 with SMTP id o6mr4032126pfj.91.1504895064927; Fri, 08 Sep 2017 11:24:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504895064; cv=none; d=google.com; s=arc-20160816; b=unzBMDTBCiVdVfoehmwzlenAFwfvKKWobrv5S0VPjC+c0OgbvEtc27ojkjpeLGNMKj kTTO9hCdVHbdB4YV1PIY4ZFWjV/v7No9tmK4ewb8n6fqRx6PYueWB2aTTRhn8kGAp0bg BcJKXxWnMiURMJTxx3HwL77IgLmMZ5A7T5QRlzOyWUda+/XSYTbCxs17CG1PZrUAZHao fhmyQ0YU5NqzlVYuIOWJ9rIRpbHkdTOaC5xTpVjizmLG7WisKDN5rH6NqYIctHPqJinh KXnBpMQJ2kD1tE/VjzcgajBudmFtBoqVlw6H73tAMPHOht9dV61fHx/isYs4vzis9iLS sL1w== 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:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=S/JuOeE6A/sQvQz46rlcnCLmBKaxSDJe+LA81TtKwVQ=; b=M5c5F+45vtpLAJYeo7Op4uKLRzIOJVb08lSPgtmeB456vyHwyY1yTBH1WI4TJSFWtx v2faVZP3DikQNr0qdnb74pwc9JZYIfeDL7P9QxDRMHgUjH67MNgv5XpypKSaDi22cTKU 8Ijsd1C0eQiBJc8/aMr9dd/wrhgsqAHESZ/dwzSXn+RHMEKzBa5/beTYFI8sk1Xppi76 y4FiF7YAT0JVoEDJdyQ3srR/QJjJnw/e6csJJhW1gTCK+lR0bOwU9rp9XrsW5ruq/+dI pPs/rQzWBmLkddyuWSKTdLLmfNY2OBTgVTtPyGL0TBHec52oSDlZ4IpJUXoqmPltLMdD k3JA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=aoQ56qh9; 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 l63si1918954pgl.340.2017.09.08.11.24.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Sep 2017 11:24:24 -0700 (PDT) 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=aoQ56qh9; 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 3F87120945BF7; Fri, 8 Sep 2017 11:21:08 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-wm0-x22d.google.com (mail-wm0-x22d.google.com [IPv6:2a00:1450:400c:c09::22d]) (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 9261720945BE3 for ; Fri, 8 Sep 2017 11:21:06 -0700 (PDT) Received: by mail-wm0-x22d.google.com with SMTP id i189so9394993wmf.1 for ; Fri, 08 Sep 2017 11:23:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=WrUkItZ3FRr5updHODOZrFWSniM4RKfKxrHOslD4ZYE=; b=aoQ56qh9osG5f7lQsAjL4Qs2rsuazoRtX4ebHnIyuxaiXE931V6gDeNSXKLEUmg2hK cDZc0vEIbmzFRnDLR8QwVlpYUTXI38Kq7A0CSxC8uHRGWUZDnA9ehXHTJ30pGzWPiMA2 kkCzRNd/tkBy8CMqlDC0GqzNp83Ekh475wvWk= 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:in-reply-to :references; bh=WrUkItZ3FRr5updHODOZrFWSniM4RKfKxrHOslD4ZYE=; b=PI8f74AbqxNd9vTlQ76mZ1frJdW1gO3x42qkm/Bysu9gEVQaWGcdqsisXWe785Als9 c7u4ji8Xa2W5AZag8Iln706XgkQ54X40I4n+gyb4/azqtdNEyAG6RC2hh/r6+RAGTAkD 3FQiwRqu+tfiNV/HrfpEFo81I38VK4Lnm6MCTkZ/omlBvuMHCVm1nbJ6nlNaB9q2Fydf efcP6s0qibWIlYm7Sjeyl5LDiDSCpZtAoTB3CbDgGMqJdc4ARbWML2nPecJ2tMjlbiQT 1GV98Fi4lq/jqI+DK/ga6foXjun14w1tTFBqO02OP2s7dIxFw2dR0Z3bxIQdzoSuCdDO BsaA== X-Gm-Message-State: AHPjjUhV2Be0mi2FTydfPZ8Qyb1izuSrfAhqOk+u5rhlcg3GtHO/P4vy Z6XEhEPLUZXxzl7d4SAoaagapUPhR9Y= X-Google-Smtp-Source: AOwi7QAlcnXxpqPZW1YQKpFHGFH73DbLgYMNXmFKiM+GdR0udpHlFmOzViZDZIFPDvhMZIF3YENOcw== X-Received: by 10.28.69.155 with SMTP id l27mr2187652wmi.122.1504895037527; Fri, 08 Sep 2017 11:23:57 -0700 (PDT) Received: from localhost.localdomain ([154.151.223.220]) by smtp.gmail.com with ESMTPSA id s196sm3254354wmb.6.2017.09.08.11.23.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Sep 2017 11:23:56 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Fri, 8 Sep 2017 19:23:13 +0100 Message-Id: <20170908182315.9591-13-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170908182315.9591-1-ard.biesheuvel@linaro.org> References: <20170908182315.9591-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH edk2-platforms 12/14] Silicon/Synquacer: add NorFlashPlatformLib implementation 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: masahisa.kojima@linaro.org, methavanitpong.pipat@socionext.com, masami.hiramatsu@linaro.org, leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" Add the platform glue for the NOR flash driver. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- Silicon/Socionext/Synquacer/Library/NorFlashSynquacerLib/NorFlashSynquacer.c | 60 ++++++++++++++++++++ Silicon/Socionext/Synquacer/Library/NorFlashSynquacerLib/NorFlashSynquacerLib.inf | 38 +++++++++++++ 2 files changed, 98 insertions(+) -- 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/Library/NorFlashSynquacerLib/NorFlashSynquacer.c b/Silicon/Socionext/Synquacer/Library/NorFlashSynquacerLib/NorFlashSynquacer.c new file mode 100644 index 000000000000..0d9a81b61b73 --- /dev/null +++ b/Silicon/Socionext/Synquacer/Library/NorFlashSynquacerLib/NorFlashSynquacer.c @@ -0,0 +1,60 @@ +/** @file + + Copyright (c) 2011-2014, ARM Ltd. All rights reserved.
+ + This program and the accompanying materials + are licensed and made available under the terms and conditions of the BSD License + which accompanies this distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + + **/ + +#include +#include +#include +#include + +#include + +STATIC NOR_FLASH_DESCRIPTION mNorFlashDevices[] = { + { + // Environment variable region + SYNQUACER_SPI_NOR_BASE, // device base + FixedPcdGet32 (PcdFlashNvStorageVariableBase), // region base + FixedPcdGet32 (PcdFlashNvStorageVariableSize) + + FixedPcdGet32 (PcdFlashNvStorageFtwWorkingSize) + + FixedPcdGet32 (PcdFlashNvStorageFtwSpareSize), // region size + SIZE_64KB, // block size + { + 0x3105BD7A, 0x82C3, 0x486F, { 0xB1, 0x03, 0x1E, 0x09, 0x54, 0xEC, 0x85, 0x75 } + } + }, +}; + +EFI_STATUS +NorFlashPlatformInitialization ( + VOID + ) +{ + return EFI_SUCCESS; +} + +EFI_STATUS +NorFlashPlatformGetDevices ( + OUT NOR_FLASH_DESCRIPTION **NorFlashDevices, + OUT UINT32 *Count + ) +{ + if (NorFlashDevices == NULL || + Count == NULL) { + return EFI_INVALID_PARAMETER; + } + + *Count = ARRAY_SIZE (mNorFlashDevices); + *NorFlashDevices = mNorFlashDevices; + + return EFI_SUCCESS; +} diff --git a/Silicon/Socionext/Synquacer/Library/NorFlashSynquacerLib/NorFlashSynquacerLib.inf b/Silicon/Socionext/Synquacer/Library/NorFlashSynquacerLib/NorFlashSynquacerLib.inf new file mode 100644 index 000000000000..bd84be0aebf8 --- /dev/null +++ b/Silicon/Socionext/Synquacer/Library/NorFlashSynquacerLib/NorFlashSynquacerLib.inf @@ -0,0 +1,38 @@ +#/** @file +# +# Copyright (c) 2011 - 2014, ARM Ltd. All rights reserved.
+# This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +#**/ + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = NorFlashSynquacerLib + FILE_GUID = 8279227C-C555-4D75-B439-D8A959635CDD + MODULE_TYPE = BASE + VERSION_STRING = 1.0 + LIBRARY_CLASS = NorFlashPlatformLib + +[Sources] + NorFlashSynquacer.c + +[Packages] + ArmPlatformPkg/ArmPlatformPkg.dec + MdeModulePkg/MdeModulePkg.dec + MdePkg/MdePkg.dec + Silicon/Socionext/Synquacer/Synquacer.dec + +[LibraryClasses] + BaseLib + +[FixedPcd] + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize