aboutsummaryrefslogtreecommitdiff
path: root/board/st/stm32mp1
diff options
context:
space:
mode:
authorPatrice Chotard2022-04-22 09:39:18 +0200
committerPatrice Chotard2022-05-10 13:56:11 +0200
commit67899c2201a8009a1ea6bee55fe812fd298ca79e (patch)
tree501a844dc1631d01efd675aecbfe47cd175d40a6 /board/st/stm32mp1
parentda6473c0d458c070c74a55c23f9fb26a1c8a0efd (diff)
board: st: stm32mp1: Consider USB cable connected when boot device is USB
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>
Diffstat (limited to 'board/st/stm32mp1')
-rw-r--r--board/st/stm32mp1/stm32mp1.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/board/st/stm32mp1/stm32mp1.c b/board/st/stm32mp1/stm32mp1.c
index 7466e1c732a..07b1a63db7d 100644
--- a/board/st/stm32mp1/stm32mp1.c
+++ b/board/st/stm32mp1/stm32mp1.c
@@ -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)