From 7bec79fb7c33027c8a5401e1b526164d10db976b Mon Sep 17 00:00:00 2001 From: Antony Arun T Date: Tue, 17 Sep 2019 17:05:46 +0530 Subject: [PATCH] ipq: bootm: do pcie and usb deinit in bootm path Change-Id: Ic49f292b6c1ce9497dbab0f36a0d46e89300f2cb Signed-off-by: Antony Arun T --- common/bootm.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/common/bootm.c b/common/bootm.c index 9c8d28a621..ca368c2909 100644 --- a/common/bootm.c +++ b/common/bootm.c @@ -39,6 +39,8 @@ #ifndef USE_HOSTCC +extern void board_usb_deinit(int id); + DECLARE_GLOBAL_DATA_PTR; static const void *boot_get_kernel(cmd_tbl_t *cmdtp, int flag, int argc, @@ -601,6 +603,9 @@ int do_bootm_states(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[], boot_os_fn *boot_fn; ulong iflag = 0; int ret = 0, need_boot_fn; +#ifdef CONFIG_USB_XHCI_IPQ + unsigned int i; +#endif images->state |= states; @@ -702,9 +707,18 @@ int do_bootm_states(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[], } /* Now run the OS! We hope this doesn't return */ - if (!ret && (states & BOOTM_STATE_OS_GO)) + if (!ret && (states & BOOTM_STATE_OS_GO)) { + board_pci_deinit(); + +#ifdef CONFIG_USB_XHCI_IPQ + usb_stop(); + for (i=0; i