* [PATCH net] net: dsa: mv88e6xxx: Restore USXGMII support for 6393X
@ 2023-12-05 22:13 Tobias Waldekranz
2023-12-06 20:37 ` Michal Smulski
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Tobias Waldekranz @ 2023-12-05 22:13 UTC (permalink / raw)
To: davem, kuba; +Cc: andrew, f.fainelli, olteanv, linux, michal.smulski, netdev
In 4a56212774ac, USXGMII support was added for 6393X, but this was
lost in the PCS conversion (the blamed commit), most likely because
these efforts where more or less done in parallel.
Restore this feature by porting Michal's patch to fit the new
implementation.
Fixes: e5b732a275f5 ("net: dsa: mv88e6xxx: convert 88e639x to phylink_pcs")
Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
---
drivers/net/dsa/mv88e6xxx/pcs-639x.c | 31 ++++++++++++++++++++++++++--
1 file changed, 29 insertions(+), 2 deletions(-)
diff --git a/drivers/net/dsa/mv88e6xxx/pcs-639x.c b/drivers/net/dsa/mv88e6xxx/pcs-639x.c
index 9a8429f5d09c..d758a6c1b226 100644
--- a/drivers/net/dsa/mv88e6xxx/pcs-639x.c
+++ b/drivers/net/dsa/mv88e6xxx/pcs-639x.c
@@ -465,6 +465,7 @@ mv88e639x_pcs_select(struct mv88e6xxx_chip *chip, int port,
case PHY_INTERFACE_MODE_10GBASER:
case PHY_INTERFACE_MODE_XAUI:
case PHY_INTERFACE_MODE_RXAUI:
+ case PHY_INTERFACE_MODE_USXGMII:
return &mpcs->xg_pcs;
default:
@@ -873,7 +874,8 @@ static int mv88e6393x_xg_pcs_post_config(struct phylink_pcs *pcs,
struct mv88e639x_pcs *mpcs = xg_pcs_to_mv88e639x_pcs(pcs);
int err;
- if (interface == PHY_INTERFACE_MODE_10GBASER) {
+ if (interface == PHY_INTERFACE_MODE_10GBASER ||
+ interface == PHY_INTERFACE_MODE_USXGMII) {
err = mv88e6393x_erratum_5_2(mpcs);
if (err)
return err;
@@ -886,12 +888,37 @@ static int mv88e6393x_xg_pcs_post_config(struct phylink_pcs *pcs,
return mv88e639x_xg_pcs_enable(mpcs);
}
+static void mv88e6393x_xg_pcs_get_state(struct phylink_pcs *pcs,
+ struct phylink_link_state *state)
+{
+ struct mv88e639x_pcs *mpcs = xg_pcs_to_mv88e639x_pcs(pcs);
+ u16 status, lp_status;
+ int err;
+
+ if (state->interface != PHY_INTERFACE_MODE_USXGMII)
+ return mv88e639x_xg_pcs_get_state(pcs, state);
+
+ state->link = false;
+
+ err = mv88e639x_read(mpcs, MV88E6390_USXGMII_PHY_STATUS, &status);
+ err = err ? : mv88e639x_read(mpcs, MV88E6390_USXGMII_LP_STATUS, &lp_status);
+ if (err) {
+ dev_err(mpcs->mdio.dev.parent,
+ "can't read USXGMII status: %pe\n", ERR_PTR(err));
+ return;
+ }
+
+ state->link = !!(status & MDIO_USXGMII_LINK);
+ state->an_complete = state->link;
+ phylink_decode_usxgmii_word(state, lp_status);
+}
+
static const struct phylink_pcs_ops mv88e6393x_xg_pcs_ops = {
.pcs_enable = mv88e6393x_xg_pcs_enable,
.pcs_disable = mv88e6393x_xg_pcs_disable,
.pcs_pre_config = mv88e6393x_xg_pcs_pre_config,
.pcs_post_config = mv88e6393x_xg_pcs_post_config,
- .pcs_get_state = mv88e639x_xg_pcs_get_state,
+ .pcs_get_state = mv88e6393x_xg_pcs_get_state,
.pcs_config = mv88e639x_xg_pcs_config,
};
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* RE: [PATCH net] net: dsa: mv88e6xxx: Restore USXGMII support for 6393X
2023-12-05 22:13 [PATCH net] net: dsa: mv88e6xxx: Restore USXGMII support for 6393X Tobias Waldekranz
@ 2023-12-06 20:37 ` Michal Smulski
2023-12-06 21:07 ` Andrew Lunn
2023-12-06 21:43 ` Michal Smulski
2023-12-06 21:19 ` Florian Fainelli
` (2 subsequent siblings)
3 siblings, 2 replies; 7+ messages in thread
From: Michal Smulski @ 2023-12-06 20:37 UTC (permalink / raw)
To: Tobias Waldekranz, davem@davemloft.net, kuba@kernel.org
Cc: andrew@lunn.ch, f.fainelli@gmail.com, olteanv@gmail.com,
linux@armlinux.org.uk, netdev@vger.kernel.org
I confirm that applying this patch to net-next tree works (and it is required) on my hardware.
Here is log from the kernel running on the actual hardware:
[ 49.818070] mv88e6085 0x0000000008b96000:02: switch 0x1920 detected: Marvell 88E6191X, revision 0
[ 50.429506] mv88e6085 0x0000000008b96000:02: configuring for inband/usxgmii link mode
[ 50.509099] mv88e6085 0x0000000008b96000:02 p1 (uninitialized): PHY [!soc!mdio@8b96000!switch0@2!mdio:01] driver [Marvell 88E6393 Family] (irq=388)
[ 50.577062] mv88e6085 0x0000000008b96000:02 p2 (uninitialized): PHY [!soc!mdio@8b96000!switch0@2!mdio:02] driver [Marvell 88E6393 Family] (irq=389)
[ 50.635256] mv88e6085 0x0000000008b96000:02: Link is Up - 10Gbps/Full - flow control off
[ 50.641109] mv88e6085 0x0000000008b96000:02 p3 (uninitialized): PHY [!soc!mdio@8b96000!switch0@2!mdio:03] driver [Marvell 88E6393 Family] (irq=391)
[ 50.697091] mv88e6085 0x0000000008b96000:02 p4 (uninitialized): PHY [!soc!mdio@8b96000!switch0@2!mdio:04] driver [Marvell 88E6393 Family] (irq=392)
[ 50.725072] mv88e6085 0x0000000008b96000:02 p5 (uninitialized): PHY [!soc!mdio@8b96000!switch0@2!mdio:05] driver [Marvell 88E6393 Family] (irq=393)
[ 50.753074] mv88e6085 0x0000000008b96000:02 p6 (uninitialized): PHY [!soc!mdio@8b96000!switch0@2!mdio:06] driver [Marvell 88E6393 Family] (irq=394)
[ 50.781085] mv88e6085 0x0000000008b96000:02 p7 (uninitialized): PHY [!soc!mdio@8b96000!switch0@2!mdio:07] driver [Marvell 88E6393 Family] (irq=395)
[ 50.809080] mv88e6085 0x0000000008b96000:02 p8 (uninitialized): PHY [!soc!mdio@8b96000!switch0@2!mdio:08] driver [Marvell 88E6393 Family] (irq=396)
[ 50.815677] DSA: tree 0 setup
[ 170.719608] fsl_dpaa2_eth dpni.3 eth1: configuring for inband/usxgmii link mode
[ 170.735697] fsl_dpaa2_eth dpni.3 eth1: Link is Up - 10Gbps/Full - flow control off
[ 170.813015] mv88e6085 0x0000000008b96000:02 p8: configuring for phy/gmii link mode
[ 170.913510] mv88e6085 0x0000000008b96000:02 p7: configuring for phy/gmii link mode
[ 171.014155] mv88e6085 0x0000000008b96000:02 p6: configuring for phy/gmii link mode
[ 171.119832] mv88e6085 0x0000000008b96000:02 p5: configuring for phy/gmii link mode
[ 171.230594] mv88e6085 0x0000000008b96000:02 p4: configuring for phy/gmii link mode
[ 171.346344] mv88e6085 0x0000000008b96000:02 p3: configuring for phy/gmii link mode
[ 171.472394] mv88e6085 0x0000000008b96000:02 p2: configuring for phy/gmii link mode
[ 171.594045] mv88e6085 0x0000000008b96000:02 p1: configuring for phy/gmii link mode
[ 969.248179] mv88e6085 0x0000000008b96000:02 p8: Link is Up - 1Gbps/Full - flow control rx/tx
[ 1089.691582] mv88e6085 0x0000000008b96000:02 p8: Link is Down
[ 1452.761369] mv88e6085 0x0000000008b96000:02 p8: Link is Up - 1Gbps/Full - flow control rx/tx
Michal
-----Original Message-----
From: Tobias Waldekranz <tobias@waldekranz.com>
Sent: Tuesday, December 5, 2023 2:14 PM
To: davem@davemloft.net; kuba@kernel.org
Cc: andrew@lunn.ch; f.fainelli@gmail.com; olteanv@gmail.com; linux@armlinux.org.uk; Michal Smulski <michal.smulski@ooma.com>; netdev@vger.kernel.org
Subject: [PATCH net] net: dsa: mv88e6xxx: Restore USXGMII support for 6393X
CAUTION: This email is originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
In 4a56212774ac, USXGMII support was added for 6393X, but this was lost in the PCS conversion (the blamed commit), most likely because these efforts where more or less done in parallel.
Restore this feature by porting Michal's patch to fit the new implementation.
Fixes: e5b732a275f5 ("net: dsa: mv88e6xxx: convert 88e639x to phylink_pcs")
Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
---
drivers/net/dsa/mv88e6xxx/pcs-639x.c | 31 ++++++++++++++++++++++++++--
1 file changed, 29 insertions(+), 2 deletions(-)
diff --git a/drivers/net/dsa/mv88e6xxx/pcs-639x.c b/drivers/net/dsa/mv88e6xxx/pcs-639x.c
index 9a8429f5d09c..d758a6c1b226 100644
--- a/drivers/net/dsa/mv88e6xxx/pcs-639x.c
+++ b/drivers/net/dsa/mv88e6xxx/pcs-639x.c
@@ -465,6 +465,7 @@ mv88e639x_pcs_select(struct mv88e6xxx_chip *chip, int port,
case PHY_INTERFACE_MODE_10GBASER:
case PHY_INTERFACE_MODE_XAUI:
case PHY_INTERFACE_MODE_RXAUI:
+ case PHY_INTERFACE_MODE_USXGMII:
return &mpcs->xg_pcs;
default:
@@ -873,7 +874,8 @@ static int mv88e6393x_xg_pcs_post_config(struct phylink_pcs *pcs,
struct mv88e639x_pcs *mpcs = xg_pcs_to_mv88e639x_pcs(pcs);
int err;
- if (interface == PHY_INTERFACE_MODE_10GBASER) {
+ if (interface == PHY_INTERFACE_MODE_10GBASER ||
+ interface == PHY_INTERFACE_MODE_USXGMII) {
err = mv88e6393x_erratum_5_2(mpcs);
if (err)
return err;
@@ -886,12 +888,37 @@ static int mv88e6393x_xg_pcs_post_config(struct phylink_pcs *pcs,
return mv88e639x_xg_pcs_enable(mpcs); }
+static void mv88e6393x_xg_pcs_get_state(struct phylink_pcs *pcs,
+ struct phylink_link_state
+*state) {
+ struct mv88e639x_pcs *mpcs = xg_pcs_to_mv88e639x_pcs(pcs);
+ u16 status, lp_status;
+ int err;
+
+ if (state->interface != PHY_INTERFACE_MODE_USXGMII)
+ return mv88e639x_xg_pcs_get_state(pcs, state);
+
+ state->link = false;
+
+ err = mv88e639x_read(mpcs, MV88E6390_USXGMII_PHY_STATUS, &status);
+ err = err ? : mv88e639x_read(mpcs, MV88E6390_USXGMII_LP_STATUS, &lp_status);
+ if (err) {
+ dev_err(mpcs->mdio.dev.parent,
+ "can't read USXGMII status: %pe\n", ERR_PTR(err));
+ return;
+ }
+
+ state->link = !!(status & MDIO_USXGMII_LINK);
+ state->an_complete = state->link;
+ phylink_decode_usxgmii_word(state, lp_status); }
+
static const struct phylink_pcs_ops mv88e6393x_xg_pcs_ops = {
.pcs_enable = mv88e6393x_xg_pcs_enable,
.pcs_disable = mv88e6393x_xg_pcs_disable,
.pcs_pre_config = mv88e6393x_xg_pcs_pre_config,
.pcs_post_config = mv88e6393x_xg_pcs_post_config,
- .pcs_get_state = mv88e639x_xg_pcs_get_state,
+ .pcs_get_state = mv88e6393x_xg_pcs_get_state,
.pcs_config = mv88e639x_xg_pcs_config, };
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH net] net: dsa: mv88e6xxx: Restore USXGMII support for 6393X
2023-12-06 20:37 ` Michal Smulski
@ 2023-12-06 21:07 ` Andrew Lunn
2023-12-06 21:43 ` Michal Smulski
1 sibling, 0 replies; 7+ messages in thread
From: Andrew Lunn @ 2023-12-06 21:07 UTC (permalink / raw)
To: Michal Smulski
Cc: Tobias Waldekranz, davem@davemloft.net, kuba@kernel.org,
f.fainelli@gmail.com, olteanv@gmail.com, linux@armlinux.org.uk,
netdev@vger.kernel.org
On Wed, Dec 06, 2023 at 08:37:50PM +0000, Michal Smulski wrote:
> I confirm that applying this patch to net-next tree works (and it is required) on my hardware.
>
> Here is log from the kernel running on the actual hardware:
> [ 49.818070] mv88e6085 0x0000000008b96000:02: switch 0x1920 detected: Marvell 88E6191X, revision 0
> [ 50.429506] mv88e6085 0x0000000008b96000:02: configuring for inband/usxgmii link mode
> [ 50.509099] mv88e6085 0x0000000008b96000:02 p1 (uninitialized): PHY [!soc!mdio@8b96000!switch0@2!mdio:01] driver [Marvell 88E6393 Family] (irq=388)
> [ 50.577062] mv88e6085 0x0000000008b96000:02 p2 (uninitialized): PHY [!soc!mdio@8b96000!switch0@2!mdio:02] driver [Marvell 88E6393 Family] (irq=389)
> [ 50.635256] mv88e6085 0x0000000008b96000:02: Link is Up - 10Gbps/Full - flow control off
> [ 50.641109] mv88e6085 0x0000000008b96000:02 p3 (uninitialized): PHY [!soc!mdio@8b96000!switch0@2!mdio:03] driver [Marvell 88E6393 Family] (irq=391)
> [ 50.697091] mv88e6085 0x0000000008b96000:02 p4 (uninitialized): PHY [!soc!mdio@8b96000!switch0@2!mdio:04] driver [Marvell 88E6393 Family] (irq=392)
> [ 50.725072] mv88e6085 0x0000000008b96000:02 p5 (uninitialized): PHY [!soc!mdio@8b96000!switch0@2!mdio:05] driver [Marvell 88E6393 Family] (irq=393)
> [ 50.753074] mv88e6085 0x0000000008b96000:02 p6 (uninitialized): PHY [!soc!mdio@8b96000!switch0@2!mdio:06] driver [Marvell 88E6393 Family] (irq=394)
> [ 50.781085] mv88e6085 0x0000000008b96000:02 p7 (uninitialized): PHY [!soc!mdio@8b96000!switch0@2!mdio:07] driver [Marvell 88E6393 Family] (irq=395)
> [ 50.809080] mv88e6085 0x0000000008b96000:02 p8 (uninitialized): PHY [!soc!mdio@8b96000!switch0@2!mdio:08] driver [Marvell 88E6393 Family] (irq=396)
> [ 50.815677] DSA: tree 0 setup
> [ 170.719608] fsl_dpaa2_eth dpni.3 eth1: configuring for inband/usxgmii link mode
> [ 170.735697] fsl_dpaa2_eth dpni.3 eth1: Link is Up - 10Gbps/Full - flow control off
> [ 170.813015] mv88e6085 0x0000000008b96000:02 p8: configuring for phy/gmii link mode
> [ 170.913510] mv88e6085 0x0000000008b96000:02 p7: configuring for phy/gmii link mode
> [ 171.014155] mv88e6085 0x0000000008b96000:02 p6: configuring for phy/gmii link mode
> [ 171.119832] mv88e6085 0x0000000008b96000:02 p5: configuring for phy/gmii link mode
> [ 171.230594] mv88e6085 0x0000000008b96000:02 p4: configuring for phy/gmii link mode
> [ 171.346344] mv88e6085 0x0000000008b96000:02 p3: configuring for phy/gmii link mode
> [ 171.472394] mv88e6085 0x0000000008b96000:02 p2: configuring for phy/gmii link mode
> [ 171.594045] mv88e6085 0x0000000008b96000:02 p1: configuring for phy/gmii link mode
> [ 969.248179] mv88e6085 0x0000000008b96000:02 p8: Link is Up - 1Gbps/Full - flow control rx/tx
> [ 1089.691582] mv88e6085 0x0000000008b96000:02 p8: Link is Down
> [ 1452.761369] mv88e6085 0x0000000008b96000:02 p8: Link is Up - 1Gbps/Full - flow control rx/tx
>
>
> Michal
Hi Michal
Would you mind adding a Tested-by:
See https://www.kernel.org/doc/html/latest/process/submitting-patches.html#using-reported-by-tested-by-reviewed-by-suggested-by-and-fixes
Andrew
^ permalink raw reply [flat|nested] 7+ messages in thread* RE: [PATCH net] net: dsa: mv88e6xxx: Restore USXGMII support for 6393X
2023-12-06 20:37 ` Michal Smulski
2023-12-06 21:07 ` Andrew Lunn
@ 2023-12-06 21:43 ` Michal Smulski
1 sibling, 0 replies; 7+ messages in thread
From: Michal Smulski @ 2023-12-06 21:43 UTC (permalink / raw)
To: Tobias Waldekranz, davem@davemloft.net, kuba@kernel.org
Cc: andrew@lunn.ch, f.fainelli@gmail.com, olteanv@gmail.com,
linux@armlinux.org.uk, netdev@vger.kernel.org
Tested-by: Michal Smulski <michal.smulski@ooma.com>
-----Original Message-----
From: Michal Smulski <michal.smulski@ooma.com>
Sent: Wednesday, December 6, 2023 12:38 PM
To: Tobias Waldekranz <tobias@waldekranz.com>; davem@davemloft.net; kuba@kernel.org
Cc: andrew@lunn.ch; f.fainelli@gmail.com; olteanv@gmail.com; linux@armlinux.org.uk; netdev@vger.kernel.org
Subject: RE: [PATCH net] net: dsa: mv88e6xxx: Restore USXGMII support for 6393X
I confirm that applying this patch to net-next tree works (and it is required) on my hardware.
Here is log from the kernel running on the actual hardware:
[ 49.818070] mv88e6085 0x0000000008b96000:02: switch 0x1920 detected: Marvell 88E6191X, revision 0
[ 50.429506] mv88e6085 0x0000000008b96000:02: configuring for inband/usxgmii link mode
[ 50.509099] mv88e6085 0x0000000008b96000:02 p1 (uninitialized): PHY [!soc!mdio@8b96000!switch0@2!mdio:01] driver [Marvell 88E6393 Family] (irq=388)
[ 50.577062] mv88e6085 0x0000000008b96000:02 p2 (uninitialized): PHY [!soc!mdio@8b96000!switch0@2!mdio:02] driver [Marvell 88E6393 Family] (irq=389)
[ 50.635256] mv88e6085 0x0000000008b96000:02: Link is Up - 10Gbps/Full - flow control off
[ 50.641109] mv88e6085 0x0000000008b96000:02 p3 (uninitialized): PHY [!soc!mdio@8b96000!switch0@2!mdio:03] driver [Marvell 88E6393 Family] (irq=391)
[ 50.697091] mv88e6085 0x0000000008b96000:02 p4 (uninitialized): PHY [!soc!mdio@8b96000!switch0@2!mdio:04] driver [Marvell 88E6393 Family] (irq=392)
[ 50.725072] mv88e6085 0x0000000008b96000:02 p5 (uninitialized): PHY [!soc!mdio@8b96000!switch0@2!mdio:05] driver [Marvell 88E6393 Family] (irq=393)
[ 50.753074] mv88e6085 0x0000000008b96000:02 p6 (uninitialized): PHY [!soc!mdio@8b96000!switch0@2!mdio:06] driver [Marvell 88E6393 Family] (irq=394)
[ 50.781085] mv88e6085 0x0000000008b96000:02 p7 (uninitialized): PHY [!soc!mdio@8b96000!switch0@2!mdio:07] driver [Marvell 88E6393 Family] (irq=395)
[ 50.809080] mv88e6085 0x0000000008b96000:02 p8 (uninitialized): PHY [!soc!mdio@8b96000!switch0@2!mdio:08] driver [Marvell 88E6393 Family] (irq=396)
[ 50.815677] DSA: tree 0 setup
[ 170.719608] fsl_dpaa2_eth dpni.3 eth1: configuring for inband/usxgmii link mode [ 170.735697] fsl_dpaa2_eth dpni.3 eth1: Link is Up - 10Gbps/Full - flow control off [ 170.813015] mv88e6085 0x0000000008b96000:02 p8: configuring for phy/gmii link mode [ 170.913510] mv88e6085 0x0000000008b96000:02 p7: configuring for phy/gmii link mode [ 171.014155] mv88e6085 0x0000000008b96000:02 p6: configuring for phy/gmii link mode [ 171.119832] mv88e6085 0x0000000008b96000:02 p5: configuring for phy/gmii link mode [ 171.230594] mv88e6085 0x0000000008b96000:02 p4: configuring for phy/gmii link mode [ 171.346344] mv88e6085 0x0000000008b96000:02 p3: configuring for phy/gmii link mode [ 171.472394] mv88e6085 0x0000000008b96000:02 p2: configuring for phy/gmii link mode [ 171.594045] mv88e6085 0x0000000008b96000:02 p1: configuring for phy/gmii link mode [ 969.248179] mv88e6085 0x0000000008b96000:02 p8: Link is Up - 1Gbps/Full - flow control rx/tx [ 1089.691582] mv88e6085 0x0000000008b96000:02 p8: Link is Down [ 1452.761369] mv88e6085 0x0000000008b96000:02 p8: Link is Up - 1Gbps/Full - flow control rx/tx
Michal
-----Original Message-----
From: Tobias Waldekranz <tobias@waldekranz.com>
Sent: Tuesday, December 5, 2023 2:14 PM
To: davem@davemloft.net; kuba@kernel.org
Cc: andrew@lunn.ch; f.fainelli@gmail.com; olteanv@gmail.com; linux@armlinux.org.uk; Michal Smulski <michal.smulski@ooma.com>; netdev@vger.kernel.org
Subject: [PATCH net] net: dsa: mv88e6xxx: Restore USXGMII support for 6393X
CAUTION: This email is originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
In 4a56212774ac, USXGMII support was added for 6393X, but this was lost in the PCS conversion (the blamed commit), most likely because these efforts where more or less done in parallel.
Restore this feature by porting Michal's patch to fit the new implementation.
Fixes: e5b732a275f5 ("net: dsa: mv88e6xxx: convert 88e639x to phylink_pcs")
Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
---
drivers/net/dsa/mv88e6xxx/pcs-639x.c | 31 ++++++++++++++++++++++++++--
1 file changed, 29 insertions(+), 2 deletions(-)
diff --git a/drivers/net/dsa/mv88e6xxx/pcs-639x.c b/drivers/net/dsa/mv88e6xxx/pcs-639x.c
index 9a8429f5d09c..d758a6c1b226 100644
--- a/drivers/net/dsa/mv88e6xxx/pcs-639x.c
+++ b/drivers/net/dsa/mv88e6xxx/pcs-639x.c
@@ -465,6 +465,7 @@ mv88e639x_pcs_select(struct mv88e6xxx_chip *chip, int port,
case PHY_INTERFACE_MODE_10GBASER:
case PHY_INTERFACE_MODE_XAUI:
case PHY_INTERFACE_MODE_RXAUI:
+ case PHY_INTERFACE_MODE_USXGMII:
return &mpcs->xg_pcs;
default:
@@ -873,7 +874,8 @@ static int mv88e6393x_xg_pcs_post_config(struct phylink_pcs *pcs,
struct mv88e639x_pcs *mpcs = xg_pcs_to_mv88e639x_pcs(pcs);
int err;
- if (interface == PHY_INTERFACE_MODE_10GBASER) {
+ if (interface == PHY_INTERFACE_MODE_10GBASER ||
+ interface == PHY_INTERFACE_MODE_USXGMII) {
err = mv88e6393x_erratum_5_2(mpcs);
if (err)
return err;
@@ -886,12 +888,37 @@ static int mv88e6393x_xg_pcs_post_config(struct phylink_pcs *pcs,
return mv88e639x_xg_pcs_enable(mpcs); }
+static void mv88e6393x_xg_pcs_get_state(struct phylink_pcs *pcs,
+ struct phylink_link_state
+*state) {
+ struct mv88e639x_pcs *mpcs = xg_pcs_to_mv88e639x_pcs(pcs);
+ u16 status, lp_status;
+ int err;
+
+ if (state->interface != PHY_INTERFACE_MODE_USXGMII)
+ return mv88e639x_xg_pcs_get_state(pcs, state);
+
+ state->link = false;
+
+ err = mv88e639x_read(mpcs, MV88E6390_USXGMII_PHY_STATUS, &status);
+ err = err ? : mv88e639x_read(mpcs, MV88E6390_USXGMII_LP_STATUS, &lp_status);
+ if (err) {
+ dev_err(mpcs->mdio.dev.parent,
+ "can't read USXGMII status: %pe\n", ERR_PTR(err));
+ return;
+ }
+
+ state->link = !!(status & MDIO_USXGMII_LINK);
+ state->an_complete = state->link;
+ phylink_decode_usxgmii_word(state, lp_status); }
+
static const struct phylink_pcs_ops mv88e6393x_xg_pcs_ops = {
.pcs_enable = mv88e6393x_xg_pcs_enable,
.pcs_disable = mv88e6393x_xg_pcs_disable,
.pcs_pre_config = mv88e6393x_xg_pcs_pre_config,
.pcs_post_config = mv88e6393x_xg_pcs_post_config,
- .pcs_get_state = mv88e639x_xg_pcs_get_state,
+ .pcs_get_state = mv88e6393x_xg_pcs_get_state,
.pcs_config = mv88e639x_xg_pcs_config, };
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH net] net: dsa: mv88e6xxx: Restore USXGMII support for 6393X
2023-12-05 22:13 [PATCH net] net: dsa: mv88e6xxx: Restore USXGMII support for 6393X Tobias Waldekranz
2023-12-06 20:37 ` Michal Smulski
@ 2023-12-06 21:19 ` Florian Fainelli
2023-12-06 22:02 ` Vladimir Oltean
2023-12-07 3:30 ` patchwork-bot+netdevbpf
3 siblings, 0 replies; 7+ messages in thread
From: Florian Fainelli @ 2023-12-06 21:19 UTC (permalink / raw)
To: Tobias Waldekranz, davem, kuba
Cc: andrew, olteanv, linux, michal.smulski, netdev
On 12/5/23 14:13, Tobias Waldekranz wrote:
> In 4a56212774ac, USXGMII support was added for 6393X, but this was
> lost in the PCS conversion (the blamed commit), most likely because
> these efforts where more or less done in parallel.
>
> Restore this feature by porting Michal's patch to fit the new
> implementation.
>
> Fixes: e5b732a275f5 ("net: dsa: mv88e6xxx: convert 88e639x to phylink_pcs")
> Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
--
Florian
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH net] net: dsa: mv88e6xxx: Restore USXGMII support for 6393X
2023-12-05 22:13 [PATCH net] net: dsa: mv88e6xxx: Restore USXGMII support for 6393X Tobias Waldekranz
2023-12-06 20:37 ` Michal Smulski
2023-12-06 21:19 ` Florian Fainelli
@ 2023-12-06 22:02 ` Vladimir Oltean
2023-12-07 3:30 ` patchwork-bot+netdevbpf
3 siblings, 0 replies; 7+ messages in thread
From: Vladimir Oltean @ 2023-12-06 22:02 UTC (permalink / raw)
To: Tobias Waldekranz
Cc: davem, kuba, andrew, f.fainelli, linux, michal.smulski, netdev
On Tue, Dec 05, 2023 at 11:13:59PM +0100, Tobias Waldekranz wrote:
> In 4a56212774ac, USXGMII support was added for 6393X, but this was
> lost in the PCS conversion (the blamed commit), most likely because
> these efforts where more or less done in parallel.
>
> Restore this feature by porting Michal's patch to fit the new
> implementation.
>
> Fixes: e5b732a275f5 ("net: dsa: mv88e6xxx: convert 88e639x to phylink_pcs")
> Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
> ---
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH net] net: dsa: mv88e6xxx: Restore USXGMII support for 6393X
2023-12-05 22:13 [PATCH net] net: dsa: mv88e6xxx: Restore USXGMII support for 6393X Tobias Waldekranz
` (2 preceding siblings ...)
2023-12-06 22:02 ` Vladimir Oltean
@ 2023-12-07 3:30 ` patchwork-bot+netdevbpf
3 siblings, 0 replies; 7+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-12-07 3:30 UTC (permalink / raw)
To: Tobias Waldekranz
Cc: davem, kuba, andrew, f.fainelli, olteanv, linux, michal.smulski,
netdev
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Tue, 5 Dec 2023 23:13:59 +0100 you wrote:
> In 4a56212774ac, USXGMII support was added for 6393X, but this was
> lost in the PCS conversion (the blamed commit), most likely because
> these efforts where more or less done in parallel.
>
> Restore this feature by porting Michal's patch to fit the new
> implementation.
>
> [...]
Here is the summary with links:
- [net] net: dsa: mv88e6xxx: Restore USXGMII support for 6393X
https://git.kernel.org/netdev/net/c/0c7ed1f9197a
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2023-12-07 3:30 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-05 22:13 [PATCH net] net: dsa: mv88e6xxx: Restore USXGMII support for 6393X Tobias Waldekranz
2023-12-06 20:37 ` Michal Smulski
2023-12-06 21:07 ` Andrew Lunn
2023-12-06 21:43 ` Michal Smulski
2023-12-06 21:19 ` Florian Fainelli
2023-12-06 22:02 ` Vladimir Oltean
2023-12-07 3:30 ` patchwork-bot+netdevbpf
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).