Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

PCI: cadence: Allow PTM Responder to be enabled

This enables the Controller [RP] to automatically respond with
Response/ResponseD messages if CDNS_PCIE_LM_TPM_CTRL_PTMRSEN
and PCI_PTM_CTRL_ENABLE bits are both set.

Link: https://lore.kernel.org/r/20220512055539.1782437-1-christian.gmeiner@gmail.com
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>

authored by

Christian Gmeiner and committed by
Lorenzo Pieralisi
a1f67bc1 0aa3a093

+14
+10
drivers/pci/controller/cadence/pcie-cadence-host.c
··· 123 123 return ret; 124 124 } 125 125 126 + static void cdns_pcie_host_enable_ptm_response(struct cdns_pcie *pcie) 127 + { 128 + u32 val; 129 + 130 + val = cdns_pcie_readl(pcie, CDNS_PCIE_LM_PTM_CTRL); 131 + cdns_pcie_writel(pcie, CDNS_PCIE_LM_PTM_CTRL, val | CDNS_PCIE_LM_TPM_CTRL_PTMRSEN); 132 + } 133 + 126 134 static int cdns_pcie_host_start_link(struct cdns_pcie_rc *rc) 127 135 { 128 136 struct cdns_pcie *pcie = &rc->pcie; ··· 508 500 509 501 if (rc->quirk_detect_quiet_flag) 510 502 cdns_pcie_detect_quiet_min_delay_set(&rc->pcie); 503 + 504 + cdns_pcie_host_enable_ptm_response(pcie); 511 505 512 506 ret = cdns_pcie_start_link(pcie); 513 507 if (ret) {
+4
drivers/pci/controller/cadence/pcie-cadence.h
··· 116 116 #define LM_RC_BAR_CFG_APERTURE(bar, aperture) \ 117 117 (((aperture) - 2) << ((bar) * 8)) 118 118 119 + /* PTM Control Register */ 120 + #define CDNS_PCIE_LM_PTM_CTRL (CDNS_PCIE_LM_BASE + 0x0da8) 121 + #define CDNS_PCIE_LM_TPM_CTRL_PTMRSEN BIT(17) 122 + 119 123 /* 120 124 * Endpoint Function Registers (PCI configuration space for endpoint functions) 121 125 */