Lines Matching +full:pll1 +full:- +full:refclk
165 struct brcm_sata_phy *priv = port->phy_priv; in brcm_sata_pcb_base()
168 switch (priv->version) { in brcm_sata_pcb_base()
177 dev_err(priv->dev, "invalid phy version\n"); in brcm_sata_pcb_base()
181 return priv->phy_base + (port->portnum * size); in brcm_sata_pcb_base()
186 struct brcm_sata_phy *priv = port->phy_priv; in brcm_sata_ctrl_base()
189 switch (priv->version) { in brcm_sata_ctrl_base()
194 dev_err(priv->dev, "invalid phy version\n"); in brcm_sata_ctrl_base()
198 return priv->ctrl_base + (port->portnum * size); in brcm_sata_ctrl_base()
226 struct brcm_sata_phy *priv = port->phy_priv; in brcm_stb_sata_ssc_init()
239 if (port->ssc_en) { in brcm_stb_sata_ssc_init()
240 dev_info(priv->dev, "enabling SSC on port%d\n", port->portnum); in brcm_stb_sata_ssc_init()
258 switch (port->rxaeq_mode) { in brcm_stb_sata_rxaeq_init()
270 if (port->rxaeq_val > AEQ_FRC_EQ_VAL_MASK) in brcm_stb_sata_rxaeq_init()
271 return -EINVAL; in brcm_stb_sata_rxaeq_init()
272 tmp |= port->rxaeq_val << AEQ_FRC_EQ_VAL_SHIFT; in brcm_stb_sata_rxaeq_init()
289 /* NS2 SATA PLL1 defaults were characterized by H/W group */
300 struct device *dev = port->phy_priv->dev; in brcm_ns2_sata_init()
324 /* Set oob_clk_sel to refclk/2 */ in brcm_ns2_sata_init()
343 try--; in brcm_ns2_sata_init()
347 dev_err(dev, "port%d PLL did not lock\n", port->portnum); in brcm_ns2_sata_init()
348 return -ETIMEDOUT; in brcm_ns2_sata_init()
351 dev_dbg(dev, "port%d initialized\n", port->portnum); in brcm_ns2_sata_init()
358 struct brcm_sata_phy *priv = port->phy_priv; in brcm_nsp_sata_init()
359 struct device *dev = port->phy_priv->dev; in brcm_nsp_sata_init()
360 void __iomem *base = priv->phy_base; in brcm_nsp_sata_init()
365 if (port->portnum == 0) in brcm_nsp_sata_init()
367 else if (port->portnum == 1) in brcm_nsp_sata_init()
370 return -EINVAL; in brcm_nsp_sata_init()
405 while (--try) { in brcm_nsp_sata_init()
414 dev_err(dev, "port%d PLL did not lock\n", port->portnum); in brcm_nsp_sata_init()
415 return -ETIMEDOUT; in brcm_nsp_sata_init()
418 dev_dbg(dev, "port%d initialized\n", port->portnum); in brcm_nsp_sata_init()
426 /* SR PHY PLL1 registers */
433 struct brcm_sata_phy *priv = port->phy_priv; in brcm_sr_sata_init()
434 struct device *dev = port->phy_priv->dev; in brcm_sr_sata_init()
435 void __iomem *base = priv->phy_base; in brcm_sr_sata_init()
458 try--; in brcm_sr_sata_init()
463 dev_err(dev, "port%d PLL did not lock\n", port->portnum); in brcm_sr_sata_init()
464 return -ETIMEDOUT; in brcm_sr_sata_init()
490 switch (port->phy_priv->version) { in brcm_sata_phy_init()
505 rc = -ENODEV; in brcm_sata_phy_init()
523 int rc = -EOPNOTSUPP; in brcm_sata_phy_calibrate()
525 switch (port->phy_priv->version) { in brcm_sata_phy_calibrate()
545 { .compatible = "brcm,bcm7445-sata-phy",
547 { .compatible = "brcm,bcm7425-sata-phy",
549 { .compatible = "brcm,iproc-ns2-sata-phy",
551 { .compatible = "brcm,iproc-nsp-sata-phy",
553 { .compatible = "brcm,iproc-sr-sata-phy",
562 struct device *dev = &pdev->dev; in brcm_sata_phy_probe()
563 struct device_node *dn = dev->of_node, *child; in brcm_sata_phy_probe()
571 return -ENODEV; in brcm_sata_phy_probe()
575 return -ENOMEM; in brcm_sata_phy_probe()
577 priv->dev = dev; in brcm_sata_phy_probe()
580 priv->phy_base = devm_ioremap_resource(dev, res); in brcm_sata_phy_probe()
581 if (IS_ERR(priv->phy_base)) in brcm_sata_phy_probe()
582 return PTR_ERR(priv->phy_base); in brcm_sata_phy_probe()
586 priv->version = (enum brcm_sata_phy_version)of_id->data; in brcm_sata_phy_probe()
588 priv->version = BRCM_SATA_PHY_STB_28NM; in brcm_sata_phy_probe()
590 if (priv->version == BRCM_SATA_PHY_IPROC_NS2) { in brcm_sata_phy_probe()
592 "phy-ctrl"); in brcm_sata_phy_probe()
593 priv->ctrl_base = devm_ioremap_resource(dev, res); in brcm_sata_phy_probe()
594 if (IS_ERR(priv->ctrl_base)) in brcm_sata_phy_probe()
595 return PTR_ERR(priv->ctrl_base); in brcm_sata_phy_probe()
604 child->name); in brcm_sata_phy_probe()
605 ret = -EINVAL; in brcm_sata_phy_probe()
611 ret = -EINVAL; in brcm_sata_phy_probe()
614 if (priv->phys[id].phy) { in brcm_sata_phy_probe()
616 ret = -EINVAL; in brcm_sata_phy_probe()
620 port = &priv->phys[id]; in brcm_sata_phy_probe()
621 port->portnum = id; in brcm_sata_phy_probe()
622 port->phy_priv = priv; in brcm_sata_phy_probe()
623 port->phy = devm_phy_create(dev, child, &phy_ops); in brcm_sata_phy_probe()
624 port->rxaeq_mode = RXAEQ_MODE_OFF; in brcm_sata_phy_probe()
625 if (!of_property_read_string(child, "brcm,rxaeq-mode", in brcm_sata_phy_probe()
627 port->rxaeq_mode = rxaeq_to_val(rxaeq_mode); in brcm_sata_phy_probe()
628 if (port->rxaeq_mode == RXAEQ_MODE_MANUAL) in brcm_sata_phy_probe()
629 of_property_read_u32(child, "brcm,rxaeq-value", in brcm_sata_phy_probe()
630 &port->rxaeq_val); in brcm_sata_phy_probe()
631 port->ssc_en = of_property_read_bool(child, "brcm,enable-ssc"); in brcm_sata_phy_probe()
632 if (IS_ERR(port->phy)) { in brcm_sata_phy_probe()
634 ret = PTR_ERR(port->phy); in brcm_sata_phy_probe()
638 phy_set_drvdata(port->phy, port); in brcm_sata_phy_probe()
660 .name = "brcm-sata-phy",
669 MODULE_ALIAS("platform:phy-brcm-sata");