From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-x22f.google.com (mail-wm0-x22f.google.com [IPv6:2a00:1450:400c:c09::22f]) (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 767A620958BCF for ; Mon, 11 Sep 2017 09:35:58 -0700 (PDT) Received: by mail-wm0-x22f.google.com with SMTP id i189so44210887wmf.1 for ; Mon, 11 Sep 2017 09:38:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=rOwhNveh/gyPVH0Bd/c0H6JO6UJ0CyHcM0DR/M/K5tk=; b=VPfP6+zrltAbiZmTBJnH6l6Q6JyuaepWDJpF2uEM4uwuXTC3mH/04CgsACcMCDI6Np jzRVZ8iuZnqJP3UGrXwAdy2XjaAyie5cFTMPqjoU7AWPZ8/vhb7NPAojR679zUl5qgVD tgzash+Z6miXZGaIZeUMuu33SXUB0BlOu7R28= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=rOwhNveh/gyPVH0Bd/c0H6JO6UJ0CyHcM0DR/M/K5tk=; b=cVVUfxtK+62g0CbcWOLRdnckCUU5wAxAhejru8EYU1kNAgffTS4y6cryy8Jwaf/q/q RAQQC53udcSBaNBxVomNgCDgxuZGJ9A8IjWlPc+VP6b9iL3m/O+uSWvhWby7xoqq0Ar7 fUfgzi4uSEb2vmVx95GhGwxFPIe3VSJDZXqiHRJWKxnlsPPipAQ1NQH4YGofZpnkCk6o fS2PL8hfz10jfmfC7q2bHD6IBSrxymvHg0BjDpaelzUm281vYQC2htVIJOO9kUngpn/j tZ5+ghN2M0nGFdAdtxB+OKmZJOjzbbLA8C8fo0UKUUbcXJ0+CU52T2v1x+Z6NOYBSzmP JzBw== X-Gm-Message-State: AHPjjUh/82aMEyn1aoXuaTRaVspbawRwp/6ltRT+Zcdjsu/vgOYp2AnE zUuCwbgcfI44ivJAlaq4/gfQPuZgqSA= X-Google-Smtp-Source: AOwi7QBXfptUUzHQCPanU3ICnToG8VAyZ1VO8B2bzKvjZUwm45hxF1W75gMcB7PlN+ZcXIZIeMEqOw== X-Received: by 10.28.127.195 with SMTP id a186mr8951433wmd.107.1505147932938; Mon, 11 Sep 2017 09:38:52 -0700 (PDT) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id 66sm5907029wmn.37.2017.09.11.09.38.51 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 11 Sep 2017 09:38:52 -0700 (PDT) Date: Mon, 11 Sep 2017 17:38:50 +0100 From: Leif Lindholm To: Ard Biesheuvel Cc: edk2-devel@lists.01.org, methavanitpong.pipat@socionext.com, masahisa.kojima@linaro.org, masami.hiramatsu@linaro.org Message-ID: <20170911163850.c7pfxc7iqy36jkho@bivouac.eciton.net> References: <20170908182315.9591-1-ard.biesheuvel@linaro.org> <20170908182315.9591-13-ard.biesheuvel@linaro.org> MIME-Version: 1.0 In-Reply-To: <20170908182315.9591-13-ard.biesheuvel@linaro.org> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [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: Mon, 11 Sep 2017 16:35:58 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Sep 08, 2017 at 07:23:13PM +0100, Ard Biesheuvel wrote: > 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 If you bump this: Reviewed-by: Leif Lindholm > + 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 >