Lines Matching full:pcie

3 // Cadence PCIe controller driver.
9 #include "pcie-cadence.h"
11 void cdns_pcie_detect_quiet_min_delay_set(struct cdns_pcie *pcie) in cdns_pcie_detect_quiet_min_delay_set() argument
19 ltssm_control_cap = cdns_pcie_readl(pcie, CDNS_PCIE_LTSSM_CONTROL_CAP); in cdns_pcie_detect_quiet_min_delay_set()
24 cdns_pcie_writel(pcie, CDNS_PCIE_LTSSM_CONTROL_CAP, ltssm_control_cap); in cdns_pcie_detect_quiet_min_delay_set()
27 void cdns_pcie_set_outbound_region(struct cdns_pcie *pcie, u8 busnr, u8 fn, in cdns_pcie_set_outbound_region() argument
47 cdns_pcie_writel(pcie, CDNS_PCIE_AT_OB_REGION_PCI_ADDR0(r), addr0); in cdns_pcie_set_outbound_region()
48 cdns_pcie_writel(pcie, CDNS_PCIE_AT_OB_REGION_PCI_ADDR1(r), addr1); in cdns_pcie_set_outbound_region()
50 /* Set the PCIe header descriptor */ in cdns_pcie_set_outbound_region()
59 * PCIe descriptor, the PCI function number must be set into in cdns_pcie_set_outbound_region()
63 * mode, the PCIe controller may support more than one function. This in cdns_pcie_set_outbound_region()
64 * function number needs to be set properly into the outbound PCIe in cdns_pcie_set_outbound_region()
73 * the PCIe controller will use the captured values for the bus and in cdns_pcie_set_outbound_region()
76 if (pcie->is_rc) { in cdns_pcie_set_outbound_region()
89 cdns_pcie_writel(pcie, CDNS_PCIE_AT_OB_REGION_DESC0(r), desc0); in cdns_pcie_set_outbound_region()
90 cdns_pcie_writel(pcie, CDNS_PCIE_AT_OB_REGION_DESC1(r), desc1); in cdns_pcie_set_outbound_region()
93 if (pcie->ops->cpu_addr_fixup) in cdns_pcie_set_outbound_region()
94 cpu_addr = pcie->ops->cpu_addr_fixup(pcie, cpu_addr); in cdns_pcie_set_outbound_region()
100 cdns_pcie_writel(pcie, CDNS_PCIE_AT_OB_REGION_CPU_ADDR0(r), addr0); in cdns_pcie_set_outbound_region()
101 cdns_pcie_writel(pcie, CDNS_PCIE_AT_OB_REGION_CPU_ADDR1(r), addr1); in cdns_pcie_set_outbound_region()
104 void cdns_pcie_set_outbound_region_for_normal_msg(struct cdns_pcie *pcie, in cdns_pcie_set_outbound_region_for_normal_msg() argument
114 if (pcie->is_rc) { in cdns_pcie_set_outbound_region_for_normal_msg()
123 if (pcie->ops->cpu_addr_fixup) in cdns_pcie_set_outbound_region_for_normal_msg()
124 cpu_addr = pcie->ops->cpu_addr_fixup(pcie, cpu_addr); in cdns_pcie_set_outbound_region_for_normal_msg()
130 cdns_pcie_writel(pcie, CDNS_PCIE_AT_OB_REGION_PCI_ADDR0(r), 0); in cdns_pcie_set_outbound_region_for_normal_msg()
131 cdns_pcie_writel(pcie, CDNS_PCIE_AT_OB_REGION_PCI_ADDR1(r), 0); in cdns_pcie_set_outbound_region_for_normal_msg()
132 cdns_pcie_writel(pcie, CDNS_PCIE_AT_OB_REGION_DESC0(r), desc0); in cdns_pcie_set_outbound_region_for_normal_msg()
133 cdns_pcie_writel(pcie, CDNS_PCIE_AT_OB_REGION_DESC1(r), desc1); in cdns_pcie_set_outbound_region_for_normal_msg()
134 cdns_pcie_writel(pcie, CDNS_PCIE_AT_OB_REGION_CPU_ADDR0(r), addr0); in cdns_pcie_set_outbound_region_for_normal_msg()
135 cdns_pcie_writel(pcie, CDNS_PCIE_AT_OB_REGION_CPU_ADDR1(r), addr1); in cdns_pcie_set_outbound_region_for_normal_msg()
138 void cdns_pcie_reset_outbound_region(struct cdns_pcie *pcie, u32 r) in cdns_pcie_reset_outbound_region() argument
140 cdns_pcie_writel(pcie, CDNS_PCIE_AT_OB_REGION_PCI_ADDR0(r), 0); in cdns_pcie_reset_outbound_region()
141 cdns_pcie_writel(pcie, CDNS_PCIE_AT_OB_REGION_PCI_ADDR1(r), 0); in cdns_pcie_reset_outbound_region()
143 cdns_pcie_writel(pcie, CDNS_PCIE_AT_OB_REGION_DESC0(r), 0); in cdns_pcie_reset_outbound_region()
144 cdns_pcie_writel(pcie, CDNS_PCIE_AT_OB_REGION_DESC1(r), 0); in cdns_pcie_reset_outbound_region()
146 cdns_pcie_writel(pcie, CDNS_PCIE_AT_OB_REGION_CPU_ADDR0(r), 0); in cdns_pcie_reset_outbound_region()
147 cdns_pcie_writel(pcie, CDNS_PCIE_AT_OB_REGION_CPU_ADDR1(r), 0); in cdns_pcie_reset_outbound_region()
150 void cdns_pcie_disable_phy(struct cdns_pcie *pcie) in cdns_pcie_disable_phy() argument
152 int i = pcie->phy_count; in cdns_pcie_disable_phy()
155 phy_power_off(pcie->phy[i]); in cdns_pcie_disable_phy()
156 phy_exit(pcie->phy[i]); in cdns_pcie_disable_phy()
160 int cdns_pcie_enable_phy(struct cdns_pcie *pcie) in cdns_pcie_enable_phy() argument
165 for (i = 0; i < pcie->phy_count; i++) { in cdns_pcie_enable_phy()
166 ret = phy_init(pcie->phy[i]); in cdns_pcie_enable_phy()
170 ret = phy_power_on(pcie->phy[i]); in cdns_pcie_enable_phy()
172 phy_exit(pcie->phy[i]); in cdns_pcie_enable_phy()
181 phy_power_off(pcie->phy[i]); in cdns_pcie_enable_phy()
182 phy_exit(pcie->phy[i]); in cdns_pcie_enable_phy()
188 int cdns_pcie_init_phy(struct device *dev, struct cdns_pcie *pcie) in cdns_pcie_init_phy() argument
201 pcie->phy_count = 0; in cdns_pcie_init_phy()
228 pcie->phy_count = phy_count; in cdns_pcie_init_phy()
229 pcie->phy = phy; in cdns_pcie_init_phy()
230 pcie->link = link; in cdns_pcie_init_phy()
232 ret = cdns_pcie_enable_phy(pcie); in cdns_pcie_init_phy()
249 struct cdns_pcie *pcie = dev_get_drvdata(dev); in cdns_pcie_suspend_noirq() local
251 cdns_pcie_disable_phy(pcie); in cdns_pcie_suspend_noirq()
258 struct cdns_pcie *pcie = dev_get_drvdata(dev); in cdns_pcie_resume_noirq() local
261 ret = cdns_pcie_enable_phy(pcie); in cdns_pcie_resume_noirq()