Lines Matching full:pcie
3 // Cadence PCIe controller driver.
8 #include "pcie-cadence.h"
10 void cdns_pcie_set_outbound_region(struct cdns_pcie *pcie, u8 busnr, u8 fn, in cdns_pcie_set_outbound_region() argument
30 cdns_pcie_writel(pcie, CDNS_PCIE_AT_OB_REGION_PCI_ADDR0(r), addr0); in cdns_pcie_set_outbound_region()
31 cdns_pcie_writel(pcie, CDNS_PCIE_AT_OB_REGION_PCI_ADDR1(r), addr1); in cdns_pcie_set_outbound_region()
33 /* Set the PCIe header descriptor */ in cdns_pcie_set_outbound_region()
42 * PCIe descriptor, the PCI function number must be set into in cdns_pcie_set_outbound_region()
46 * mode, the PCIe controller may support more than one function. This in cdns_pcie_set_outbound_region()
47 * function number needs to be set properly into the outbound PCIe in cdns_pcie_set_outbound_region()
56 * the PCIe controller will use the captured values for the bus and in cdns_pcie_set_outbound_region()
59 if (pcie->is_rc) { in cdns_pcie_set_outbound_region()
72 cdns_pcie_writel(pcie, CDNS_PCIE_AT_OB_REGION_DESC0(r), desc0); in cdns_pcie_set_outbound_region()
73 cdns_pcie_writel(pcie, CDNS_PCIE_AT_OB_REGION_DESC1(r), desc1); in cdns_pcie_set_outbound_region()
76 if (pcie->ops->cpu_addr_fixup) in cdns_pcie_set_outbound_region()
77 cpu_addr = pcie->ops->cpu_addr_fixup(pcie, cpu_addr); in cdns_pcie_set_outbound_region()
83 cdns_pcie_writel(pcie, CDNS_PCIE_AT_OB_REGION_CPU_ADDR0(r), addr0); in cdns_pcie_set_outbound_region()
84 cdns_pcie_writel(pcie, CDNS_PCIE_AT_OB_REGION_CPU_ADDR1(r), addr1); in cdns_pcie_set_outbound_region()
87 void cdns_pcie_set_outbound_region_for_normal_msg(struct cdns_pcie *pcie, in cdns_pcie_set_outbound_region_for_normal_msg() argument
97 if (pcie->is_rc) { in cdns_pcie_set_outbound_region_for_normal_msg()
106 if (pcie->ops->cpu_addr_fixup) in cdns_pcie_set_outbound_region_for_normal_msg()
107 cpu_addr = pcie->ops->cpu_addr_fixup(pcie, cpu_addr); in cdns_pcie_set_outbound_region_for_normal_msg()
113 cdns_pcie_writel(pcie, CDNS_PCIE_AT_OB_REGION_PCI_ADDR0(r), 0); in cdns_pcie_set_outbound_region_for_normal_msg()
114 cdns_pcie_writel(pcie, CDNS_PCIE_AT_OB_REGION_PCI_ADDR1(r), 0); in cdns_pcie_set_outbound_region_for_normal_msg()
115 cdns_pcie_writel(pcie, CDNS_PCIE_AT_OB_REGION_DESC0(r), desc0); in cdns_pcie_set_outbound_region_for_normal_msg()
116 cdns_pcie_writel(pcie, CDNS_PCIE_AT_OB_REGION_DESC1(r), desc1); in cdns_pcie_set_outbound_region_for_normal_msg()
117 cdns_pcie_writel(pcie, CDNS_PCIE_AT_OB_REGION_CPU_ADDR0(r), addr0); in cdns_pcie_set_outbound_region_for_normal_msg()
118 cdns_pcie_writel(pcie, CDNS_PCIE_AT_OB_REGION_CPU_ADDR1(r), addr1); in cdns_pcie_set_outbound_region_for_normal_msg()
121 void cdns_pcie_reset_outbound_region(struct cdns_pcie *pcie, u32 r) in cdns_pcie_reset_outbound_region() argument
123 cdns_pcie_writel(pcie, CDNS_PCIE_AT_OB_REGION_PCI_ADDR0(r), 0); in cdns_pcie_reset_outbound_region()
124 cdns_pcie_writel(pcie, CDNS_PCIE_AT_OB_REGION_PCI_ADDR1(r), 0); in cdns_pcie_reset_outbound_region()
126 cdns_pcie_writel(pcie, CDNS_PCIE_AT_OB_REGION_DESC0(r), 0); in cdns_pcie_reset_outbound_region()
127 cdns_pcie_writel(pcie, CDNS_PCIE_AT_OB_REGION_DESC1(r), 0); in cdns_pcie_reset_outbound_region()
129 cdns_pcie_writel(pcie, CDNS_PCIE_AT_OB_REGION_CPU_ADDR0(r), 0); in cdns_pcie_reset_outbound_region()
130 cdns_pcie_writel(pcie, CDNS_PCIE_AT_OB_REGION_CPU_ADDR1(r), 0); in cdns_pcie_reset_outbound_region()
133 void cdns_pcie_disable_phy(struct cdns_pcie *pcie) in cdns_pcie_disable_phy() argument
135 int i = pcie->phy_count; in cdns_pcie_disable_phy()
138 phy_power_off(pcie->phy[i]); in cdns_pcie_disable_phy()
139 phy_exit(pcie->phy[i]); in cdns_pcie_disable_phy()
143 int cdns_pcie_enable_phy(struct cdns_pcie *pcie) in cdns_pcie_enable_phy() argument
148 for (i = 0; i < pcie->phy_count; i++) { in cdns_pcie_enable_phy()
149 ret = phy_init(pcie->phy[i]); in cdns_pcie_enable_phy()
153 ret = phy_power_on(pcie->phy[i]); in cdns_pcie_enable_phy()
155 phy_exit(pcie->phy[i]); in cdns_pcie_enable_phy()
164 phy_power_off(pcie->phy[i]); in cdns_pcie_enable_phy()
165 phy_exit(pcie->phy[i]); in cdns_pcie_enable_phy()
171 int cdns_pcie_init_phy(struct device *dev, struct cdns_pcie *pcie) in cdns_pcie_init_phy() argument
184 pcie->phy_count = 0; in cdns_pcie_init_phy()
211 pcie->phy_count = phy_count; in cdns_pcie_init_phy()
212 pcie->phy = phy; in cdns_pcie_init_phy()
213 pcie->link = link; in cdns_pcie_init_phy()
215 ret = cdns_pcie_enable_phy(pcie); in cdns_pcie_init_phy()
233 struct cdns_pcie *pcie = dev_get_drvdata(dev); in cdns_pcie_suspend_noirq() local
235 cdns_pcie_disable_phy(pcie); in cdns_pcie_suspend_noirq()
242 struct cdns_pcie *pcie = dev_get_drvdata(dev); in cdns_pcie_resume_noirq() local
245 ret = cdns_pcie_enable_phy(pcie); in cdns_pcie_resume_noirq()