u-boot: fake support for new vboot APIs

We added some functions to vboot to prevent a
"surreptitious switch to developer mode" attack.
We need to support them here too, to the extent
that we don't break the compilation or the existing
behavior.

BUG=chrome-os-partner:21729
TEST=emerged parrot
BRANCH=none
Signed-off-by: Luigi Semenzato <semenzato@chromium.org>
CQ-DEPEND=CL:182420,CL:182241,CL:182357

Change-Id: I7f21ad7215312d4629e81e8afc1c9d4970de91b9
Reviewed-on: https://chromium-review.googlesource.com/182982
Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
Commit-Queue: Luigi Semenzato <semenzato@chromium.org>
Tested-by: Luigi Semenzato <semenzato@chromium.org>
diff --git a/cros/vboot/Makefile b/cros/vboot/Makefile
index d11cab4..2801d39 100644
--- a/cros/vboot/Makefile
+++ b/cros/vboot/Makefile
@@ -31,6 +31,7 @@
 COBJS-$(CONFIG_CHROMEOS) += nvstorage_cros_ec.o
 endif
 COBJS-$(CONFIG_CHROMEOS) += stages.o
+COBJS-$(CONFIG_CHROMEOS) += switches.o
 COBJS-$(CONFIG_CHROMEOS) += tlcl_stub.o
 COBJS-$(CONFIG_CHROMEOS) += utility.o
 
diff --git a/cros/vboot/keyboard.c b/cros/vboot/keyboard.c
index 3b5d94f..709ca80 100644
--- a/cros/vboot/keyboard.c
+++ b/cros/vboot/keyboard.c
@@ -137,3 +137,11 @@
 out:
 	return c;
 }
+
+uint32_t VbExKeyboardReadWithFlags(uint32_t *flags_ptr)
+{
+	if (flags_ptr)
+		/* We trust keyboards on u-boot legacy devices */
+		*flags_ptr = VB_KEY_FLAG_TRUSTED_KEYBOARD;
+	return VbExKeyboardRead();
+}
diff --git a/cros/vboot/switches.c b/cros/vboot/switches.c
new file mode 100644
index 0000000..02f9206
--- /dev/null
+++ b/cros/vboot/switches.c
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ */
+
+#include <common.h>
+#include <vboot_api.h>
+
+/* This should never get called. */
+
+uint32_t VbExGetSwitches(uint32_t request_mask)
+{
+	return 0;
+}