public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* Silicon/SbsaQemu: Fix NOR flash RegionBaseAddress
@ 2020-06-16 19:29 Tanmay Jagdale
  2020-06-17  7:39 ` Graeme Gregory
  0 siblings, 1 reply; 3+ messages in thread
From: Tanmay Jagdale @ 2020-06-16 19:29 UTC (permalink / raw)
  To: leif, ard.biesheuvel, graeme.gregory, devel; +Cc: rad, Tanmay Jagdale

The EFI_FIMRWARE_VOLUME_HEADER is present at an offset in the
NOR flash of Sbsa QEMU model. Use the right RegionBaseAddress
so that the EFI firmware volume header can be found correctly.

Signed-off-by: Tanmay Jagdale <tanmay.jagdale@linaro.org>
---
 .../SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.c  | 2 +-
 .../Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.inf         | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/Silicon/Qemu/SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.c b/Silicon/Qemu/SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.c
index e7bb626596..0946327cb5 100644
--- a/Silicon/Qemu/SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.c
+++ b/Silicon/Qemu/SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.c
@@ -23,7 +23,7 @@ NorFlashPlatformInitialization (
 NOR_FLASH_DESCRIPTION mNorFlashDevice =
 {
  FixedPcdGet64(PcdFdBaseAddress),
- FixedPcdGet64(PcdFdBaseAddress),
+ FixedPcdGet64(PcdFlashNvStorageVariableBase),
  FixedPcdGet32(PcdFdSize),
  QEMU_NOR_BLOCK_SIZE
 };
diff --git a/Silicon/Qemu/SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.inf b/Silicon/Qemu/SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.inf
index 82712c8901..f2ba41e1df 100644
--- a/Silicon/Qemu/SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.inf
+++ b/Silicon/Qemu/SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.inf
@@ -23,7 +23,9 @@
   ArmPlatformPkg/ArmPlatformPkg.dec
   ArmPkg/ArmPkg.dec
   MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
 
 [FixedPcd]
   gArmTokenSpaceGuid.PcdFdBaseAddress
   gArmTokenSpaceGuid.PcdFdSize
+  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: Silicon/SbsaQemu: Fix NOR flash RegionBaseAddress
  2020-06-16 19:29 Silicon/SbsaQemu: Fix NOR flash RegionBaseAddress Tanmay Jagdale
@ 2020-06-17  7:39 ` Graeme Gregory
  2020-06-17  8:41   ` Ard Biesheuvel
  0 siblings, 1 reply; 3+ messages in thread
From: Graeme Gregory @ 2020-06-17  7:39 UTC (permalink / raw)
  To: Tanmay Jagdale; +Cc: leif, ard.biesheuvel, devel, rad

On Wed, Jun 17, 2020 at 12:59:13AM +0530, Tanmay Jagdale wrote:
> The EFI_FIMRWARE_VOLUME_HEADER is present at an offset in the
> NOR flash of Sbsa QEMU model. Use the right RegionBaseAddress
> so that the EFI firmware volume header can be found correctly.
> 
> Signed-off-by: Tanmay Jagdale <tanmay.jagdale@linaro.org>

This fixes the problem for me, I have tested setting variables from
efi shell and from debian guest OS and they persist correctly now.

Tested-by: Graeme Gregory <graeme.gregory@linaro.org>

> ---
>  .../SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.c  | 2 +-
>  .../Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.inf         | 2 ++
>  2 files changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/Silicon/Qemu/SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.c b/Silicon/Qemu/SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.c
> index e7bb626596..0946327cb5 100644
> --- a/Silicon/Qemu/SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.c
> +++ b/Silicon/Qemu/SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.c
> @@ -23,7 +23,7 @@ NorFlashPlatformInitialization (
>  NOR_FLASH_DESCRIPTION mNorFlashDevice =
>  {
>   FixedPcdGet64(PcdFdBaseAddress),
> - FixedPcdGet64(PcdFdBaseAddress),
> + FixedPcdGet64(PcdFlashNvStorageVariableBase),
>   FixedPcdGet32(PcdFdSize),
>   QEMU_NOR_BLOCK_SIZE
>  };
> diff --git a/Silicon/Qemu/SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.inf b/Silicon/Qemu/SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.inf
> index 82712c8901..f2ba41e1df 100644
> --- a/Silicon/Qemu/SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.inf
> +++ b/Silicon/Qemu/SbsaQemu/Library/SbsaQemuNorFlashLib/SbsaQemuNorFlashLib.inf
> @@ -23,7 +23,9 @@
>    ArmPlatformPkg/ArmPlatformPkg.dec
>    ArmPkg/ArmPkg.dec
>    MdePkg/MdePkg.dec
> +  MdeModulePkg/MdeModulePkg.dec
>  
>  [FixedPcd]
>    gArmTokenSpaceGuid.PcdFdBaseAddress
>    gArmTokenSpaceGuid.PcdFdSize
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase
> -- 
> 2.27.0
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Silicon/SbsaQemu: Fix NOR flash RegionBaseAddress
  2020-06-17  7:39 ` Graeme Gregory
@ 2020-06-17  8:41   ` Ard Biesheuvel
  0 siblings, 0 replies; 3+ messages in thread
From: Ard Biesheuvel @ 2020-06-17  8:41 UTC (permalink / raw)
  To: Graeme Gregory, Tanmay Jagdale; +Cc: leif, devel, rad

On 6/17/20 9:39 AM, Graeme Gregory wrote:
> On Wed, Jun 17, 2020 at 12:59:13AM +0530, Tanmay Jagdale wrote:
>> The EFI_FIMRWARE_VOLUME_HEADER is present at an offset in the
>> NOR flash of Sbsa QEMU model. Use the right RegionBaseAddress
>> so that the EFI firmware volume header can be found correctly.
>>
>> Signed-off-by: Tanmay Jagdale <tanmay.jagdale@linaro.org>
> 
> This fixes the problem for me, I have tested setting variables from
> efi shell and from debian guest OS and they persist correctly now.
> 
> Tested-by: Graeme Gregory <graeme.gregory@linaro.org>
> 

Pushed as 8b2c8fcaa90b..5f13ce8a65f2

Thanks,

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-06-17  8:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-16 19:29 Silicon/SbsaQemu: Fix NOR flash RegionBaseAddress Tanmay Jagdale
2020-06-17  7:39 ` Graeme Gregory
2020-06-17  8:41   ` Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox