[U-Boot] [PATCH 22/27] kc1: Boot to bootloader (fastboot) on ID pin pull-up

Paul Kocialkowski contact at paulk.fr
Sat Feb 27 19:19:10 CET 2016


USB ID pin pull-up indicates factory (fastboot) cable detection.

Signed-off-by: Paul Kocialkowski <contact at paulk.fr>
---
 board/amazon/kc1/kc1.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/board/amazon/kc1/kc1.c b/board/amazon/kc1/kc1.c
index d526695..9367b50 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);
-- 
2.6.4



More information about the U-Boot mailing list