Skip to content

Commit 8385b1f

Browse files
fidomaxdavem330
authored andcommitted
net: phy: marvell: enable downshift by default
A number of PHYs support the PHY tunable to set and get downshift. However, only 88E1116R enables downshift by default. Extend this default enabled to all the PHYs that support the downshift tunable. Signed-off-by: Maxim Kochetkov <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c5fab80 commit 8385b1f

File tree

1 file changed

+50
-12
lines changed

1 file changed

+50
-12
lines changed

drivers/net/phy/marvell.c

Lines changed: 50 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,6 +1088,38 @@ static int m88e1011_set_tunable(struct phy_device *phydev,
10881088
}
10891089
}
10901090

1091+
static int m88e1112_config_init(struct phy_device *phydev)
1092+
{
1093+
int err;
1094+
1095+
err = m88e1011_set_downshift(phydev, 3);
1096+
if (err < 0)
1097+
return err;
1098+
1099+
return m88e1111_config_init(phydev);
1100+
}
1101+
1102+
static int m88e1111gbe_config_init(struct phy_device *phydev)
1103+
{
1104+
int err;
1105+
1106+
err = m88e1111_set_downshift(phydev, 3);
1107+
if (err < 0)
1108+
return err;
1109+
1110+
return m88e1111_config_init(phydev);
1111+
}
1112+
1113+
static int marvell_1011gbe_config_init(struct phy_device *phydev)
1114+
{
1115+
int err;
1116+
1117+
err = m88e1011_set_downshift(phydev, 3);
1118+
if (err < 0)
1119+
return err;
1120+
1121+
return marvell_config_init(phydev);
1122+
}
10911123
static int m88e1116r_config_init(struct phy_device *phydev)
10921124
{
10931125
int err;
@@ -1168,6 +1200,9 @@ static int m88e1510_config_init(struct phy_device *phydev)
11681200
if (err < 0)
11691201
return err;
11701202
}
1203+
err = m88e1011_set_downshift(phydev, 3);
1204+
if (err < 0)
1205+
return err;
11711206

11721207
return m88e1318_config_init(phydev);
11731208
}
@@ -1320,6 +1355,9 @@ static int m88e1145_config_init(struct phy_device *phydev)
13201355
if (err < 0)
13211356
return err;
13221357
}
1358+
err = m88e1111_set_downshift(phydev, 3);
1359+
if (err < 0)
1360+
return err;
13231361

13241362
err = marvell_of_reg_init(phydev);
13251363
if (err < 0)
@@ -2698,7 +2736,7 @@ static struct phy_driver marvell_drivers[] = {
26982736
.name = "Marvell 88E1112",
26992737
/* PHY_GBIT_FEATURES */
27002738
.probe = marvell_probe,
2701-
.config_init = m88e1111_config_init,
2739+
.config_init = m88e1112_config_init,
27022740
.config_aneg = marvell_config_aneg,
27032741
.config_intr = marvell_config_intr,
27042742
.handle_interrupt = marvell_handle_interrupt,
@@ -2718,7 +2756,7 @@ static struct phy_driver marvell_drivers[] = {
27182756
.name = "Marvell 88E1111",
27192757
/* PHY_GBIT_FEATURES */
27202758
.probe = marvell_probe,
2721-
.config_init = m88e1111_config_init,
2759+
.config_init = m88e1111gbe_config_init,
27222760
.config_aneg = m88e1111_config_aneg,
27232761
.read_status = marvell_read_status,
27242762
.config_intr = marvell_config_intr,
@@ -2739,7 +2777,7 @@ static struct phy_driver marvell_drivers[] = {
27392777
.name = "Marvell 88E1111 (Finisar)",
27402778
/* PHY_GBIT_FEATURES */
27412779
.probe = marvell_probe,
2742-
.config_init = m88e1111_config_init,
2780+
.config_init = m88e1111gbe_config_init,
27432781
.config_aneg = m88e1111_config_aneg,
27442782
.read_status = marvell_read_status,
27452783
.config_intr = marvell_config_intr,
@@ -2779,7 +2817,7 @@ static struct phy_driver marvell_drivers[] = {
27792817
.driver_data = DEF_MARVELL_HWMON_OPS(m88e1121_hwmon_ops),
27802818
/* PHY_GBIT_FEATURES */
27812819
.probe = marvell_probe,
2782-
.config_init = marvell_config_init,
2820+
.config_init = marvell_1011gbe_config_init,
27832821
.config_aneg = m88e1121_config_aneg,
27842822
.read_status = marvell_read_status,
27852823
.config_intr = marvell_config_intr,
@@ -2859,7 +2897,7 @@ static struct phy_driver marvell_drivers[] = {
28592897
.name = "Marvell 88E1240",
28602898
/* PHY_GBIT_FEATURES */
28612899
.probe = marvell_probe,
2862-
.config_init = m88e1111_config_init,
2900+
.config_init = m88e1112_config_init,
28632901
.config_aneg = marvell_config_aneg,
28642902
.config_intr = marvell_config_intr,
28652903
.handle_interrupt = marvell_handle_interrupt,
@@ -2929,7 +2967,7 @@ static struct phy_driver marvell_drivers[] = {
29292967
/* PHY_GBIT_FEATURES */
29302968
.flags = PHY_POLL_CABLE_TEST,
29312969
.probe = marvell_probe,
2932-
.config_init = marvell_config_init,
2970+
.config_init = marvell_1011gbe_config_init,
29332971
.config_aneg = m88e1510_config_aneg,
29342972
.read_status = marvell_read_status,
29352973
.config_intr = marvell_config_intr,
@@ -2955,7 +2993,7 @@ static struct phy_driver marvell_drivers[] = {
29552993
.probe = marvell_probe,
29562994
/* PHY_GBIT_FEATURES */
29572995
.flags = PHY_POLL_CABLE_TEST,
2958-
.config_init = marvell_config_init,
2996+
.config_init = marvell_1011gbe_config_init,
29592997
.config_aneg = m88e1510_config_aneg,
29602998
.read_status = marvell_read_status,
29612999
.config_intr = marvell_config_intr,
@@ -3000,7 +3038,7 @@ static struct phy_driver marvell_drivers[] = {
30003038
/* PHY_GBIT_FEATURES */
30013039
.flags = PHY_POLL_CABLE_TEST,
30023040
.probe = marvell_probe,
3003-
.config_init = marvell_config_init,
3041+
.config_init = marvell_1011gbe_config_init,
30043042
.config_aneg = m88e6390_config_aneg,
30053043
.read_status = marvell_read_status,
30063044
.config_intr = marvell_config_intr,
@@ -3026,7 +3064,7 @@ static struct phy_driver marvell_drivers[] = {
30263064
/* PHY_GBIT_FEATURES */
30273065
.flags = PHY_POLL_CABLE_TEST,
30283066
.probe = marvell_probe,
3029-
.config_init = marvell_config_init,
3067+
.config_init = marvell_1011gbe_config_init,
30303068
.config_aneg = m88e6390_config_aneg,
30313069
.read_status = marvell_read_status,
30323070
.config_intr = marvell_config_intr,
@@ -3052,7 +3090,7 @@ static struct phy_driver marvell_drivers[] = {
30523090
/* PHY_GBIT_FEATURES */
30533091
.flags = PHY_POLL_CABLE_TEST,
30543092
.probe = marvell_probe,
3055-
.config_init = marvell_config_init,
3093+
.config_init = marvell_1011gbe_config_init,
30563094
.config_aneg = m88e1510_config_aneg,
30573095
.read_status = marvell_read_status,
30583096
.config_intr = marvell_config_intr,
@@ -3077,7 +3115,7 @@ static struct phy_driver marvell_drivers[] = {
30773115
.driver_data = DEF_MARVELL_HWMON_OPS(m88e1510_hwmon_ops),
30783116
.probe = marvell_probe,
30793117
/* PHY_GBIT_FEATURES */
3080-
.config_init = marvell_config_init,
3118+
.config_init = marvell_1011gbe_config_init,
30813119
.config_aneg = m88e1510_config_aneg,
30823120
.read_status = marvell_read_status,
30833121
.config_intr = marvell_config_intr,
@@ -3099,7 +3137,7 @@ static struct phy_driver marvell_drivers[] = {
30993137
.driver_data = DEF_MARVELL_HWMON_OPS(m88e1510_hwmon_ops),
31003138
.probe = marvell_probe,
31013139
.features = PHY_GBIT_FIBRE_FEATURES,
3102-
.config_init = marvell_config_init,
3140+
.config_init = marvell_1011gbe_config_init,
31033141
.config_aneg = m88e1510_config_aneg,
31043142
.read_status = marvell_read_status,
31053143
.config_intr = marvell_config_intr,

0 commit comments

Comments
 (0)