From: "Sunil V L" <sunilvl@ventanamicro.com>
To: devel@edk2.groups.io, ardb@kernel.org
Cc: Leif Lindholm <quic_llindhol@quicinc.com>,
Thomas Abraham <thomas.abraham@arm.com>,
Sami Mujawar <sami.mujawar@arm.com>
Subject: Re: [edk2-devel] [PATCH edk2-platforms 2/4] Platform/ARM: create local definition of NorFlashPlatformLib
Date: Wed, 19 Oct 2022 18:21:27 +0530 [thread overview]
Message-ID: <Y0/yz9RSpzW8oPi2@sunil-laptop> (raw)
In-Reply-To: <20221019103555.493477-3-ardb@kernel.org>
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 <ardb@kernel.org>
> ---
> 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.<BR>
> +
> + 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
next prev parent reply other threads:[~2022-10-19 12:51 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-19 10:35 [PATCH edk2-platforms 0/4] Platform/ARM: clone ArmPlatformPkg's NorFlashDxe Ard Biesheuvel
2022-10-19 10:35 ` [PATCH edk2-platforms 1/4] Platform/ARM/BootMonFs: drop spurious dependency on ArmPlatformPkg Ard Biesheuvel
2022-10-19 12:46 ` Sami Mujawar
2022-10-19 10:35 ` [PATCH edk2-platforms 2/4] Platform/ARM: create local definition of NorFlashPlatformLib Ard Biesheuvel
2022-10-19 12:51 ` Sunil V L [this message]
2022-10-19 12:52 ` Sami Mujawar
2022-10-19 12:56 ` [edk2-devel] " Ard Biesheuvel
2022-10-19 13:26 ` Sunil V L
2022-10-19 10:35 ` [PATCH edk2-platforms 3/4] Platform/ARM: clone NorFlashDxe from ArmPlatformPkg Ard Biesheuvel
2022-10-19 12:52 ` Sami Mujawar
2022-10-19 10:35 ` [PATCH edk2-platforms 4/4] Platform/ARM: switch to local version of NorFlashDxe drivers Ard Biesheuvel
2022-10-19 12:53 ` Sami Mujawar
2022-10-19 15:12 ` [PATCH edk2-platforms 0/4] Platform/ARM: clone ArmPlatformPkg's NorFlashDxe Ard Biesheuvel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y0/yz9RSpzW8oPi2@sunil-laptop \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox