]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
usb: xhci-mtk: disable all ports when disable host controller
authorChunfeng Yun <chunfeng.yun@mediatek.com>
Fri, 27 May 2022 01:52:09 +0000 (09:52 +0800)
committerMarek Vasut <marex@denx.de>
Tue, 7 Jun 2022 07:55:57 +0000 (09:55 +0200)
This is used to avoid the ports status of IPPC being brought in kernel
stage, it may cause ports error especially when the xhci controller is
a component of dual-role controller.

Reported-by: Yun-Chien Yu <yun-chien.yu@mediatek.com>
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
drivers/usb/host/xhci-mtk.c

index 18b4f55d8962396a910d1c103907c925272437e5..3838a990ec37f34414997007c45e0d1d9671d8f8 100644 (file)
@@ -122,11 +122,13 @@ static int xhci_mtk_host_disable(struct mtk_xhci *mtk)
 
        /* power down all u3 ports */
        for (i = 0; i < mtk->num_u3ports; i++)
-               setbits_le32(mtk->ippc + IPPC_U3_CTRL(i), CTRL_U3_PORT_PDN);
+               setbits_le32(mtk->ippc + IPPC_U3_CTRL(i),
+                            CTRL_U3_PORT_PDN | CTRL_U3_PORT_DIS);
 
        /* power down all u2 ports */
        for (i = 0; i < mtk->num_u2ports; i++)
-               setbits_le32(mtk->ippc + IPPC_U2_CTRL(i), CTRL_U2_PORT_PDN);
+               setbits_le32(mtk->ippc + IPPC_U2_CTRL(i),
+                            CTRL_U2_PORT_PDN | CTRL_U2_PORT_DIS);
 
        /* power down host ip */
        setbits_le32(mtk->ippc + IPPC_IP_PW_CTRL1, CTRL1_IP_HOST_PDN);