net/axgbe: fix mdio access for non-zero ports and CL45 PHYs
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH v3 1/25 net/axgbe: fix mdio access for non-zero ports and CL45 PHYs
From: Venkat Kumar Ande <[email protected]>
The XGBE supports performing MDIO operations using an MDIO command request. The driver mistakenly uses the mdio port address as the MDIO command request device address instead of the MDIO command request port address. Additionally, the driver does not properly check for and create a clause 45 MDIO command
Without the fix PHY device is not detected and can't be usable.
Check the supplied MDIO register to determine if the request is a clause 45 operation (MII_ADDR_C45). For a clause 45 operation, extract device address and register number from the supplied MDIO register and use them to set the MDIO command request device address and register number fields. For a clause 22 operation, the MDIO request device address is set to zero and the MDIO command request register number is set to the supplied MDIO register. In either case, the supplied MDIO port address is used as the MDIO command request port address.
--- drivers/net/axgbe/axgbe_common.h | 2 -- drivers/net/axgbe/axgbe_dev.c | 22 ++++++++++++++++------ 2 files changed, 16 insertions(+), 8 deletions(-)
drivers/net/axgbe/axgbe_common.h +0 -2
@@ -407,8 +407,6 @@#define MAC_MDIOSCAR_PA_WIDTH 5#define MAC_MDIOSCAR_RA_INDEX 0#define MAC_MDIOSCAR_RA_WIDTH 16 -#define MAC_MDIOSCAR_REG_INDEX 0 -#define MAC_MDIOSCAR_REG_WIDTH 21#define MAC_MDIOSCCDR_BUSY_INDEX 22#define MAC_MDIOSCCDR_BUSY_WIDTH 1#define MAC_MDIOSCCDR_CMD_INDEX 16
drivers/net/axgbe/axgbe_dev.c +16 -6
@@ -63,15 +63,27 @@ static int mdio_complete(struct axgbe_port *pdata)return 0 ; } +static unsigned int axgbe_create_mdio_sca (int port,int reg) +{ +unsigned int mdio_sca, da; + + da = (reg &MII_ADDR_C45 ) ? reg >>16 :0 ; + + mdio_sca =0 ; +AXGMAC_SET_BITS (mdio_sca,MAC_MDIOSCAR ,RA , reg); +AXGMAC_SET_BITS (mdio_sca,MAC_MDIOSCAR ,PA , port); +AXGMAC_SET_BITS (mdio_sca,MAC_MDIOSCAR ,DA , da); + +return mdio_sca; +} +static int axgbe_write_ext_mii_regs (struct axgbe_port *pdata,int addr,int reg,u16 val) {unsigned int mdio_sca, mdio_sccd;uint64_t timeout; - mdio_sca =0 ; -AXGMAC_SET_BITS (mdio_sca,MAC_MDIOSCAR ,REG , reg); -AXGMAC_SET_BITS (mdio_sca,MAC_MDIOSCAR ,DA , addr); + mdio_sca =axgbe_create_mdio_sca (addr, reg);AXGMAC_IOWRITE (pdata,MAC_MDIOSCAR , mdio_sca); mdio_sccd =0 ;
@@ -97,9 +109,7 @@ static int axgbe_read_ext_mii_regs(struct axgbe_port *pdata, int addr,unsigned int mdio_sca, mdio_sccd;uint64_t timeout; - mdio_sca =0 ; -AXGMAC_SET_BITS (mdio_sca,MAC_MDIOSCAR ,REG , reg); -AXGMAC_SET_BITS (mdio_sca,MAC_MDIOSCAR ,DA , addr); + mdio_sca =axgbe_create_mdio_sca (addr, reg);AXGMAC_IOWRITE (pdata,MAC_MDIOSCAR , mdio_sca); mdio_sccd =0 ;
Signature · 1 line
2.34.1
PATCH v3 2/25 net/axgbe: reset link when the link never comes back
From: Venkat Kumar Ande <[email protected]>
Normally, auto negotiation and reconnect should be automatically done by the hardware. But there seems to be an issue where auto negotiation has to be restarted manually. This happens because of link training and so even though still connected to the partner the link never "comes back". This needs an auto-negotiation restart.
Without the fix the user will not see the link up status
--- drivers/net/axgbe/axgbe_mdio.c | 2 +- drivers/net/axgbe/axgbe_phy_impl.c | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-)
drivers/net/axgbe/axgbe_mdio.c +1 -1
@@ -1051,7 +1051,7 @@ static void axgbe_phy_status(struct axgbe_port *pdata) &an_restart);if (an_restart) {axgbe_phy_config_aneg (pdata); -return ; + goto adjust_link; }if (pdata->phy.link) {
drivers/net/axgbe/axgbe_phy_impl.c +7 -0
@@ -1697,6 +1697,13 @@ static int axgbe_phy_link_status(struct axgbe_port *pdata, int *an_restart)if (reg &MDIO_STAT1_LSTATUS )return 1 ; +if (pdata->phy.autoneg ==AUTONEG_ENABLE && + phy_data->port_mode ==AXGBE_PORT_MODE_BACKPLANE ) { +if (rte_bit_relaxed_get32 (AXGBE_LINK_INIT , &pdata->dev_state)) { + *an_restart =1 ; + } + } +/* No link, attempt a receiver reset cycle */ if (phy_data->rrc_count++) { phy_data->rrc_count =0 ;
Signature · 1 line
2.34.1
PATCH v3 3/25 net/axgbe: fix fluctuations for 1G BELFUSE SFP
In reply to Venkat Kumar AndeFrom: Venkat Kumar Ande <[email protected]>
Frequent link up/down events can happen when a Bel Fuse SFP part is connected to the amd-xgbe device. Try to avoid the frequent link issues by resetting the PHY as documented in Bel Fuse SFP datasheets.
Without the fix user will see continuous port link up and down.
--- drivers/net/axgbe/axgbe_phy_impl.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/axgbe/axgbe_phy_impl.c +3 -0
@@ -578,6 +578,9 @@ static bool axgbe_phy_belfuse_parse_quirks(struct axgbe_port *pdata) AXGBE_BEL_FUSE_VENDOR, strlen(AXGBE_BEL_FUSE_VENDOR)))return false; +/* Reset PHY - wait for self-clearing reset bit to clear */ + pdata->phy_if.phy_impl.reset (pdata); +if (!memcmp (&sfp_eeprom->base[AXGBE_SFP_BASE_VENDOR_PN ],AXGBE_BEL_FUSE_PARTNO ,strlen (AXGBE_BEL_FUSE_PARTNO ))) { phy_data->sfp_base =AXGBE_SFP_BASE_1000_SX ;
Signature · 1 line
2.34.1
PATCH v3 4/25 net/axgbe: update DMA coherency values
In reply to Venkat Kumar AndeFrom: Venkat Kumar Ande <[email protected]>
Based on the IOMMU configuration, the current cache control settings can result in possible coherency issues. The hardware team has recommended new settings for the PCI device path to eliminate the issue.
Without the fix the user will get incorrect data in TSO functionality
--- drivers/net/axgbe/axgbe_dev.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-)
drivers/net/axgbe/axgbe_dev.c +9 -11
@@ -647,23 +647,21 @@ static void axgbe_config_dma_cache(struct axgbe_port *pdata)unsigned int arcache, awcache, arwcache; arcache =0 ; -AXGMAC_SET_BITS (arcache,DMA_AXIARCR ,DRC ,0x3 ); +AXGMAC_SET_BITS (arcache,DMA_AXIARCR ,DRC ,0xf ); +AXGMAC_SET_BITS (arcache,DMA_AXIARCR ,TEC ,0xf ); +AXGMAC_SET_BITS (arcache,DMA_AXIARCR ,THC ,0xf );AXGMAC_IOWRITE (pdata,DMA_AXIARCR , arcache); awcache =0 ; -AXGMAC_SET_BITS (awcache,DMA_AXIAWCR ,DWC ,0x3 ); -AXGMAC_SET_BITS (awcache,DMA_AXIAWCR ,RPC ,0x3 ); -AXGMAC_SET_BITS (awcache,DMA_AXIAWCR ,RPD ,0x1 ); -AXGMAC_SET_BITS (awcache,DMA_AXIAWCR ,RHC ,0x3 ); -AXGMAC_SET_BITS (awcache,DMA_AXIAWCR ,RHD ,0x1 ); -AXGMAC_SET_BITS (awcache,DMA_AXIAWCR ,RDC ,0x3 ); -AXGMAC_SET_BITS (awcache,DMA_AXIAWCR ,RDD ,0x1 ); +AXGMAC_SET_BITS (awcache,DMA_AXIAWCR ,DWC ,0xf ); +AXGMAC_SET_BITS (awcache,DMA_AXIAWCR ,RPC ,0xf ); +AXGMAC_SET_BITS (awcache,DMA_AXIAWCR ,RHC ,0xf ); +AXGMAC_SET_BITS (awcache,DMA_AXIAWCR ,RDC ,0xf );AXGMAC_IOWRITE (pdata,DMA_AXIAWCR , awcache); arwcache =0 ; -AXGMAC_SET_BITS (arwcache,DMA_AXIAWRCR ,TDWD ,0x1 ); -AXGMAC_SET_BITS (arwcache,DMA_AXIAWRCR ,TDWC ,0x3 ); -AXGMAC_SET_BITS (arwcache,DMA_AXIAWRCR ,RDRC ,0x3 ); +AXGMAC_SET_BITS (arwcache,DMA_AXIAWRCR ,TDWC ,0xf ); +AXGMAC_SET_BITS (arwcache,DMA_AXIAWRCR ,RDRC ,0xf );AXGMAC_IOWRITE (pdata,DMA_AXIAWRCR , arwcache); }
Signature · 1 line
2.34.1
PATCH v3 5/25 net/axgbe: disable interrupts during device removal
In reply to Venkat Kumar AndeFrom: Venkat Kumar Ande <[email protected]>
Hardware interrupts are enabled during the init, however, they are not disabled during close.
Disable all hardware interrupts during close operation to avoid any issues.
--- drivers/net/axgbe/axgbe_ethdev.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/axgbe/axgbe_ethdev.c +5 -0
@@ -2411,12 +2411,14 @@ static int axgbe_dev_close(struct rte_eth_dev *eth_dev) {struct rte_pci_device *pci_dev; +struct axgbe_port *pdata;PMD_INIT_FUNC_TRACE ();if (rte_eal_process_type () !=RTE_PROC_PRIMARY )return 0 ; + pdata = eth_dev->data->dev_private; pci_dev =RTE_DEV_TO_PCI (eth_dev->device);axgbe_dev_clear_queues (eth_dev);
@@ -2426,6 +2428,9 @@ axgbe_dev_close(struct rte_eth_dev *eth_dev) axgbe_dev_interrupt_handler, (void *)eth_dev); +/* Disable all interrupts in the hardware */ +XP_IOWRITE (pdata,XP_INT_EN ,0x0 ); +return 0 ; }
Signature · 1 line
2.34.1
PATCH v3 6/25 net/axgbe: yellow carp devices do not need rrc
In reply to Venkat Kumar AndeFrom: Venkat Kumar Ande <[email protected]>
Link stability issues are noticed on Yellow carp platforms when Receiver Reset Cycle is issued. Since the CDR workaround is disabled on these platforms, the Receiver Reset Cycle is not needed.
So, avoid issuing rrc on Yellow carp platforms.
Without the fix the user will not get the link UP.
--- drivers/net/axgbe/axgbe_ethdev.c | 5 +++++ drivers/net/axgbe/axgbe_ethdev.h | 1 + drivers/net/axgbe/axgbe_phy_impl.c | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-)
drivers/net/axgbe/axgbe_ethdev.c +5 -0
@@ -208,6 +208,7 @@ static struct axgbe_version_data axgbe_v2a = { .ecc_support = 1, .i2c_support = 1, .an_cdr_workaround = 1, + .enable_rrc = 1, };static struct axgbe_version_data axgbe_v2b = {
@@ -220,6 +221,7 @@ static struct axgbe_version_data axgbe_v2b = { .ecc_support = 1, .i2c_support = 1, .an_cdr_workaround = 1, + .enable_rrc = 1, };static const struct rte_eth_desc_lim rx_desc_lim = {
@@ -2269,6 +2271,9 @@ eth_axgbe_dev_init(struct rte_eth_dev *eth_dev)/* Yellow Carp devices do not need cdr workaround */ pdata->vdata->an_cdr_workaround =0 ; + +/* Yellow Carp devices do not need rrc */ + pdata->vdata->enable_rrc =0 ; }else { unknown_cpu =1 ; }
drivers/net/axgbe/axgbe_ethdev.h +1 -0
@@ -463,6 +463,7 @@ struct axgbe_version_data {unsigned int ecc_support;unsigned int i2c_support;unsigned int an_cdr_workaround; +unsigned int enable_rrc; };struct axgbe_mmc_stats {
drivers/net/axgbe/axgbe_phy_impl.c +1 -1
@@ -1708,7 +1708,7 @@ static int axgbe_phy_link_status(struct axgbe_port *pdata, int *an_restart) }/* No link, attempt a receiver reset cycle */ -if (phy_data->rrc_count++) { +if (pdata->vdata->enable_rrc && phy_data->rrc_count++) { phy_data->rrc_count =0 ;axgbe_phy_rrc (pdata); }
Signature · 1 line
2.34.1
PATCH v3 7/25 net/axgbe: enable PLL control for fixed PHY modes only
In reply to Venkat Kumar AndeFrom: Venkat Kumar Ande <[email protected]>
PLL control setting(RRC) is needed only in fixed PHY configuration to fix the peer-peer issues. Without the PLL control setting, the link up takes longer time in a fixed phy configuration.
Without the fix the user will not get the link come UP.
Driver implements SW RRC for Autoneg On configuration, hence PLL control setting (RRC) is not needed for AN On configuration, and can be skipped.
Also, PLL re-initialization is not needed for PHY Power Off and RRC commands. Otherwise, they lead to mailbox errors. Added the changes accordingly.
--- drivers/net/axgbe/axgbe_phy_impl.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/net/axgbe/axgbe_phy_impl.c +7 -2
@@ -1228,6 +1228,10 @@ static void axgbe_phy_rx_reset(struct axgbe_port *pdata)static void axgbe_phy_pll_ctrl (struct axgbe_port *pdata,bool enable) { +/* PLL_CTRL feature needs to be enabled for fixed PHY modes (Non-Autoneg) only */ +if (pdata->phy.autoneg !=AUTONEG_DISABLE ) +return ; + XMDIO_WRITE_BITS(pdata, MDIO_MMD_PMAPMD, MDIO_VEND2_PMA_MISC_CTRL0, XGBE_PMA_PLL_CTRL_MASK, enable ? XGBE_PMA_PLL_CTRL_SET
@@ -1272,8 +1276,9 @@ static void axgbe_phy_perform_ratechange(struct axgbe_port *pdata,axgbe_phy_rx_reset (pdata); reenable_pll: -/* Re-enable the PLL control */ -axgbe_phy_pll_ctrl (pdata, true); +/* Enable PLL re-initialization, not needed for PHY Power Off and RRC cmds */ +if (cmd !=0 && cmd !=5 ) +axgbe_phy_pll_ctrl (pdata, true);PMD_DRV_LOG (NOTICE ,"firmware mailbox command did not complete\n" ); }
Signature · 1 line
2.34.1
PATCH v3 8/25 net/axgbe: fix the SFP codes check for DAC cables
In reply to Venkat Kumar AndeFrom: Venkat Kumar Ande <[email protected]>
The current AXGBE code assumes that offset 6 of EEPROM SFP DAC (passive) cables is NULL. However, some cables (the 5 meter and 7 meter Molex passive cables) have non-zero data at offset 6. Fix the logic by moving the passive cable check above the active checks, so as not to be improperly identified as an active cable. This will fix the issue for any passive cable that advertises 1000Base-CX in offset 6.
Without the fix the user will not get link UP for few DAC cables.
--- drivers/net/axgbe/axgbe_phy_impl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/axgbe/axgbe_phy_impl.c +4 -4
@@ -625,7 +625,10 @@ static void axgbe_phy_sfp_parse_eeprom(struct axgbe_port *pdata) }/* Determine the type of SFP */ -if (sfp_base[AXGBE_SFP_BASE_10GBE_CC ] &AXGBE_SFP_BASE_10GBE_CC_SR ) +if (phy_data->sfp_cable ==AXGBE_SFP_CABLE_PASSIVE && +axgbe_phy_sfp_bit_rate (sfp_eeprom,AXGBE_SFP_SPEED_10000 )) + phy_data->sfp_base =AXGBE_SFP_BASE_10000_CR ; +else if (sfp_base[AXGBE_SFP_BASE_10GBE_CC ] &AXGBE_SFP_BASE_10GBE_CC_SR ) phy_data->sfp_base =AXGBE_SFP_BASE_10000_SR ;else if (sfp_base[AXGBE_SFP_BASE_10GBE_CC ] &AXGBE_SFP_BASE_10GBE_CC_LR ) phy_data->sfp_base =AXGBE_SFP_BASE_10000_LR ;
@@ -642,9 +645,6 @@ static void axgbe_phy_sfp_parse_eeprom(struct axgbe_port *pdata) phy_data->sfp_base =AXGBE_SFP_BASE_1000_CX ; else if (sfp_base[AXGBE_SFP_BASE_1GBE_CC] & AXGBE_SFP_BASE_1GBE_CC_T) phy_data->sfp_base = AXGBE_SFP_BASE_1000_T; - else if ((phy_data->sfp_cable == AXGBE_SFP_CABLE_PASSIVE) && - axgbe_phy_sfp_bit_rate(sfp_eeprom, AXGBE_SFP_SPEED_10000)) - phy_data->sfp_base = AXGBE_SFP_BASE_10000_CR;switch (phy_data->sfp_base) {case AXGBE_SFP_BASE_1000_T :
Signature · 1 line
2.34.1
PATCH v3 9/25 net/axgbe: fix logic around active and passive cables
In reply to Venkat Kumar AndeFrom: Venkat Kumar Ande <[email protected]>
SFP+ active and passive cables are copper cables with fixed SFP+ end connectors. Due to a misinterpretation of this, SFP+ active cables could end up not being recognized, causing the driver to fail to establish a connection.
Introduce a new enum in SFP+ cable types, XGBE_SFP_CABLE_FIBER, that is the default cable type, and handle active and passive cables when they are specifically detected.
--- drivers/net/axgbe/axgbe_phy_impl.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/net/axgbe/axgbe_phy_impl.c +6 -3
@@ -69,6 +69,7 @@ enum axgbe_sfp_cable {AXGBE_SFP_CABLE_UNKNOWN =0 ,AXGBE_SFP_CABLE_ACTIVE ,AXGBE_SFP_CABLE_PASSIVE , + AXGBE_SFP_CABLE_FIBER, }; enum axgbe_sfp_base {
@@ -616,16 +617,18 @@ static void axgbe_phy_sfp_parse_eeprom(struct axgbe_port *pdata)axgbe_phy_sfp_parse_quirks (pdata); -/* Assume ACTIVE cable unless told it is PASSIVE */ +/* Assume FIBER cable unless told otherwise */ if (sfp_base[AXGBE_SFP_BASE_CABLE ] &AXGBE_SFP_BASE_CABLE_PASSIVE ) { phy_data->sfp_cable =AXGBE_SFP_CABLE_PASSIVE ; phy_data->sfp_cable_len = sfp_base[AXGBE_SFP_BASE_CU_CABLE_LEN ]; - }else { + }else if (sfp_base[AXGBE_SFP_BASE_CABLE ] &AXGBE_SFP_BASE_CABLE_ACTIVE ) { phy_data->sfp_cable =AXGBE_SFP_CABLE_ACTIVE ; + }else { + phy_data->sfp_cable =AXGBE_SFP_CABLE_FIBER ; }/* Determine the type of SFP */ -if (phy_data->sfp_cable ==AXGBE_SFP_CABLE_PASSIVE && +if (phy_data->sfp_cable !=AXGBE_SFP_CABLE_FIBER &&axgbe_phy_sfp_bit_rate (sfp_eeprom,AXGBE_SFP_SPEED_10000 )) phy_data->sfp_base =AXGBE_SFP_BASE_10000_CR ;else if (sfp_base[AXGBE_SFP_BASE_10GBE_CC ] &AXGBE_SFP_BASE_10GBE_CC_SR )
Signature · 1 line
2.34.1
PATCH v3 10/25 net/axgbe: check only the minimum speed for cables
In reply to Venkat Kumar AndeFrom: Venkat Kumar Ande <[email protected]>
There are cables that exist that can support speeds in excess of 10GbE. The driver, however, restricts the EEPROM advertised nominal bitrate to a specific range, which can prevent usage of cables that can support, for example, up to 25GbE.
Rather than checking that an active or passive cable supports a specific range, only check for a minimum supported speed.
--- drivers/net/axgbe/axgbe_phy_impl.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/net/axgbe/axgbe_phy_impl.c +2 -7
@@ -117,9 +117,7 @@ enum axgbe_sfp_speed {#define AXGBE_SFP_BASE_BR 12#define AXGBE_SFP_BASE_BR_1GBE_MIN 0x0a -#define AXGBE_SFP_BASE_BR_1GBE_MAX 0x0d#define AXGBE_SFP_BASE_BR_10GBE_MIN 0x64 -#define AXGBE_SFP_BASE_BR_10GBE_MAX 0x68#define AXGBE_SFP_BASE_CU_CABLE_LEN 18
@@ -536,25 +534,22 @@ static void axgbe_phy_sfp_phy_settings(struct axgbe_port *pdata)static bool axgbe_phy_sfp_bit_rate (struct axgbe_sfp_eeprom *sfp_eeprom,enum axgbe_sfp_speed sfp_speed) { -u8 *sfp_base, min, max; +u8 *sfp_base, min; sfp_base = sfp_eeprom->base;switch (sfp_speed) {case AXGBE_SFP_SPEED_1000 : min =AXGBE_SFP_BASE_BR_1GBE_MIN ; - max =AXGBE_SFP_BASE_BR_1GBE_MAX ;break ;case AXGBE_SFP_SPEED_10000 : min =AXGBE_SFP_BASE_BR_10GBE_MIN ; - max =AXGBE_SFP_BASE_BR_10GBE_MAX ;break ;default :return false; } -return ((sfp_base[AXGBE_SFP_BASE_BR ] >= min) && - (sfp_base[AXGBE_SFP_BASE_BR ] <= max)); +return sfp_base[AXGBE_SFP_BASE_BR ] >= min; }static void axgbe_phy_sfp_external_phy (struct axgbe_port *pdata)
Signature · 1 line
2.34.1
PATCH v3 11/25 net/axgbe: flow Tx Ctrl Registers are h/w version dependent
In reply to Venkat Kumar AndeFrom: Venkat Kumar Ande <[email protected]>
There is difference in the TX Flow Control registers (TFCR) between the revisions of the hardware. The older revisions of hardware used to have single register per queue. Whereas, the newer revision of hardware (from ver 30H onwards) have one register per priority.
Without the fix the user will face problem in TX operation on new 30H HW
--- drivers/net/axgbe/axgbe_dev.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-)
drivers/net/axgbe/axgbe_dev.c +15 -10
@@ -269,20 +269,28 @@ static int axgbe_set_speed(struct axgbe_port *pdata, int speed)return 0 ; } +static unsigned int axgbe_get_fc_queue_count (struct axgbe_port *pdata) +{ +unsigned int max_q_count =AXGMAC_MAX_FLOW_CONTROL_QUEUES ; + +/* From MAC ver 30H the TFCR is per priority, instead of per queue */ +if (AXGMAC_GET_BITS (pdata->hw_feat.version,MAC_VR ,SNPSVER ) >=0x30 ) +return max_q_count; +else +return (RTE_MIN (pdata->tx_q_count, max_q_count)); +} +static int axgbe_disable_tx_flow_control (struct axgbe_port *pdata) { -unsigned int max_q_count, q_count;unsigned int reg, reg_val; -unsigned int i; +unsigned int i, q_count;/* Clear MTL flow control */ for (i =0 ; i < pdata->rx_q_count; i++)AXGMAC_MTL_IOWRITE_BITS (pdata, i,MTL_Q_RQOMR ,EHFC ,0 );/* Clear MAC flow control */ - max_q_count =AXGMAC_MAX_FLOW_CONTROL_QUEUES ; - q_count =RTE_MIN (pdata->tx_q_count, - max_q_count); + q_count =axgbe_get_fc_queue_count (pdata); reg =MAC_Q0TFCR ;for (i =0 ; i < q_count; i++) { reg_val =AXGMAC_IOREAD (pdata, reg);
@@ -297,9 +305,8 @@ static int axgbe_disable_tx_flow_control(struct axgbe_port *pdata)static int axgbe_enable_tx_flow_control (struct axgbe_port *pdata) { -unsigned int max_q_count, q_count;unsigned int reg, reg_val; -unsigned int i; +unsigned int i, q_count;/* Set MTL flow control */ for (i =0 ; i < pdata->rx_q_count; i++) {
@@ -316,9 +323,7 @@ static int axgbe_enable_tx_flow_control(struct axgbe_port *pdata) }/* Set MAC flow control */ - max_q_count =AXGMAC_MAX_FLOW_CONTROL_QUEUES ; - q_count =RTE_MIN (pdata->tx_q_count, - max_q_count); + q_count =axgbe_get_fc_queue_count (pdata); reg =MAC_Q0TFCR ;for (i =0 ; i < q_count; i++) { reg_val =AXGMAC_IOREAD (pdata, reg);
Signature · 1 line
2.34.1
PATCH v3 12/25 net/axgbe: delay AN timeout during KR training
In reply to Venkat Kumar AndeFrom: Venkat Kumar Ande <[email protected]>
AN restart triggered during KR training not only aborts the KR training process but also move the HW to unstable state. Driver has to wait up to 500ms or until the KR training is completed before restarting AN cycle.
Without the fix the user will face KR training failure issues.
--- drivers/net/axgbe/axgbe_ethdev.h | 2 ++ drivers/net/axgbe/axgbe_mdio.c | 25 +++++++++++++++++++++++++ 2 files changed, 27 insertions(+)
drivers/net/axgbe/axgbe_ethdev.h +2 -0
@@ -111,6 +111,7 @@/* Auto-negotiation */ #define AXGBE_AN_MS_TIMEOUT 500#define AXGBE_LINK_TIMEOUT 5 +#define AXGBE_KR_TRAINING_WAIT_ITER 50#define AXGBE_SGMII_AN_LINK_STATUS BIT(1)#define AXGBE_SGMII_AN_LINK_SPEED (BIT(2) | BIT(3))
@@ -661,6 +662,7 @@ struct axgbe_port {unsigned int parallel_detect;unsigned int fec_ability;unsigned long an_start; +unsigned long kr_start_time;enum axgbe_an_mode an_mode;/* I2C support */
drivers/net/axgbe/axgbe_mdio.c +25 -0
@@ -357,6 +357,7 @@ static enum axgbe_an axgbe_an73_tx_training(struct axgbe_port *pdata, reg |=AXGBE_KR_TRAINING_ENABLE ; reg |=AXGBE_KR_TRAINING_START ;XMDIO_WRITE (pdata,MDIO_MMD_PMAPMD ,MDIO_PMA_10GBR_PMD_CTRL , reg); + pdata->kr_start_time =rte_get_timer_cycles ();PMD_DRV_LOG (DEBUG ,"KR training initiated\n" );if (pdata->phy_if.phy_impl.kr_training_post)
@@ -487,6 +488,7 @@ static enum axgbe_an axgbe_an73_incompat_link(struct axgbe_port *pdata)axgbe_an_disable (pdata);axgbe_switch_mode (pdata); + pdata->an_result =AXGBE_AN_READY ;axgbe_an_restart (pdata);return AXGBE_AN_INCOMPAT_LINK ;
@@ -967,11 +969,34 @@ static void axgbe_check_link_timeout(struct axgbe_port *pdata) {unsigned long link_timeout;unsigned long ticks; +unsigned long kr_time; +int wait; link_timeout = pdata->link_check + (AXGBE_LINK_TIMEOUT *2 *rte_get_timer_hz ()); ticks =rte_get_timer_cycles ();if (time_after (ticks, link_timeout)) { +if ((axgbe_cur_mode (pdata) ==AXGBE_MODE_KR ) && + pdata->phy.autoneg ==AUTONEG_ENABLE ) { +/* AN restart should not happen while KR training is in progress. +* The while loop ensures no AN restart during KR training, +* waits up to 500ms and AN restart is triggered only if KR +* training is failed. +*/ + wait =AXGBE_KR_TRAINING_WAIT_ITER ; +while (wait--) { + kr_time = pdata->kr_start_time + +msecs_to_timer_cycles (AXGBE_AN_MS_TIMEOUT ); + ticks =rte_get_timer_cycles (); +if (time_after (ticks, kr_time)) +break ; +/* AN restart is not required, if AN result is COMPLETE */ +if (pdata->an_result ==AXGBE_AN_COMPLETE ) +return ; +rte_delay_us (10500 ); + } + } +PMD_DRV_LOG (NOTICE ,"AN link timeout\n" );axgbe_phy_config_aneg (pdata); }
Signature · 1 line
2.34.1
PATCH v3 13/25 net/axgbe: fix the false linkup in axgbe PHY status
In reply to Venkat Kumar AndeFrom: Venkat Kumar Ande <[email protected]>
In the event of a change in AXGBE mode, the current auto-negotiation needs to be reset and the AN cycle needs to be re-triggered. However, the current code ignores the return value of axgbe_set_mode(), leading to false information as the link is declared without checking the status register.
Fix this by propagating the mode switch status information to axgbe_phy_status().
--- drivers/net/axgbe/axgbe_mdio.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-)
drivers/net/axgbe/axgbe_mdio.c +12 -5
@@ -200,13 +200,14 @@ static void axgbe_switch_mode(struct axgbe_port *pdata)axgbe_change_mode (pdata, pdata->phy_if.phy_impl.switch_mode (pdata)); } -static void axgbe_set_mode (struct axgbe_port *pdata, +static bool axgbe_set_mode (struct axgbe_port *pdata,enum axgbe_mode mode) {if (mode ==axgbe_cur_mode (pdata)) -return ; +return false;axgbe_change_mode (pdata, mode); +return true; } static bool axgbe_use_mode(struct axgbe_port *pdata,
@@ -1007,7 +1008,7 @@ static enum axgbe_mode axgbe_phy_status_aneg(struct axgbe_port *pdata)return pdata->phy_if.phy_impl.an_outcome (pdata); } -static void axgbe_phy_status_result (struct axgbe_port *pdata) +static bool axgbe_phy_status_result (struct axgbe_port *pdata) {enum axgbe_mode mode;
@@ -1041,7 +1042,10 @@ static void axgbe_phy_status_result(struct axgbe_port *pdata) pdata->phy.duplex =DUPLEX_FULL ; -axgbe_set_mode (pdata, mode); +if (axgbe_set_mode (pdata, mode)) +return true; +else +return false; }static int autoneg_time_out (unsigned long autoneg_start_time)
@@ -1108,7 +1112,10 @@ static void axgbe_phy_status(struct axgbe_port *pdata)return ; } } -axgbe_phy_status_result (pdata); + +if (axgbe_phy_status_result (pdata)) +return ; +if (rte_bit_relaxed_get32 (AXGBE_LINK_INIT , &pdata->dev_state))rte_bit_relaxed_clear32 (AXGBE_LINK_INIT , &pdata->dev_state);
Signature · 1 line
2.34.1
PATCH v3 14/25 net/axgbe: remove use of comm owned field
In reply to Venkat Kumar AndeFrom: Venkat Kumar Ande <[email protected]>
The comm_owned field can hide logic where double locking is attempted and prevent multiple threads for the same device from accessing the mutex properly. Remove the comm_owned field and use the mutex API exclusively for gaining ownership.
--- drivers/net/axgbe/axgbe_phy_impl.c | 16 ---------------- 1 file changed, 16 deletions(-)
drivers/net/axgbe/axgbe_phy_impl.c +0 -16
@@ -204,8 +204,6 @@ struct axgbe_phy_data {unsigned int mdio_addr; -unsigned int comm_owned; -/* SFP Support */ enum axgbe_sfp_comm sfp_comm;unsigned int sfp_mux_address;
@@ -253,12 +251,6 @@ static enum axgbe_an_mode axgbe_phy_an_mode(struct axgbe_port *pdata);static int axgbe_phy_i2c_xfer (struct axgbe_port *pdata,struct axgbe_i2c_op *i2c_op) { -struct axgbe_phy_data *phy_data = pdata->phy_data; - -/* Be sure we own the bus */ -if (!phy_data->comm_owned) -return -EIO ; -return pdata->i2c_if.i2c_xfer (pdata, i2c_op); }
@@ -399,10 +391,6 @@ static int axgbe_phy_sfp_get_mux(struct axgbe_port *pdata)static void axgbe_phy_put_comm_ownership (struct axgbe_port *pdata) { -struct axgbe_phy_data *phy_data = pdata->phy_data; - - phy_data->comm_owned =0 ; -pthread_mutex_unlock (&pdata->phy_mutex); }
@@ -418,9 +406,6 @@ static int axgbe_phy_get_comm_ownership(struct axgbe_port *pdata)*/ pthread_mutex_lock (&pdata->phy_mutex); -if (phy_data->comm_owned) -return 0 ; -/* Clear the mutexes */ XP_IOWRITE (pdata,XP_I2C_MUTEX ,AXGBE_MUTEX_RELEASE );XP_IOWRITE (pdata,XP_MDIO_MUTEX ,AXGBE_MUTEX_RELEASE );
@@ -443,7 +428,6 @@ static int axgbe_phy_get_comm_ownership(struct axgbe_port *pdata)XP_IOWRITE (pdata,XP_I2C_MUTEX , mutex_id);XP_IOWRITE (pdata,XP_MDIO_MUTEX , mutex_id); - phy_data->comm_owned =1 ;return 0 ; }
Signature · 1 line
2.34.1
PATCH v3 15/25 net/axgbe: remove field of SFP diagnostic support
In reply to Venkat Kumar AndeFrom: Venkat Kumar Ande <[email protected]>
The driver currently sets an indication of whether the SFP supports, and that the driver can obtain, diagnostics data. This isn't currently used by the driver. Remove this field and the logic supporting it.
--- drivers/net/axgbe/axgbe_phy_impl.c | 10 ---------- 1 file changed, 10 deletions(-)
drivers/net/axgbe/axgbe_phy_impl.c +0 -10
@@ -219,7 +219,6 @@ struct axgbe_phy_data {unsigned int sfp_rx_los;unsigned int sfp_tx_fault;unsigned int sfp_mod_absent; -unsigned int sfp_diags;unsigned int sfp_changed;unsigned int sfp_phy_avail;unsigned int sfp_cable_len;
@@ -702,14 +701,6 @@ static int axgbe_phy_sfp_read_eeprom(struct axgbe_port *pdata)if (memcmp (&phy_data->sfp_eeprom, &sfp_eeprom,sizeof (sfp_eeprom))) { phy_data->sfp_changed =1 ;memcpy (&phy_data->sfp_eeprom, &sfp_eeprom,sizeof (sfp_eeprom)); - -if (sfp_eeprom.extd[AXGBE_SFP_EXTD_SFF_8472 ]) { -uint8_t diag_type; - diag_type = sfp_eeprom.extd[AXGBE_SFP_EXTD_DIAG ]; - -if (!(diag_type &AXGBE_SFP_EXTD_DIAG_ADDR_CHANGE )) - phy_data->sfp_diags =1 ; - } }else { phy_data->sfp_changed =0 ; }
@@ -770,7 +761,6 @@ static void axgbe_phy_sfp_reset(struct axgbe_phy_data *phy_data) phy_data->sfp_rx_los =0 ; phy_data->sfp_tx_fault =0 ; phy_data->sfp_mod_absent =1 ; - phy_data->sfp_diags =0 ; phy_data->sfp_base =AXGBE_SFP_BASE_UNKNOWN ; phy_data->sfp_cable =AXGBE_SFP_CABLE_UNKNOWN ; phy_data->sfp_speed =AXGBE_SFP_SPEED_UNKNOWN ;
Signature · 1 line
2.34.1
PATCH v3 16/25 net/axgbe: improve SFP 100Mbps auto-negotiation
In reply to Venkat Kumar AndeFrom: Venkat Kumar Ande <[email protected]>
After changing speed to 100Mbps as a result of auto-negotiation (AN), some 10/100/1000Mbps SFPs indicate a successful link (no faults or loss of signal), but cannot successfully transmit or receive data. These SFPs required an extra auto-negotiation (AN) after the speed change in order to operate properly. Add a quirk for these SFPs so that if the outcome of the AN actually results in changing to a new speed, re-initiate AN at that new speed.
--- drivers/net/axgbe/axgbe_ethdev.h | 1 + drivers/net/axgbe/axgbe_mdio.c | 74 +++++++++++++++++------------- drivers/net/axgbe/axgbe_phy_impl.c | 5 ++ 3 files changed, 47 insertions(+), 33 deletions(-)
drivers/net/axgbe/axgbe_ethdev.h +1 -0
@@ -658,6 +658,7 @@ struct axgbe_port {enum axgbe_an an_state;enum axgbe_rx kr_state;enum axgbe_rx kx_state; +unsigned int an_again;unsigned int an_supported;unsigned int parallel_detect;unsigned int fec_ability;
drivers/net/axgbe/axgbe_mdio.c +41 -33
117 lines not on this page · raw message
drivers/net/axgbe/axgbe_phy_impl.c +5 -0
@@ -556,6 +556,8 @@ static bool axgbe_phy_belfuse_parse_quirks(struct axgbe_port *pdata)if (memcmp (&sfp_eeprom->base[AXGBE_SFP_BASE_VENDOR_NAME ],AXGBE_BEL_FUSE_VENDOR ,strlen (AXGBE_BEL_FUSE_VENDOR )))return false; +/* For Bel-Fuse, use the extra AN flag */ + pdata->an_again =1 ;/* Reset PHY - wait for self-clearing reset bit to clear */ pdata->phy_if.phy_impl.reset (pdata);
@@ -797,6 +799,9 @@ static void axgbe_phy_sfp_detect(struct axgbe_port *pdata)struct axgbe_phy_data *phy_data = pdata->phy_data;int ret; +/* Clear the extra AN flag */ + pdata->an_again =0 ; +/* Reset the SFP signals and info */ axgbe_phy_sfp_reset (phy_data);
Signature · 1 line
2.34.1
PATCH v3 17/25 net/axgbe: remove unnecessary conversion to bool
In reply to Venkat Kumar AndeFrom: Venkat Kumar Ande <[email protected]>
The conversion to bool is not needed, remove it.
--- drivers/net/axgbe/axgbe_phy_impl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/axgbe/axgbe_phy_impl.c +1 -1
@@ -658,7 +658,7 @@ static bool axgbe_phy_sfp_verify_eeprom(uint8_t cc_in, uint8_t *buf,for (cc =0 ; len; buf++, len--) cc += *buf; -return (cc == cc_in) ? true : false; +return cc == cc_in; }static int axgbe_phy_sfp_read_eeprom (struct axgbe_port *pdata)
Signature · 1 line
2.34.1
PATCH v3 18/25 net/axgbe: use definitions for mailbox commands
In reply to Venkat Kumar AndeFrom: Venkat Kumar Ande <[email protected]>
Instead of using hardcoded values, use enumerations for mailbox command and sub commands.
--- drivers/net/axgbe/axgbe_ethdev.h | 25 +++++++++++++++++++++++++ drivers/net/axgbe/axgbe_phy_impl.c | 28 +++++++++++++++++----------- 2 files changed, 42 insertions(+), 11 deletions(-)
drivers/net/axgbe/axgbe_ethdev.h +25 -0
@@ -231,6 +231,31 @@ enum axgbe_mdio_mode { AXGBE_MDIO_MODE_CL45, }; +enum axgbe_mb_cmd { +AXGBE_MB_CMD_POWER_OFF =0 , +AXGBE_MB_CMD_SET_1G , +AXGBE_MB_CMD_SET_2_5G , +AXGBE_MB_CMD_SET_10G_SFI , +AXGBE_MB_CMD_SET_10G_KR , +AXGBE_MB_CMD_RRC +}; + +enum axgbe_mb_subcmd { +AXGBE_MB_SUBCMD_NONE =0 , + +/* 10GbE SFP subcommands */ +AXGBE_MB_SUBCMD_ACTIVE =0 , +AXGBE_MB_SUBCMD_PASSIVE_1M , +AXGBE_MB_SUBCMD_PASSIVE_3M , +AXGBE_MB_SUBCMD_PASSIVE_OTHER , + +/* 1GbE Mode subcommands */ +AXGBE_MB_SUBCMD_10MBITS =0 , +AXGBE_MB_SUBCMD_100MBITS , +AXGBE_MB_SUBCMD_1G_SGMII , +AXGBE_MB_SUBCMD_1G_KX +}; +struct axgbe_phy {uint32_t supported;uint32_t advertising;
drivers/net/axgbe/axgbe_phy_impl.c +17 -11
@@ -1219,7 +1219,7 @@ static void axgbe_phy_pll_ctrl(struct axgbe_port *pdata, bool enable) }static void axgbe_phy_perform_ratechange (struct axgbe_port *pdata, -unsigned int cmd,unsigned int sub_cmd) +enum axgbe_mb_cmd cmd,enum axgbe_mb_subcmd sub_cmd) {unsigned int s0 =0 ;unsigned int wait;
@@ -1254,7 +1254,8 @@ static void axgbe_phy_perform_ratechange(struct axgbe_port *pdata, reenable_pll:/* Enable PLL re-initialization, not needed for PHY Power Off and RRC cmds */ -if (cmd !=0 && cmd !=5 ) +if (cmd !=AXGBE_MB_CMD_POWER_OFF && + cmd !=AXGBE_MB_CMD_RRC )axgbe_phy_pll_ctrl (pdata, true);PMD_DRV_LOG (NOTICE ,"firmware mailbox command did not complete\n" );
@@ -1265,7 +1266,7 @@ static void axgbe_phy_rrc(struct axgbe_port *pdata)/* Receiver Reset Cycle */ -axgbe_phy_perform_ratechange (pdata,5 ,0 ); +axgbe_phy_perform_ratechange (pdata,AXGBE_MB_CMD_RRC ,AXGBE_MB_SUBCMD_NONE );PMD_DRV_LOG (DEBUG ,"receiver reset complete\n" ); }
@@ -1275,7 +1276,7 @@ static void axgbe_phy_power_off(struct axgbe_port *pdata)struct axgbe_phy_data *phy_data = pdata->phy_data;/* Power off */ -axgbe_phy_perform_ratechange (pdata,0 ,0 ); +axgbe_phy_perform_ratechange (pdata,AXGBE_MB_CMD_POWER_OFF ,AXGBE_MB_SUBCMD_NONE ); phy_data->cur_mode =AXGBE_MODE_UNKNOWN ;
@@ -1290,14 +1291,18 @@ static void axgbe_phy_sfi_mode(struct axgbe_port *pdata)/* 10G/SFI */ if (phy_data->sfp_cable !=AXGBE_SFP_CABLE_PASSIVE ) { -axgbe_phy_perform_ratechange (pdata,3 ,0 ); +axgbe_phy_perform_ratechange (pdata,AXGBE_MB_CMD_SET_10G_SFI , +AXGBE_MB_SUBCMD_ACTIVE ); }else {if (phy_data->sfp_cable_len <=1 ) -axgbe_phy_perform_ratechange (pdata,3 ,1 ); +axgbe_phy_perform_ratechange (pdata,AXGBE_MB_CMD_SET_10G_SFI , +AXGBE_MB_SUBCMD_PASSIVE_1M );else if (phy_data->sfp_cable_len <=3 ) -axgbe_phy_perform_ratechange (pdata,3 ,2 ); +axgbe_phy_perform_ratechange (pdata,AXGBE_MB_CMD_SET_10G_SFI , +AXGBE_MB_SUBCMD_PASSIVE_3M );else -axgbe_phy_perform_ratechange (pdata,3 ,3 ); +axgbe_phy_perform_ratechange (pdata,AXGBE_MB_CMD_SET_10G_SFI , +AXGBE_MB_SUBCMD_PASSIVE_OTHER ); } phy_data->cur_mode =AXGBE_MODE_SFI ;
@@ -1312,7 +1317,8 @@ static void axgbe_phy_kr_mode(struct axgbe_port *pdata)axgbe_phy_set_redrv_mode (pdata);/* 10G/KR */ -axgbe_phy_perform_ratechange (pdata,4 ,0 ); +axgbe_phy_perform_ratechange (pdata,AXGBE_MB_CMD_SET_10G_KR , +AXGBE_MB_SUBCMD_NONE ); phy_data->cur_mode =AXGBE_MODE_KR ;PMD_DRV_LOG (DEBUG ,"10GbE KR mode set\n" );
@@ -1325,7 +1331,7 @@ static void axgbe_phy_kx_2500_mode(struct axgbe_port *pdata)axgbe_phy_set_redrv_mode (pdata);/* 2.5G/KX */ -axgbe_phy_perform_ratechange (pdata,2 ,0 ); +axgbe_phy_perform_ratechange (pdata,AXGBE_MB_CMD_SET_2_5G ,AXGBE_MB_SUBCMD_NONE ); phy_data->cur_mode =AXGBE_MODE_KX_2500 ; }
@@ -1336,7 +1342,7 @@ static void axgbe_phy_sgmii_1000_mode(struct axgbe_port *pdata)axgbe_phy_set_redrv_mode (pdata);/* 1G/SGMII */ -axgbe_phy_perform_ratechange (pdata,1 ,2 ); +axgbe_phy_perform_ratechange (pdata,AXGBE_MB_CMD_SET_1G ,AXGBE_MB_SUBCMD_1G_SGMII ); phy_data->cur_mode =AXGBE_MODE_SGMII_1000 ; }
Signature · 1 line
2.34.1
PATCH v3 19/25 net/axgbe: add support for 10 Mbps speed
In reply to Venkat Kumar AndeFrom: Venkat Kumar Ande <[email protected]>
Add the necessary changes to support 10 Mbps speed for BaseT and SFP port modes. This is supported in MAC ver >= 30H.
--- drivers/net/axgbe/axgbe_dev.c | 3 ++ drivers/net/axgbe/axgbe_ethdev.h | 2 + drivers/net/axgbe/axgbe_mdio.c | 22 +++++++++ drivers/net/axgbe/axgbe_phy.h | 2 + drivers/net/axgbe/axgbe_phy_impl.c | 75 ++++++++++++++++++++++++++++-- 5 files changed, 100 insertions(+), 4 deletions(-)
drivers/net/axgbe/axgbe_dev.c +3 -0
@@ -250,6 +250,9 @@ static int axgbe_set_speed(struct axgbe_port *pdata, int speed)unsigned int ss;switch (speed) { +case SPEED_10 : + ss =0x07 ; +break ;case SPEED_1000 : ss =0x03 ;break ;
drivers/net/axgbe/axgbe_ethdev.h +2 -0
@@ -115,6 +115,7 @@#define AXGBE_SGMII_AN_LINK_STATUS BIT(1)#define AXGBE_SGMII_AN_LINK_SPEED (BIT(2) | BIT(3)) +#define AXGBE_SGMII_AN_LINK_SPEED_10 0x00#define AXGBE_SGMII_AN_LINK_SPEED_100 0x04#define AXGBE_SGMII_AN_LINK_SPEED_1000 0x08#define AXGBE_SGMII_AN_LINK_DUPLEX BIT(4)
@@ -214,6 +215,7 @@ enum axgbe_mode {AXGBE_MODE_KX_2500 ,AXGBE_MODE_KR ,AXGBE_MODE_X , +AXGBE_MODE_SGMII_10 ,AXGBE_MODE_SGMII_100 ,AXGBE_MODE_SGMII_1000 , AXGBE_MODE_SFI,
drivers/net/axgbe/axgbe_mdio.c +22 -0
@@ -143,6 +143,15 @@ static void axgbe_sgmii_1000_mode(struct axgbe_port *pdata) pdata->phy_if.phy_impl.set_mode (pdata,AXGBE_MODE_SGMII_1000 ); } +static void axgbe_sgmii_10_mode (struct axgbe_port *pdata) +{ +/* Set MAC to 10M speed */ + pdata->hw_if.set_speed (pdata,SPEED_10 ); + +/* Call PHY implementation support to complete rate change */ + pdata->phy_if.phy_impl.set_mode (pdata,AXGBE_MODE_SGMII_10 ); +} +static void axgbe_sgmii_100_mode (struct axgbe_port *pdata) {
@@ -176,6 +185,9 @@ static void axgbe_change_mode(struct axgbe_port *pdata,case AXGBE_MODE_KR :axgbe_kr_mode (pdata);break ; +case AXGBE_MODE_SGMII_10 : +axgbe_sgmii_10_mode (pdata); +break ;case AXGBE_MODE_SGMII_100 :axgbe_sgmii_100_mode (pdata);break ;
@@ -864,6 +876,7 @@ static int axgbe_phy_config_fixed(struct axgbe_port *pdata)case AXGBE_MODE_KX_1000 :case AXGBE_MODE_KX_2500 :case AXGBE_MODE_KR : +case AXGBE_MODE_SGMII_10 :case AXGBE_MODE_SGMII_100 :case AXGBE_MODE_SGMII_1000 :case AXGBE_MODE_X :
@@ -923,6 +936,8 @@ static int __axgbe_phy_config_aneg(struct axgbe_port *pdata, bool set_mode)axgbe_set_mode (pdata,AXGBE_MODE_SGMII_1000 ); }else if (axgbe_use_mode (pdata,AXGBE_MODE_SGMII_100 )) {axgbe_set_mode (pdata,AXGBE_MODE_SGMII_100 ); + }else if (axgbe_use_mode (pdata,AXGBE_MODE_SGMII_10 )) { +axgbe_set_mode (pdata,AXGBE_MODE_SGMII_10 ); }else {rte_intr_enable (pdata->pci_dev->intr_handle); ret = -EINVAL ;
@@ -1025,6 +1040,9 @@ static bool axgbe_phy_status_result(struct axgbe_port *pdata) mode =axgbe_phy_status_aneg (pdata);switch (mode) { +case AXGBE_MODE_SGMII_10 : + pdata->phy.speed =SPEED_10 ; +break ;case AXGBE_MODE_SGMII_100 : pdata->phy.speed =SPEED_100 ;break ;
@@ -1181,6 +1199,8 @@ static int axgbe_phy_start(struct axgbe_port *pdata)axgbe_sgmii_1000_mode (pdata); }else if (axgbe_use_mode (pdata,AXGBE_MODE_SGMII_100 )) {axgbe_sgmii_100_mode (pdata); + }else if (axgbe_use_mode (pdata,AXGBE_MODE_SGMII_10 )) { +axgbe_sgmii_10_mode (pdata); }else { ret = -EINVAL ; goto err_stop;
@@ -1228,6 +1248,8 @@ static int axgbe_phy_best_advertised_speed(struct axgbe_port *pdata)return SPEED_1000 ; else if (pdata->phy.advertising & ADVERTISED_100baseT_Full) return SPEED_100; + else if (pdata->phy.advertising & ADVERTISED_10baseT_Full) + return SPEED_10;return SPEED_UNKNOWN ; }
drivers/net/axgbe/axgbe_phy.h +2 -0
@@ -168,6 +168,7 @@#define ADVERTISED_1000baseKX_Full (1 << 17)#define ADVERTISED_1000baseT_Full (1 << 5)#define ADVERTISED_100baseT_Full (1 << 3) +#define ADVERTISED_10baseT_Full (1 << 2)#define ADVERTISED_TP (1 << 7)#define ADVERTISED_FIBRE (1 << 10)#define ADVERTISED_Backplane (1 << 16)
@@ -175,6 +176,7 @@#define SUPPORTED_1000baseKX_Full (1 << 17)#define SUPPORTED_10000baseKR_Full (1 << 19)#define SUPPORTED_2500baseX_Full (1 << 15) +#define SUPPORTED_10baseT_Full (1 << 3)#define SUPPORTED_100baseT_Full (1 << 2)#define SUPPORTED_1000baseT_Full (1 << 5)#define SUPPORTED_10000baseT_Full (1 << 12)
drivers/net/axgbe/axgbe_phy_impl.c +71 -4
194 lines not on this page · raw message
Signature · 1 line
2.34.1
PATCH v3 20/25 net/axgbe: separate C22 and C45 transactions
In reply to Venkat Kumar AndeFrom: Venkat Kumar Ande <[email protected]>
The xgbe MDIO bus driver can perform both C22 and C45 transfers, when using its MDIO bus hardware. The SFP I2C mdio bus driver only supports C22. Create separate functions for each and register the C45 versions using the new API calls where appropriate.
--- drivers/net/axgbe/axgbe_dev.c | 77 +++++++++++++++++++++++++----- drivers/net/axgbe/axgbe_ethdev.h | 7 ++- drivers/net/axgbe/axgbe_phy_impl.c | 4 +- 3 files changed, 71 insertions(+), 17 deletions(-)
drivers/net/axgbe/axgbe_dev.c +64 -13
@@ -63,11 +63,20 @@ static int mdio_complete(struct axgbe_port *pdata)return 0 ; } -static unsigned int axgbe_create_mdio_sca (int port,int reg) +static unsigned int axgbe_create_mdio_sca_c22 (int port,int reg) { -unsigned int mdio_sca, da; +unsigned int mdio_sca; - da = (reg &MII_ADDR_C45 ) ? reg >>16 :0 ; + mdio_sca =0 ; +AXGMAC_SET_BITS (mdio_sca,MAC_MDIOSCAR ,RA , reg); +AXGMAC_SET_BITS (mdio_sca,MAC_MDIOSCAR ,PA , port); + +return mdio_sca; +} + +static unsigned int axgbe_create_mdio_sca_c45 (int port,unsigned int da,int reg) +{ +unsigned int mdio_sca; mdio_sca =0 ;AXGMAC_SET_BITS (mdio_sca,MAC_MDIOSCAR ,RA , reg);
@@ -77,13 +86,12 @@ static unsigned int axgbe_create_mdio_sca(int port, int reg)return mdio_sca; } -static int axgbe_write_ext_mii_regs (struct axgbe_port *pdata,int addr, -int reg,u16 val) +static int axgbe_write_ext_mii_regs (struct axgbe_port *pdata, +unsigned int mdio_sca,u16 val) { -unsigned int mdio_sca, mdio_sccd; +unsigned int mdio_sccd;uint64_t timeout; - mdio_sca =axgbe_create_mdio_sca (addr, reg);AXGMAC_IOWRITE (pdata,MAC_MDIOSCAR , mdio_sca); mdio_sccd =0 ;
@@ -103,13 +111,34 @@ static int axgbe_write_ext_mii_regs(struct axgbe_port *pdata, int addr,return -ETIMEDOUT ; } -static int axgbe_read_ext_mii_regs (struct axgbe_port *pdata,int addr, -int reg) + +static int axgbe_write_ext_mii_regs_c22 (struct axgbe_port *pdata, +int addr,int reg,u16 val) +{ +unsigned int mdio_sca; + + mdio_sca =axgbe_create_mdio_sca_c22 (addr, reg); + +return axgbe_write_ext_mii_regs (pdata, mdio_sca, val); +} + +static int axgbe_write_ext_mii_regs_c45 (struct axgbe_port *pdata, +int addr,int devad,int reg,u16 val) { -unsigned int mdio_sca, mdio_sccd; +unsigned int mdio_sca; + + mdio_sca =axgbe_create_mdio_sca_c45 (addr, devad, reg); + +return axgbe_write_ext_mii_regs (pdata, mdio_sca, val); +} + + +static int axgbe_read_ext_mii_regs (struct axgbe_port *pdata, +unsigned int mdio_sca) +{ +unsigned int mdio_sccd;uint64_t timeout; - mdio_sca =axgbe_create_mdio_sca (addr, reg);AXGMAC_IOWRITE (pdata,MAC_MDIOSCAR , mdio_sca); mdio_sccd =0 ;
@@ -132,6 +161,25 @@ static int axgbe_read_ext_mii_regs(struct axgbe_port *pdata, int addr,return AXGMAC_IOREAD_BITS (pdata,MAC_MDIOSCCDR ,DATA ); } +static int axgbe_read_ext_mii_regs_c22 (struct axgbe_port *pdata,int addr,int reg) +{ +unsigned int mdio_sca; + + mdio_sca =axgbe_create_mdio_sca_c22 (addr, reg); + +return axgbe_read_ext_mii_regs (pdata, mdio_sca); +} + +static int axgbe_read_ext_mii_regs_c45 (struct axgbe_port *pdata,int addr, +int devad,int reg) +{ +unsigned int mdio_sca; + + mdio_sca =axgbe_create_mdio_sca_c45 (addr, devad, reg); + +return axgbe_read_ext_mii_regs (pdata, mdio_sca); +} +static int axgbe_set_ext_mii_mode (struct axgbe_port *pdata,unsigned int port,enum axgbe_mdio_mode mode) {
@@ -1373,8 +1421,11 @@ void axgbe_init_function_ptrs_dev(struct axgbe_hw_if *hw_if) hw_if->set_speed = axgbe_set_speed; hw_if->set_ext_mii_mode = axgbe_set_ext_mii_mode; - hw_if->read_ext_mii_regs = axgbe_read_ext_mii_regs; - hw_if->write_ext_mii_regs = axgbe_write_ext_mii_regs; + hw_if->read_ext_mii_regs_c22 = axgbe_read_ext_mii_regs_c22; + hw_if->write_ext_mii_regs_c22 = axgbe_write_ext_mii_regs_c22; + hw_if->read_ext_mii_regs_c45 = axgbe_read_ext_mii_regs_c45; + hw_if->write_ext_mii_regs_c45 = axgbe_write_ext_mii_regs_c45; +/* For FLOW ctrl */ hw_if->config_tx_flow_control = axgbe_config_tx_flow_control; hw_if->config_rx_flow_control = axgbe_config_rx_flow_control;
drivers/net/axgbe/axgbe_ethdev.h +5 -2
@@ -325,8 +325,11 @@ struct axgbe_hw_if {int (*set_ext_mii_mode)(struct axgbe_port *,unsigned int ,enum axgbe_mdio_mode ); -int (*read_ext_mii_regs)(struct axgbe_port *,int ,int ); -int (*write_ext_mii_regs)(struct axgbe_port *,int ,int ,uint16_t ); +int (*read_ext_mii_regs_c22)(struct axgbe_port *pdata,int addr,int reg); +int (*write_ext_mii_regs_c22)(struct axgbe_port *pdata,int addr,int reg,uint16_t val); +int (*read_ext_mii_regs_c45)(struct axgbe_port *pdata,int addr,int devad,int reg); +int (*write_ext_mii_regs_c45)(struct axgbe_port *pdata,int addr,int devad, +int reg,uint16_t val);/* For FLOW ctrl */ int (*config_tx_flow_control)(struct axgbe_port *);
drivers/net/axgbe/axgbe_phy_impl.c +2 -2
@@ -1148,8 +1148,8 @@ static int axgbe_phy_set_redrv_mode_mdio(struct axgbe_port *pdata, redrv_reg =AXGBE_PHY_REDRV_MODE_REG + (phy_data->redrv_lane *0x1000 ); redrv_val = (u16 )mode; -return pdata->hw_if.write_ext_mii_regs (pdata, phy_data->redrv_addr, - redrv_reg, redrv_val); +return pdata->hw_if.write_ext_mii_regs_c22 (pdata, + phy_data->redrv_addr, redrv_reg, redrv_val); } static int axgbe_phy_set_redrv_mode_i2c(struct axgbe_port *pdata,
Signature · 1 line
2.34.1
PATCH v3 21/25 net/axgbe: replace mii generic macro for c45 with AXGBE
In reply to Venkat Kumar AndeFrom: Venkat Kumar Ande <[email protected]>
The axgbe driver reuses MII_ADDR_C45 for its own purpose. The values derived with it are never passed to phylib or a linux MDIO bus driver. In order that MII_ADDR_C45 can be removed, add AXGBE specific macro.
--- drivers/net/axgbe/axgbe_common.h | 4 ++-- drivers/net/axgbe/axgbe_dev.c | 8 ++++---- drivers/net/axgbe/axgbe_phy.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-)
drivers/net/axgbe/axgbe_common.h +2 -2
@@ -1732,14 +1732,14 @@ do { \*/ #define XMDIO_READ (_pdata, _mmd, _reg) \ ((_pdata)->hw_if.read_mmd_regs((_pdata), 0, \ - MII_ADDR_C45 | ((_mmd) << 16) | ((_reg) & 0xffff))) + AXGBE_ADDR_C45 | ((_mmd) << 16) | ((_reg) & 0xffff)))#define XMDIO_READ_BITS (_pdata, _mmd, _reg, _mask) \ (XMDIO_READ((_pdata), _mmd, _reg) & _mask)#define XMDIO_WRITE (_pdata, _mmd, _reg, _val) \ ((_pdata)->hw_if.write_mmd_regs((_pdata), 0, \ - MII_ADDR_C45 | ((_mmd) << 16) | ((_reg) & 0xffff), (_val))) + AXGBE_ADDR_C45 | ((_mmd) << 16) | ((_reg) & 0xffff), (_val)))#define XMDIO_WRITE_BITS (_pdata, _mmd, _reg, _mask, _val) \ do { \
drivers/net/axgbe/axgbe_dev.c +4 -4
@@ -207,8 +207,8 @@ static int axgbe_read_mmd_regs_v2(struct axgbe_port *pdata,unsigned int mmd_address, index, offset;int mmd_data; -if (mmd_reg &MII_ADDR_C45 ) - mmd_address = mmd_reg & ~MII_ADDR_C45 ; +if (mmd_reg &AXGBE_ADDR_C45 ) + mmd_address = mmd_reg & ~AXGBE_ADDR_C45 ;else mmd_address = (pdata->mdio_mmd <<16 ) | (mmd_reg &0xffff );
@@ -241,8 +241,8 @@ static void axgbe_write_mmd_regs_v2(struct axgbe_port *pdata, {unsigned int mmd_address, index, offset; -if (mmd_reg &MII_ADDR_C45 ) - mmd_address = mmd_reg & ~MII_ADDR_C45 ; +if (mmd_reg &AXGBE_ADDR_C45 ) + mmd_address = mmd_reg & ~AXGBE_ADDR_C45 ;else mmd_address = (pdata->mdio_mmd <<16 ) | (mmd_reg &0xffff );
drivers/net/axgbe/axgbe_phy.h +1 -1
@@ -16,7 +16,7 @@/* Or MII_ADDR_C45 into regnum for read/write on mii_bus to enable the 21 bit * IEEE 802.3ae clause 45 addressing mode used by 10GIGE phy chips. */ -#define MII_ADDR_C45 (1 << 30) +#define AXGBE_ADDR_C45 (1 << 30)/* Basic mode status register. */ #define BMSR_LSTATUS 0x0004/* Link status */
Signature · 1 line
2.34.1
PATCH v3 22/25 net/axgbe: add 2.5GbE support to 10G BaseT mode
In reply to Venkat Kumar AndeFrom: Venkat Kumar Ande <[email protected]>
Add support to the driver to fully recognize and enable 2.5GbE speed in 10GBaseT mode.
--- drivers/net/axgbe/axgbe_phy_impl.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/net/axgbe/axgbe_phy_impl.c +8 -1
@@ -1392,9 +1392,11 @@ static enum axgbe_mode axgbe_phy_switch_baset_mode(struct axgbe_port *pdata)case AXGBE_MODE_SGMII_100 :case AXGBE_MODE_SGMII_1000 :return AXGBE_MODE_KR ; +case AXGBE_MODE_KX_2500 : +return AXGBE_MODE_SGMII_1000 ;case AXGBE_MODE_KR :default : -return AXGBE_MODE_SGMII_1000 ; +return AXGBE_MODE_KX_2500 ; } }
@@ -1883,6 +1885,7 @@ static bool axgbe_phy_port_mode_mismatch(struct axgbe_port *pdata)if ((phy_data->port_speeds &AXGBE_PHY_PORT_SPEED_10 ) || (phy_data->port_speeds &AXGBE_PHY_PORT_SPEED_100 ) || (phy_data->port_speeds &AXGBE_PHY_PORT_SPEED_1000 ) || + (phy_data->port_speeds &AXGBE_PHY_PORT_SPEED_2500 ) || (phy_data->port_speeds &AXGBE_PHY_PORT_SPEED_10000 ))return false;break ;
@@ -2270,6 +2273,10 @@ static int axgbe_phy_init(struct axgbe_port *pdata) pdata->phy.supported |= SUPPORTED_1000baseT_Full; phy_data->start_mode =AXGBE_MODE_SGMII_1000 ; } +if (phy_data->port_speeds &AXGBE_PHY_PORT_SPEED_2500 ) { + pdata->phy.supported |= SUPPORTED_2500baseX_Full; + phy_data->start_mode =AXGBE_MODE_KX_2500 ; + }if (phy_data->port_speeds &AXGBE_PHY_PORT_SPEED_10000 ) { pdata->phy.supported |= SUPPORTED_10000baseT_Full; phy_data->start_mode =AXGBE_MODE_KR ;
Signature · 1 line
2.34.1
PATCH v3 23/25 net/axgbe: add support for Rx adaptation
In reply to Venkat Kumar AndeFrom: Venkat Kumar Ande <[email protected]>
The existing implementation for non-Autonegotiation 10G speed modes does not enable RX adaptation in the Driver and FW. The RX Equalization settings (AFE settings alone) are manually configured and the existing link-up sequence in the driver does not perform rx adaptation process as mentioned in the Synopsys databook. There's a customer request for 10G backplane mode without Auto-negotiation and for the DAC cables of more significant length that follow the non-Autonegotiation mode. These modes require PHY to perform RX Adaptation.
The proposed logic adds the necessary changes to Yellow Carp devices to ensure seamless RX Adaptation for 10G-SFI (LONG DAC) and 10G-KR without AN (CL72 not present). The RX adaptation core algorithm is executed by firmware, however, to achieve that a new mailbox sub-command is required to be sent by the driver.
--- drivers/net/axgbe/axgbe_common.h | 38 +++++++ drivers/net/axgbe/axgbe_ethdev.h | 5 + drivers/net/axgbe/axgbe_phy_impl.c | 170 ++++++++++++++++++++++++++++- 3 files changed, 210 insertions(+), 3 deletions(-)
drivers/net/axgbe/axgbe_common.h +38 -0
@@ -1274,6 +1274,22 @@#define MDIO_PMA_RX_CTRL1 0x8051#endif +#ifndef MDIO_PMA_RX_LSTS +#define MDIO_PMA_RX_LSTS 0x018020 +#endif + +#ifndef MDIO_PMA_RX_EQ_CTRL4 +#define MDIO_PMA_RX_EQ_CTRL4 0x0001805C +#endif + +#ifndef MDIO_PMA_MP_MISC_STS +#define MDIO_PMA_MP_MISC_STS 0x0078 +#endif + +#ifndef MDIO_PMA_PHY_RX_EQ_CEU +#define MDIO_PMA_PHY_RX_EQ_CEU 0x1800E +#endif +#ifndef MDIO_PCS_DIG_CTRL #define MDIO_PCS_DIG_CTRL 0x8000#endif
@@ -1415,6 +1431,28 @@ static inline uint32_t high32_value(uint64_t addr)#define XGBE_PMA_RX_RST_0_RESET_ON 0x10#define XGBE_PMA_RX_RST_0_RESET_OFF 0x00 +#define XGBE_PMA_RX_SIG_DET_0_MASK BIT(4) +#define XGBE_PMA_RX_SIG_DET_0_ENABLE BIT(4) +#define XGBE_PMA_RX_SIG_DET_0_DISABLE 0x0000 + +#define XGBE_PMA_RX_VALID_0_MASK BIT(12) +#define XGBE_PMA_RX_VALID_0_ENABLE BIT(12) +#define XGBE_PMA_RX_VALID_0_DISABLE 0x0000 + +#define XGBE_PMA_RX_AD_REQ_MASK BIT(12) +#define XGBE_PMA_RX_AD_REQ_ENABLE BIT(12) +#define XGBE_PMA_RX_AD_REQ_DISABLE 0x0000 + +#define XGBE_PMA_RX_ADPT_ACK_MASK BIT(12) +#define XGBE_PMA_RX_ADPT_ACK BIT(12) + +#define XGBE_PMA_CFF_UPDTM1_VLD BIT(8) +#define XGBE_PMA_CFF_UPDT0_VLD BIT(9) +#define XGBE_PMA_CFF_UPDT1_VLD BIT(10) +#define XGBE_PMA_CFF_UPDT_MASK (XGBE_PMA_CFF_UPDTM1_VLD |\ + XGBE_PMA_CFF_UPDT0_VLD | \ + XGBE_PMA_CFF_UPDT1_VLD) +/*END*/ /* Bit setting and getting macros
drivers/net/axgbe/axgbe_ethdev.h +5 -0
@@ -244,6 +244,7 @@ enum axgbe_mb_cmd {enum axgbe_mb_subcmd {AXGBE_MB_SUBCMD_NONE =0 , +AXGBE_MB_SUBCMD_RX_ADAP ,/* 10GbE SFP subcommands */ AXGBE_MB_SUBCMD_ACTIVE =0 ,
@@ -722,6 +723,10 @@ struct axgbe_port {struct rte_timecounter tx_tstamp;unsigned int tstamp_addend; +bool en_rx_adap; +int rx_adapt_retries; +bool rx_adapt_done; +bool mode_set; };void axgbe_init_function_ptrs_dev (struct axgbe_hw_if *hw_if);
drivers/net/axgbe/axgbe_phy_impl.c +167 -3
226 lines not on this page · raw message
Signature · 1 line
2.34.1
PATCH v3 24/25 net/axgbe: extend 10Mbps support to MAC version 21H
In reply to Venkat Kumar AndeFrom: Venkat Kumar Ande <[email protected]>
MAC version 21H supports the 10Mbps speed. So, extend support to platforms that support it.
--- drivers/net/axgbe/axgbe_phy_impl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/axgbe/axgbe_phy_impl.c +2 -2
@@ -2012,9 +2012,9 @@ static bool axgbe_phy_port_mode_mismatch(struct axgbe_port *pdata)struct axgbe_phy_data *phy_data = pdata->phy_data;unsigned int ver; -/* 10 Mbps speed is not supported in ver < 30H */ +/* 10 Mbps speed is supported in ver 21H and ver >= 30H */ ver =AXGMAC_GET_BITS (pdata->hw_feat.version,MAC_VR ,SNPSVER ); -if (ver <0x30 && phy_data->port_speeds &AXGBE_PHY_PORT_SPEED_10 ) +if ((ver <0x30 && ver !=0x21 ) && phy_data->port_speeds &AXGBE_PHY_PORT_SPEED_10 )return true;switch (phy_data->port_mode) {
Signature · 1 line
2.34.1
PATCH v3 25/25 net/axgbe: modify debug messages
In reply to Venkat Kumar AndeFrom: Venkat Kumar Ande <[email protected]>
Modify debug messages to get better information from debug logs
--- drivers/net/axgbe/axgbe_ethdev.c | 4 ++-- drivers/net/axgbe/axgbe_phy_impl.c | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-)
drivers/net/axgbe/axgbe_ethdev.c +2 -2
@@ -783,8 +783,8 @@ axgbe_dev_link_update(struct rte_eth_dev *dev, link.link_autoneg = !(dev->data->dev_conf.link_speeds &RTE_ETH_LINK_SPEED_FIXED ); ret =rte_eth_linkstatus_set (dev, &link); -if (ret ==-1 ) -PMD_DRV_LOG (ERR ,"No change in link status\n" ); +if (ret ==0 ) +PMD_DRV_LOG (ERR ,"Link status changed\n" );return ret; }
drivers/net/axgbe/axgbe_phy_impl.c +0 -2
@@ -1375,8 +1375,6 @@ static void axgbe_phy_perform_ratechange(struct axgbe_port *pdata,if (cmd !=AXGBE_MB_CMD_POWER_OFF && cmd !=AXGBE_MB_CMD_RRC )axgbe_phy_pll_ctrl (pdata, true); - -PMD_DRV_LOG (NOTICE ,"firmware mailbox command did not complete\n" ); }static void axgbe_phy_rrc (struct axgbe_port *pdata)
Signature · 1 line
2.34.1
Quoted 19 lines · Venkat Kumar Ande
From: Venkat Kumar Ande <[email protected]>
The XGBE supports performing MDIO operations using an MDIO command request. The driver mistakenly uses the mdio port address as the MDIO command request device address instead of the MDIO command request port address. Additionally, the driver does not properly check for and create a clause 45 MDIO command
Without the fix PHY device is not detected and can't be usable.
Check the supplied MDIO register to determine if the request is a clause 45 operation (
MII_ADDR_C45). For a clause 45 operation, extract device address and register number from the supplied MDIO register and use them to set the MDIO command request device address and register number fields. For a clause 22 operation, the MDIO request device address is set to zero and the MDIO command request register number is set to the supplied MDIO register. In either case, the supplied MDIO port address is used as the MDIO command request port address.
Quoted 5 lines
Fixes 4ac7516b8b39 ("net/axgbe: add phy init and related APIs")Signed-off-by Venkat Kumar Ande <[email protected]>Acked-by Selwin Sebastian <[email protected]>
Series applied to dpdk-next-net/main, thanks.