Matt and Patrick,
Yes, if coreboot can provide an abstracted flash read/write/erase interfaces for payload to consume, then UEFI payload can implement a generic variable driver on top of it.
I know coreboot already has the flash driver to update MRC training data, however, as far as I know that interface is limited to be used inside coreboot only.
Considering UEFI variable services need to be runtime available (potentially used inside UEFI OS environment), one possible solution I can think of is to use software SMI to provide the abstracted flash access services.
This solution might raise some security concerns though. Other than this, it is also possible to implement a platform specific variable driver in UEFI payload. But as I mentioned, it needs to be ported for different platforms.
Thanks
Maurice
From: Patrick Georgi [mailto:pgeorgi@google.com]
Sent: Thursday, March 23, 2017 12:31 AM
To: Matt DeVillier <matt.devillier(a)gmail.com>
Cc: coreboot(a)coreboot.org; Agyeman, Prince <prince.agyeman(a)intel.com>; Ma, Maurice <maurice.ma(a)intel.com>; Leahy, Leroy P <leroy.p.leahy(a)intel.com>; Sibi.Rajasekaran(a)dell.com
Subject: Re: [coreboot] Maintain boot order for multiple EFI based OS
Am 23.03.2017 08:10 schrieb "Matt DeVillier" <matt.devillier(a)gmail.com<mailto:matt.devillier@gmail.com>>:
that seems like the kind of functionality it would make sense to handle in an abstracted way (perhaps using libpayload?)
How about importing flashrom for this purpose? It has drivers for pretty much everything under the sun as long as it's flash.
Patrick