Lines Matching refs:imx8_phy
77 struct imx8_pcie_phy *imx8_phy = phy_get_drvdata(phy); in imx8_pcie_phy_power_on() local
79 pad_mode = imx8_phy->refclk_pad_mode; in imx8_pcie_phy_power_on()
80 switch (imx8_phy->drvdata->variant) { in imx8_pcie_phy_power_on()
82 reset_control_assert(imx8_phy->reset); in imx8_pcie_phy_power_on()
85 if (imx8_phy->tx_deemph_gen1) in imx8_pcie_phy_power_on()
86 writel(imx8_phy->tx_deemph_gen1, in imx8_pcie_phy_power_on()
87 imx8_phy->base + PCIE_PHY_TRSV_REG5); in imx8_pcie_phy_power_on()
88 if (imx8_phy->tx_deemph_gen2) in imx8_pcie_phy_power_on()
89 writel(imx8_phy->tx_deemph_gen2, in imx8_pcie_phy_power_on()
90 imx8_phy->base + PCIE_PHY_TRSV_REG6); in imx8_pcie_phy_power_on()
99 val = readl(imx8_phy->base + IMX8MM_PCIE_PHY_CMN_REG061); in imx8_pcie_phy_power_on()
101 imx8_phy->base + IMX8MM_PCIE_PHY_CMN_REG061); in imx8_pcie_phy_power_on()
105 imx8_phy->base + IMX8MM_PCIE_PHY_CMN_REG061); in imx8_pcie_phy_power_on()
112 imx8_phy->base + IMX8MM_PCIE_PHY_CMN_REG062); in imx8_pcie_phy_power_on()
114 imx8_phy->base + IMX8MM_PCIE_PHY_CMN_REG063); in imx8_pcie_phy_power_on()
117 imx8_phy->base + IMX8MM_PCIE_PHY_CMN_REG064); in imx8_pcie_phy_power_on()
119 imx8_phy->base + IMX8MM_PCIE_PHY_CMN_REG065); in imx8_pcie_phy_power_on()
123 regmap_update_bits(imx8_phy->iomuxc_gpr, IOMUXC_GPR14, in imx8_pcie_phy_power_on()
125 imx8_phy->clkreq_unused ? in imx8_pcie_phy_power_on()
127 regmap_update_bits(imx8_phy->iomuxc_gpr, IOMUXC_GPR14, in imx8_pcie_phy_power_on()
130 regmap_update_bits(imx8_phy->iomuxc_gpr, IOMUXC_GPR14, in imx8_pcie_phy_power_on()
132 regmap_update_bits(imx8_phy->iomuxc_gpr, IOMUXC_GPR14, in imx8_pcie_phy_power_on()
135 regmap_update_bits(imx8_phy->iomuxc_gpr, IOMUXC_GPR14, in imx8_pcie_phy_power_on()
143 regmap_update_bits(imx8_phy->iomuxc_gpr, IOMUXC_GPR14, in imx8_pcie_phy_power_on()
147 switch (imx8_phy->drvdata->variant) { in imx8_pcie_phy_power_on()
149 reset_control_deassert(imx8_phy->perst); in imx8_pcie_phy_power_on()
152 reset_control_deassert(imx8_phy->reset); in imx8_pcie_phy_power_on()
158 ret = readl_poll_timeout(imx8_phy->base + IMX8MM_PCIE_PHY_CMN_REG075, in imx8_pcie_phy_power_on()
165 struct imx8_pcie_phy *imx8_phy = phy_get_drvdata(phy); in imx8_pcie_phy_init() local
167 return clk_prepare_enable(imx8_phy->clk); in imx8_pcie_phy_init()
172 struct imx8_pcie_phy *imx8_phy = phy_get_drvdata(phy); in imx8_pcie_phy_exit() local
174 clk_disable_unprepare(imx8_phy->clk); in imx8_pcie_phy_exit()
208 struct imx8_pcie_phy *imx8_phy; in imx8_pcie_phy_probe() local
211 imx8_phy = devm_kzalloc(dev, sizeof(*imx8_phy), GFP_KERNEL); in imx8_pcie_phy_probe()
212 if (!imx8_phy) in imx8_pcie_phy_probe()
215 imx8_phy->drvdata = of_device_get_match_data(dev); in imx8_pcie_phy_probe()
219 &imx8_phy->refclk_pad_mode); in imx8_pcie_phy_probe()
222 &imx8_phy->tx_deemph_gen1)) in imx8_pcie_phy_probe()
223 imx8_phy->tx_deemph_gen1 = 0; in imx8_pcie_phy_probe()
226 &imx8_phy->tx_deemph_gen2)) in imx8_pcie_phy_probe()
227 imx8_phy->tx_deemph_gen2 = 0; in imx8_pcie_phy_probe()
230 imx8_phy->clkreq_unused = true; in imx8_pcie_phy_probe()
232 imx8_phy->clkreq_unused = false; in imx8_pcie_phy_probe()
234 imx8_phy->clk = devm_clk_get(dev, "ref"); in imx8_pcie_phy_probe()
235 if (IS_ERR(imx8_phy->clk)) { in imx8_pcie_phy_probe()
237 return PTR_ERR(imx8_phy->clk); in imx8_pcie_phy_probe()
241 imx8_phy->iomuxc_gpr = in imx8_pcie_phy_probe()
242 syscon_regmap_lookup_by_compatible(imx8_phy->drvdata->gpr); in imx8_pcie_phy_probe()
243 if (IS_ERR(imx8_phy->iomuxc_gpr)) { in imx8_pcie_phy_probe()
245 return PTR_ERR(imx8_phy->iomuxc_gpr); in imx8_pcie_phy_probe()
248 imx8_phy->reset = devm_reset_control_get_exclusive(dev, "pciephy"); in imx8_pcie_phy_probe()
249 if (IS_ERR(imx8_phy->reset)) { in imx8_pcie_phy_probe()
251 return PTR_ERR(imx8_phy->reset); in imx8_pcie_phy_probe()
254 if (imx8_phy->drvdata->variant == IMX8MP) { in imx8_pcie_phy_probe()
255 imx8_phy->perst = in imx8_pcie_phy_probe()
257 if (IS_ERR(imx8_phy->perst)) in imx8_pcie_phy_probe()
258 return dev_err_probe(dev, PTR_ERR(imx8_phy->perst), in imx8_pcie_phy_probe()
263 imx8_phy->base = devm_ioremap_resource(dev, res); in imx8_pcie_phy_probe()
264 if (IS_ERR(imx8_phy->base)) in imx8_pcie_phy_probe()
265 return PTR_ERR(imx8_phy->base); in imx8_pcie_phy_probe()
267 imx8_phy->phy = devm_phy_create(dev, NULL, &imx8_pcie_phy_ops); in imx8_pcie_phy_probe()
268 if (IS_ERR(imx8_phy->phy)) in imx8_pcie_phy_probe()
269 return PTR_ERR(imx8_phy->phy); in imx8_pcie_phy_probe()
271 phy_set_drvdata(imx8_phy->phy, imx8_phy); in imx8_pcie_phy_probe()