Skip to content

Commit 1bf40ad

Browse files
tlendackydavem330
authored andcommitted
amd-xgbe: Add support for clause 37 auto-negotiation
Add support to be able to use clause 37 auto-negotiation. Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent a64def4 commit 1bf40ad

File tree

3 files changed

+286
-8
lines changed

3 files changed

+286
-8
lines changed

drivers/net/ethernet/amd/xgbe/xgbe-common.h

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,6 +1027,10 @@
10271027
#define MDIO_PMA_10GBR_FECCTRL 0x00ab
10281028
#endif
10291029

1030+
#ifndef MDIO_PCS_DIG_CTRL
1031+
#define MDIO_PCS_DIG_CTRL 0x8000
1032+
#endif
1033+
10301034
#ifndef MDIO_AN_XNP
10311035
#define MDIO_AN_XNP 0x0016
10321036
#endif
@@ -1047,10 +1051,34 @@
10471051
#define MDIO_AN_INT 0x8002
10481052
#endif
10491053

1054+
#ifndef MDIO_VEND2_AN_ADVERTISE
1055+
#define MDIO_VEND2_AN_ADVERTISE 0x0004
1056+
#endif
1057+
1058+
#ifndef MDIO_VEND2_AN_LP_ABILITY
1059+
#define MDIO_VEND2_AN_LP_ABILITY 0x0005
1060+
#endif
1061+
1062+
#ifndef MDIO_VEND2_AN_CTRL
1063+
#define MDIO_VEND2_AN_CTRL 0x8001
1064+
#endif
1065+
1066+
#ifndef MDIO_VEND2_AN_STAT
1067+
#define MDIO_VEND2_AN_STAT 0x8002
1068+
#endif
1069+
10501070
#ifndef MDIO_CTRL1_SPEED1G
10511071
#define MDIO_CTRL1_SPEED1G (MDIO_CTRL1_SPEED10G & ~BMCR_SPEED100)
10521072
#endif
10531073

1074+
#ifndef MDIO_VEND2_CTRL1_AN_ENABLE
1075+
#define MDIO_VEND2_CTRL1_AN_ENABLE BIT(12)
1076+
#endif
1077+
1078+
#ifndef MDIO_VEND2_CTRL1_AN_RESTART
1079+
#define MDIO_VEND2_CTRL1_AN_RESTART BIT(9)
1080+
#endif
1081+
10541082
/* MDIO mask values */
10551083
#define XGBE_AN_CL73_INT_CMPLT BIT(0)
10561084
#define XGBE_AN_CL73_INC_LINK BIT(1)
@@ -1065,6 +1093,19 @@
10651093
#define XGBE_KR_TRAINING_START BIT(0)
10661094
#define XGBE_KR_TRAINING_ENABLE BIT(1)
10671095

1096+
#define XGBE_PCS_CL37_BP BIT(12)
1097+
1098+
#define XGBE_AN_CL37_INT_CMPLT BIT(0)
1099+
#define XGBE_AN_CL37_INT_MASK 0x01
1100+
1101+
#define XGBE_AN_CL37_HD_MASK 0x40
1102+
#define XGBE_AN_CL37_FD_MASK 0x20
1103+
1104+
#define XGBE_AN_CL37_PCS_MODE_MASK 0x06
1105+
#define XGBE_AN_CL37_PCS_MODE_BASEX 0x00
1106+
#define XGBE_AN_CL37_PCS_MODE_SGMII 0x04
1107+
#define XGBE_AN_CL37_TX_CONFIG_MASK 0x08
1108+
10681109
/* Bit setting and getting macros
10691110
* The get macro will extract the current bit field value from within
10701111
* the variable

0 commit comments

Comments
 (0)