From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mx.groups.io with SMTP id smtpd.web11.7372.1666184214318970083 for ; Wed, 19 Oct 2022 05:56:54 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XmoSgVfC; spf=pass (domain: kernel.org, ip: 139.178.84.217, mailfrom: ardb@kernel.org) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A481C6185A for ; Wed, 19 Oct 2022 12:56:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 14ACAC433D6 for ; Wed, 19 Oct 2022 12:56:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666184213; bh=6oZ5ACxunJkucnhsjJWKuRbQ1LCRK8tG0Z5uM0LbWdQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=XmoSgVfCF+Zu5acy92dyMnMEZnZDqA9eCnAl5q0fGbTLWmKYuKRNEk92/Q3Tj7ipt JQFCbkrP20esALRn1GOEvc9TEgQ1m2toG17YI1jMNZFngqP8blD3ybatdEqaStBBxm RWj7hZO9Owoh5Iq4gtx9/EJDcU2FrDXzlJLupS9XA+zd3Ih/Rp6pgqGm2cfRJxJveq 6qiRfIy+WuQj4VBbwuGT8aeth8e5G6WWYtzmK0ASvXFZanv7C8mjh/fAQTTihCeGaD KyJj54F41Okabs6ReOxXLrs3h2ra4Sdx3WgS04BwCkB93C8odd/5/4+wK3XuTvpbjP 3xR4DFnzRKyEQ== Received: by mail-lj1-f180.google.com with SMTP id a6so22047908ljq.5 for ; Wed, 19 Oct 2022 05:56:52 -0700 (PDT) X-Gm-Message-State: ACrzQf3faKZyMyHAC4E+cbaxNzh1KR2RSETw1WcvfMCR8pnJeTdZSoF9 IUUGVNAVXHfVrAJeZ/d1Sj3VNynDNNUTiLNXie8= X-Google-Smtp-Source: AMsMyM7I3Fh5+1L66YLxPgYQUyWs+VBSPTx/CjJsU9YDazLbE+bWsvPxMD5nHO2yrBsxEtJ5r5AG+P1U16ArDKnIzQc= X-Received: by 2002:a05:651c:b2b:b0:26f:cf40:a560 with SMTP id b43-20020a05651c0b2b00b0026fcf40a560mr3030180ljr.516.1666184211061; Wed, 19 Oct 2022 05:56:51 -0700 (PDT) MIME-Version: 1.0 References: <20221019103555.493477-1-ardb@kernel.org> <20221019103555.493477-3-ardb@kernel.org> <0d8b82d3-83ce-e8a8-468a-c41907f015d6@arm.com> In-Reply-To: <0d8b82d3-83ce-e8a8-468a-c41907f015d6@arm.com> From: "Ard Biesheuvel" Date: Wed, 19 Oct 2022 14:56:39 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [edk2-devel] [PATCH edk2-platforms 2/4] Platform/ARM: create local definition of NorFlashPlatformLib To: devel@edk2.groups.io, sami.mujawar@arm.com, Sunil V L Cc: Leif Lindholm , Thomas Abraham , "nd@arm.com" Content-Type: text/plain; charset="UTF-8" On Wed, 19 Oct 2022 at 14:52, Sami Mujawar wrote: > > Hi Ard, > > Thank you for this patch. > > The patch at 'https://edk2.groups.io/g/devel/message/95239' is moving > the NorFlashPlatformLib.h to > MdePkg/Include/Library/NorFlashPlatformLib.h. Is the plan to drop > Platform/ARM/Include/Library/NorFlashPlatformLib.h once the MdePkg patch > is merged? > MdePkg is not the place for this - it only carries things that are defined in PI, UEFI, or other industry standard specifications. NorFlashPlatformLib is tightly coupled to NorFlashDxe. We will be moving the latter into OvmfPkg/ so the library definition should move there as well, most probably. > Other than that, these changes look good to me. > > Reviewed-by: Sami Mujawar > > Regards, > > Sami Mujawar > > On 19/10/2022 11:35 am, 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_ */ > > > > > > >