From patchwork Tue Oct 31 10:52:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 117548 Delivered-To: patch@linaro.org Received: by 10.80.245.45 with SMTP id t42csp3794188edm; Tue, 31 Oct 2017 03:53:39 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TeIYHdCWxRUVlBxlJt1ZWdFvgJp9tgQ3xe4AlnD0FHYE6kO5oqTJaDS2WDt5x0tCxvQEFz X-Received: by 10.99.113.92 with SMTP id b28mr1487677pgn.42.1509447219778; Tue, 31 Oct 2017 03:53:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509447219; cv=none; d=google.com; s=arc-20160816; b=riYcH8G/ro+o91OvtrJuOLqplWjAwu0fwX/yUEe/X2re+Wt3EJcCqL5zI3AJK5tbsM q0b/28xPvm5Ert/Haxt7kebzefjmMkIFtph2JVavTyXWe/hcZMMVYcruFlGbUtFPfuMu lU8e9+mNR98HVLYxr//zsEjuBkJpt/fH5ziAyVHS7T44WhO17Ewy3t8UHxya7jvWJC1U p1BXLD1xum7jMyk5UZDAk/oO8WjHKTRSTNUSpE5eGMh2d5WWUJf2QHube1NHYsJMSFVM CbXgFAkf3se54c1P05Kxayy06IXd6YO35uLORALgp6KJtqFpO10R5slOFp5t7jbMLkNi juvA== 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=dfqGwnTDfGtgbhq6vl+ebxR3oga7vc7RWkclsqa0J9c=; b=0zVD68eNY4C5q/yF41w5JyifdsIBO3fL33h/6ZBhfVtT6zTcjF0eYPNixBdeAo8m9o pKi0TUzjR7PnNWnJfeCvkIIh4rOzrTmUUzgnSDhwcPhurmazeu3S2LVfiijpZKCyaMpc Ne5etljY0ZrM1MheaWP5hZVjLLhHXuVdMvRb6sQKn/7Mt6m0oY5VxM5hBGi/3WhIdaOJ T9EyeMH228tyCWNT7pcNrIZW+9TfUsCIFVYrgheuxXkqsr5h8tB+TVblRfVZD3dGlFQR 1B7cEsY210sS3IAFpegPlIgB66EUtLqpe+Y14S8KS9/yAOIDuuW3Eg3MFehxm8V8pEkS czLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=MU4gLoHx; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 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. [198.145.21.10]) by mx.google.com with ESMTPS id h124si1389741pfc.290.2017.10.31.03.53.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 31 Oct 2017 03:53:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=MU4gLoHx; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 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 31F2A2035D0F1; Tue, 31 Oct 2017 03:49:17 -0700 (PDT) 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:c09::243; helo=mail-wm0-x243.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) (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 A07712035D0E2 for ; Tue, 31 Oct 2017 03:49:14 -0700 (PDT) Received: by mail-wm0-x243.google.com with SMTP id y83so22078167wmc.4 for ; Tue, 31 Oct 2017 03:53:06 -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=IPr7AbXPPgixWsBE7QeQvFZqBjvEI/igEvxr7mqMwYs=; b=MU4gLoHxebuTJW55EW9bJdcuaHZ1+7Ofg2t8k6RbGjtDliiVQ015Vgbu/5b6DWX3VH 3CKDWA5zOBwTsX5wM+5UFqgB3/SO+36UK1sJ91HGCUg2mq/fPK8imNjZHNhb9Cx6Jrki +j/r11pGyHbOwK6Opose0eakRFnWmXK3eRLBs= 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=IPr7AbXPPgixWsBE7QeQvFZqBjvEI/igEvxr7mqMwYs=; b=qY5fS2Sk5fO33scyBH073UVoML6zyty7feTSZ/BaOI4sNc0Myvmk2CzzO77oJpfDM6 Wm1Shr2F+mVJwgfPHiX7ctzzr6X67gLuUqhd/hXQOlJE2ysZHfO5hDf8vLkB2lacs6v2 Ncnxx/LKL6TkURTTOF1hP43At4jIG3tdWRsNhgId7zPEjEnYvuQe7YeIHJdbCPRFKLwB oB2DrMGssH4MPV4+zoKTMy5WpiT58fjn41Rmq9fVKSOnB/Yl8cRNugja5q62gcXO4AUl 5LCVKVWNVaAL8GZmcQR7kmv3BRJ93jOFevg2KHJr7wut95uTa8P9s9UCaJzKjz6NusWC +hcw== X-Gm-Message-State: AMCzsaW+8knZhgGspc0P2LOM2syOTT531RRO6vVo30In8G3R7IoMvY0b C/DvvixOgQkZobJcg76f2yN9g3/c31I= X-Received: by 10.28.15.5 with SMTP id 5mr1618055wmp.43.1509447184669; Tue, 31 Oct 2017 03:53:04 -0700 (PDT) Received: from localhost.localdomain ([105.129.222.2]) by smtp.gmail.com with ESMTPSA id o14sm460985wra.54.2017.10.31.03.53.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 31 Oct 2017 03:53:03 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org, leif.lindholm@linaro.org Date: Tue, 31 Oct 2017 10:52:05 +0000 Message-Id: <20171031105218.30208-15-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171031105218.30208-1-ard.biesheuvel@linaro.org> References: <20171031105218.30208-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH edk2-platforms v3 14/27] 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: daniel.thompson@linaro.org, masami.hiramatsu@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 Reviewed-by: Leif Lindholm --- Silicon/Socionext/SynQuacer/Library/NorFlashSynQuacerLib/NorFlashSynQuacer.c | 70 ++++++++++++++++++++ Silicon/Socionext/SynQuacer/Library/NorFlashSynQuacerLib/NorFlashSynQuacerLib.inf | 41 ++++++++++++ 2 files changed, 111 insertions(+) -- 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/Silicon/Socionext/SynQuacer/Library/NorFlashSynQuacerLib/NorFlashSynQuacer.c b/Silicon/Socionext/SynQuacer/Library/NorFlashSynQuacerLib/NorFlashSynQuacer.c new file mode 100644 index 000000000000..816d8ba33f8c --- /dev/null +++ b/Silicon/Socionext/SynQuacer/Library/NorFlashSynQuacerLib/NorFlashSynQuacer.c @@ -0,0 +1,70 @@ +/** @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[] = { + { + // UEFI code region + SYNQUACER_SPI_NOR_BASE, // device base + FixedPcdGet64 (PcdFdBaseAddress), // region base + FixedPcdGet32 (PcdFdSize), // region size + SIZE_64KB, // block size + { + 0x19c118b0, 0xc423, 0x42be, { 0xb8, 0x0f, 0x70, 0x6f, 0x1f, 0xcb, 0x59, 0x9a } + } + }, + { + // 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..2a8fd209f5e3 --- /dev/null +++ b/Silicon/Socionext/SynQuacer/Library/NorFlashSynQuacerLib/NorFlashSynQuacerLib.inf @@ -0,0 +1,41 @@ +#/** @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 = 0x0001001A + 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 + ArmPkg/ArmPkg.dec + MdeModulePkg/MdeModulePkg.dec + MdePkg/MdePkg.dec + Silicon/Socionext/SynQuacer/SynQuacer.dec + +[LibraryClasses] + BaseLib + +[FixedPcd] + gArmTokenSpaceGuid.PcdFdBaseAddress + gArmTokenSpaceGuid.PcdFdSize + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize