Skip to content

Commit 4fb8e46

Browse files
Vidya Sagarbjorn-helgaas
authored andcommitted
PCI: tegra194: Enable support for 256 Byte payload
Set 256 byte payload as the default in the Device Control Register to allow the PCIe subsystem to enable 256 byte Max Payload Size when a capable link partner is connected. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vidya Sagar <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
1 parent 6c12e3e commit 4fb8e46

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -839,13 +839,19 @@ static int tegra_pcie_dw_host_init(struct pcie_port *pp)
839839
struct dw_pcie *pci = to_dw_pcie_from_pp(pp);
840840
struct tegra_pcie_dw *pcie = to_tegra_pcie(pci);
841841
u32 val;
842+
u16 val_16;
842843

843844
pp->bridge->ops = &tegra_pci_ops;
844845

845846
if (!pcie->pcie_cap_base)
846847
pcie->pcie_cap_base = dw_pcie_find_capability(&pcie->pci,
847848
PCI_CAP_ID_EXP);
848849

850+
val_16 = dw_pcie_readw_dbi(pci, pcie->pcie_cap_base + PCI_EXP_DEVCTL);
851+
val_16 &= ~PCI_EXP_DEVCTL_PAYLOAD;
852+
val_16 |= PCI_EXP_DEVCTL_PAYLOAD_256B;
853+
dw_pcie_writew_dbi(pci, pcie->pcie_cap_base + PCI_EXP_DEVCTL, val_16);
854+
849855
val = dw_pcie_readl_dbi(pci, PCI_IO_BASE);
850856
val &= ~(IO_BASE_IO_DECODE | IO_BASE_IO_DECODE_BIT8);
851857
dw_pcie_writel_dbi(pci, PCI_IO_BASE, val);
@@ -1632,6 +1638,7 @@ static void pex_ep_event_pex_rst_deassert(struct tegra_pcie_dw *pcie)
16321638
struct device *dev = pcie->dev;
16331639
u32 val;
16341640
int ret;
1641+
u16 val_16;
16351642

16361643
if (pcie->ep_state == EP_STATE_ENABLED)
16371644
return;
@@ -1749,6 +1756,12 @@ static void pex_ep_event_pex_rst_deassert(struct tegra_pcie_dw *pcie)
17491756

17501757
pcie->pcie_cap_base = dw_pcie_find_capability(&pcie->pci,
17511758
PCI_CAP_ID_EXP);
1759+
1760+
val_16 = dw_pcie_readw_dbi(pci, pcie->pcie_cap_base + PCI_EXP_DEVCTL);
1761+
val_16 &= ~PCI_EXP_DEVCTL_PAYLOAD;
1762+
val_16 |= PCI_EXP_DEVCTL_PAYLOAD_256B;
1763+
dw_pcie_writew_dbi(pci, pcie->pcie_cap_base + PCI_EXP_DEVCTL, val_16);
1764+
17521765
clk_set_rate(pcie->core_clk, GEN4_CORE_CLK_FREQ);
17531766

17541767
val = (ep->msi_mem_phys & MSIX_ADDR_MATCH_LOW_OFF_MASK);

0 commit comments

Comments
 (0)