From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Cc: leif.lindholm@linaro.org, methavanitpong.pipat@socionext.com, masahisa.kojima@linaro.org, masami.hiramatsu@linaro.org, Ard Biesheuvel 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: [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: , X-List-Received-Date: Fri, 08 Sep 2017 18:21:07 -0000 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(+) 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 -- 2.11.0