Commit a64def41 authored by Lendacky, Thomas's avatar Lendacky, Thomas Committed by David S. Miller

amd-xgbe: Prepare for introduction of clause 37 autoneg

Prepare for the future introduction of clause 37 auto-negotiation by
updating the current auto-negotiation related functions to identify
them as clause 73 functions. Move interrupt enablement to the
enable/disable auto-negotiation functions. Update what will be common
routines to check for the current type of AN and process accordingly.
Signed-off-by: default avatarTom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e57f7a3f
...@@ -1052,6 +1052,11 @@ ...@@ -1052,6 +1052,11 @@
#endif #endif
/* MDIO mask values */ /* MDIO mask values */
#define XGBE_AN_CL73_INT_CMPLT BIT(0)
#define XGBE_AN_CL73_INC_LINK BIT(1)
#define XGBE_AN_CL73_PG_RCV BIT(2)
#define XGBE_AN_CL73_INT_MASK 0x07
#define XGBE_XNP_MCF_NULL_MESSAGE 0x001 #define XGBE_XNP_MCF_NULL_MESSAGE 0x001
#define XGBE_XNP_ACK_PROCESSED BIT(12) #define XGBE_XNP_ACK_PROCESSED BIT(12)
#define XGBE_XNP_MP_FORMATTED BIT(13) #define XGBE_XNP_MP_FORMATTED BIT(13)
......
This diff is collapsed.
...@@ -295,6 +295,11 @@ static enum xgbe_mode xgbe_phy_an_outcome(struct xgbe_prv_data *pdata) ...@@ -295,6 +295,11 @@ static enum xgbe_mode xgbe_phy_an_outcome(struct xgbe_prv_data *pdata)
return mode; return mode;
} }
static enum xgbe_an_mode xgbe_phy_an_mode(struct xgbe_prv_data *pdata)
{
return XGBE_AN_MODE_CL73;
}
static void xgbe_phy_pcs_power_cycle(struct xgbe_prv_data *pdata) static void xgbe_phy_pcs_power_cycle(struct xgbe_prv_data *pdata)
{ {
unsigned int reg; unsigned int reg;
...@@ -814,6 +819,8 @@ void xgbe_init_function_ptrs_phy_v1(struct xgbe_phy_if *phy_if) ...@@ -814,6 +819,8 @@ void xgbe_init_function_ptrs_phy_v1(struct xgbe_phy_if *phy_if)
phy_impl->switch_mode = xgbe_phy_switch_mode; phy_impl->switch_mode = xgbe_phy_switch_mode;
phy_impl->cur_mode = xgbe_phy_cur_mode; phy_impl->cur_mode = xgbe_phy_cur_mode;
phy_impl->an_mode = xgbe_phy_an_mode;
phy_impl->an_outcome = xgbe_phy_an_outcome; phy_impl->an_outcome = xgbe_phy_an_outcome;
phy_impl->kr_training_pre = xgbe_phy_kr_training_pre; phy_impl->kr_training_pre = xgbe_phy_kr_training_pre;
......
...@@ -263,11 +263,6 @@ ...@@ -263,11 +263,6 @@
#define XGBE_AN_MS_TIMEOUT 500 #define XGBE_AN_MS_TIMEOUT 500
#define XGBE_LINK_TIMEOUT 10 #define XGBE_LINK_TIMEOUT 10
#define XGBE_AN_INT_CMPLT 0x01
#define XGBE_AN_INC_LINK 0x02
#define XGBE_AN_PG_RCV 0x04
#define XGBE_AN_INT_MASK 0x07
struct xgbe_prv_data; struct xgbe_prv_data;
struct xgbe_packet_data { struct xgbe_packet_data {
...@@ -470,6 +465,11 @@ enum xgbe_speed { ...@@ -470,6 +465,11 @@ enum xgbe_speed {
XGBE_SPEEDS, XGBE_SPEEDS,
}; };
enum xgbe_an_mode {
XGBE_AN_MODE_CL73 = 0,
XGBE_AN_MODE_NONE,
};
enum xgbe_an { enum xgbe_an {
XGBE_AN_READY = 0, XGBE_AN_READY = 0,
XGBE_AN_PAGE_RECEIVED, XGBE_AN_PAGE_RECEIVED,
...@@ -699,6 +699,9 @@ struct xgbe_phy_impl_if { ...@@ -699,6 +699,9 @@ struct xgbe_phy_impl_if {
/* Retrieve current mode */ /* Retrieve current mode */
enum xgbe_mode (*cur_mode)(struct xgbe_prv_data *); enum xgbe_mode (*cur_mode)(struct xgbe_prv_data *);
/* Retrieve current auto-negotiation mode */
enum xgbe_an_mode (*an_mode)(struct xgbe_prv_data *);
/* Process results of auto-negotiation */ /* Process results of auto-negotiation */
enum xgbe_mode (*an_outcome)(struct xgbe_prv_data *); enum xgbe_mode (*an_outcome)(struct xgbe_prv_data *);
...@@ -968,6 +971,7 @@ struct xgbe_prv_data { ...@@ -968,6 +971,7 @@ struct xgbe_prv_data {
unsigned int parallel_detect; unsigned int parallel_detect;
unsigned int fec_ability; unsigned int fec_ability;
unsigned long an_start; unsigned long an_start;
enum xgbe_an_mode an_mode;
unsigned int lpm_ctrl; /* CTRL1 for resume */ unsigned int lpm_ctrl; /* CTRL1 for resume */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment