dm: pass vrpmb key via cmos interface

CMOS offset from 0x20 to 0x9F is used to store rpmb key information.
vsbl loader will init vrpmb key in CMOS when boot/reboot.
vsbl loader will not init vrpmb key during S3 resume.
vsbl will read vrpmb key via CMOS interface.
After reading, the key value is cleared in CMOS. So the key can only be
read once until next boot.

Signed-off-by: Binbin Wu <binbin.wu@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
This commit is contained in:
Binbin Wu
2018-08-03 15:29:18 +08:00
committed by lijinxia
parent c8c0e10a90
commit b8c1fd6104
3 changed files with 38 additions and 11 deletions

View File

@@ -45,6 +45,8 @@
#define ALIGN_UP(x, align) (((x) + ((align)-1)) & ~((align)-1))
#define ALIGN_DOWN(x, align) ((x) & ~((align)-1))
#define CMOS_BUF_SIZE 256
struct vmctx {
int fd;
int vmid;
@@ -61,6 +63,10 @@ struct vmctx {
void *atkbdc_base;
void *vrtc;
void *ioc_dev;
/* cmos buffer used to store write/read contents,
* and it should not be cleared when reboot
*/
uint8_t cmos_buffer[CMOS_BUF_SIZE];
};
/*