mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-11-26 19:25:02 +00:00
vboot: Pass vb2 context and use vboot2 NV routines
Passing the vb2 context around allows using more of the vb2 functions in future changes, and prepares for a future where we directly use the context as it was set up in firmware verification. BUG=chromium:611535 BRANCH=none TEST=make runtests; emerge-kevin coreboot depthcharge Change-Id: I8efa606dbdec5d195b66eb899e76fdc84337ad36 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/404997 Reviewed-by: Shelley Chen <shchen@chromium.org>
This commit is contained in:
committed by
chrome-bot
parent
b57d9505c0
commit
e4136dcaa0
@@ -12,6 +12,8 @@
|
||||
#include "vboot_api.h"
|
||||
#include "vboot_nvstorage.h"
|
||||
|
||||
struct vb2_context;
|
||||
|
||||
/* Interface provided by verified boot library to BDS */
|
||||
|
||||
/* Boot flags for LoadKernel().boot_flags */
|
||||
@@ -71,9 +73,14 @@ typedef struct LoadKernelParams {
|
||||
/**
|
||||
* Attempt to load the kernel from the current device.
|
||||
*
|
||||
* @param ctx Vboot context
|
||||
* @param params Params specific to loading the kernel
|
||||
* @param cparams Common parameters to vboot1 APIs
|
||||
*
|
||||
* Returns VBERROR_SUCCESS if successful. If unsuccessful, sets a recovery
|
||||
* reason via VbNvStorage and returns an error code.
|
||||
*/
|
||||
VbError_t LoadKernel(LoadKernelParams *params, VbCommonParams *cparams);
|
||||
VbError_t LoadKernel(struct vb2_context *ctx, LoadKernelParams *params,
|
||||
VbCommonParams *cparams);
|
||||
|
||||
#endif /* VBOOT_REFERENCE_LOAD_KERNEL_FW_H_ */
|
||||
|
||||
@@ -12,13 +12,16 @@
|
||||
#include "vboot_api.h"
|
||||
#include "vboot_nvstorage.h"
|
||||
|
||||
VbError_t VbDisplayScreenFromGBB(VbCommonParams *cparams, uint32_t screen,
|
||||
VbNvContext *vncptr, uint32_t locale);
|
||||
VbError_t VbDisplayScreen(VbCommonParams *cparams, uint32_t screen, int force,
|
||||
VbNvContext *vncptr);
|
||||
VbError_t VbDisplayDebugInfo(VbCommonParams *cparams, VbNvContext *vncptr);
|
||||
VbError_t VbCheckDisplayKey(VbCommonParams *cparams, uint32_t key,
|
||||
VbNvContext *vncptr);
|
||||
struct vb2_context;
|
||||
|
||||
VbError_t VbDisplayScreenFromGBB(struct vb2_context *ctx,
|
||||
VbCommonParams *cparams, uint32_t screen,
|
||||
uint32_t locale);
|
||||
VbError_t VbDisplayScreen(struct vb2_context *ctx, VbCommonParams *cparams,
|
||||
uint32_t screen, int force);
|
||||
VbError_t VbDisplayDebugInfo(struct vb2_context *ctx, VbCommonParams *cparams);
|
||||
VbError_t VbCheckDisplayKey(struct vb2_context *ctx, VbCommonParams *cparams,
|
||||
uint32_t key);
|
||||
|
||||
/* Internal functions, for unit testing */
|
||||
|
||||
|
||||
@@ -14,10 +14,7 @@
|
||||
#include "load_kernel_fw.h"
|
||||
#include "vboot_api.h"
|
||||
|
||||
/**
|
||||
* Accessors for unit tests only.
|
||||
*/
|
||||
VbNvContext *VbApiKernelGetVnc(void);
|
||||
struct vb2_context;
|
||||
|
||||
/**
|
||||
* Exported for unit tests only - frees memory used by VbSelectAndLoadKernel()
|
||||
@@ -25,9 +22,20 @@ VbNvContext *VbApiKernelGetVnc(void);
|
||||
void VbApiKernelFree(VbCommonParams *cparams);
|
||||
|
||||
/**
|
||||
* Try to load a kernel.
|
||||
* Attempt loading a kernel from the specified type(s) of disks.
|
||||
*
|
||||
* If successful, sets p->disk_handle to the disk for the kernel and returns
|
||||
* VBERROR_SUCCESS.
|
||||
*
|
||||
* @param ctx Vboot context
|
||||
* @param cparams Vboot common params
|
||||
* @param p Parameters for loading kernel
|
||||
* @param get_info_flags Flags to pass to VbExDiskGetInfo()
|
||||
* @return VBERROR_SUCCESS, VBERROR_NO_DISK_FOUND if no disks of the specified
|
||||
* type were found, or other non-zero VBERROR_ codes for other failures.
|
||||
*/
|
||||
uint32_t VbTryLoadKernel(VbCommonParams *cparams, LoadKernelParams *p,
|
||||
uint32_t VbTryLoadKernel(struct vb2_context *ctx, VbCommonParams *cparams,
|
||||
LoadKernelParams *p,
|
||||
uint32_t get_info_flags);
|
||||
|
||||
/* Flags for VbUserConfirms() */
|
||||
@@ -48,31 +56,35 @@ uint32_t VbTryLoadKernel(VbCommonParams *cparams, LoadKernelParams *p,
|
||||
*
|
||||
* Returns: 1=yes, 0=no, -1 = shutdown.
|
||||
*/
|
||||
int VbUserConfirms(VbCommonParams *cparams, uint32_t confirm_flags);
|
||||
int VbUserConfirms(struct vb2_context *ctx, VbCommonParams *cparams,
|
||||
uint32_t confirm_flags);
|
||||
|
||||
/**
|
||||
* Handle a normal boot.
|
||||
*/
|
||||
VbError_t VbBootNormal(VbCommonParams *cparams, LoadKernelParams *p);
|
||||
VbError_t VbBootNormal(struct vb2_context *ctx, VbCommonParams *cparams,
|
||||
LoadKernelParams *p);
|
||||
|
||||
/**
|
||||
* Handle a developer-mode boot.
|
||||
*/
|
||||
VbError_t VbBootDeveloper(VbCommonParams *cparams, LoadKernelParams *p);
|
||||
VbError_t VbBootDeveloper(struct vb2_context *ctx, VbCommonParams *cparams,
|
||||
LoadKernelParams *p);
|
||||
|
||||
/**
|
||||
* Handle a recovery-mode boot.
|
||||
*/
|
||||
VbError_t VbBootRecovery(VbCommonParams *cparams, LoadKernelParams *p);
|
||||
VbError_t VbBootRecovery(struct vb2_context *ctx, VbCommonParams *cparams,
|
||||
LoadKernelParams *p);
|
||||
|
||||
/**
|
||||
* Sync EC device <devidx> firmware to expected version.
|
||||
*
|
||||
* @param ctx Vboot context
|
||||
* @param devidx EC device index to sync
|
||||
* @param cparams Common vboot params
|
||||
* @param vnc NV storage context
|
||||
*/
|
||||
VbError_t VbEcSoftwareSync(int devidx, VbCommonParams *cparams,
|
||||
VbNvContext *vnc);
|
||||
VbError_t VbEcSoftwareSync(struct vb2_context *ctx, int devidx,
|
||||
VbCommonParams *cparams);
|
||||
|
||||
#endif /* VBOOT_REFERENCE_VBOOT_KERNEL_H_ */
|
||||
|
||||
Reference in New Issue
Block a user