You can implement a Firmware_Volume_Block_Protocol based on your emmc driver. 
then all variable read/write would be passed down to variable region in EMMC.
From: zhengjiewen2005 [mailto:zhengjiewen2...@163.com]
Sent: Thursday, February 27, 2014 14:17
To: edk2-devel
Subject: [edk2] the implemention of the NVRAM storage with EMMC device on ARM 
platform

all:
i am porting the uefi to a arm soc with emmc stroage, i meet some questions 
when i am trying to
implement the NVRAM variable read/write.
since there is no nor flash on my platform, so i want to store the variable in 
the emmc device(RPMB partition).
but i find in the edk2, there is no proper way to implement this design. i 
refered the ARMVExpressPkg and wanna
get some idea,but the ARM boards generally have one or two memmory mapped nor 
flash to store NVRAM variable,so
it directly refered the  
MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf and
MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf dxe 
driver to do some variable
read/load stuff,.in the DSC file for ARM VExpress board ,i can see:
  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase|0x0FFC0000
  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize|0x00010000
  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|0x0FFD0000
  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize|0x00010000
  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|0x0FFE0000
  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize|0x00010000

the memory area  0x0ffc0000-0x0fff0000 is the nor flash memory space that be 
mapped into the 4G memory space(AARCH32).
so the  driver can directly read the the variable stored in this area.just like 
intel platform.
but on my platform,if i add a FV partition in FD file as NVRAM storage, as the 
whole firmware will be read to ddr memory,so the FV partition for
NVRAM will be in DDR memory too, and if we want to write a non-volatile 
variable to the FV, actrully it's volatile(ddr memory).
so when considering the emmc storage, it seems that this two  drivers are not 
suitable for emmc storage, because the data memory
is not mapped into the 4G memory space. so, do you guys have any good idea 
about how to design the NVRAM variable driver for emmc
device which can make good use of the current code in edk2 ?

________________________________
martin zheng
------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to