Lines Matching refs:usb3
68 static int bcm_ns_usb3_mdio_phy_write(struct bcm_ns_usb3 *usb3, u16 reg,
71 static int bcm_ns_usb3_phy_init_ns_bx(struct bcm_ns_usb3 *usb3) in bcm_ns_usb3_phy_init_ns_bx() argument
76 err = bcm_ns_usb3_mdio_phy_write(usb3, BCM_NS_USB3_PHY_BASE_ADDR_REG, in bcm_ns_usb3_phy_init_ns_bx()
82 bcm_ns_usb3_mdio_phy_write(usb3, BCM_NS_USB3_PLL_CONTROL, 0x1000); in bcm_ns_usb3_phy_init_ns_bx()
85 bcm_ns_usb3_mdio_phy_write(usb3, BCM_NS_USB3_PLLA_CONTROL0, 0x6400); in bcm_ns_usb3_phy_init_ns_bx()
88 bcm_ns_usb3_mdio_phy_write(usb3, BCM_NS_USB3_PLLA_CONTROL1, 0xc000); in bcm_ns_usb3_phy_init_ns_bx()
91 bcm_ns_usb3_mdio_phy_write(usb3, BCM_NS_USB3_PLLA_CONTROL1, 0x8000); in bcm_ns_usb3_phy_init_ns_bx()
94 writel(0, usb3->dmp + BCMA_RESET_CTL); in bcm_ns_usb3_phy_init_ns_bx()
97 bcm_ns_usb3_mdio_phy_write(usb3, BCM_NS_USB3_PLL_CONTROL, 0x9000); in bcm_ns_usb3_phy_init_ns_bx()
100 bcm_ns_usb3_mdio_phy_write(usb3, BCM_NS_USB3_PHY_BASE_ADDR_REG, in bcm_ns_usb3_phy_init_ns_bx()
104 bcm_ns_usb3_mdio_phy_write(usb3, BCM_NS_USB3_LFPS_CMP, 0xf30d); in bcm_ns_usb3_phy_init_ns_bx()
107 bcm_ns_usb3_mdio_phy_write(usb3, BCM_NS_USB3_LFPS_DEGLITCH, 0x6302); in bcm_ns_usb3_phy_init_ns_bx()
110 bcm_ns_usb3_mdio_phy_write(usb3, BCM_NS_USB3_PHY_BASE_ADDR_REG, in bcm_ns_usb3_phy_init_ns_bx()
114 bcm_ns_usb3_mdio_phy_write(usb3, BCM_NS_USB3_TX_PMD_CONTROL1, 0x1003); in bcm_ns_usb3_phy_init_ns_bx()
119 static int bcm_ns_usb3_phy_init_ns_ax(struct bcm_ns_usb3 *usb3) in bcm_ns_usb3_phy_init_ns_ax() argument
124 err = bcm_ns_usb3_mdio_phy_write(usb3, BCM_NS_USB3_PHY_BASE_ADDR_REG, in bcm_ns_usb3_phy_init_ns_ax()
129 bcm_ns_usb3_mdio_phy_write(usb3, BCM_NS_USB3_PLLA_CONTROL0, 0x6400); in bcm_ns_usb3_phy_init_ns_ax()
131 bcm_ns_usb3_mdio_phy_write(usb3, BCM_NS_USB3_PHY_BASE_ADDR_REG, 0x80e0); in bcm_ns_usb3_phy_init_ns_ax()
133 bcm_ns_usb3_mdio_phy_write(usb3, 0x02, 0x009c); in bcm_ns_usb3_phy_init_ns_ax()
136 bcm_ns_usb3_mdio_phy_write(usb3, BCM_NS_USB3_PHY_BASE_ADDR_REG, in bcm_ns_usb3_phy_init_ns_ax()
139 bcm_ns_usb3_mdio_phy_write(usb3, 0x02, 0x21d3); in bcm_ns_usb3_phy_init_ns_ax()
141 bcm_ns_usb3_mdio_phy_write(usb3, BCM_NS_USB3_TX_PMD_CONTROL1, 0x1003); in bcm_ns_usb3_phy_init_ns_ax()
144 writel(0, usb3->dmp + BCMA_RESET_CTL); in bcm_ns_usb3_phy_init_ns_ax()
151 struct bcm_ns_usb3 *usb3 = phy_get_drvdata(phy); in bcm_ns_usb3_phy_init() local
155 writel(BCMA_RESET_CTL_RESET, usb3->dmp + BCMA_RESET_CTL); in bcm_ns_usb3_phy_init()
157 switch (usb3->family) { in bcm_ns_usb3_phy_init()
159 err = bcm_ns_usb3_phy_init_ns_ax(usb3); in bcm_ns_usb3_phy_init()
162 err = bcm_ns_usb3_phy_init_ns_bx(usb3); in bcm_ns_usb3_phy_init()
181 static int bcm_ns_usb3_mdio_phy_write(struct bcm_ns_usb3 *usb3, u16 reg, in bcm_ns_usb3_mdio_phy_write() argument
184 struct mdio_device *mdiodev = usb3->mdiodev; in bcm_ns_usb3_mdio_phy_write()
195 struct bcm_ns_usb3 *usb3; in bcm_ns_usb3_mdio_probe() local
199 usb3 = devm_kzalloc(dev, sizeof(*usb3), GFP_KERNEL); in bcm_ns_usb3_mdio_probe()
200 if (!usb3) in bcm_ns_usb3_mdio_probe()
203 usb3->dev = dev; in bcm_ns_usb3_mdio_probe()
204 usb3->mdiodev = mdiodev; in bcm_ns_usb3_mdio_probe()
209 usb3->family = (enum bcm_ns_family)of_id->data; in bcm_ns_usb3_mdio_probe()
217 usb3->dmp = devm_ioremap_resource(dev, &res); in bcm_ns_usb3_mdio_probe()
218 if (IS_ERR(usb3->dmp)) in bcm_ns_usb3_mdio_probe()
219 return PTR_ERR(usb3->dmp); in bcm_ns_usb3_mdio_probe()
221 usb3->phy = devm_phy_create(dev, NULL, &ops); in bcm_ns_usb3_mdio_probe()
222 if (IS_ERR(usb3->phy)) { in bcm_ns_usb3_mdio_probe()
224 return PTR_ERR(usb3->phy); in bcm_ns_usb3_mdio_probe()
227 phy_set_drvdata(usb3->phy, usb3); in bcm_ns_usb3_mdio_probe()