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 <speriaka@codeaurora.org>
This commit is contained in:
speriaka 2019-10-04 12:56:40 +05:30 committed by Gerrit - the friendly Code Review server
parent 107d511bdc
commit 7b44c8c9b2
2 changed files with 14 additions and 25 deletions

View file

@ -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; i<CONFIG_USB_MAX_CONTROLLER_COUNT; i++) {
board_usb_deinit(i);
}
#endif
ret = config_select(request, runcmd, sizeof(runcmd));
if (debug)
@ -676,9 +664,6 @@ static int do_boot_unsignedimg(cmd_tbl_t *cmdtp, int flag, int argc, char *const
disk_partition_t disk_info;
unsigned int active_part = 0;
#endif
#ifdef CONFIG_USB_XHCI_IPQ
int i;
#endif
if (argc == 2 && strncmp(argv[1], "debug", 5) == 0)
debug = 1;
@ -780,15 +765,6 @@ static int do_boot_unsignedimg(cmd_tbl_t *cmdtp, int flag, int argc, char *const
dcache_enable();
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
setenv("mtdids", mtdids);
ret = genimg_get_format((void *)CONFIG_SYS_LOAD_ADDR);

View file

@ -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,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: