f88efc07320e49a908e5a769dbf4be8e6b311178
[openwrt/staging/jow.git] / target / linux / mediatek / patches-6.1 / 611-pcie-mediatek-gen3-PERST-for-100ms.patch
1 --- a/drivers/pci/controller/pcie-mediatek-gen3.c
2 +++ b/drivers/pci/controller/pcie-mediatek-gen3.c
3 @@ -350,9 +350,15 @@ static int mtk_pcie_startup_port(struct
4 msleep(100);
5
6 /* De-assert reset signals */
7 - val &= ~(PCIE_MAC_RSTB | PCIE_PHY_RSTB | PCIE_BRG_RSTB | PCIE_PE_RSTB);
8 + val &= ~(PCIE_MAC_RSTB | PCIE_PHY_RSTB | PCIE_BRG_RSTB);
9 writel_relaxed(val, pcie->base + PCIE_RST_CTRL_REG);
10
11 + msleep(100);
12 +
13 + /* De-assert PERST# signals */
14 + val &= ~(PCIE_PE_RSTB);
15 + writel_relaxed(val, port->base + PCIE_RST_CTRL_REG);
16 +
17 /* Check if the link is up or not */
18 err = readl_poll_timeout(pcie->base + PCIE_LINK_STATUS_REG, val,
19 !!(val & PCIE_PORT_LINKUP), 20,