From c81672979abafcecc7543c582af2d5370c85cd27 Mon Sep 17 00:00:00 2001 From: Ji Luo Date: Fri, 12 Jun 2020 17:15:53 +0800 Subject: [PATCH] MA-17368 Trigger board reset for fastboot reboot Trigger system board reset for imx8q when reboot is required in fastboot commands, this will help fix the hang issue when switch normal Android and Android Auto images. Test: fastboot reboot. Change-Id: Ibfdb34e88e0393294af25c1ef5aceeadb8c02f74 Signed-off-by: Ji Luo (cherry picked from commit 2cb43a55955ae400acce66b3d4ce870b0e423c81) (cherry picked from commit fa8c79a3b4b4bc8fe0a399f9f8a415c94c2e280c) --- drivers/usb/gadget/f_fastboot.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c index 346573aff8..f92de33e44 100644 --- a/drivers/usb/gadget/f_fastboot.c +++ b/drivers/usb/gadget/f_fastboot.c @@ -508,9 +508,17 @@ static int fastboot_tx_write_str(const char *buffer) return fastboot_tx_write(buffer, strlen(buffer)); } +#ifdef CONFIG_PSCI_BOARD_REBOOT +int do_board_reboot(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]); +#endif + static void compl_do_reset(struct usb_ep *ep, struct usb_request *req) { +#ifdef CONFIG_PSCI_BOARD_REBOOT + do_board_reboot(NULL, 0, 0, NULL); +#else do_reset(NULL, 0, 0, NULL); +#endif } static unsigned int rx_bytes_expected(struct usb_ep *ep) -- 2.17.1