Skip to content

Commit e466b89

Browse files
Siddharth-Vadapalli-at-TIgregkh
authored andcommitted
PCI: j721e: Deassert PERST# after a delay of PCIE_T_PVPERL_MS milliseconds
[ Upstream commit 22a9120 ] 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/[email protected] Signed-off-by: Siddharth Vadapalli <[email protected]> Signed-off-by: Krzysztof Wilczyński <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 9621a3d commit e466b89

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
@@ -516,15 +516,14 @@ static int j721e_pcie_probe(struct platform_device *pdev)
516516
pcie->refclk = clk;
517517

518518
/*
519-
* The "Power Sequencing and Reset Signal Timings" table of the
520-
* PCI Express Card Electromechanical Specification, Revision
521-
* 5.1, Section 2.9.2, Symbol "T_PERST-CLK", indicates PERST#
522-
* should be deasserted after minimum of 100us once REFCLK is
523-
* stable. The REFCLK to the connector in RC mode is selected
524-
* while enabling the PHY. So deassert PERST# after 100 us.
519+
* Section 2.2 of the PCI Express Card Electromechanical
520+
* Specification (Revision 5.1) mandates that the deassertion
521+
* of the PERST# signal should be delayed by 100 ms (TPVPERL).
522+
* This shall ensure that the power and the reference clock
523+
* are stable.
525524
*/
526525
if (gpiod) {
527-
fsleep(PCIE_T_PERST_CLK_US);
526+
msleep(PCIE_T_PVPERL_MS);
528527
gpiod_set_value_cansleep(gpiod, 1);
529528
}
530529

@@ -615,15 +614,14 @@ static int j721e_pcie_resume_noirq(struct device *dev)
615614
return ret;
616615

617616
/*
618-
* The "Power Sequencing and Reset Signal Timings" table of the
619-
* PCI Express Card Electromechanical Specification, Revision
620-
* 5.1, Section 2.9.2, Symbol "T_PERST-CLK", indicates PERST#
621-
* should be deasserted after minimum of 100us once REFCLK is
622-
* stable. The REFCLK to the connector in RC mode is selected
623-
* while enabling the PHY. So deassert PERST# after 100 us.
617+
* Section 2.2 of the PCI Express Card Electromechanical
618+
* Specification (Revision 5.1) mandates that the deassertion
619+
* of the PERST# signal should be delayed by 100 ms (TPVPERL).
620+
* This shall ensure that the power and the reference clock
621+
* are stable.
624622
*/
625623
if (pcie->reset_gpio) {
626-
fsleep(PCIE_T_PERST_CLK_US);
624+
msleep(PCIE_T_PVPERL_MS);
627625
gpiod_set_value_cansleep(pcie->reset_gpio, 1);
628626
}
629627

0 commit comments

Comments
 (0)