Hi,
  If you boot from a PI FV image, you can add MdeModulePkg 
FvSimpleFileSystemDxe driver, then you can see the bootable EFI image in Shell 
env.

Thanks
Liming
From: Andrew Fish [mailto:af...@apple.com]
Sent: Saturday, January 03, 2015 12:55 AM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] SPI boot support


On Jan 1, 2015, at 11:42 PM, Meenakshi Aggarwal 
<meenakshi.aggar...@freescale.com<mailto:meenakshi.aggar...@freescale.com>> 
wrote:

Hi,

I want to boot UEFI from SPI flash.


If it is a PI based system you can just boot from an FV (Firmware Volume). 
http://www.uefi.org/specifications

The MdePkg UEFI Lib has a function to create a a device path node, File names 
for an FV are a EFI_GUID.

https://svn.code.sf.net/p/edk2/code/trunk/edk2/MdePkg/Include/Library/UefiLib.h

/**

  Initialize a Firmware Volume (FV) Media Device Path node.



  The Framework FwVol Device Path changed to conform to the UEFI 2.0 
specification.

  This library function abstracts initializing a device path node.

  Initialize the MEDIA_FW_VOL_FILEPATH_DEVICE_PATH data structure.  This device

  path changed in the DXE CIS version 0.92 in a non back ward compatible way to

  not conflict with the UEFI 2.0 specification.  This function abstracts the

  differences from the caller.

  If FvDevicePathNode is NULL, then ASSERT().

  If NameGuid is NULL, then ASSERT().



  @param  FvDevicePathNode  The pointer to a FV device path node to initialize

  @param  NameGuid          FV file name to use in FvDevicePathNode



**/

VOID

EFIAPI

EfiInitializeFwVolDevicepathNode (

  IN OUT MEDIA_FW_VOL_FILEPATH_DEVICE_PATH  *FvDevicePathNode,

  IN CONST EFI_GUID                         *NameGuid

  );

The BDS supports an option of booting the shell from an FV. You can search for 
PcdShellFile.

https://svn.code.sf.net/p/edk2/code/trunk/edk2/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c


/**

  Build the on flash shell boot option with the handle parsed in.



  @param  Handle                 The handle which present the device path to 
create

                                 on flash shell boot option

  @param  BdsBootOptionList      The header of the link list which indexed all

                                 current boot options



**/

VOID

EFIAPI

BdsLibBuildOptionFromShell (

  IN EFI_HANDLE                  Handle,

  IN OUT LIST_ENTRY              *BdsBootOptionList

  )

{

  EFI_DEVICE_PATH_PROTOCOL          *DevicePath;

  MEDIA_FW_VOL_FILEPATH_DEVICE_PATH ShellNode;



  DevicePath = DevicePathFromHandle (Handle);



  //

  // Build the shell device path

  //

  EfiInitializeFwVolDevicepathNode (&ShellNode, PcdGetPtr(PcdShellFile));



  DevicePath = AppendDevicePathNode (DevicePath, (EFI_DEVICE_PATH_PROTOCOL *) 
&ShellNode);



  //

  // Create and register the shell boot option

  //

  BdsLibRegisterNewOption (BdsBootOptionList, DevicePath, L"EFI Internal 
Shell", L"BootOrder");



}



Thanks,

Andrew Fish


Kindly tell if there is any support of SPI in UEFI?
Also which protocol to use for writing SPI driver?



Thanks & regards
Meenakshi Aggarwal

------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. 
http://goparallel.sourceforge.net_______________________________________________<http://goparallel.sourceforge.net_______________________________________________/>
edk2-devel mailing list
edk2-devel@lists.sourceforge.net<mailto:edk2-devel@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/edk2-devel

------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to