Lines Matching +full:spread +full:- +full:spectrum +full:- +full:center
1 // SPDX-License-Identifier: GPL-2.0-or-later
196 struct brcm_sata_phy *priv = port->phy_priv; in brcm_sata_ctrl_base()
199 switch (priv->version) { in brcm_sata_ctrl_base()
204 dev_err(priv->dev, "invalid phy version\n"); in brcm_sata_ctrl_base()
208 return priv->ctrl_base + (port->portnum * size); in brcm_sata_ctrl_base()
214 struct brcm_sata_phy *priv = port->phy_priv; in brcm_sata_phy_wr()
215 void __iomem *pcb_base = priv->phy_base; in brcm_sata_phy_wr()
218 if (priv->version == BRCM_SATA_PHY_STB_40NM) in brcm_sata_phy_wr()
219 bank += (port->portnum * SATA_PCB_REG_40NM_SPACE_SIZE); in brcm_sata_phy_wr()
221 pcb_base += (port->portnum * SATA_PCB_REG_28NM_SPACE_SIZE); in brcm_sata_phy_wr()
231 struct brcm_sata_phy *priv = port->phy_priv; in brcm_sata_phy_rd()
232 void __iomem *pcb_base = priv->phy_base; in brcm_sata_phy_rd()
234 if (priv->version == BRCM_SATA_PHY_STB_40NM) in brcm_sata_phy_rd()
235 bank += (port->portnum * SATA_PCB_REG_40NM_SPACE_SIZE); in brcm_sata_phy_rd()
237 pcb_base += (port->portnum * SATA_PCB_REG_28NM_SPACE_SIZE); in brcm_sata_phy_rd()
250 struct brcm_sata_phy *priv = port->phy_priv; in brcm_stb_sata_ssc_init()
253 /* override the TX spread spectrum setting */ in brcm_stb_sata_ssc_init()
263 if (port->ssc_en) { in brcm_stb_sata_ssc_init()
264 dev_info(priv->dev, "enabling SSC on port%d\n", port->portnum); in brcm_stb_sata_ssc_init()
281 switch (port->rxaeq_mode) { in brcm_stb_sata_rxaeq_init()
293 if (port->rxaeq_val > AEQ_FRC_EQ_VAL_MASK) in brcm_stb_sata_rxaeq_init()
294 return -EINVAL; in brcm_stb_sata_rxaeq_init()
295 tmp |= port->rxaeq_val << AEQ_FRC_EQ_VAL_SHIFT; in brcm_stb_sata_rxaeq_init()
329 /* Set RX PPM val center frequency */ in brcm_stb_sata_16nm_ssc_init()
330 if (port->ssc_en) in brcm_stb_sata_16nm_ssc_init()
341 if (port->ssc_en) in brcm_stb_sata_16nm_ssc_init()
356 if (port->ssc_en) in brcm_stb_sata_16nm_ssc_init()
369 if (port->ssc_en) in brcm_stb_sata_16nm_ssc_init()
380 if (port->ssc_en) in brcm_stb_sata_16nm_ssc_init()
388 switch (port->tx_amplitude_val) { in brcm_stb_sata_16nm_ssc_init()
412 port->ssc_en ? TX_ACTRL5_SSC_EN : 0); in brcm_stb_sata_16nm_ssc_init()
432 struct device *dev = port->phy_priv->dev; in brcm_ns2_sata_init()
475 try--; in brcm_ns2_sata_init()
479 dev_err(dev, "port%d PLL did not lock\n", port->portnum); in brcm_ns2_sata_init()
480 return -ETIMEDOUT; in brcm_ns2_sata_init()
483 dev_dbg(dev, "port%d initialized\n", port->portnum); in brcm_ns2_sata_init()
490 struct device *dev = port->phy_priv->dev; in brcm_nsp_sata_init()
495 if (port->portnum == 0) in brcm_nsp_sata_init()
497 else if (port->portnum == 1) in brcm_nsp_sata_init()
500 return -EINVAL; in brcm_nsp_sata_init()
535 while (--try) { in brcm_nsp_sata_init()
544 dev_err(dev, "port%d PLL did not lock\n", port->portnum); in brcm_nsp_sata_init()
545 return -ETIMEDOUT; in brcm_nsp_sata_init()
548 dev_dbg(dev, "port%d initialized\n", port->portnum); in brcm_nsp_sata_init()
563 struct device *dev = port->phy_priv->dev; in brcm_sr_sata_init()
586 try--; in brcm_sr_sata_init()
591 dev_err(dev, "port%d PLL did not lock\n", port->portnum); in brcm_sr_sata_init()
592 return -ETIMEDOUT; in brcm_sr_sata_init()
615 struct device *dev = port->phy_priv->dev; in brcm_dsl_sata_init()
653 try--; in brcm_dsl_sata_init()
658 dev_err(dev, "port%d PLL did not lock\n", port->portnum); in brcm_dsl_sata_init()
659 return -ETIMEDOUT; in brcm_dsl_sata_init()
662 dev_dbg(dev, "port%d initialized\n", port->portnum); in brcm_dsl_sata_init()
672 switch (port->phy_priv->version) { in brcm_sata_phy_init()
693 rc = -ENODEV; in brcm_sata_phy_init()
710 int rc = -EOPNOTSUPP; in brcm_sata_phy_calibrate()
712 switch (port->phy_priv->version) { in brcm_sata_phy_calibrate()
732 { .compatible = "brcm,bcm7216-sata-phy",
734 { .compatible = "brcm,bcm7445-sata-phy",
736 { .compatible = "brcm,bcm7425-sata-phy",
738 { .compatible = "brcm,iproc-ns2-sata-phy",
740 { .compatible = "brcm,iproc-nsp-sata-phy",
742 { .compatible = "brcm,iproc-sr-sata-phy",
744 { .compatible = "brcm,bcm63138-sata-phy",
753 struct device *dev = &pdev->dev; in brcm_sata_phy_probe()
754 struct device_node *dn = dev->of_node; in brcm_sata_phy_probe()
761 return -ENODEV; in brcm_sata_phy_probe()
765 return -ENOMEM; in brcm_sata_phy_probe()
767 priv->dev = dev; in brcm_sata_phy_probe()
769 priv->phy_base = devm_platform_ioremap_resource_byname(pdev, "phy"); in brcm_sata_phy_probe()
770 if (IS_ERR(priv->phy_base)) in brcm_sata_phy_probe()
771 return PTR_ERR(priv->phy_base); in brcm_sata_phy_probe()
775 priv->version = (uintptr_t)of_id->data; in brcm_sata_phy_probe()
777 priv->version = BRCM_SATA_PHY_STB_28NM; in brcm_sata_phy_probe()
779 if (priv->version == BRCM_SATA_PHY_IPROC_NS2) { in brcm_sata_phy_probe()
780 priv->ctrl_base = devm_platform_ioremap_resource_byname(pdev, "phy-ctrl"); in brcm_sata_phy_probe()
781 if (IS_ERR(priv->ctrl_base)) in brcm_sata_phy_probe()
782 return PTR_ERR(priv->ctrl_base); in brcm_sata_phy_probe()
792 return -EINVAL; in brcm_sata_phy_probe()
797 return -EINVAL; in brcm_sata_phy_probe()
799 if (priv->phys[id].phy) { in brcm_sata_phy_probe()
801 return -EINVAL; in brcm_sata_phy_probe()
804 port = &priv->phys[id]; in brcm_sata_phy_probe()
805 port->portnum = id; in brcm_sata_phy_probe()
806 port->phy_priv = priv; in brcm_sata_phy_probe()
807 port->phy = devm_phy_create(dev, child, &phy_ops); in brcm_sata_phy_probe()
808 port->rxaeq_mode = RXAEQ_MODE_OFF; in brcm_sata_phy_probe()
809 if (!of_property_read_string(child, "brcm,rxaeq-mode", in brcm_sata_phy_probe()
811 port->rxaeq_mode = rxaeq_to_val(rxaeq_mode); in brcm_sata_phy_probe()
812 if (port->rxaeq_mode == RXAEQ_MODE_MANUAL) in brcm_sata_phy_probe()
813 of_property_read_u32(child, "brcm,rxaeq-value", in brcm_sata_phy_probe()
814 &port->rxaeq_val); in brcm_sata_phy_probe()
816 of_property_read_u32(child, "brcm,tx-amplitude-millivolt", in brcm_sata_phy_probe()
817 &port->tx_amplitude_val); in brcm_sata_phy_probe()
819 port->ssc_en = of_property_read_bool(child, "brcm,enable-ssc"); in brcm_sata_phy_probe()
820 if (IS_ERR(port->phy)) { in brcm_sata_phy_probe()
822 return PTR_ERR(port->phy); in brcm_sata_phy_probe()
825 phy_set_drvdata(port->phy, port); in brcm_sata_phy_probe()
844 .name = "brcm-sata-phy",
853 MODULE_ALIAS("platform:phy-brcm-sata");