EC sync: Drop support for "PD" software sync.
All devices which have a PD chip running CrOS EC code have already shipped, and there is no intention to go back to using an "EC" for a TCPC anymore. BUG=b:143762298,chromium:1017093 BRANCH=none TEST=make runtests Change-Id: I177c00581089de59e4f35608b97ef5432e8b492b Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1895712 Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Joel Kitching <kitching@chromium.org>
This commit is contained in:
parent
2cc38ec1b7
commit
b35c2d1012
4
Makefile
4
Makefile
|
@ -179,10 +179,6 @@ ifneq (${FORCE_LOGGING_ON},)
|
|||
CFLAGS += -DFORCE_LOGGING_ON=${FORCE_LOGGING_ON}
|
||||
endif
|
||||
|
||||
ifneq (${PD_SYNC},)
|
||||
CFLAGS += -DPD_SYNC
|
||||
endif
|
||||
|
||||
ifneq (${TPM2_MODE},)
|
||||
CFLAGS += -DTPM2_MODE
|
||||
endif
|
||||
|
|
|
@ -15,21 +15,18 @@
|
|||
#include "vboot_display.h"
|
||||
#include "vboot_kernel.h"
|
||||
|
||||
#define VB2_SD_FLAG_ECSYNC_RW \
|
||||
(VB2_SD_FLAG_ECSYNC_EC_RW | VB2_SD_FLAG_ECSYNC_PD_RW)
|
||||
#define VB2_SD_FLAG_ECSYNC_RW VB2_SD_FLAG_ECSYNC_EC_RW
|
||||
#define VB2_SD_FLAG_ECSYNC_ANY \
|
||||
(VB2_SD_FLAG_ECSYNC_EC_RO | VB2_SD_FLAG_ECSYNC_RW)
|
||||
#define VB2_SD_FLAG_ECSYNC_IN_RW \
|
||||
(VB2_SD_FLAG_ECSYNC_EC_IN_RW | VB2_SD_FLAG_ECSYNC_PD_IN_RW)
|
||||
#define VB2_SD_FLAG_ECSYNC_IN_RW VB2_SD_FLAG_ECSYNC_EC_IN_RW
|
||||
|
||||
#define IN_RW(devidx) \
|
||||
((devidx) ? VB2_SD_FLAG_ECSYNC_PD_IN_RW : VB2_SD_FLAG_ECSYNC_EC_IN_RW)
|
||||
((devidx) ? 0 : VB2_SD_FLAG_ECSYNC_EC_IN_RW)
|
||||
|
||||
#define WHICH_EC(devidx, select) \
|
||||
((select) == VB_SELECT_FIRMWARE_READONLY ? VB2_SD_FLAG_ECSYNC_EC_RO : \
|
||||
((devidx) ? VB2_SD_FLAG_ECSYNC_PD_RW : VB2_SD_FLAG_ECSYNC_EC_RW))
|
||||
((devidx) ? 0 : VB2_SD_FLAG_ECSYNC_EC_RW))
|
||||
|
||||
/* PD doesn't support RW A/B */
|
||||
#define RW_AB(devidx) ((devidx) ? 0 : VB2_CONTEXT_EC_EFS)
|
||||
|
||||
static void request_recovery(struct vb2_context *ctx, uint32_t recovery_request)
|
||||
|
@ -200,7 +197,7 @@ static vb2_error_t update_ec(struct vb2_context *ctx, int devidx,
|
|||
* Set IN_RW flag for a EC
|
||||
*
|
||||
* @param ctx Vboot2 context
|
||||
* @param devidx Which device (EC=0, PD=1)
|
||||
* @param devidx Which device (EC=0)
|
||||
*/
|
||||
static vb2_error_t check_ec_active(struct vb2_context *ctx, int devidx)
|
||||
{
|
||||
|
@ -233,7 +230,7 @@ static vb2_error_t check_ec_active(struct vb2_context *ctx, int devidx)
|
|||
* Sync, jump, and protect one EC device
|
||||
*
|
||||
* @param ctx Vboot2 context
|
||||
* @param devidx Which device (EC=0, PD=1)
|
||||
* @param devidx Which device (EC=0)
|
||||
* @return VB2_SUCCESS, or non-zero if error.
|
||||
*/
|
||||
static vb2_error_t sync_one_ec(struct vb2_context *ctx, int devidx)
|
||||
|
@ -280,7 +277,7 @@ static vb2_error_t sync_one_ec(struct vb2_context *ctx, int devidx)
|
|||
}
|
||||
}
|
||||
|
||||
/* Might need to update EC-RO (but not PD-RO) */
|
||||
/* Might need to update EC-RO */
|
||||
if (sd->flags & VB2_SD_FLAG_ECSYNC_EC_RO) {
|
||||
VB2_DEBUG("RO Software Sync\n");
|
||||
|
||||
|
@ -347,30 +344,16 @@ vb2_error_t ec_sync_phase1(struct vb2_context *ctx)
|
|||
if (gbb->flags & VB2_GBB_FLAG_DISABLE_EC_SOFTWARE_SYNC)
|
||||
return VB2_SUCCESS;
|
||||
|
||||
#ifdef PD_SYNC
|
||||
const int do_pd_sync = !(gbb->flags &
|
||||
VB2_GBB_FLAG_DISABLE_PD_SOFTWARE_SYNC);
|
||||
#else
|
||||
const int do_pd_sync = 0;
|
||||
#endif
|
||||
|
||||
/* Set IN_RW flags */
|
||||
if (check_ec_active(ctx, 0))
|
||||
return VBERROR_EC_REBOOT_TO_RO_REQUIRED;
|
||||
if (do_pd_sync && check_ec_active(ctx, 1))
|
||||
return VBERROR_EC_REBOOT_TO_RO_REQUIRED;
|
||||
|
||||
/* Check if we need to update RW. Failures trigger recovery mode. */
|
||||
if (check_ec_hash(ctx, 0, VB_SELECT_FIRMWARE_EC_ACTIVE))
|
||||
return VBERROR_EC_REBOOT_TO_RO_REQUIRED;
|
||||
if (do_pd_sync && check_ec_hash(ctx, 1, VB_SELECT_FIRMWARE_EC_ACTIVE))
|
||||
return VBERROR_EC_REBOOT_TO_RO_REQUIRED;
|
||||
|
||||
/*
|
||||
* See if we need to update EC-RO (devidx=0).
|
||||
*
|
||||
* If we want to extend this in the future to update PD-RO, we'll use a
|
||||
* different NV flag so we can track EC-RO and PD-RO updates
|
||||
* separately.
|
||||
*/
|
||||
if (vb2_nv_get(ctx, VB2_NV_TRY_RO_SYNC) &&
|
||||
check_ec_hash(ctx, 0, VB_SELECT_FIRMWARE_READONLY)) {
|
||||
|
@ -430,10 +413,11 @@ vb2_error_t ec_sync_check_aux_fw(struct vb2_context *ctx,
|
|||
|
||||
/* If we're not updating the EC, skip aux fw syncs as well */
|
||||
if (!ec_sync_allowed(ctx) ||
|
||||
(gbb->flags & VB2_GBB_FLAG_DISABLE_PD_SOFTWARE_SYNC)) {
|
||||
(gbb->flags & VB2_GBB_FLAG_DISABLE_AUXFW_SOFTWARE_SYNC)) {
|
||||
*severity = VB_AUX_FW_NO_UPDATE;
|
||||
return VB2_SUCCESS;
|
||||
}
|
||||
|
||||
return VbExCheckAuxFw(severity);
|
||||
}
|
||||
|
||||
|
@ -461,16 +445,6 @@ vb2_error_t ec_sync_phase2(struct vb2_context *ctx)
|
|||
if (retval != VB2_SUCCESS)
|
||||
return retval;
|
||||
|
||||
#ifdef PD_SYNC
|
||||
/* Handle updates and jumps for PD */
|
||||
struct vb2_gbb_header *gbb = vb2_get_gbb(ctx);
|
||||
if (!(gbb->flags & VB2_GBB_FLAG_DISABLE_PD_SOFTWARE_SYNC)) {
|
||||
retval = sync_one_ec(ctx, 1);
|
||||
if (retval != VB2_SUCCESS)
|
||||
return retval;
|
||||
}
|
||||
#endif
|
||||
|
||||
return VB2_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
@ -62,8 +62,8 @@ enum vb2_gbb_flag {
|
|||
/* Default to booting legacy OS when dev screen times out */
|
||||
VB2_GBB_FLAG_DEFAULT_DEV_BOOT_LEGACY = 1 << 10,
|
||||
|
||||
/* Disable PD software sync */
|
||||
VB2_GBB_FLAG_DISABLE_PD_SOFTWARE_SYNC = 1 << 11,
|
||||
/* Disable auxiliary firmware (auxfw) software sync */
|
||||
VB2_GBB_FLAG_DISABLE_AUXFW_SOFTWARE_SYNC = 1 << 11,
|
||||
|
||||
/* Disable shutdown on lid closed */
|
||||
VB2_GBB_FLAG_DISABLE_LID_SHUTDOWN = 1 << 12,
|
||||
|
|
|
@ -37,14 +37,23 @@ enum vb2_shared_data_flags {
|
|||
/* Kernel keyblock was verified by signature (not just hash) */
|
||||
VB2_SD_FLAG_KERNEL_SIGNED = (1 << 2),
|
||||
|
||||
/* Software sync needs to update EC-RO, EC-RW, or PD-RW respectively */
|
||||
/* Software sync needs to update EC-RO or EC-RW */
|
||||
VB2_SD_FLAG_ECSYNC_EC_RO = (1 << 3),
|
||||
VB2_SD_FLAG_ECSYNC_EC_RW = (1 << 4),
|
||||
VB2_SD_FLAG_ECSYNC_PD_RW = (1 << 5),
|
||||
|
||||
/* Software sync says EC / PD running RW */
|
||||
/*
|
||||
* VB2_SD_FLAG_ECSYNC_PD_RW (1 << 5) is deprecated. Vboot no
|
||||
* longer supports updating "PD" devices running CrOS EC code.
|
||||
*/
|
||||
|
||||
/* Software sync says EC running RW */
|
||||
VB2_SD_FLAG_ECSYNC_EC_IN_RW = (1 << 6),
|
||||
VB2_SD_FLAG_ECSYNC_PD_IN_RW = (1 << 7),
|
||||
|
||||
/*
|
||||
* VB2_SD_FLAG_ECSYNC_PD_IN_RW (1 << 7) is deprecated. Vboot
|
||||
* no longer supports updating "PD" devices running CrOS EC
|
||||
* code.
|
||||
*/
|
||||
|
||||
/* Display is available on this boot */
|
||||
VB2_SD_FLAG_DISPLAY_AVAILABLE = (1 << 8),
|
||||
|
|
|
@ -672,7 +672,7 @@ vb2_error_t VbExEcDisableJump(int devidx);
|
|||
/**
|
||||
* Read the SHA-256 hash of the selected EC image.
|
||||
*
|
||||
* @param devidx Device index. 0: EC, 1: PD.
|
||||
* @param devidx Device index. 0: EC
|
||||
* @param select Image to get hash of. RO or RW.
|
||||
* @param hash Pointer to the hash.
|
||||
* @param hash_size Pointer to the hash size.
|
||||
|
|
|
@ -30,7 +30,7 @@ GBBFLAGS_LIST="
|
|||
VB2_GBB_FLAG_FAFT_KEY_OVERIDE 0x00000100
|
||||
VB2_GBB_FLAG_DISABLE_EC_SOFTWARE_SYNC 0x00000200
|
||||
VB2_GBB_FLAG_DEFAULT_DEV_BOOT_LEGACY 0x00000400
|
||||
VB2_GBB_FLAG_DISABLE_PD_SOFTWARE_SYNC 0x00000800
|
||||
VB2_GBB_FLAG_DISABLE_AUXFW_SOFTWARE_SYNC 0x00000800
|
||||
VB2_GBB_FLAG_DISABLE_LID_SHUTDOWN 0x00001000
|
||||
VB2_GBB_FLAG_FORCE_MANUAL_RECOVERY 0x00004000
|
||||
VB2_GBB_FLAG_DISABLE_FWMP 0x00008000
|
||||
|
@ -40,7 +40,7 @@ GBBFLAGS_LIST="
|
|||
GBBFLAGS_DESCRIPTION_SUFFIX="
|
||||
To get a developer-friendly device, try 0x11 (short_delay + boot_usb).
|
||||
For factory-related tests (always DEV), try 0x39.
|
||||
For early development (disable EC/PD software sync), try 0xa39.
|
||||
For early development (disable EC/auxfw software sync), try 0xa39.
|
||||
"
|
||||
GBBFLAGS_DESCRIPTION="${GBBFLAGS_DESCRIPTION_PREFIX}${GBBFLAGS_LIST}"
|
||||
GBBFLAGS_DESCRIPTION="${GBBFLAGS_DESCRIPTION}${GBBFLAGS_DESCRIPTION_SUFFIX}"
|
||||
|
|
|
@ -442,10 +442,10 @@ static void VbSoftwareSyncTest(void)
|
|||
TEST_EQ(ec_aux_fw_protected, 1, " aux fw protected");
|
||||
|
||||
ResetMocks();
|
||||
gbb.flags |= VB2_GBB_FLAG_DISABLE_PD_SOFTWARE_SYNC;
|
||||
gbb.flags |= VB2_GBB_FLAG_DISABLE_AUXFW_SOFTWARE_SYNC;
|
||||
ec_aux_fw_mock_severity = VB_AUX_FW_FAST_UPDATE;
|
||||
test_ssync(VB2_SUCCESS, 0,
|
||||
"VB2_GBB_FLAG_DISABLE_PD_SOFTWARE_SYNC"
|
||||
"VB2_GBB_FLAG_DISABLE_AUXFW_SOFTWARE_SYNC"
|
||||
" disables auxiliary FW update request");
|
||||
TEST_EQ(ec_aux_fw_update_req, 0, " aux fw update disabled");
|
||||
TEST_EQ(ec_aux_fw_protected, 1, " aux fw protected");
|
||||
|
|
Loading…
Reference in New Issue