]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
kc1: Boot to bootloader (fastboot) on ID pin pull-up
authorPaul Kocialkowski <contact@paulk.fr>
Sat, 27 Feb 2016 18:19:10 +0000 (19:19 +0100)
committerTom Rini <trini@konsulko.com>
Tue, 15 Mar 2016 19:12:55 +0000 (15:12 -0400)
USB ID pin pull-up indicates factory (fastboot) cable detection.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
board/amazon/kc1/kc1.c

index d526695b7c729860b2031d86cfb0db0b66cd7642..9367b50da399f656b4ad535bc7c906e1b6db5aeb 100644 (file)
@@ -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);