Lines Matching +full:ls1028a +full:- +full:reset

1 // SPDX-License-Identifier: GPL-2.0
26 #include "pcie-designware.h"
31 #define PCIE_ABSERR_SETTING 0x9401 /* Forward error of non-posted request */
46 #define PEXPME(idx) BIT(31 - (idx) * 4)
73 #define to_ls_pcie(x) dev_get_drvdata((x)->dev)
77 struct dw_pcie *pci = pcie->pci; in ls_pcie_is_bridge()
80 header_type = ioread8(pci->dbi_base + PCI_HEADER_TYPE); in ls_pcie_is_bridge()
86 /* Clear multi-function bit */
89 struct dw_pcie *pci = pcie->pci; in ls_pcie_clear_multifunction()
91 iowrite8(PCI_HEADER_TYPE_BRIDGE, pci->dbi_base + PCI_HEADER_TYPE); in ls_pcie_clear_multifunction()
98 struct dw_pcie *pci = pcie->pci; in ls_pcie_drop_msg_tlp()
100 val = ioread32(pci->dbi_base + PCIE_STRFMR1); in ls_pcie_drop_msg_tlp()
102 iowrite32(val, pci->dbi_base + PCIE_STRFMR1); in ls_pcie_drop_msg_tlp()
105 /* Forward error response of outbound non-posted requests */
108 struct dw_pcie *pci = pcie->pci; in ls_pcie_fix_error_response()
110 iowrite32(PCIE_ABSERR_SETTING, pci->dbi_base + PCIE_ABSERR); in ls_pcie_fix_error_response()
115 if (pcie->big_endian) in ls_pcie_pf_lut_readl()
116 return ioread32be(pcie->pf_lut_base + off); in ls_pcie_pf_lut_readl()
118 return ioread32(pcie->pf_lut_base + off); in ls_pcie_pf_lut_readl()
123 if (pcie->big_endian) in ls_pcie_pf_lut_writel()
124 iowrite32be(val, pcie->pf_lut_base + off); in ls_pcie_pf_lut_writel()
126 iowrite32(val, pcie->pf_lut_base + off); in ls_pcie_pf_lut_writel()
145 dev_err(pcie->pci->dev, "PME_Turn_off timeout\n"); in ls_pcie_send_turnoff_msg()
172 dev_err(pcie->pci->dev, "L2 exit timeout\n"); in ls_pcie_exit_from_l2()
216 scfg_pcie_send_turnoff_msg(pcie->scfg, SCFG_PEXPMWRCR(pcie->index), PMXMTTURNOFF); in ls1021a_pcie_send_turnoff_msg()
221 /* Reset the PEX wrapper to bring the link out of L2 */ in scfg_pcie_exit_from_l2()
233 return scfg_pcie_exit_from_l2(pcie->scfg, SCFG_PEXSFTRSTCR, PEXSR(pcie->index)); in ls1021a_pcie_exit_from_l2()
241 scfg_pcie_send_turnoff_msg(pcie->scfg, SCFG_PEXPMECR, PEXPME(pcie->index)); in ls1043a_pcie_send_turnoff_msg()
251 * Reset the PEX wrapper to bring the link out of L2. in ls1043a_pcie_exit_from_l2()
253 * clearing the soft reset on the PEX module. in ls1043a_pcie_exit_from_l2()
254 * LDBG_SR: When SR is set to 1, the PEX module enters soft reset. in ls1043a_pcie_exit_from_l2()
313 { .compatible = "fsl,ls1012a-pcie", .data = &layerscape_drvdata },
314 { .compatible = "fsl,ls1021a-pcie", .data = &ls1021a_drvdata },
315 { .compatible = "fsl,ls1028a-pcie", .data = &layerscape_drvdata },
316 { .compatible = "fsl,ls1043a-pcie", .data = &ls1043a_drvdata },
317 { .compatible = "fsl,ls1046a-pcie", .data = &layerscape_drvdata },
318 { .compatible = "fsl,ls2080a-pcie", .data = &layerscape_drvdata },
319 { .compatible = "fsl,ls2085a-pcie", .data = &layerscape_drvdata },
320 { .compatible = "fsl,ls2088a-pcie", .data = &layerscape_drvdata },
321 { .compatible = "fsl,ls1088a-pcie", .data = &layerscape_drvdata },
327 struct device *dev = &pdev->dev; in ls_pcie_probe()
335 return -ENOMEM; in ls_pcie_probe()
339 return -ENOMEM; in ls_pcie_probe()
341 pcie->drvdata = of_device_get_match_data(dev); in ls_pcie_probe()
343 pci->dev = dev; in ls_pcie_probe()
344 pcie->pci = pci; in ls_pcie_probe()
345 pci->pp.ops = pcie->drvdata->ops; in ls_pcie_probe()
348 pci->dbi_base = devm_pci_remap_cfg_resource(dev, dbi_base); in ls_pcie_probe()
349 if (IS_ERR(pci->dbi_base)) in ls_pcie_probe()
350 return PTR_ERR(pci->dbi_base); in ls_pcie_probe()
352 pcie->big_endian = of_property_read_bool(dev->of_node, "big-endian"); in ls_pcie_probe()
354 pcie->pf_lut_base = pci->dbi_base + pcie->drvdata->pf_lut_off; in ls_pcie_probe()
356 if (pcie->drvdata->scfg_support) { in ls_pcie_probe()
357 pcie->scfg = in ls_pcie_probe()
358 syscon_regmap_lookup_by_phandle_args(dev->of_node, in ls_pcie_probe()
359 "fsl,pcie-scfg", 1, in ls_pcie_probe()
361 if (IS_ERR(pcie->scfg)) { in ls_pcie_probe()
363 return PTR_ERR(pcie->scfg); in ls_pcie_probe()
366 pcie->index = index[1]; in ls_pcie_probe()
370 return -ENODEV; in ls_pcie_probe()
374 return dw_pcie_host_init(&pci->pp); in ls_pcie_probe()
381 if (!pcie->drvdata->pm_support) in ls_pcie_suspend_noirq()
384 return dw_pcie_suspend_noirq(pcie->pci); in ls_pcie_suspend_noirq()
392 if (!pcie->drvdata->pm_support) in ls_pcie_resume_noirq()
395 ret = pcie->drvdata->exit_from_l2(&pcie->pci->pp); in ls_pcie_resume_noirq()
399 return dw_pcie_resume_noirq(pcie->pci); in ls_pcie_resume_noirq()
409 .name = "layerscape-pcie",