public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Andrew Fish <afish@apple.com>
To: galla rao <galla.rao80@gmail.com>
Cc: edk2-devel@lists.01.org
Subject: Re: Query on Variable Services
Date: Thu, 17 Jan 2019 09:54:35 -0800	[thread overview]
Message-ID: <B26FD6DD-90B6-413E-A273-C2F0E275118B@apple.com> (raw)
In-Reply-To: <CAC=A7_BZfmcshRxtMvSGYGZCszJBm2OxDZRpcf0_YuwMadi7AQ@mail.gmail.com>

Galla,

The PCD value usually get set as the result of the build. 

EFI_MEMORY_RUNTIME attribute is used to request a virtual mapping from the OS. When the variable services are called from the OS the run in a virtual address space provided by the OS. Thus trying to access 0xFFE00000 would page fault. 

You can run the memmap command from the EFI Shell and see if bit 63 is set. If your SPI controller is a memory mapped hardware device you may also need to map the SPI register via EFI_MEMORY_RUNTIME. The SPI driver also needs to deal with the SetVirtualAddress map event to convert its pointers over to the new OS provided virtual memory space.

Thanks,

Andrew Fish


> On Jan 17, 2019, at 9:23 AM, galla rao <galla.rao80@gmail.com> wrote:
> 
> Hi All,
> 
> Have a question for Variable services
> 
> Given PCD's are initialized
> 
> gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase   | 0xFFE00000
> 
>  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase |
> 0xFFE3E000
> 
>  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase   |
> 0xFFE40000
> 
> Do i need to make these regions as *EFI_MEMORY_RUNTIME *through
> *gDS->SetMemorySpaceAttributes*
> 
> SPI Flash writes within BIOS works good!
> 
> *when trying to change BootOrder from efibootmgr, the failure is seen*
> 
> It would be useful if someone has faced this issue earlier and can respond
> kindly.
> 
> Best Regards
> Galla
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel



  reply	other threads:[~2019-01-17 17:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-17 17:23 Query on Variable Services galla rao
2019-01-17 17:54 ` Andrew Fish [this message]
2019-01-17 18:26   ` galla rao
2019-01-17 18:48     ` Andrew Fish

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=B26FD6DD-90B6-413E-A273-C2F0E275118B@apple.com \
    --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