vboot: remove VBERROR_TPM_SET_BOOT_MODE_STATE error code

Since secdata and nvdata get/set functions no longer return error
codes, and instead use VB2_ASSERT and VB2_DIE to abort on failure,
vb2_enable_developer_mode no longer has any error code to return.
Change the function return type to void, and remove checks around
the function call.  As a result, VBERROR_TPM_SET_BOOT_MODE_STATE
becomes unused and we may remove it.  Finally, move the
USB_BOOT_ON_DEV logic (enable USB boot when on transition to dev
mode) into vb2_enable_developer_mode.  Also add unit tests.

BUG=b:124141368, chromium:988410
TEST=make clean && make runtests

Change-Id: I286d9343c4c751ff24bf4c149a26fbe5306e383a
Signed-off-by: Joel Kitching <kitching@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2152212
Reviewed-by: Joel Kitching <kitching@chromium.org>
Commit-Queue: Joel Kitching <kitching@chromium.org>
Tested-by: Joel Kitching <kitching@chromium.org>
8 files changed