From nobody Thu Dec 26 14:04:53 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1504895065960706.5795676599532; Fri, 8 Sep 2017 11:24:25 -0700 (PDT) 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) 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) 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) X-Original-To: edk2-devel@lists.01.org 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) 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 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" 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/NorFlashSynquacer= Lib.inf | 38 +++++++++++++ 2 files changed, 98 insertions(+) diff --git a/Silicon/Socionext/Synquacer/Library/NorFlashSynquacerLib/NorFl= ashSynquacer.c b/Silicon/Socionext/Synquacer/Library/NorFlashSynquacerLib/N= orFlashSynquacer.c new file mode 100644 index 000000000000..0d9a81b61b73 --- /dev/null +++ b/Silicon/Socionext/Synquacer/Library/NorFlashSynquacerLib/NorFlashSynq= uacer.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 IMPL= IED. + + **/ + +#include +#include +#include +#include + +#include + +STATIC NOR_FLASH_DESCRIPTION mNorFlashDevices[] =3D { + { + // 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, 0x= 85, 0x75 } + } + }, +}; + +EFI_STATUS +NorFlashPlatformInitialization ( + VOID + ) +{ + return EFI_SUCCESS; +} + +EFI_STATUS +NorFlashPlatformGetDevices ( + OUT NOR_FLASH_DESCRIPTION **NorFlashDevices, + OUT UINT32 *Count + ) +{ + if (NorFlashDevices =3D=3D NULL || + Count =3D=3D NULL) { + return EFI_INVALID_PARAMETER; + } + + *Count =3D ARRAY_SIZE (mNorFlashDevices); + *NorFlashDevices =3D mNorFlashDevices; + + return EFI_SUCCESS; +} diff --git a/Silicon/Socionext/Synquacer/Library/NorFlashSynquacerLib/NorFl= ashSynquacerLib.inf b/Silicon/Socionext/Synquacer/Library/NorFlashSynquacer= Lib/NorFlashSynquacerLib.inf new file mode 100644 index 000000000000..bd84be0aebf8 --- /dev/null +++ b/Silicon/Socionext/Synquacer/Library/NorFlashSynquacerLib/NorFlashSynq= uacerLib.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 B= SD 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 IM= PLIED. +# +#**/ + +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D NorFlashSynquacerLib + FILE_GUID =3D 8279227C-C555-4D75-B439-D8A959635CDD + MODULE_TYPE =3D BASE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D 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 --=20 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel