]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
board: st: stm32mp1: Consider USB cable connected when boot device is USB
authorPatrice Chotard <patrice.chotard@foss.st.com>
Fri, 22 Apr 2022 07:39:18 +0000 (09:39 +0200)
committerPatrice Chotard <patrice.chotard@foss.st.com>
Tue, 10 May 2022 11:56:11 +0000 (13:56 +0200)
Always consider USB cable is connected when USB boot device is detected.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
board/st/stm32mp1/stm32mp1.c

index 7466e1c732afec9dd895fe6231ce426d95f61c02..07b1a63db7dc263446765697bf9c5e9c2514a9bc 100644 (file)
@@ -199,6 +199,13 @@ int g_dnl_board_usb_cable_connected(void)
        if (!IS_ENABLED(CONFIG_USB_GADGET_DWC2_OTG))
                return -ENODEV;
 
+       /*
+        * In case of USB boot device is detected, consider USB cable is
+        * connected
+        */
+       if ((get_bootmode() & TAMP_BOOT_DEVICE_MASK) == BOOT_SERIAL_USB)
+               return true;
+
        /* if typec stusb160x is present, means DK1 or DK2 board */
        ret = stusb160x_cable_connected();
        if (ret >= 0)