From 7b44c8c9b2ee894ec295ace6304ec3a1121375f4 Mon Sep 17 00:00:00 2001 From: speriaka Date: Fri, 4 Oct 2019 12:56:40 +0530 Subject: [PATCH] ipq: Move pcie and usb deinit from booti to bootm This is because we will be needing pcie and usb deinit during bootm. Also during booti, bootm will be called, so that time also this deinit will be called. Change-Id: I81eb43bf6db89a3f5600ce5327042a5aab0bb437 Signed-off-by: speriaka --- board/qca/arm/common/cmd_bootqca.c | 24 ------------------------ common/bootm.c | 15 ++++++++++++++- 2 files changed, 14 insertions(+), 25 deletions(-) diff --git a/board/qca/arm/common/cmd_bootqca.c b/board/qca/arm/common/cmd_bootqca.c index 41493843cc..f4aab67dbd 100644 --- a/board/qca/arm/common/cmd_bootqca.c +++ b/board/qca/arm/common/cmd_bootqca.c @@ -43,7 +43,6 @@ static qca_smem_flash_info_t *sfi = &qca_smem_flash_info; int ipq_fs_on_nand ; extern int nand_env_device; extern qca_mmc mmc_host; -extern void board_usb_deinit(int id); #ifdef CONFIG_QCA_MMC static qca_mmc *host = &mmc_host; @@ -426,9 +425,6 @@ static int do_boot_signedimg(cmd_tbl_t *cmdtp, int flag, int argc, char *const a disk_partition_t disk_info; unsigned int active_part = 0; #endif -#ifdef CONFIG_USB_XHCI_IPQ - int i; -#endif #ifdef CONFIG_IPQ_ELF_AUTH image_info img_info; #endif @@ -637,14 +633,6 @@ static int do_boot_signedimg(cmd_tbl_t *cmdtp, int flag, int argc, char *const a dcache_enable(); - board_pci_deinit(); -#ifdef CONFIG_USB_XHCI_IPQ - usb_stop(); - for (i=0; istate |= states; @@ -702,9 +707,17 @@ 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 < CONFIG_USB_MAX_CONTROLLER_COUNT; i++) + board_usb_deinit(i); +#endif ret = boot_selected_os(argc, argv, BOOTM_STATE_OS_GO, images, boot_fn); + } /* Deal with any fallout */ err: