hc
2023-11-06 e3e12f52b214121840b44c91de5b3e5af5d3eb84
kernel/drivers/net/phy/motorcomm.c
....@@ -573,7 +573,7 @@
573573
574574 static int yt8531_config_init(struct phy_device *phydev)
575575 {
576
- int ret = 0;
576
+ int ret = 0, val;
577577
578578 #if (YTPHY8531A_XTAL_INIT)
579579 ret = yt8531a_xtal_init(phydev);
....@@ -591,10 +591,17 @@
591591 return ret;
592592
593593 /* RXC, PHY_CLK_OUT and RXData Drive strength:
594
- * Drive strength of RXC = 4, PHY_CLK_OUT = 3, RXD0 = 4 (default)
595
- * If the io voltage is 3.3v, PHY_CLK_OUT = 2, set 0xa010 = 0x9acf
594
+ * Drive strength of RXC = 6, PHY_CLK_OUT = 3, RXD0 = 4 (default 1.8v)
595
+ * If the io voltage is 3.3v, PHY_CLK_OUT = 2, set 0xa010 = 0xdacf
596596 */
597
- ret = ytphy_write_ext(phydev, 0xa010, 0x9bcf);
597
+ ret = ytphy_write_ext(phydev, 0xa010, 0xdbcf);
598
+ if (ret < 0)
599
+ return ret;
600
+
601
+ /* Change 100M default BGS voltage from 0x294c to 0x274c */
602
+ val = ytphy_read_ext(phydev, 0x57);
603
+ val = (val & ~(0xf << 8)) | (7 << 8);
604
+ ret = ytphy_write_ext(phydev, 0x57, val);
598605 if (ret < 0)
599606 return ret;
600607