Lines Matching +full:pcie +full:- +full:phy +full:- +full:0
1 // SPDX-License-Identifier: GPL-2.0
16 #include <linux/phy/phy.h>
19 #include "pcie-iproc.h"
23 .compatible = "brcm,iproc-pcie",
26 .compatible = "brcm,iproc-pcie-paxb-v2",
29 .compatible = "brcm,iproc-pcie-paxc",
32 .compatible = "brcm,iproc-pcie-paxc-v2",
41 struct device *dev = &pdev->dev; in iproc_pltfm_pcie_probe()
42 struct iproc_pcie *pcie; in iproc_pltfm_pcie_probe() local
43 struct device_node *np = dev->of_node; in iproc_pltfm_pcie_probe()
48 bridge = devm_pci_alloc_host_bridge(dev, sizeof(*pcie)); in iproc_pltfm_pcie_probe()
50 return -ENOMEM; in iproc_pltfm_pcie_probe()
52 pcie = pci_host_bridge_priv(bridge); in iproc_pltfm_pcie_probe()
54 pcie->dev = dev; in iproc_pltfm_pcie_probe()
55 pcie->type = (uintptr_t)of_device_get_match_data(dev); in iproc_pltfm_pcie_probe()
57 ret = of_address_to_resource(np, 0, ®); in iproc_pltfm_pcie_probe()
58 if (ret < 0) { in iproc_pltfm_pcie_probe()
63 pcie->base = devm_pci_remap_cfgspace(dev, reg.start, in iproc_pltfm_pcie_probe()
65 if (!pcie->base) { in iproc_pltfm_pcie_probe()
67 return -ENOMEM; in iproc_pltfm_pcie_probe()
69 pcie->base_addr = reg.start; in iproc_pltfm_pcie_probe()
71 if (of_property_read_bool(np, "brcm,pcie-ob")) { in iproc_pltfm_pcie_probe()
74 ret = of_property_read_u32(np, "brcm,pcie-ob-axi-offset", in iproc_pltfm_pcie_probe()
78 "missing brcm,pcie-ob-axi-offset property\n"); in iproc_pltfm_pcie_probe()
81 pcie->ob.axi_offset = val; in iproc_pltfm_pcie_probe()
82 pcie->need_ob_cfg = true; in iproc_pltfm_pcie_probe()
86 * DT nodes are not used by all platforms that use the iProc PCIe in iproc_pltfm_pcie_probe()
88 * configuration, "dma-ranges" would have been present in DT in iproc_pltfm_pcie_probe()
90 pcie->need_ib_cfg = of_property_read_bool(np, "dma-ranges"); in iproc_pltfm_pcie_probe()
92 /* PHY use is optional */ in iproc_pltfm_pcie_probe()
93 pcie->phy = devm_phy_optional_get(dev, "pcie-phy"); in iproc_pltfm_pcie_probe()
94 if (IS_ERR(pcie->phy)) in iproc_pltfm_pcie_probe()
95 return PTR_ERR(pcie->phy); in iproc_pltfm_pcie_probe()
98 switch (pcie->type) { in iproc_pltfm_pcie_probe()
101 pcie->map_irq = NULL; in iproc_pltfm_pcie_probe()
107 ret = iproc_pcie_setup(pcie, &bridge->windows); in iproc_pltfm_pcie_probe()
109 dev_err(dev, "PCIe controller setup failed\n"); in iproc_pltfm_pcie_probe()
113 platform_set_drvdata(pdev, pcie); in iproc_pltfm_pcie_probe()
114 return 0; in iproc_pltfm_pcie_probe()
119 struct iproc_pcie *pcie = platform_get_drvdata(pdev); in iproc_pltfm_pcie_remove() local
121 iproc_pcie_remove(pcie); in iproc_pltfm_pcie_remove()
126 struct iproc_pcie *pcie = platform_get_drvdata(pdev); in iproc_pltfm_pcie_shutdown() local
128 iproc_pcie_shutdown(pcie); in iproc_pltfm_pcie_shutdown()
133 .name = "iproc-pcie",
143 MODULE_DESCRIPTION("Broadcom iPROC PCIe platform driver");