summaryrefslogtreecommitdiffstats
path: root/board/amazon
diff options
context:
space:
mode:
authorPaul Kocialkowski <contact@paulk.fr>2016-02-27 19:19:10 +0100
committerTom Rini <trini@konsulko.com>2016-03-15 15:12:55 -0400
commitbd55eedc07a7f3811cbbd4e934081b9a915af758 (patch)
tree6146467d57fe4c392d96524aad629e797733061e /board/amazon
parent7c0a4b795589511a4880ca268d03a140551e5b4e (diff)
downloadu-boot-bd55eedc07a7f3811cbbd4e934081b9a915af758.tar.gz
u-boot-bd55eedc07a7f3811cbbd4e934081b9a915af758.tar.xz
u-boot-bd55eedc07a7f3811cbbd4e934081b9a915af758.zip
kc1: Boot to bootloader (fastboot) on ID pin pull-up
USB ID pin pull-up indicates factory (fastboot) cable detection. Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Diffstat (limited to 'board/amazon')
-rw-r--r--board/amazon/kc1/kc1.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/board/amazon/kc1/kc1.c b/board/amazon/kc1/kc1.c
index d526695b7c..9367b50da3 100644
--- a/board/amazon/kc1/kc1.c
+++ b/board/amazon/kc1/kc1.c
@@ -86,11 +86,20 @@ int board_init(void)
int misc_init_r(void)
{
char reboot_mode[2] = { 0 };
+ u32 value;
/* Reboot mode */
omap_reboot_mode(reboot_mode, sizeof(reboot_mode));
+ /* USB ID pin pull-up indicates factory (fastboot) cable detection. */
+ gpio_request(KC1_GPIO_USB_ID, "USB_ID");
+ gpio_direction_input(KC1_GPIO_USB_ID);
+ value = gpio_get_value(KC1_GPIO_USB_ID);
+
+ if (value)
+ reboot_mode[0] = 'b';
+
if (reboot_mode[0] > 0 && isascii(reboot_mode[0])) {
if (!getenv("reboot-mode"))
setenv("reboot-mode", (char *)reboot_mode);