From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) by mx.groups.io with SMTP id smtpd.web09.7456.1666183895674633504 for ; Wed, 19 Oct 2022 05:51:35 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@ventanamicro.com header.s=google header.b=ln/N6laf; spf=pass (domain: ventanamicro.com, ip: 209.85.210.172, mailfrom: sunilvl@ventanamicro.com) Received: by mail-pf1-f172.google.com with SMTP id p14so17147487pfq.5 for ; Wed, 19 Oct 2022 05:51:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=soePGrp5JmJwvWhblFHMXEMLuacUBbClvDiN1JhkeGs=; b=ln/N6lafCqBmILUpaP+PjMSHqrhWK0EQqWirie+3rqYSZptkaUr7ONQ4hdT6FMyWRY ErfG28/mcTRu27ulKllMd9aJPGyW49ts/IUfM0F0Ht+Wng2wqSfhjIUISMeLhILPW30A jxzInnhAqtO4kpcxaA/fvZG/V+IjfCw5UES01JUNteBs0oWDUARqHmysEKRvAZgF/VFb iaLOW3kzAw1mf0+Am5mfJ6h6zEiw4X7+B7WbJEYyp8EsfxqTrb7EA48jBHfW8UN0LzUr JPaBLHefpTcX0D6SjmwbkpIfHJAha5iO/RO+7V5cxgMwk8fM2TDVHTD/EW+ZcdsQa0w0 D5iA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=soePGrp5JmJwvWhblFHMXEMLuacUBbClvDiN1JhkeGs=; b=qzcoznhjJhL4MX6hGib58hAc8h1Rt6Lv9/gu06uB+VZ7YT0m0jp5qpebZIV8UCvFqk sLG7h50RDkRrNBRplJahWPpw94mp7/EZ55ndzT29urDq1wlafSTIuy7USz42LIF6kSVk mBytOo+aNer1QlrDb4/RuOLrHGqXs6WRqC/mKVpuRoBKcWXt17mMSEjUDPx2OuEdLg/y Ycu6eP9qoroLJpOZ9IU4FIGaH+kX8EUl8voUAOYWVkhALsw93mJYEsn7ryeKcX32TUnW l0+BVAzejPhoy+Ucou2kfL9+Zuq0XwmMLRRomkIT/RKoo6+zZwq4wr9ctMEH8PX07Xc/ kIIA== X-Gm-Message-State: ACrzQf0tnYgH9phOOMUicVIZoJO71VXgq8HGkVuxs/DB9ZdDQiwmhobN R8XE5hW2ZU7Xk6MDEQMAqly5neNYvKJo4Q== X-Google-Smtp-Source: AMsMyM4I+W0kFfgcQ0Qq0frReh8VrVk8sCn8OX+qkWgGYzY7Yrybrn1lQzRMIuvMJ+Q8tvw4dzg39A== X-Received: by 2002:a05:6a00:1256:b0:563:ce4b:f525 with SMTP id u22-20020a056a00125600b00563ce4bf525mr8520617pfi.72.1666183894456; Wed, 19 Oct 2022 05:51:34 -0700 (PDT) Return-Path: Received: from sunil-laptop ([49.206.13.138]) by smtp.gmail.com with ESMTPSA id y20-20020a170902b49400b0017f72a430adsm10649758plr.71.2022.10.19.05.51.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 05:51:33 -0700 (PDT) Date: Wed, 19 Oct 2022 18:21:27 +0530 From: "Sunil V L" To: devel@edk2.groups.io, ardb@kernel.org Cc: Leif Lindholm , Thomas Abraham , Sami Mujawar Subject: Re: [edk2-devel] [PATCH edk2-platforms 2/4] Platform/ARM: create local definition of NorFlashPlatformLib Message-ID: References: <20221019103555.493477-1-ardb@kernel.org> <20221019103555.493477-3-ardb@kernel.org> MIME-Version: 1.0 In-Reply-To: <20221019103555.493477-3-ardb@kernel.org> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Oct 19, 2022 at 12:35:53PM +0200, Ard Biesheuvel wrote: > The version of NorFlashPlatformLib defined in ArmPlatformPkg will go > away once we retire its version of NorFlashDxe, so switch to a local > Platform/ARM version instead. > > Signed-off-by: Ard Biesheuvel > --- > Platform/ARM/ARM.dec | 1 + > Platform/ARM/JunoPkg/Library/NorFlashJunoLib/NorFlashJunoLib.inf | 2 +- > Platform/ARM/SgiPkg/Library/NorFlashLib/NorFlashLib.inf | 2 +- > Platform/ARM/SgiPkg/Library/NorFlashLib/StandaloneMmNorFlashLib.inf | 2 +- > Platform/ARM/Include/Library/NorFlashPlatformLib.h | 30 ++++++++++++++++++++ > 5 files changed, 34 insertions(+), 3 deletions(-) > > diff --git a/Platform/ARM/ARM.dec b/Platform/ARM/ARM.dec > index 5175b313f95a..cf1c8ef04742 100644 > --- a/Platform/ARM/ARM.dec > +++ b/Platform/ARM/ARM.dec > @@ -17,6 +17,7 @@ [Includes] > > [LibraryClasses] > BdsLib|Include/Library/BdsLib.h > + NorFlashPlatformLib|Include/Library/NorFlashPlatformLib.h > > [Guids] > gArmBootMonFsFileInfoGuid = { 0x41e26b9c, 0xada6, 0x45b3, { 0x80, 0x8e, 0x23, 0x57, 0xa3, 0x5b, 0x60, 0xd6 } } > diff --git a/Platform/ARM/JunoPkg/Library/NorFlashJunoLib/NorFlashJunoLib.inf b/Platform/ARM/JunoPkg/Library/NorFlashJunoLib/NorFlashJunoLib.inf > index e5e5628de387..1a38bf81b349 100644 > --- a/Platform/ARM/JunoPkg/Library/NorFlashJunoLib/NorFlashJunoLib.inf > +++ b/Platform/ARM/JunoPkg/Library/NorFlashJunoLib/NorFlashJunoLib.inf > @@ -17,8 +17,8 @@ [Sources.common] > NorFlashJuno.c > > [Packages] > - ArmPlatformPkg/ArmPlatformPkg.dec > MdePkg/MdePkg.dec > + Platform/ARM/ARM.dec > Platform/ARM/JunoPkg/ArmJuno.dec > > [LibraryClasses] > diff --git a/Platform/ARM/SgiPkg/Library/NorFlashLib/NorFlashLib.inf b/Platform/ARM/SgiPkg/Library/NorFlashLib/NorFlashLib.inf > index 74486eacd009..06068db0e4f3 100644 > --- a/Platform/ARM/SgiPkg/Library/NorFlashLib/NorFlashLib.inf > +++ b/Platform/ARM/SgiPkg/Library/NorFlashLib/NorFlashLib.inf > @@ -18,8 +18,8 @@ [Sources.common] > NorFlashLib.c > > [Packages] > - ArmPlatformPkg/ArmPlatformPkg.dec > MdePkg/MdePkg.dec > + Platform/ARM/ARM.dec > Platform/ARM/SgiPkg/SgiPlatform.dec > > [LibraryClasses] > diff --git a/Platform/ARM/SgiPkg/Library/NorFlashLib/StandaloneMmNorFlashLib.inf b/Platform/ARM/SgiPkg/Library/NorFlashLib/StandaloneMmNorFlashLib.inf > index 96bbf1e42313..54b3cb041645 100644 > --- a/Platform/ARM/SgiPkg/Library/NorFlashLib/StandaloneMmNorFlashLib.inf > +++ b/Platform/ARM/SgiPkg/Library/NorFlashLib/StandaloneMmNorFlashLib.inf > @@ -19,8 +19,8 @@ [Sources.common] > StandaloneMmNorFlashLib.c > > [Packages] > - ArmPlatformPkg/ArmPlatformPkg.dec > MdePkg/MdePkg.dec > + Platform/ARM/ARM.dec > Platform/ARM/SgiPkg/SgiPlatform.dec > > [LibraryClasses] > diff --git a/Platform/ARM/Include/Library/NorFlashPlatformLib.h b/Platform/ARM/Include/Library/NorFlashPlatformLib.h > new file mode 100644 > index 000000000000..6ef5b70e9948 > --- /dev/null > +++ b/Platform/ARM/Include/Library/NorFlashPlatformLib.h > @@ -0,0 +1,30 @@ > +/** @file > + > + Copyright (c) 2011-2012, ARM Ltd. All rights reserved.
> + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > + **/ > + > +#ifndef _NORFLASHPLATFORMLIB_H_ > +#define _NORFLASHPLATFORMLIB_H_ > + > +typedef struct { > + UINTN DeviceBaseAddress; // Start address of the Device Base Address (DBA) > + UINTN RegionBaseAddress; // Start address of one single region > + UINTN Size; > + UINTN BlockSize; > +} NOR_FLASH_DESCRIPTION; > + > +EFI_STATUS > +NorFlashPlatformInitialization ( > + VOID > + ); > + > +EFI_STATUS > +NorFlashPlatformGetDevices ( > + OUT NOR_FLASH_DESCRIPTION **NorFlashDescriptions, > + OUT UINT32 *Count > + ); > + > +#endif /* _NORFLASHPLATFORMLIB_H_ */ Hi Ard, I had moved NorFlashPlatformLib.h to MdePkg (patch 25/34) thinking it can be used by both Ovmf and real platforms. Is there an issue with that approach? Thanks Sunil