601-PCI-mediatek-Assert-PERST-for-100ms-for-power-and-cl.patch 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. From: qizhong cheng <[email protected]>
  2. Date: Mon, 27 Dec 2021 21:31:10 +0800
  3. Subject: [PATCH] PCI: mediatek: Assert PERST# for 100ms for power and clock to
  4. stabilize
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. Described in PCIe CEM specification sections 2.2 (PERST# Signal) and
  9. 2.2.1 (Initial Power-Up (G3 to S0)). The deassertion of PERST# should
  10. be delayed 100ms (TPVPERL) for the power and clock to become stable.
  11. Link: https://lore.kernel.org/r/[email protected]
  12. Signed-off-by: qizhong cheng <[email protected]>
  13. Signed-off-by: Lorenzo Pieralisi <[email protected]>
  14. Acked-by: Pali Rohár <[email protected]>
  15. ---
  16. --- a/drivers/pci/controller/pcie-mediatek.c
  17. +++ b/drivers/pci/controller/pcie-mediatek.c
  18. @@ -702,6 +702,13 @@ static int mtk_pcie_startup_port_v2(stru
  19. */
  20. msleep(100);
  21. + /*
  22. + * Described in PCIe CEM specification sections 2.2 (PERST# Signal) and
  23. + * 2.2.1 (Initial Power-Up (G3 to S0)). The deassertion of PERST# should
  24. + * be delayed 100ms (TPVPERL) for the power and clock to become stable.
  25. + */
  26. + msleep(100);
  27. +
  28. /* De-assert PHY, PE, PIPE, MAC and configuration reset */
  29. val = readl(port->base + PCIE_RST_CTRL);
  30. val |= PCIE_PHY_RSTB | PCIE_PERSTB | PCIE_PIPE_SRSTB |