From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4001:c0b::244; helo=mail-it0-x244.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-it0-x244.google.com (mail-it0-x244.google.com [IPv6:2607:f8b0:4001:c0b::244]) (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 2C052226C7C5F for ; Sun, 15 Apr 2018 23:21:39 -0700 (PDT) Received: by mail-it0-x244.google.com with SMTP id q85-v6so10191572itc.0 for ; Sun, 15 Apr 2018 23:21:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=UFsNpwS+96Edb7SbpE0QVFDiylTaTB6NqK7drVjRbd0=; b=NqDXzN8LFtt5+lRN1xJx84L19gmkVHEhUkRzJuYBx4gwMAeJde0lT6dOK2bvz3NaXV C29zKMWqLnWQYf5aEyUN5BpWlySX4zAsId4ZefqwqtsZbgUmmVrfEdBKK5OkH9NOv/Ww g+Odi/QeY8B//Ghk+3ZLb7ikjxB8W1OEpsv+A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=UFsNpwS+96Edb7SbpE0QVFDiylTaTB6NqK7drVjRbd0=; b=RYfcELrOM+1trK9vTtCq7oazyjbyUl7GADP2AJJdy7fZT+sB4Z0e452hM8tKsHBU6F Ov+QCF+iKavsJp6Qvona41+zDeoX0eN90piG99Y/PN77vhY7psUm/Ni65jTsaDHnP1+6 gVMJgZgmrbo3t0uLnV8T36vHMreyXZ8m77UghqlF/laE3vLNyh6lqY8JaDwOfGcEw3oe FL/GitW3pixBixPAv2ZnbDpYHYy+4l4lS+1ocutIUbI7SR8hoXe9Oc0h9W06i88aAh48 NejLrM2YumTQ6doPeh9MM/QIt7a0Y7BAYVFfAF9IxOn2jxdtIh1zoh8fsUhHKxRLlqfq Q8Xw== X-Gm-Message-State: ALQs6tBo8sOy8WUGmn72XWPf9Jkohg6pb09J2KASfWpLVJaskI13HwYZ F1bkExg30S6kaxOMmJD5inFGYXkLb65qskYZA39BhYh1 X-Google-Smtp-Source: AIpwx4+sLZ5PVezE0bjd2nOlR6be3B5phm9y5lgPgf5S6Qv9ZsZCHBuIezNtmL/Uhvdp0HD4cCKiOG8sAwjA0QFg8ww= X-Received: by 2002:a24:36c9:: with SMTP id l192-v6mr13671752itl.42.1523859698355; Sun, 15 Apr 2018 23:21:38 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.187.67 with HTTP; Sun, 15 Apr 2018 23:21:37 -0700 (PDT) In-Reply-To: <1523558863-5427-3-git-send-email-thomas.abraham@arm.com> References: <1523558863-5427-1-git-send-email-thomas.abraham@arm.com> <1523558863-5427-3-git-send-email-thomas.abraham@arm.com> From: Ard Biesheuvel Date: Mon, 16 Apr 2018 08:21:37 +0200 Message-ID: To: Thomas Abraham Cc: "edk2-devel@lists.01.org" , Leif Lindholm , Vishwanatha HG Subject: Re: [PATCH edk2-platforms v2 2/6] Platform/ARM/Sgi: add NOR flash platform library implementation X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Apr 2018 06:21:39 -0000 Content-Type: text/plain; charset="UTF-8" On 12 April 2018 at 20:47, Thomas Abraham wrote: > From: Vishwanatha HG > > Add a initial NOR flash driver platform wrapper as part of the platform > library. Access to NOR fash 0 is enabled in this initial implementation. > > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Vishwanatha HG > Signed-off-by: Thomas Abraham > --- > Platform/ARM/SgiPkg/Library/NorFlashLib/NorFlash.c | 60 ++++++++++++++++++++++ > .../ARM/SgiPkg/Library/NorFlashLib/NorFlashLib.inf | 33 ++++++++++++ > 2 files changed, 93 insertions(+) > create mode 100644 Platform/ARM/SgiPkg/Library/NorFlashLib/NorFlash.c > create mode 100644 Platform/ARM/SgiPkg/Library/NorFlashLib/NorFlashLib.inf > > diff --git a/Platform/ARM/SgiPkg/Library/NorFlashLib/NorFlash.c b/Platform/ARM/SgiPkg/Library/NorFlashLib/NorFlash.c > new file mode 100644 > index 0000000..5d7efea > --- /dev/null > +++ b/Platform/ARM/SgiPkg/Library/NorFlashLib/NorFlash.c > @@ -0,0 +1,60 @@ > +/** @file > + > + Copyright (c) 2018, 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[] = { > + { > + SGI_EXP_SMC_CS0_BASE, > + SGI_EXP_SMC_CS0_BASE, > + SIZE_256KB * 255, > + SIZE_256KB, > + {0xEBF0B9DF, 0x17d0, 0x4812, { 0xA9, 0x59, 0xCF, 0xD7, 0x92, 0xEE, 0x31, 0x13} } > + }, > + { > + SGI_EXP_SMC_CS0_BASE, > + SGI_EXP_SMC_CS0_BASE + SIZE_256KB * 255, > + SIZE_64KB * 4, > + SIZE_64KB, > + {0x98C111C6, 0xB322, 0x4C33, { 0x95, 0xD5, 0xAF, 0x56, 0xAF, 0x90, 0x18, 0x6A } } > + }, > +}; > + > +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; > + } > + > + *NorFlashDevices = mNorFlashDevices; > + *Count = sizeof (mNorFlashDevices) / sizeof (NOR_FLASH_DESCRIPTION); Please use ARRAY_SIZE() here > + > + return EFI_SUCCESS; > +} > diff --git a/Platform/ARM/SgiPkg/Library/NorFlashLib/NorFlashLib.inf b/Platform/ARM/SgiPkg/Library/NorFlashLib/NorFlashLib.inf > new file mode 100644 > index 0000000..a860e5c > --- /dev/null > +++ b/Platform/ARM/SgiPkg/Library/NorFlashLib/NorFlashLib.inf > @@ -0,0 +1,33 @@ > +#/** @file > +# > +# Copyright (c) 2018, 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 0x0001001A > + BASE_NAME = NorFlashSgiLib > + FILE_GUID = 3f021755-6d74-4065-9ee4-98225267b36e > + MODULE_TYPE = DXE_DRIVER > + VERSION_STRING = 1.0 > + LIBRARY_CLASS = NorFlashPlatformLib > + > +[Sources.common] > + NorFlash.c > + > +[Packages] > + MdePkg/MdePkg.dec > + ArmPlatformPkg/ArmPlatformPkg.dec > + > +[LibraryClasses] > + BaseLib > + DebugLib > + IoLib > -- > 2.7.4 >