Skip to content

Commit 5c8bd7f

Browse files
committed
Merge branch 'pci/controller/j721e'
- Add PCIe support for J722S SoC (Siddharth Vadapalli) - Delay PCIE_T_PVPERL_MS (100 ms), not just PCIE_T_PERST_CLK_US (100 us), before deasserting PERST# to ensure power and refclk are stable (Siddharth Vadapalli) * pci/controller/j721e: PCI: j721e: Deassert PERST# after a delay of PCIE_T_PVPERL_MS milliseconds PCI: j721e: Add PCIe support for J722S SoC
2 parents 7b86e0a + 22a9120 commit 5c8bd7f

File tree

1 file changed

+23
-14
lines changed

1 file changed

+23
-14
lines changed

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

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,13 @@ static const struct j721e_pcie_data j784s4_pcie_ep_data = {
386386
.max_lanes = 4,
387387
};
388388

389+
static const struct j721e_pcie_data j722s_pcie_rc_data = {
390+
.mode = PCI_MODE_RC,
391+
.linkdown_irq_regfield = J7200_LINK_DOWN,
392+
.byte_access_allowed = true,
393+
.max_lanes = 1,
394+
};
395+
389396
static const struct of_device_id of_j721e_pcie_match[] = {
390397
{
391398
.compatible = "ti,j721e-pcie-host",
@@ -419,6 +426,10 @@ static const struct of_device_id of_j721e_pcie_match[] = {
419426
.compatible = "ti,j784s4-pcie-ep",
420427
.data = &j784s4_pcie_ep_data,
421428
},
429+
{
430+
.compatible = "ti,j722s-pcie-host",
431+
.data = &j722s_pcie_rc_data,
432+
},
422433
{},
423434
};
424435

@@ -572,15 +583,14 @@ static int j721e_pcie_probe(struct platform_device *pdev)
572583
pcie->refclk = clk;
573584

574585
/*
575-
* The "Power Sequencing and Reset Signal Timings" table of the
576-
* PCI Express Card Electromechanical Specification, Revision
577-
* 5.1, Section 2.9.2, Symbol "T_PERST-CLK", indicates PERST#
578-
* should be deasserted after minimum of 100us once REFCLK is
579-
* stable. The REFCLK to the connector in RC mode is selected
580-
* 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.
581591
*/
582592
if (gpiod) {
583-
fsleep(PCIE_T_PERST_CLK_US);
593+
msleep(PCIE_T_PVPERL_MS);
584594
gpiod_set_value_cansleep(gpiod, 1);
585595
}
586596

@@ -671,15 +681,14 @@ static int j721e_pcie_resume_noirq(struct device *dev)
671681
return ret;
672682

673683
/*
674-
* The "Power Sequencing and Reset Signal Timings" table of the
675-
* PCI Express Card Electromechanical Specification, Revision
676-
* 5.1, Section 2.9.2, Symbol "T_PERST-CLK", indicates PERST#
677-
* should be deasserted after minimum of 100us once REFCLK is
678-
* stable. The REFCLK to the connector in RC mode is selected
679-
* 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.
680689
*/
681690
if (pcie->reset_gpio) {
682-
fsleep(PCIE_T_PERST_CLK_US);
691+
msleep(PCIE_T_PVPERL_MS);
683692
gpiod_set_value_cansleep(pcie->reset_gpio, 1);
684693
}
685694

0 commit comments

Comments
 (0)