* [PATCH v2] drivers/net/bnx2x : Add experimental 2.5Gbps support for BCM578xx.
@ 2023-05-18 0:01 julien_dpdk
2023-05-18 7:14 ` Jerin Jacob
2023-06-01 10:21 ` [PATCH v3] net/bnx2x : add " Julien Aube
0 siblings, 2 replies; 6+ messages in thread
From: julien_dpdk @ 2023-05-18 0:01 UTC (permalink / raw)
To: dev; +Cc: Julien Aube
From: Julien Aube <julien_dpdk@jaube.fr>
This has been tested with GPON's ONU SFP but requires a specific
firmware configuration.
Signed-off-by: Julien Aube <julien_dpdk@jaube.fr>
---
doc/guides/nics/bnx2x.rst | 4 ++++
drivers/net/bnx2x/elink.c | 19 +++++++++++++++++--
2 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/doc/guides/nics/bnx2x.rst b/doc/guides/nics/bnx2x.rst
index 788a6dac08..f19784db2c 100644
--- a/doc/guides/nics/bnx2x.rst
+++ b/doc/guides/nics/bnx2x.rst
@@ -22,6 +22,7 @@ BNX2X PMD has support for:
- Promiscuous mode
- Port hardware statistics
- SR-IOV VF
+- Experimental 2.5Gbps support
Non-supported Features
----------------------
@@ -72,6 +73,9 @@ Prerequisites
`linux-firmware git repository <https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/bnx2x/bnx2x-e2-7.13.11.0.fw>`_
to get the required firmware.
+- 2.5Gbps speed currently require that the firmware's nvm configuration number 7 / 35 (first port) and 36 (second port) are set to 0x70
+ for 1G/2.5G/10G support . This can be done for EFI or DOS using EDIAG tool from Broadcom.
+
Pre-Installation Configuration
------------------------------
diff --git a/drivers/net/bnx2x/elink.c b/drivers/net/bnx2x/elink.c
index 43fbf04ece..2c81f85b96 100644
--- a/drivers/net/bnx2x/elink.c
+++ b/drivers/net/bnx2x/elink.c
@@ -867,6 +867,7 @@ typedef elink_status_t (*read_sfp_module_eeprom_func_p)(struct elink_phy *phy,
#define ELINK_SFP_EEPROM_CON_TYPE_ADDR 0x2
#define ELINK_SFP_EEPROM_CON_TYPE_VAL_UNKNOWN 0x0
+ #define ELINK_SFP_EEPROM_CON_TYPE_VAL_SC 0x1
#define ELINK_SFP_EEPROM_CON_TYPE_VAL_LC 0x7
#define ELINK_SFP_EEPROM_CON_TYPE_VAL_COPPER 0x21
#define ELINK_SFP_EEPROM_CON_TYPE_VAL_RJ45 0x22
@@ -5069,6 +5070,15 @@ static void elink_warpcore_set_sgmii_speed(struct elink_phy *phy,
0x1000);
ELINK_DEBUG_P0(sc, "set SGMII AUTONEG");
} else {
+ /* Note that 2.5G works only when used with 1G advertisement */
+ if (fiber_mode && phy->req_line_speed == SPEED_2500 &&
+ (phy->speed_cap_mask &
+ (PORT_HW_CFG_SPEED_CAPABILITY_D0_1G |
+ PORT_HW_CFG_SPEED_CAPABILITY_D0_2_5G))) {
+ elink_cl45_write(sc, phy, MDIO_WC_DEVAD,
+ MDIO_WC_REG_SERDESDIGITAL_MISC1, 0x6010);
+ }
+
elink_cl45_read(sc, phy, MDIO_WC_DEVAD,
MDIO_WC_REG_COMBO_IEEE0_MIICTRL, &val16);
val16 &= 0xcebf;
@@ -5079,6 +5089,7 @@ static void elink_warpcore_set_sgmii_speed(struct elink_phy *phy,
val16 |= 0x2000;
break;
case ELINK_SPEED_1000:
+ case ELINK_SPEED_2500:
val16 |= 0x0040;
break;
default:
@@ -9138,6 +9149,7 @@ static elink_status_t elink_get_edc_mode(struct elink_phy *phy,
break;
}
case ELINK_SFP_EEPROM_CON_TYPE_VAL_UNKNOWN:
+ case ELINK_SFP_EEPROM_CON_TYPE_VAL_SC:
case ELINK_SFP_EEPROM_CON_TYPE_VAL_LC:
case ELINK_SFP_EEPROM_CON_TYPE_VAL_RJ45:
check_limiting_mode = 1;
@@ -9151,7 +9163,8 @@ static elink_status_t elink_get_edc_mode(struct elink_phy *phy,
(val[ELINK_SFP_EEPROM_1G_COMP_CODE_ADDR] != 0)) {
ELINK_DEBUG_P0(sc, "1G SFP module detected");
phy->media_type = ELINK_ETH_PHY_SFP_1G_FIBER;
- if (phy->req_line_speed != ELINK_SPEED_1000) {
+ if (phy->req_line_speed != ELINK_SPEED_1000 &&
+ phy->req_line_speed != ELINK_SPEED_2500) {
uint8_t gport = params->port;
phy->req_line_speed = ELINK_SPEED_1000;
if (!CHIP_IS_E1x(sc)) {
@@ -9324,7 +9337,7 @@ static elink_status_t elink_wait_for_sfp_module_initialized(
* some phys type ( e.g. JDSU )
*/
- for (timeout = 0; timeout < 60; timeout++) {
+ for (timeout = 0; timeout < 1800; timeout++) {
if (phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT)
rc = elink_warpcore_read_sfp_module_eeprom(
phy, params, ELINK_I2C_DEV_ADDR_A0, 1, 1, &val,
@@ -12614,6 +12627,7 @@ static const struct elink_phy phy_warpcore = {
ELINK_SUPPORTED_100baseT_Half |
ELINK_SUPPORTED_100baseT_Full |
ELINK_SUPPORTED_1000baseT_Full |
+ ELINK_SUPPORTED_2500baseX_Full |
ELINK_SUPPORTED_1000baseKX_Full |
ELINK_SUPPORTED_10000baseT_Full |
ELINK_SUPPORTED_10000baseKR_Full |
@@ -13156,6 +13170,7 @@ static elink_status_t elink_populate_int_phy(struct bnx2x_softc *sc,
break;
case PORT_HW_CFG_NET_SERDES_IF_SFI:
phy->supported &= (ELINK_SUPPORTED_1000baseT_Full |
+ ELINK_SUPPORTED_2500baseX_Full |
ELINK_SUPPORTED_10000baseT_Full |
ELINK_SUPPORTED_FIBRE |
ELINK_SUPPORTED_Pause |
--
2.30.2
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] drivers/net/bnx2x : Add experimental 2.5Gbps support for BCM578xx.
2023-05-18 0:01 [PATCH v2] drivers/net/bnx2x : Add experimental 2.5Gbps support for BCM578xx julien_dpdk
@ 2023-05-18 7:14 ` Jerin Jacob
2023-06-01 10:21 ` [PATCH v3] net/bnx2x : add " Julien Aube
1 sibling, 0 replies; 6+ messages in thread
From: Jerin Jacob @ 2023-05-18 7:14 UTC (permalink / raw)
To: julien_dpdk; +Cc: dev
On Thu, May 18, 2023 at 5:31 AM <julien_dpdk@jaube.fr> wrote:
>
> From: Julien Aube <julien_dpdk@jaube.fr>
>
Please also add what is the change.
> This has been tested with GPON's ONU SFP but requires a specific
> firmware configuration.
>
> Signed-off-by: Julien Aube <julien_dpdk@jaube.fr>
a) Please change subject to:
net/bnx2x : support 2.5Gbps
i.e
1) change drivers/net/... to net/..
2) start with small letter (Add vs add)
b) Please check ..mailmap needs to updated or not?
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v3] net/bnx2x : add experimental 2.5Gbps support for BCM578xx.
2023-05-18 0:01 [PATCH v2] drivers/net/bnx2x : Add experimental 2.5Gbps support for BCM578xx julien_dpdk
2023-05-18 7:14 ` Jerin Jacob
@ 2023-06-01 10:21 ` Julien Aube
2023-06-02 4:11 ` Jerin Jacob
2023-06-02 7:57 ` [PATCH v4] net/bnx2x: support 2.5Gbps Julien Aube
1 sibling, 2 replies; 6+ messages in thread
From: Julien Aube @ 2023-06-01 10:21 UTC (permalink / raw)
To: dev; +Cc: Julien Aube
- add support for 2500baseX_Full in addition to 1000baseT_Full.
For 2.5Gbps speed, HSGMII mode shall be enabled in the serdes.
- add the possibility to support SC connectors on SFP (GPON are mostly SC)
- change the initialisation time from 60ms to 1800ms (for xPON-Based SFP)
This has been tested with GPON's ONU SFP but requires a specific
firmware configuration described in the documentation.
Signed-off-by: Julien Aube <julien_dpdk@jaube.fr>
---
doc/guides/nics/bnx2x.rst | 4 ++++
drivers/net/bnx2x/elink.c | 19 +++++++++++++++++--
2 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/doc/guides/nics/bnx2x.rst b/doc/guides/nics/bnx2x.rst
index 788a6dac08..f19784db2c 100644
--- a/doc/guides/nics/bnx2x.rst
+++ b/doc/guides/nics/bnx2x.rst
@@ -22,6 +22,7 @@ BNX2X PMD has support for:
- Promiscuous mode
- Port hardware statistics
- SR-IOV VF
+- Experimental 2.5Gbps support
Non-supported Features
----------------------
@@ -72,6 +73,9 @@ Prerequisites
`linux-firmware git repository <https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/bnx2x/bnx2x-e2-7.13.11.0.fw>`_
to get the required firmware.
+- 2.5Gbps speed currently require that the firmware's nvm configuration number 7 / 35 (first port) and 36 (second port) are set to 0x70
+ for 1G/2.5G/10G support . This can be done for EFI or DOS using EDIAG tool from Broadcom.
+
Pre-Installation Configuration
------------------------------
diff --git a/drivers/net/bnx2x/elink.c b/drivers/net/bnx2x/elink.c
index 43fbf04ece..2c81f85b96 100644
--- a/drivers/net/bnx2x/elink.c
+++ b/drivers/net/bnx2x/elink.c
@@ -867,6 +867,7 @@ typedef elink_status_t (*read_sfp_module_eeprom_func_p)(struct elink_phy *phy,
#define ELINK_SFP_EEPROM_CON_TYPE_ADDR 0x2
#define ELINK_SFP_EEPROM_CON_TYPE_VAL_UNKNOWN 0x0
+ #define ELINK_SFP_EEPROM_CON_TYPE_VAL_SC 0x1
#define ELINK_SFP_EEPROM_CON_TYPE_VAL_LC 0x7
#define ELINK_SFP_EEPROM_CON_TYPE_VAL_COPPER 0x21
#define ELINK_SFP_EEPROM_CON_TYPE_VAL_RJ45 0x22
@@ -5069,6 +5070,15 @@ static void elink_warpcore_set_sgmii_speed(struct elink_phy *phy,
0x1000);
ELINK_DEBUG_P0(sc, "set SGMII AUTONEG");
} else {
+ /* Note that 2.5G works only when used with 1G advertisement */
+ if (fiber_mode && phy->req_line_speed == SPEED_2500 &&
+ (phy->speed_cap_mask &
+ (PORT_HW_CFG_SPEED_CAPABILITY_D0_1G |
+ PORT_HW_CFG_SPEED_CAPABILITY_D0_2_5G))) {
+ elink_cl45_write(sc, phy, MDIO_WC_DEVAD,
+ MDIO_WC_REG_SERDESDIGITAL_MISC1, 0x6010);
+ }
+
elink_cl45_read(sc, phy, MDIO_WC_DEVAD,
MDIO_WC_REG_COMBO_IEEE0_MIICTRL, &val16);
val16 &= 0xcebf;
@@ -5079,6 +5089,7 @@ static void elink_warpcore_set_sgmii_speed(struct elink_phy *phy,
val16 |= 0x2000;
break;
case ELINK_SPEED_1000:
+ case ELINK_SPEED_2500:
val16 |= 0x0040;
break;
default:
@@ -9138,6 +9149,7 @@ static elink_status_t elink_get_edc_mode(struct elink_phy *phy,
break;
}
case ELINK_SFP_EEPROM_CON_TYPE_VAL_UNKNOWN:
+ case ELINK_SFP_EEPROM_CON_TYPE_VAL_SC:
case ELINK_SFP_EEPROM_CON_TYPE_VAL_LC:
case ELINK_SFP_EEPROM_CON_TYPE_VAL_RJ45:
check_limiting_mode = 1;
@@ -9151,7 +9163,8 @@ static elink_status_t elink_get_edc_mode(struct elink_phy *phy,
(val[ELINK_SFP_EEPROM_1G_COMP_CODE_ADDR] != 0)) {
ELINK_DEBUG_P0(sc, "1G SFP module detected");
phy->media_type = ELINK_ETH_PHY_SFP_1G_FIBER;
- if (phy->req_line_speed != ELINK_SPEED_1000) {
+ if (phy->req_line_speed != ELINK_SPEED_1000 &&
+ phy->req_line_speed != ELINK_SPEED_2500) {
uint8_t gport = params->port;
phy->req_line_speed = ELINK_SPEED_1000;
if (!CHIP_IS_E1x(sc)) {
@@ -9324,7 +9337,7 @@ static elink_status_t elink_wait_for_sfp_module_initialized(
* some phys type ( e.g. JDSU )
*/
- for (timeout = 0; timeout < 60; timeout++) {
+ for (timeout = 0; timeout < 1800; timeout++) {
if (phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT)
rc = elink_warpcore_read_sfp_module_eeprom(
phy, params, ELINK_I2C_DEV_ADDR_A0, 1, 1, &val,
@@ -12614,6 +12627,7 @@ static const struct elink_phy phy_warpcore = {
ELINK_SUPPORTED_100baseT_Half |
ELINK_SUPPORTED_100baseT_Full |
ELINK_SUPPORTED_1000baseT_Full |
+ ELINK_SUPPORTED_2500baseX_Full |
ELINK_SUPPORTED_1000baseKX_Full |
ELINK_SUPPORTED_10000baseT_Full |
ELINK_SUPPORTED_10000baseKR_Full |
@@ -13156,6 +13170,7 @@ static elink_status_t elink_populate_int_phy(struct bnx2x_softc *sc,
break;
case PORT_HW_CFG_NET_SERDES_IF_SFI:
phy->supported &= (ELINK_SUPPORTED_1000baseT_Full |
+ ELINK_SUPPORTED_2500baseX_Full |
ELINK_SUPPORTED_10000baseT_Full |
ELINK_SUPPORTED_FIBRE |
ELINK_SUPPORTED_Pause |
--
2.30.2
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v3] net/bnx2x : add experimental 2.5Gbps support for BCM578xx.
2023-06-01 10:21 ` [PATCH v3] net/bnx2x : add " Julien Aube
@ 2023-06-02 4:11 ` Jerin Jacob
2023-06-02 7:57 ` [PATCH v4] net/bnx2x: support 2.5Gbps Julien Aube
1 sibling, 0 replies; 6+ messages in thread
From: Jerin Jacob @ 2023-06-02 4:11 UTC (permalink / raw)
To: Julien Aube; +Cc: dev
On Thu, Jun 1, 2023 at 3:51 PM Julien Aube <julien_dpdk@jaube.fr> wrote:
>
> - add support for 2500baseX_Full in addition to 1000baseT_Full.
> For 2.5Gbps speed, HSGMII mode shall be enabled in the serdes.
> - add the possibility to support SC connectors on SFP (GPON are mostly SC)
> - change the initialisation time from 60ms to 1800ms (for xPON-Based SFP)
>
> This has been tested with GPON's ONU SFP but requires a specific
> firmware configuration described in the documentation.
>
> Signed-off-by: Julien Aube <julien_dpdk@jaube.fr>
Please fix the following
Wrong headline format:
net/bnx2x : add experimental 2.5Gbps support for BCM578xx.
Contributor name/email mismatch with .mailmap:
Julien Aube <julien_dpdk@jaube.fr> is unknown in .mailmap
> ---
> doc/guides/nics/bnx2x.rst | 4 ++++
> drivers/net/bnx2x/elink.c | 19 +++++++++++++++++--
> 2 files changed, 21 insertions(+), 2 deletions(-)
>
> diff --git a/doc/guides/nics/bnx2x.rst b/doc/guides/nics/bnx2x.rst
> index 788a6dac08..f19784db2c 100644
> --- a/doc/guides/nics/bnx2x.rst
> +++ b/doc/guides/nics/bnx2x.rst
> @@ -22,6 +22,7 @@ BNX2X PMD has support for:
> - Promiscuous mode
> - Port hardware statistics
> - SR-IOV VF
> +- Experimental 2.5Gbps support
>
> Non-supported Features
> ----------------------
> @@ -72,6 +73,9 @@ Prerequisites
> `linux-firmware git repository <https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/bnx2x/bnx2x-e2-7.13.11.0.fw>`_
> to get the required firmware.
>
> +- 2.5Gbps speed currently require that the firmware's nvm configuration number 7 / 35 (first port) and 36 (second port) are set to 0x70
> + for 1G/2.5G/10G support . This can be done for EFI or DOS using EDIAG tool from Broadcom.
> +
> Pre-Installation Configuration
> ------------------------------
>
> diff --git a/drivers/net/bnx2x/elink.c b/drivers/net/bnx2x/elink.c
> index 43fbf04ece..2c81f85b96 100644
> --- a/drivers/net/bnx2x/elink.c
> +++ b/drivers/net/bnx2x/elink.c
> @@ -867,6 +867,7 @@ typedef elink_status_t (*read_sfp_module_eeprom_func_p)(struct elink_phy *phy,
>
> #define ELINK_SFP_EEPROM_CON_TYPE_ADDR 0x2
> #define ELINK_SFP_EEPROM_CON_TYPE_VAL_UNKNOWN 0x0
> + #define ELINK_SFP_EEPROM_CON_TYPE_VAL_SC 0x1
> #define ELINK_SFP_EEPROM_CON_TYPE_VAL_LC 0x7
> #define ELINK_SFP_EEPROM_CON_TYPE_VAL_COPPER 0x21
> #define ELINK_SFP_EEPROM_CON_TYPE_VAL_RJ45 0x22
> @@ -5069,6 +5070,15 @@ static void elink_warpcore_set_sgmii_speed(struct elink_phy *phy,
> 0x1000);
> ELINK_DEBUG_P0(sc, "set SGMII AUTONEG");
> } else {
> + /* Note that 2.5G works only when used with 1G advertisement */
> + if (fiber_mode && phy->req_line_speed == SPEED_2500 &&
> + (phy->speed_cap_mask &
> + (PORT_HW_CFG_SPEED_CAPABILITY_D0_1G |
> + PORT_HW_CFG_SPEED_CAPABILITY_D0_2_5G))) {
> + elink_cl45_write(sc, phy, MDIO_WC_DEVAD,
> + MDIO_WC_REG_SERDESDIGITAL_MISC1, 0x6010);
> + }
> +
> elink_cl45_read(sc, phy, MDIO_WC_DEVAD,
> MDIO_WC_REG_COMBO_IEEE0_MIICTRL, &val16);
> val16 &= 0xcebf;
> @@ -5079,6 +5089,7 @@ static void elink_warpcore_set_sgmii_speed(struct elink_phy *phy,
> val16 |= 0x2000;
> break;
> case ELINK_SPEED_1000:
> + case ELINK_SPEED_2500:
> val16 |= 0x0040;
> break;
> default:
> @@ -9138,6 +9149,7 @@ static elink_status_t elink_get_edc_mode(struct elink_phy *phy,
> break;
> }
> case ELINK_SFP_EEPROM_CON_TYPE_VAL_UNKNOWN:
> + case ELINK_SFP_EEPROM_CON_TYPE_VAL_SC:
> case ELINK_SFP_EEPROM_CON_TYPE_VAL_LC:
> case ELINK_SFP_EEPROM_CON_TYPE_VAL_RJ45:
> check_limiting_mode = 1;
> @@ -9151,7 +9163,8 @@ static elink_status_t elink_get_edc_mode(struct elink_phy *phy,
> (val[ELINK_SFP_EEPROM_1G_COMP_CODE_ADDR] != 0)) {
> ELINK_DEBUG_P0(sc, "1G SFP module detected");
> phy->media_type = ELINK_ETH_PHY_SFP_1G_FIBER;
> - if (phy->req_line_speed != ELINK_SPEED_1000) {
> + if (phy->req_line_speed != ELINK_SPEED_1000 &&
> + phy->req_line_speed != ELINK_SPEED_2500) {
> uint8_t gport = params->port;
> phy->req_line_speed = ELINK_SPEED_1000;
> if (!CHIP_IS_E1x(sc)) {
> @@ -9324,7 +9337,7 @@ static elink_status_t elink_wait_for_sfp_module_initialized(
> * some phys type ( e.g. JDSU )
> */
>
> - for (timeout = 0; timeout < 60; timeout++) {
> + for (timeout = 0; timeout < 1800; timeout++) {
> if (phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT)
> rc = elink_warpcore_read_sfp_module_eeprom(
> phy, params, ELINK_I2C_DEV_ADDR_A0, 1, 1, &val,
> @@ -12614,6 +12627,7 @@ static const struct elink_phy phy_warpcore = {
> ELINK_SUPPORTED_100baseT_Half |
> ELINK_SUPPORTED_100baseT_Full |
> ELINK_SUPPORTED_1000baseT_Full |
> + ELINK_SUPPORTED_2500baseX_Full |
> ELINK_SUPPORTED_1000baseKX_Full |
> ELINK_SUPPORTED_10000baseT_Full |
> ELINK_SUPPORTED_10000baseKR_Full |
> @@ -13156,6 +13170,7 @@ static elink_status_t elink_populate_int_phy(struct bnx2x_softc *sc,
> break;
> case PORT_HW_CFG_NET_SERDES_IF_SFI:
> phy->supported &= (ELINK_SUPPORTED_1000baseT_Full |
> + ELINK_SUPPORTED_2500baseX_Full |
> ELINK_SUPPORTED_10000baseT_Full |
> ELINK_SUPPORTED_FIBRE |
> ELINK_SUPPORTED_Pause |
> --
> 2.30.2
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v4] net/bnx2x: support 2.5Gbps
2023-06-01 10:21 ` [PATCH v3] net/bnx2x : add " Julien Aube
2023-06-02 4:11 ` Jerin Jacob
@ 2023-06-02 7:57 ` Julien Aube
2023-06-05 4:49 ` Jerin Jacob
1 sibling, 1 reply; 6+ messages in thread
From: Julien Aube @ 2023-06-02 7:57 UTC (permalink / raw)
To: dev; +Cc: Julien Aube
- add support for 2500baseX_Full in addition to 1000baseT_Full.
For 2.5Gbps speed, HSGMII mode shall be enabled in serdes.
- add the possibility to support SC connectors on SFP (GPON are mostly SC)
- change the initialisation time from 60ms to 1800ms (for xPON-Based SFP)
This has been tested with GPON's ONU SFP but requires a specific
firmware configuration described in the documentation.
Signed-off-by: Julien Aube <julien_dpdk@jaube.fr>
---
.mailmap | 1 +
doc/guides/nics/bnx2x.rst | 4 ++++
drivers/net/bnx2x/elink.c | 19 +++++++++++++++++--
3 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/.mailmap b/.mailmap
index db85cc66c6..cb689ef751 100644
--- a/.mailmap
+++ b/.mailmap
@@ -666,6 +666,7 @@ JP Lee <jongpil.lee@broadcom.com>
Juan Antonio Montesinos <juan.antonio.montesinos.delgado@ericsson.com>
Juhamatti Kuusisaari <juhamatti.kuusisaari@coriant.com>
Juho Snellman <jsnell@iki.fi>
+Julien Aube <julien_dpdk@jaube.fr>
Julien Castets <jcastets@scaleway.com>
Julien Courtat <julien.courtat@6wind.com>
Julien Cretin <julien.cretin@trust-in-soft.com>
diff --git a/doc/guides/nics/bnx2x.rst b/doc/guides/nics/bnx2x.rst
index 788a6dac08..f19784db2c 100644
--- a/doc/guides/nics/bnx2x.rst
+++ b/doc/guides/nics/bnx2x.rst
@@ -22,6 +22,7 @@ BNX2X PMD has support for:
- Promiscuous mode
- Port hardware statistics
- SR-IOV VF
+- Experimental 2.5Gbps support
Non-supported Features
----------------------
@@ -72,6 +73,9 @@ Prerequisites
`linux-firmware git repository <https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/bnx2x/bnx2x-e2-7.13.11.0.fw>`_
to get the required firmware.
+- 2.5Gbps speed currently require that the firmware's nvm configuration number 7 / 35 (first port) and 36 (second port) are set to 0x70
+ for 1G/2.5G/10G support . This can be done for EFI or DOS using EDIAG tool from Broadcom.
+
Pre-Installation Configuration
------------------------------
diff --git a/drivers/net/bnx2x/elink.c b/drivers/net/bnx2x/elink.c
index 43fbf04ece..2c81f85b96 100644
--- a/drivers/net/bnx2x/elink.c
+++ b/drivers/net/bnx2x/elink.c
@@ -867,6 +867,7 @@ typedef elink_status_t (*read_sfp_module_eeprom_func_p)(struct elink_phy *phy,
#define ELINK_SFP_EEPROM_CON_TYPE_ADDR 0x2
#define ELINK_SFP_EEPROM_CON_TYPE_VAL_UNKNOWN 0x0
+ #define ELINK_SFP_EEPROM_CON_TYPE_VAL_SC 0x1
#define ELINK_SFP_EEPROM_CON_TYPE_VAL_LC 0x7
#define ELINK_SFP_EEPROM_CON_TYPE_VAL_COPPER 0x21
#define ELINK_SFP_EEPROM_CON_TYPE_VAL_RJ45 0x22
@@ -5069,6 +5070,15 @@ static void elink_warpcore_set_sgmii_speed(struct elink_phy *phy,
0x1000);
ELINK_DEBUG_P0(sc, "set SGMII AUTONEG");
} else {
+ /* Note that 2.5G works only when used with 1G advertisement */
+ if (fiber_mode && phy->req_line_speed == SPEED_2500 &&
+ (phy->speed_cap_mask &
+ (PORT_HW_CFG_SPEED_CAPABILITY_D0_1G |
+ PORT_HW_CFG_SPEED_CAPABILITY_D0_2_5G))) {
+ elink_cl45_write(sc, phy, MDIO_WC_DEVAD,
+ MDIO_WC_REG_SERDESDIGITAL_MISC1, 0x6010);
+ }
+
elink_cl45_read(sc, phy, MDIO_WC_DEVAD,
MDIO_WC_REG_COMBO_IEEE0_MIICTRL, &val16);
val16 &= 0xcebf;
@@ -5079,6 +5089,7 @@ static void elink_warpcore_set_sgmii_speed(struct elink_phy *phy,
val16 |= 0x2000;
break;
case ELINK_SPEED_1000:
+ case ELINK_SPEED_2500:
val16 |= 0x0040;
break;
default:
@@ -9138,6 +9149,7 @@ static elink_status_t elink_get_edc_mode(struct elink_phy *phy,
break;
}
case ELINK_SFP_EEPROM_CON_TYPE_VAL_UNKNOWN:
+ case ELINK_SFP_EEPROM_CON_TYPE_VAL_SC:
case ELINK_SFP_EEPROM_CON_TYPE_VAL_LC:
case ELINK_SFP_EEPROM_CON_TYPE_VAL_RJ45:
check_limiting_mode = 1;
@@ -9151,7 +9163,8 @@ static elink_status_t elink_get_edc_mode(struct elink_phy *phy,
(val[ELINK_SFP_EEPROM_1G_COMP_CODE_ADDR] != 0)) {
ELINK_DEBUG_P0(sc, "1G SFP module detected");
phy->media_type = ELINK_ETH_PHY_SFP_1G_FIBER;
- if (phy->req_line_speed != ELINK_SPEED_1000) {
+ if (phy->req_line_speed != ELINK_SPEED_1000 &&
+ phy->req_line_speed != ELINK_SPEED_2500) {
uint8_t gport = params->port;
phy->req_line_speed = ELINK_SPEED_1000;
if (!CHIP_IS_E1x(sc)) {
@@ -9324,7 +9337,7 @@ static elink_status_t elink_wait_for_sfp_module_initialized(
* some phys type ( e.g. JDSU )
*/
- for (timeout = 0; timeout < 60; timeout++) {
+ for (timeout = 0; timeout < 1800; timeout++) {
if (phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT)
rc = elink_warpcore_read_sfp_module_eeprom(
phy, params, ELINK_I2C_DEV_ADDR_A0, 1, 1, &val,
@@ -12614,6 +12627,7 @@ static const struct elink_phy phy_warpcore = {
ELINK_SUPPORTED_100baseT_Half |
ELINK_SUPPORTED_100baseT_Full |
ELINK_SUPPORTED_1000baseT_Full |
+ ELINK_SUPPORTED_2500baseX_Full |
ELINK_SUPPORTED_1000baseKX_Full |
ELINK_SUPPORTED_10000baseT_Full |
ELINK_SUPPORTED_10000baseKR_Full |
@@ -13156,6 +13170,7 @@ static elink_status_t elink_populate_int_phy(struct bnx2x_softc *sc,
break;
case PORT_HW_CFG_NET_SERDES_IF_SFI:
phy->supported &= (ELINK_SUPPORTED_1000baseT_Full |
+ ELINK_SUPPORTED_2500baseX_Full |
ELINK_SUPPORTED_10000baseT_Full |
ELINK_SUPPORTED_FIBRE |
ELINK_SUPPORTED_Pause |
--
2.30.2
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v4] net/bnx2x: support 2.5Gbps
2023-06-02 7:57 ` [PATCH v4] net/bnx2x: support 2.5Gbps Julien Aube
@ 2023-06-05 4:49 ` Jerin Jacob
0 siblings, 0 replies; 6+ messages in thread
From: Jerin Jacob @ 2023-06-05 4:49 UTC (permalink / raw)
To: Julien Aube; +Cc: dev
On Fri, Jun 2, 2023 at 1:27 PM Julien Aube <julien_dpdk@jaube.fr> wrote:
>
> - add support for 2500baseX_Full in addition to 1000baseT_Full.
> For 2.5Gbps speed, HSGMII mode shall be enabled in serdes.
> - add the possibility to support SC connectors on SFP (GPON are mostly SC)
> - change the initialisation time from 60ms to 1800ms (for xPON-Based SFP)
>
> This has been tested with GPON's ONU SFP but requires a specific
> firmware configuration described in the documentation.
>
> Signed-off-by: Julien Aube <julien_dpdk@jaube.fr>
Applied to dpdk-next-net-mrvl/for-next-net. Thanks
> ---
> .mailmap | 1 +
> doc/guides/nics/bnx2x.rst | 4 ++++
> drivers/net/bnx2x/elink.c | 19 +++++++++++++++++--
> 3 files changed, 22 insertions(+), 2 deletions(-)
>
> diff --git a/.mailmap b/.mailmap
> index db85cc66c6..cb689ef751 100644
> --- a/.mailmap
> +++ b/.mailmap
> @@ -666,6 +666,7 @@ JP Lee <jongpil.lee@broadcom.com>
> Juan Antonio Montesinos <juan.antonio.montesinos.delgado@ericsson.com>
> Juhamatti Kuusisaari <juhamatti.kuusisaari@coriant.com>
> Juho Snellman <jsnell@iki.fi>
> +Julien Aube <julien_dpdk@jaube.fr>
> Julien Castets <jcastets@scaleway.com>
> Julien Courtat <julien.courtat@6wind.com>
> Julien Cretin <julien.cretin@trust-in-soft.com>
> diff --git a/doc/guides/nics/bnx2x.rst b/doc/guides/nics/bnx2x.rst
> index 788a6dac08..f19784db2c 100644
> --- a/doc/guides/nics/bnx2x.rst
> +++ b/doc/guides/nics/bnx2x.rst
> @@ -22,6 +22,7 @@ BNX2X PMD has support for:
> - Promiscuous mode
> - Port hardware statistics
> - SR-IOV VF
> +- Experimental 2.5Gbps support
>
> Non-supported Features
> ----------------------
> @@ -72,6 +73,9 @@ Prerequisites
> `linux-firmware git repository <https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/bnx2x/bnx2x-e2-7.13.11.0.fw>`_
> to get the required firmware.
>
> +- 2.5Gbps speed currently require that the firmware's nvm configuration number 7 / 35 (first port) and 36 (second port) are set to 0x70
> + for 1G/2.5G/10G support . This can be done for EFI or DOS using EDIAG tool from Broadcom.
> +
> Pre-Installation Configuration
> ------------------------------
>
> diff --git a/drivers/net/bnx2x/elink.c b/drivers/net/bnx2x/elink.c
> index 43fbf04ece..2c81f85b96 100644
> --- a/drivers/net/bnx2x/elink.c
> +++ b/drivers/net/bnx2x/elink.c
> @@ -867,6 +867,7 @@ typedef elink_status_t (*read_sfp_module_eeprom_func_p)(struct elink_phy *phy,
>
> #define ELINK_SFP_EEPROM_CON_TYPE_ADDR 0x2
> #define ELINK_SFP_EEPROM_CON_TYPE_VAL_UNKNOWN 0x0
> + #define ELINK_SFP_EEPROM_CON_TYPE_VAL_SC 0x1
> #define ELINK_SFP_EEPROM_CON_TYPE_VAL_LC 0x7
> #define ELINK_SFP_EEPROM_CON_TYPE_VAL_COPPER 0x21
> #define ELINK_SFP_EEPROM_CON_TYPE_VAL_RJ45 0x22
> @@ -5069,6 +5070,15 @@ static void elink_warpcore_set_sgmii_speed(struct elink_phy *phy,
> 0x1000);
> ELINK_DEBUG_P0(sc, "set SGMII AUTONEG");
> } else {
> + /* Note that 2.5G works only when used with 1G advertisement */
> + if (fiber_mode && phy->req_line_speed == SPEED_2500 &&
> + (phy->speed_cap_mask &
> + (PORT_HW_CFG_SPEED_CAPABILITY_D0_1G |
> + PORT_HW_CFG_SPEED_CAPABILITY_D0_2_5G))) {
> + elink_cl45_write(sc, phy, MDIO_WC_DEVAD,
> + MDIO_WC_REG_SERDESDIGITAL_MISC1, 0x6010);
> + }
> +
> elink_cl45_read(sc, phy, MDIO_WC_DEVAD,
> MDIO_WC_REG_COMBO_IEEE0_MIICTRL, &val16);
> val16 &= 0xcebf;
> @@ -5079,6 +5089,7 @@ static void elink_warpcore_set_sgmii_speed(struct elink_phy *phy,
> val16 |= 0x2000;
> break;
> case ELINK_SPEED_1000:
> + case ELINK_SPEED_2500:
> val16 |= 0x0040;
> break;
> default:
> @@ -9138,6 +9149,7 @@ static elink_status_t elink_get_edc_mode(struct elink_phy *phy,
> break;
> }
> case ELINK_SFP_EEPROM_CON_TYPE_VAL_UNKNOWN:
> + case ELINK_SFP_EEPROM_CON_TYPE_VAL_SC:
> case ELINK_SFP_EEPROM_CON_TYPE_VAL_LC:
> case ELINK_SFP_EEPROM_CON_TYPE_VAL_RJ45:
> check_limiting_mode = 1;
> @@ -9151,7 +9163,8 @@ static elink_status_t elink_get_edc_mode(struct elink_phy *phy,
> (val[ELINK_SFP_EEPROM_1G_COMP_CODE_ADDR] != 0)) {
> ELINK_DEBUG_P0(sc, "1G SFP module detected");
> phy->media_type = ELINK_ETH_PHY_SFP_1G_FIBER;
> - if (phy->req_line_speed != ELINK_SPEED_1000) {
> + if (phy->req_line_speed != ELINK_SPEED_1000 &&
> + phy->req_line_speed != ELINK_SPEED_2500) {
> uint8_t gport = params->port;
> phy->req_line_speed = ELINK_SPEED_1000;
> if (!CHIP_IS_E1x(sc)) {
> @@ -9324,7 +9337,7 @@ static elink_status_t elink_wait_for_sfp_module_initialized(
> * some phys type ( e.g. JDSU )
> */
>
> - for (timeout = 0; timeout < 60; timeout++) {
> + for (timeout = 0; timeout < 1800; timeout++) {
> if (phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT)
> rc = elink_warpcore_read_sfp_module_eeprom(
> phy, params, ELINK_I2C_DEV_ADDR_A0, 1, 1, &val,
> @@ -12614,6 +12627,7 @@ static const struct elink_phy phy_warpcore = {
> ELINK_SUPPORTED_100baseT_Half |
> ELINK_SUPPORTED_100baseT_Full |
> ELINK_SUPPORTED_1000baseT_Full |
> + ELINK_SUPPORTED_2500baseX_Full |
> ELINK_SUPPORTED_1000baseKX_Full |
> ELINK_SUPPORTED_10000baseT_Full |
> ELINK_SUPPORTED_10000baseKR_Full |
> @@ -13156,6 +13170,7 @@ static elink_status_t elink_populate_int_phy(struct bnx2x_softc *sc,
> break;
> case PORT_HW_CFG_NET_SERDES_IF_SFI:
> phy->supported &= (ELINK_SUPPORTED_1000baseT_Full |
> + ELINK_SUPPORTED_2500baseX_Full |
> ELINK_SUPPORTED_10000baseT_Full |
> ELINK_SUPPORTED_FIBRE |
> ELINK_SUPPORTED_Pause |
> --
> 2.30.2
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-06-05 4:50 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-18 0:01 [PATCH v2] drivers/net/bnx2x : Add experimental 2.5Gbps support for BCM578xx julien_dpdk
2023-05-18 7:14 ` Jerin Jacob
2023-06-01 10:21 ` [PATCH v3] net/bnx2x : add " Julien Aube
2023-06-02 4:11 ` Jerin Jacob
2023-06-02 7:57 ` [PATCH v4] net/bnx2x: support 2.5Gbps Julien Aube
2023-06-05 4:49 ` Jerin Jacob
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).