Request cold reboot when switching to dev mode

When switching from normal to dev mode, the EC is in RO. AP requests
warm reboot, whic causes EC to jump to RW. After sysjump, RW tries to
renegotiate PD but it's too late for type-c monitor to function
because VBIOS has already run.

This patch makes AP request EC reboot when switching to dev mode.

BUG=b:73083750
BRANCH=none
TEST=Dingdong connected to Teemo. Verify norm-to-dev screen is
displayed. make -j runtests.

Change-Id: I763cd6968406f7b904604b2588a9db6d567cbd4e
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/907734
(cherry picked from commit c7293182ed0dd01004e2ed0e1e2a02eab0c52f93)
Reviewed-on: https://chromium-review.googlesource.com/908768
diff --git a/firmware/lib/vboot_ui.c b/firmware/lib/vboot_ui.c
index 98cd1cd..1db0e4a 100644
--- a/firmware/lib/vboot_ui.c
+++ b/firmware/lib/vboot_ui.c
@@ -506,7 +506,7 @@
 					if (VbExGetSwitches
 					    (VB_INIT_FLAG_ALLOW_USB_BOOT))
 						VbAllowUsbBoot(ctx);
-					return VBERROR_REBOOT_REQUIRED;
+					return VBERROR_EC_REBOOT_TO_RO_REQUIRED;
 				case -1:
 					VB2_DEBUG("Shutdown requested\n");
 					return VBERROR_SHUTDOWN_REQUESTED;
diff --git a/tests/vboot_api_kernel2_tests.c b/tests/vboot_api_kernel2_tests.c
index 0d762ae..6c3c814 100644
--- a/tests/vboot_api_kernel2_tests.c
+++ b/tests/vboot_api_kernel2_tests.c
@@ -735,7 +735,7 @@
 	mock_keypress[0] = 0x04;
 	mock_keypress[1] = '\r';
 	mock_keyflags[1] = VB_KEY_FLAG_TRUSTED_KEYBOARD;
-	TEST_EQ(VbBootRecovery(&ctx), VBERROR_REBOOT_REQUIRED,
+	TEST_EQ(VbBootRecovery(&ctx), VBERROR_EC_REBOOT_TO_RO_REQUIRED,
 		"Ctrl+D todev confirm");
 	TEST_EQ(virtdev_set, 1, "  virtual dev mode on");