diff options
author | Randall Spangler <rspangler@chromium.org> | 2017-12-14 15:43:17 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-01-05 21:14:11 -0800 |
commit | 5142132f44bbee683c830fdb837bbedb00bad8ba (patch) | |
tree | 699df9f59656ff30f12bfacc4331d69afb9af1e1 /firmware/lib/ec_sync.c | |
parent | 4e0939b377f65048dfc1ec8ceda6fd7c444fc8b8 (diff) | |
download | vboot-5142132f44bbee683c830fdb837bbedb00bad8ba.tar.gz |
firmware: use sd->gbb_flags
Vboot1 code directly referenced the GBB from cparams even though now
it has access to the GBB flags via the vb2 context. Refactor all
existing code to use the vb2 context, since that takes us one step
closer to getting rid of the old vboot1 cparams.
No change in functionality.
BUG=chromium:611535
BRANCH=none
TEST=make -j runtests; build bob firmware and boot it
Change-Id: Ic4a5bf215b723a2eacbf0a4cf0eba8b1338155a2
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/847310
Reviewed-by: Shelley Chen <shchen@chromium.org>
Diffstat (limited to 'firmware/lib/ec_sync.c')
-rw-r--r-- | firmware/lib/ec_sync.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/firmware/lib/ec_sync.c b/firmware/lib/ec_sync.c index 35fae2de..77b5741e 100644 --- a/firmware/lib/ec_sync.c +++ b/firmware/lib/ec_sync.c @@ -348,12 +348,12 @@ VbError_t ec_sync_phase1(struct vb2_context *ctx, VbCommonParams *cparams) /* Reasons not to do sync at all */ if (!(shared->flags & VBSD_EC_SOFTWARE_SYNC)) return VBERROR_SUCCESS; - if (cparams->gbb->flags & GBB_FLAG_DISABLE_EC_SOFTWARE_SYNC) + if (sd->gbb_flags & VB2_GBB_FLAG_DISABLE_EC_SOFTWARE_SYNC) return VBERROR_SUCCESS; #ifdef PD_SYNC - const int do_pd_sync = !(cparams->gbb->flags & - GBB_FLAG_DISABLE_PD_SOFTWARE_SYNC); + const int do_pd_sync = !(sd->gbb_flags & + VB2_GBB_FLAG_DISABLE_PD_SOFTWARE_SYNC); #else const int do_pd_sync = 0; #endif @@ -425,7 +425,7 @@ static int ec_sync_allowed(struct vb2_context *ctx, VbCommonParams *cparams) /* Reasons not to do sync at all */ if (!(shared->flags & VBSD_EC_SOFTWARE_SYNC)) return 0; - if (cparams->gbb->flags & GBB_FLAG_DISABLE_EC_SOFTWARE_SYNC) + if (sd->gbb_flags & VB2_GBB_FLAG_DISABLE_EC_SOFTWARE_SYNC) return 0; if (sd->recovery_reason) return 0; @@ -436,9 +436,11 @@ VbError_t ec_sync_check_aux_fw(struct vb2_context *ctx, VbCommonParams *cparams, VbAuxFwUpdateSeverity_t *severity) { + struct vb2_shared_data *sd = vb2_get_sd(ctx); + /* If we're not updating the EC, skip aux fw syncs as well */ if (!ec_sync_allowed(ctx, cparams) || - (cparams->gbb->flags & GBB_FLAG_DISABLE_PD_SOFTWARE_SYNC)) { + (sd->gbb_flags & VB2_GBB_FLAG_DISABLE_PD_SOFTWARE_SYNC)) { *severity = VB_AUX_FW_NO_UPDATE; return VBERROR_SUCCESS; } @@ -457,7 +459,8 @@ VbError_t ec_sync_phase2(struct vb2_context *ctx, VbCommonParams *cparams) #ifdef PD_SYNC /* Handle updates and jumps for PD */ - if (!(cparams->gbb->flags & GBB_FLAG_DISABLE_PD_SOFTWARE_SYNC)) { + struct vb2_shared_data *sd = vb2_get_sd(ctx); + if (!(sd->gbb_flags & VB2_GBB_FLAG_DISABLE_PD_SOFTWARE_SYNC)) { retval = sync_one_ec(ctx, 1, cparams); if (retval != VBERROR_SUCCESS) return retval; |