From c27270dc2eab1f313b261ca4d2dd161dbbf6df32 Mon Sep 17 00:00:00 2001 From: Balaji Prakash J Date: Tue, 19 Feb 2019 23:52:47 +0530 Subject: [PATCH] ipq6018: usb: Skip usb deinit in emulation In emulation, during full boot chain, usb clocks are disabled during usb deinit in uboot. In kernel, we are using dummy clock driver for emulation. In order for the usb clocks to be enabled while kernel boot up, skipped usb deinit in uboot. Change-Id: I47de9da5a6afbed524659e936eb8215e03a99ac0 Signed-off-by: Balaji Prakash J --- board/qca/arm/ipq6018/ipq6018.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/board/qca/arm/ipq6018/ipq6018.c b/board/qca/arm/ipq6018/ipq6018.c index 0734d0e102..ab1c2ea900 100644 --- a/board/qca/arm/ipq6018/ipq6018.c +++ b/board/qca/arm/ipq6018/ipq6018.c @@ -336,6 +336,13 @@ void board_usb_deinit(int id) { void __iomem *boot_clk_ctl, *usb_bcr, *qusb2_phy_bcr; void __iomem *usb_phy_bcr, *usb_gen_cfg, *usb_guctl, *phy_base; + int nodeoff; + char node_name[8]; + + snprintf(node_name, sizeof(node_name), "usb%d", id); + nodeoff = fdt_path_offset(gd->fdt_blob, node_name); + if (fdtdec_get_int(gd->fdt_blob, nodeoff, "qcom,emulation", 0)) + return; if (id == 0) { boot_clk_ctl = GCC_USB_0_BOOT_CLOCK_CTL; @@ -602,12 +609,11 @@ static void usb_init_phy(int index) int ipq_board_usb_init(void) { int i, nodeoff; - char node, usb_node[4] = "usb\0"; + char node_name[8]; for (i=0; ifdt_blob, usb_node); + snprintf(node_name, sizeof(node_name), "usb%d", i); + nodeoff = fdt_path_offset(gd->fdt_blob, node_name); if (!fdtdec_get_int(gd->fdt_blob, nodeoff, "qcom,emulation", 0)) { usb_clock_init(i); usb_init_phy(i);