Skip to content

Commit f59df1d

Browse files
Vidya Sagarbjorn-helgaas
authored andcommitted
PCI: tegra194: Disable L1.2 capability of Tegra234 EP
When Tegra234 is operating in the Endpoint mode with L1.2 enabled, PCIe link goes down during L1.2 exit. This is because Tegra234 powers up UPHY PLL immediately without making sure that the REFCLK is stable. This causes UPHY PLL to fail to lock to the correct frequency and leads to link going down. There is no hardware fix for this, hence do not advertise the L1.2 capability in the Endpoint mode. Fixes: a54e190 ("PCI: tegra194: Add Tegra234 PCIe support") Signed-off-by: Vidya Sagar <vidyas@nvidia.com> Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com> Signed-off-by: Manivannan Sadhasivam <mani@kernel.org> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Tested-by: Jon Hunter <jonathanh@nvidia.com> Reviewed-by: Jon Hunter <jonathanh@nvidia.com> Reviewed-by: Vidya Sagar <vidyas@nvidia.com> Link: https://patch.msgid.link/20260324190755.1094879-14-mmaddireddy@nvidia.com
1 parent 40805f3 commit f59df1d

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

drivers/pci/controller/dwc/pcie-tegra194.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ struct tegra_pcie_dw_of_data {
234234
bool has_sbr_reset_fix;
235235
bool has_l1ss_exit_fix;
236236
bool has_ltr_req_fix;
237+
bool disable_l1_2;
237238
u32 cdm_chk_int_en_bit;
238239
u32 gen4_preset_vec;
239240
u8 n_fts[2];
@@ -679,6 +680,23 @@ static void init_host_aspm(struct tegra_pcie_dw *pcie)
679680
if (pcie->supports_clkreq)
680681
pci->l1ss_support = true;
681682

683+
/*
684+
* Disable L1.2 capability advertisement for Tegra234 Endpoint mode.
685+
* Tegra234 has a hardware bug where during L1.2 exit, the UPHY PLL is
686+
* powered up immediately without waiting for REFCLK to stabilize. This
687+
* causes the PLL to fail to lock to the correct frequency, resulting in
688+
* PCIe link loss. Since there is no hardware fix available, we prevent
689+
* the Endpoint from advertising L1.2 support by clearing the L1.2 bits
690+
* in the L1 PM Substates Capabilities register. This ensures the host
691+
* will not attempt to enter L1.2 state with this Endpoint.
692+
*/
693+
if (pcie->of_data->disable_l1_2 &&
694+
pcie->of_data->mode == DW_PCIE_EP_TYPE) {
695+
val = dw_pcie_readl_dbi(pci, l1ss + PCI_L1SS_CAP);
696+
val &= ~(PCI_L1SS_CAP_PCIPM_L1_2 | PCI_L1SS_CAP_ASPM_L1_2);
697+
dw_pcie_writel_dbi(pci, l1ss + PCI_L1SS_CAP, val);
698+
}
699+
682700
/* Program L0s and L1 entrance latencies */
683701
val = dw_pcie_readl_dbi(pci, PCIE_PORT_AFR);
684702
val &= ~PORT_AFR_L0S_ENTRANCE_LAT_MASK;
@@ -2444,6 +2462,7 @@ static const struct tegra_pcie_dw_of_data tegra234_pcie_dw_ep_of_data = {
24442462
.mode = DW_PCIE_EP_TYPE,
24452463
.has_l1ss_exit_fix = true,
24462464
.has_ltr_req_fix = true,
2465+
.disable_l1_2 = true,
24472466
.cdm_chk_int_en_bit = BIT(18),
24482467
/* Gen4 - 6, 8 and 9 presets enabled */
24492468
.gen4_preset_vec = 0x340,

0 commit comments

Comments
 (0)