Hi all,
I was wonder if there is an easy way to storage nonvolatile variables inside SPI BIOS. I
would like to storage some variables in this way to be able to detect its value every time
Board boots up. I have read about a region called PDR (Platform Data Region) that I
suppose is best place we could use to storage these variables. However, I haven´t seen any
clear example around SBL code where this objective is achieved. Could you provide us any
example or snippet code where this functionality is implemented or if there is a library
we can use?
Regards,
Javier
P Please consider the environment before printing this e-mail.
Show replies by date
Hi Javier,
There is a SetVariable() in litevariablelib to provide a method to save NV variable data
to SPI flash.
The purpose of the API is to save some small variable data that doesn't frequently
change from boot to boot since variable reclaim will take times.
Current usage is to save eMMC tuning data.
NOTE: Currently SPI flash would be locked after PostPciEnumeration on APL. It means
variable writing after this point might fail.
If you want to save NV data in OsLoader, one solution is that you could set
FspsConfig->SpiEiss = 0x0; not to lock SPI flash in PostPciEnumeration time, later you
need lock SPI flash in OS loader.
Thanks,
Guo
From: Sbl-devel [mailto:sbl-devel-bounces@lists.01.org] On Behalf Of Javier Santos Romo
Sent: Wednesday, May 8, 2019 10:05 AM
To: sbl-devel(a)lists.01.org
Subject: [Sbl-devel] Non Volatile Storage in SPI BIOS
Hi all,
I was wonder if there is an easy way to storage nonvolatile variables inside SPI BIOS. I
would like to storage some variables in this way to be able to detect its value every time
Board boots up. I have read about a region called PDR (Platform Data Region) that I
suppose is best place we could use to storage these variables. However, I haven´t seen any
clear example around SBL code where this objective is achieved. Could you provide us any
example or snippet code where this functionality is implemented or if there is a library
we can use?
Regards,
Javier
P Please consider the environment before printing this e-mail.
Hi Javier
Since you asked about PDR, here is a some basic information about that.
Platform Data Region (PDR) can be enabled for storing any customer specific data. PDR
needs to enabled during IFWI stitch and a PDR input file can be specified to create the
PDR region. Apollolake SpiFlashLib in SBL already supports access to PDR - The
FlashRegionType needs to be specified as "FlashRegionPlatformData".
Thanks
Ravi
From: Sbl-devel [mailto:sbl-devel-bounces@lists.01.org] On Behalf Of Dong, Guo
Sent: Wednesday, May 8, 2019 10:59 AM
To: Javier Santos Romo <jsantos(a)gmv.com>; sbl-devel(a)lists.01.org
Subject: Re: [Sbl-devel] Non Volatile Storage in SPI BIOS
Hi Javier,
There is a SetVariable() in litevariablelib to provide a method to save NV variable data
to SPI flash.
The purpose of the API is to save some small variable data that doesn't frequently
change from boot to boot since variable reclaim will take times.
Current usage is to save eMMC tuning data.
NOTE: Currently SPI flash would be locked after PostPciEnumeration on APL. It means
variable writing after this point might fail.
If you want to save NV data in OsLoader, one solution is that you could set
FspsConfig->SpiEiss = 0x0; not to lock SPI flash in PostPciEnumeration time, later you
need lock SPI flash in OS loader.
Thanks,
Guo
From: Sbl-devel [mailto:sbl-devel-bounces@lists.01.org] On Behalf Of Javier Santos Romo
Sent: Wednesday, May 8, 2019 10:05 AM
To: sbl-devel@lists.01.org<mailto:sbl-devel@lists.01.org>
Subject: [Sbl-devel] Non Volatile Storage in SPI BIOS
Hi all,
I was wonder if there is an easy way to storage nonvolatile variables inside SPI BIOS. I
would like to storage some variables in this way to be able to detect its value every time
Board boots up. I have read about a region called PDR (Platform Data Region) that I
suppose is best place we could use to storage these variables. However, I haven´t seen any
clear example around SBL code where this objective is achieved. Could you provide us any
example or snippet code where this functionality is implemented or if there is a library
we can use?
Regards,
Javier
P Please consider the environment before printing this e-mail.