Skip to content

Commit 22a9120

Browse files
PCI: j721e: Deassert PERST# after a delay of PCIE_T_PVPERL_MS milliseconds
According to Section 2.2 of the PCI Express Card Electromechanical Specification (Revision 5.1), in order to ensure that the power and the reference clock are stable, PERST# has to be deasserted after a delay of 100 milliseconds (TPVPERL). Currently, it is being assumed that the power is already stable, which is not necessarily true. Hence, change the delay to PCIE_T_PVPERL_MS to guarantee that power and reference clock are stable. Fixes: f3e2591 ("PCI: j721e: Add TI J721E PCIe driver") Fixes: f96b697 ("PCI: j721e: Use T_PERST_CLK_US macro") Link: https://lore.kernel.org/r/20241104074420.1862932-1-s-vadapalli@ti.com Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com> Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
1 parent 08e8352 commit 22a9120

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

drivers/pci/controller/cadence/pci-j721e.c

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -583,15 +583,14 @@ static int j721e_pcie_probe(struct platform_device *pdev)
583583
pcie->refclk = clk;
584584

585585
/*
586-
* The "Power Sequencing and Reset Signal Timings" table of the
587-
* PCI Express Card Electromechanical Specification, Revision
588-
* 5.1, Section 2.9.2, Symbol "T_PERST-CLK", indicates PERST#
589-
* should be deasserted after minimum of 100us once REFCLK is
590-
* stable. The REFCLK to the connector in RC mode is selected
591-
* while enabling the PHY. So deassert PERST# after 100 us.
586+
* Section 2.2 of the PCI Express Card Electromechanical
587+
* Specification (Revision 5.1) mandates that the deassertion
588+
* of the PERST# signal should be delayed by 100 ms (TPVPERL).
589+
* This shall ensure that the power and the reference clock
590+
* are stable.
592591
*/
593592
if (gpiod) {
594-
fsleep(PCIE_T_PERST_CLK_US);
593+
msleep(PCIE_T_PVPERL_MS);
595594
gpiod_set_value_cansleep(gpiod, 1);
596595
}
597596

@@ -682,15 +681,14 @@ static int j721e_pcie_resume_noirq(struct device *dev)
682681
return ret;
683682

684683
/*
685-
* The "Power Sequencing and Reset Signal Timings" table of the
686-
* PCI Express Card Electromechanical Specification, Revision
687-
* 5.1, Section 2.9.2, Symbol "T_PERST-CLK", indicates PERST#
688-
* should be deasserted after minimum of 100us once REFCLK is
689-
* stable. The REFCLK to the connector in RC mode is selected
690-
* while enabling the PHY. So deassert PERST# after 100 us.
684+
* Section 2.2 of the PCI Express Card Electromechanical
685+
* Specification (Revision 5.1) mandates that the deassertion
686+
* of the PERST# signal should be delayed by 100 ms (TPVPERL).
687+
* This shall ensure that the power and the reference clock
688+
* are stable.
691689
*/
692690
if (pcie->reset_gpio) {
693-
fsleep(PCIE_T_PERST_CLK_US);
691+
msleep(PCIE_T_PVPERL_MS);
694692
gpiod_set_value_cansleep(pcie->reset_gpio, 1);
695693
}
696694

0 commit comments

Comments
 (0)