Lines Matching defs:phy

52 	if (!(adpt->phy.sgmii_ops && adpt->phy.sgmii_ops->init))
55 return adpt->phy.sgmii_ops->init(adpt);
60 if (!(adpt->phy.sgmii_ops && adpt->phy.sgmii_ops->open))
63 return adpt->phy.sgmii_ops->open(adpt);
68 if (!(adpt->phy.sgmii_ops && adpt->phy.sgmii_ops->close))
71 adpt->phy.sgmii_ops->close(adpt);
76 if (!(adpt->phy.sgmii_ops && adpt->phy.sgmii_ops->link_change))
79 return adpt->phy.sgmii_ops->link_change(adpt, link_state);
84 if (!(adpt->phy.sgmii_ops && adpt->phy.sgmii_ops->reset))
87 adpt->phy.sgmii_ops->reset(adpt);
93 struct emac_sgmii *phy = &adpt->phy;
99 val = readl(phy->base + EMAC_SGMII_PHY_AUTONEG_CFG2);
102 writel(val, phy->base + EMAC_SGMII_PHY_AUTONEG_CFG2);
107 struct emac_sgmii *phy = &adpt->phy;
110 writel_relaxed(irq_bits, phy->base + EMAC_SGMII_PHY_INTERRUPT_CLEAR);
111 writel_relaxed(IRQ_GLOBAL_CLEAR, phy->base + EMAC_SGMII_PHY_IRQ_CMD);
119 if (readl_poll_timeout_atomic(phy->base +
129 writel_relaxed(0, phy->base + EMAC_SGMII_PHY_IRQ_CMD);
130 writel_relaxed(0, phy->base + EMAC_SGMII_PHY_INTERRUPT_CLEAR);
144 struct emac_sgmii *phy = &adpt->phy;
147 status = readl(phy->base + EMAC_SGMII_PHY_INTERRUPT_STATUS);
165 count = atomic_inc_return(&phy->decode_error_count);
168 atomic_set(&phy->decode_error_count, 0);
172 atomic_set(&phy->decode_error_count, 0);
183 struct emac_sgmii *phy = &adpt->phy;
187 val = readl(phy->base + EMAC_EMAC_WRAPPER_CSR2);
188 writel(((val & ~PHY_RESET) | PHY_RESET), phy->base +
190 /* Ensure phy-reset command is written to HW before the release cmd */
192 val = readl(phy->base + EMAC_EMAC_WRAPPER_CSR2);
193 writel((val & ~PHY_RESET), phy->base + EMAC_EMAC_WRAPPER_CSR2);
194 /* Ensure phy-reset release command is written to HW before initializing
216 struct emac_sgmii *sgmii = &adpt->phy;
240 struct emac_sgmii *sgmii = &adpt->phy;
250 struct emac_sgmii *sgmii = &adpt->phy;
354 struct emac_sgmii *phy = &adpt->phy;
361 dev = device_find_child(&pdev->dev, &phy->sgmii_ops,
365 dev_warn(&pdev->dev, "cannot find internal phy node\n");
374 np = of_parse_phandle(pdev->dev.of_node, "internal-phy", 0);
376 dev_err(&pdev->dev, "missing internal-phy property\n");
383 dev_err(&pdev->dev, "invalid internal-phy property\n");
389 dev_err(&pdev->dev, "unrecognized internal phy node\n");
394 phy->sgmii_ops = (struct sgmii_ops *)match->data;
404 phy->base = ioremap(res->start, resource_size(res));
405 if (!phy->base) {
413 phy->digital = ioremap(res->start, resource_size(res));
414 if (!phy->digital) {
428 phy->irq = ret;
438 if (phy->digital)
439 iounmap(phy->digital);
441 iounmap(phy->base);