From: Marek Behún <kabel@kernel.org> Date: 2021-03-25 13:14:06
Here are some updates for marvell10g PHY driver.
Changes since v1:
- added various MACTYPEs support also for 88E21XX
- differentiate between specific models with same PHY_ID
- better check for compatible interface
- print exact model
Marek Behún (12):
net: phy: marvell10g: rename register
net: phy: marvell10g: fix typo
net: phy: marvell10g: allow 5gbase-r and usxgmii
net: phy: marvell10g: indicate 88X33X0 only port control registers
net: phy: marvell10g: add MACTYPE definitions for 88X33X0/88X33X0P
net: phy: marvell10g: add MACTYPE definitions for 88E21XX
net: phy: marvell10g: add code to determine number of ports
net: phy: marvell10g: support all rate matching modes
net: phy: marvell10g: support other MACTYPEs
net: phy: add constants for 2.5G and 5G speed in PCS speed register
net: phy: marvell10g: print exact model
net: phy: marvell10g: better check for compatible interface
drivers/net/phy/marvell10g.c | 262 +++++++++++++++++++++++++++++------
include/uapi/linux/mdio.h | 2 +
2 files changed, 220 insertions(+), 44 deletions(-)
--
2.26.2
From: Marek Behún <kabel@kernel.org> Date: 2021-03-25 13:14:06
This space should be a tab instead.
Signed-off-by: Marek Behún <kabel@kernel.org>
---
drivers/net/phy/marvell10g.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Marek Behún <kabel@kernel.org> Date: 2021-03-25 13:14:06
The MV_V2_PORT_MAC_TYPE_* is part of the CTRL register. Rename to
MV_V2_PORT_CTRL_MACTYPE_*.
Signed-off-by: Marek Behún <kabel@kernel.org>
---
drivers/net/phy/marvell10g.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
From: Marek Behún <kabel@kernel.org> Date: 2021-03-25 13:14:06
This modes are also supported by this PHYs.
Signed-off-by: Marek Behún <kabel@kernel.org>
---
drivers/net/phy/marvell10g.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
@@ -462,9 +462,11 @@ static int mv3310_config_init(struct phy_device *phydev)/* Check that the PHY interface type is compatible */if(phydev->interface!=PHY_INTERFACE_MODE_SGMII&&phydev->interface!=PHY_INTERFACE_MODE_2500BASEX&&+phydev->interface!=PHY_INTERFACE_MODE_5GBASER&&phydev->interface!=PHY_INTERFACE_MODE_XAUI&&phydev->interface!=PHY_INTERFACE_MODE_RXAUI&&-phydev->interface!=PHY_INTERFACE_MODE_10GBASER)+phydev->interface!=PHY_INTERFACE_MODE_10GBASER&&+phydev->interface!=PHY_INTERFACE_MODE_USXGMII)return-ENODEV;phydev->mdix_ctrl=ETH_TP_MDI_AUTO;
@@ -599,6 +601,7 @@ static void mv3310_update_interface(struct phy_device *phydev)if((phydev->interface==PHY_INTERFACE_MODE_SGMII||phydev->interface==PHY_INTERFACE_MODE_2500BASEX||+phydev->interface==PHY_INTERFACE_MODE_5GBASER||phydev->interface==PHY_INTERFACE_MODE_10GBASER)&&phydev->link){/* The PHY automatically switches its serdes interface (and
From: Marek Behún <kabel@kernel.org> Date: 2021-03-25 13:14:06
Add all MACTYPE definitions for 88X3310, 88X3310P, 88X3340 and 88X3340P.
In order to have consistent naming, rename
MV_V2_33X0_PORT_CTRL_MACTYPE_RATE_MATCH to
MV_V2_33X0_PORT_CTRL_MACTYPE_10GBASER_RATE_MATCH.
Signed-off-by: Marek Behún <kabel@kernel.org>
---
drivers/net/phy/marvell10g.c | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
From: Marek Behún <kabel@kernel.org> Date: 2021-03-25 13:14:06
Indicate via register names registers that are only valid for 88X33X0,
not for 88E21X0.
Signed-off-by: Marek Behún <kabel@kernel.org>
---
drivers/net/phy/marvell10g.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
From: Marek Behún <kabel@kernel.org> Date: 2021-03-25 13:14:39
Add code to determine number of ports, from which we differentiate
88E211X from 88E218X and 88X3310 from 88X3340.
Signed-off-by: Marek Behún <kabel@kernel.org>
---
drivers/net/phy/marvell10g.c | 44 +++++++++++++++++++++++++++++++++++-
1 file changed, 43 insertions(+), 1 deletion(-)
@@ -78,6 +78,10 @@ enum {/* Temperature read register (88E2110 only) */MV_PCS_TEMP=0x8042,+MV_PCS_ID=0xd00d,+MV_PCS_ID_NPORTS_MASK=0x0380,+MV_PCS_ID_NPORTS_SHIFT=7,+/* These registers appear at 0x800X and 0xa00X - the 0xa00X control*registersappeartosetthemselvestothe0x800XwhenANis*restarted,butstatusregistersappearreadablefromeither.
@@ -108,7 +112,17 @@ enum {MV_V2_TEMP_UNKNOWN=0x9600,/* unknown function */};+enummv3310_model{+MV_MODEL_NA=0,+MV_MODEL_88E211X,+MV_MODEL_88E218X,+MV_MODEL_88X3310,+MV_MODEL_88X3340,+};+structmv3310_priv{+enummv3310_modelmodel;+u32firmware_ver;boolrate_match;
@@ -382,7 +396,7 @@ static int mv3310_probe(struct phy_device *phydev){structmv3310_priv*priv;u32mmd_mask=MDIO_DEVS_PMAPMD|MDIO_DEVS_AN;-intret;+intret,nports;if(!phydev->is_c45||(phydev->c45_ids.devices_in_package&mmd_mask)!=mmd_mask)
@@ -420,6 +434,34 @@ static int mv3310_probe(struct phy_device *phydev)priv->firmware_ver>>24,(priv->firmware_ver>>16)&255,(priv->firmware_ver>>8)&255,priv->firmware_ver&255);+ret=phy_read_mmd(phydev,MDIO_MMD_PCS,MV_PCS_ID);+if(ret<0)+returnret;++nports=((ret&MV_PCS_ID_NPORTS_MASK)>>MV_PCS_ID_NPORTS_SHIFT)+1;++switch(phydev->drv->phy_id){+caseMARVELL_PHY_ID_88X3310:+if(nports==4)+priv->model=MV_MODEL_88X3340;+elseif(nports==1)+priv->model=MV_MODEL_88X3310;+break;+caseMARVELL_PHY_ID_88E2110:+if(nports==8)+priv->model=MV_MODEL_88E218X;+elseif(nports==1)+priv->model=MV_MODEL_88E211X;+break;+default:+unreachable();+}++if(!priv->model){+phydev_err(phydev,"unknown PHY model (nports = %i)\n",nports);+return-ENODEV;+}+/* Powering down the port when not in use saves about 600mW */ret=mv3310_power_down(phydev);if(ret)
From: Marek Behún <kabel@kernel.org> Date: 2021-03-25 13:14:39
Add support for all rate matching modes, not only for 10gbase-r.
Signed-off-by: Marek Behún <kabel@kernel.org>
---
drivers/net/phy/marvell10g.c | 67 ++++++++++++++++++++++++++++++------
1 file changed, 57 insertions(+), 10 deletions(-)
@@ -512,11 +513,56 @@ static bool mv3310_has_pma_ngbaset_quirk(struct phy_device *phydev)MV_PHY_ALASKA_NBT_QUIRK_MASK)==MV_PHY_ALASKA_NBT_QUIRK_REV;}-staticintmv3310_config_init(structphy_device*phydev)+staticintmv2110_init_interface(structphy_device*phydev)+{+structmv3310_priv*priv=dev_get_drvdata(&phydev->mdio.dev);+intmactype;++mactype=phy_read_mmd(phydev,MDIO_MMD_PMAPMD,MV_PMA_21X0_PORT_CTRL);+if(mactype<0)+returnmactype;++mactype&=MV_PMA_21X0_PORT_CTRL_MACTYPE_MASK;++if(mactype==MV_PMA_21X0_PORT_CTRL_MACTYPE_10GBASER_RATE_MATCH){+priv->rate_match=true;+priv->const_interface=PHY_INTERFACE_MODE_10GBASER;+}++return0;+}++staticintmv3310_init_interface(structphy_device*phydev){structmv3310_priv*priv=dev_get_drvdata(&phydev->mdio.dev);+intmactype;++mactype=phy_read_mmd(phydev,MDIO_MMD_VEND2,MV_V2_PORT_CTRL);+if(mactype<0)+returnmactype;++mactype&=MV_V2_33X0_PORT_CTRL_MACTYPE_MASK;++if(mactype==MV_V2_33X0_PORT_CTRL_MACTYPE_10GBASER_RATE_MATCH||+mactype==MV_V2_33X0_PORT_CTRL_MACTYPE_RXAUI_RATE_MATCH||+(mactype==MV_V2_3310_PORT_CTRL_MACTYPE_XAUI_RATE_MATCH&&+priv->model==MV_MODEL_88X3310))+priv->rate_match=true;++if(mactype==MV_V2_33X0_PORT_CTRL_MACTYPE_10GBASER_RATE_MATCH)+priv->const_interface=PHY_INTERFACE_MODE_10GBASER;+elseif(mactype==MV_V2_33X0_PORT_CTRL_MACTYPE_RXAUI_RATE_MATCH)+priv->const_interface=PHY_INTERFACE_MODE_RXAUI;+elseif(priv->model==MV_MODEL_88X3310&&+mactype==MV_V2_3310_PORT_CTRL_MACTYPE_XAUI_RATE_MATCH)+priv->const_interface=PHY_INTERFACE_MODE_XAUI;++return0;+}++staticintmv3310_config_init(structphy_device*phydev)+{interr;-intval;/* Check that the PHY interface type is compatible */if(phydev->interface!=PHY_INTERFACE_MODE_SGMII&&
@@ -649,12 +696,12 @@ static void mv3310_update_interface(struct phy_device *phydev){structmv3310_priv*priv=dev_get_drvdata(&phydev->mdio.dev);-/* In "XFI with Rate Matching" mode the PHY interface is fixed at-*10Gb.ThePHYadaptstheratetoactualwirespeedwithhelpof+/* In all of the "* with Rate Matching" modes the PHY interface is fixed+*at10Gb.ThePHYadaptstheratetoactualwirespeedwithhelpof*internal16KBbuffer.*/if(priv->rate_match){-phydev->interface=PHY_INTERFACE_MODE_10GBASER;+phydev->interface=priv->const_interface;return;}
From: Marek Behún <kabel@kernel.org> Date: 2021-03-25 13:14:39
Currently the only "changing" MACTYPE we support is when the PHY changes
between
10gbase-r / 5gbase-r / 2500base-x / sgmii
Add support for
xaui / 5gbase-r / 2500base-x / sgmii
rxaui / 5gbase-r / 2500base-x / sgmii
Signed-off-by: Marek Behún <kabel@kernel.org>
---
drivers/net/phy/marvell10g.c | 95 +++++++++++++++++++++++-------------
1 file changed, 60 insertions(+), 35 deletions(-)
@@ -696,6 +719,9 @@ static void mv3310_update_interface(struct phy_device *phydev){structmv3310_priv*priv=dev_get_drvdata(&phydev->mdio.dev);+if(!phydev->link)+return;+/* In all of the "* with Rate Matching" modes the PHY interface is fixed*at10Gb.ThePHYadaptstheratetoactualwirespeedwithhelpof*internal16KBbuffer.
@@ -705,35 +731,34 @@ static void mv3310_update_interface(struct phy_device *phydev)return;}-if((phydev->interface==PHY_INTERFACE_MODE_SGMII||-phydev->interface==PHY_INTERFACE_MODE_2500BASEX||-phydev->interface==PHY_INTERFACE_MODE_5GBASER||-phydev->interface==PHY_INTERFACE_MODE_10GBASER)&&-phydev->link){-/* The PHY automatically switches its serdes interface (and-*activePHYXSinstance)betweenCiscoSGMII,10GBase-Rand-*2500BaseXmodesaccordingtothespeed.Floriansuggests-*settingphydev->interfacetocommunicatethistotheMAC.-*Onlydothisifwearealreadyinoneoftheabovemodes.-*/-switch(phydev->speed){-caseSPEED_10000:-phydev->interface=PHY_INTERFACE_MODE_10GBASER;-break;-caseSPEED_5000:-phydev->interface=PHY_INTERFACE_MODE_5GBASER;-break;-caseSPEED_2500:-phydev->interface=PHY_INTERFACE_MODE_2500BASEX;-break;-caseSPEED_1000:-caseSPEED_100:-caseSPEED_10:-phydev->interface=PHY_INTERFACE_MODE_SGMII;-break;-default:-break;-}+if(priv->const_interface==PHY_INTERFACE_MODE_USXGMII){+phydev->interface=PHY_INTERFACE_MODE_USXGMII;+return;+}++/* The PHY automatically switches its serdes interface (and active PHYXS+*instance)betweenCiscoSGMII,2500BaseX,5GBase-Rand10GBase-R/+*xaui/rxauimodesaccordingtothespeed.+*Floriansuggestssettingphydev->interfacetocommunicatethistothe+*MAC.Onlydothisifwearealreadyinoneoftheabovemodes.+*/+switch(phydev->speed){+caseSPEED_10000:+phydev->interface=priv->const_interface;+break;+caseSPEED_5000:+phydev->interface=PHY_INTERFACE_MODE_5GBASER;+break;+caseSPEED_2500:+phydev->interface=PHY_INTERFACE_MODE_2500BASEX;+break;+caseSPEED_1000:+caseSPEED_100:+caseSPEED_10:+phydev->interface=PHY_INTERFACE_MODE_SGMII;+break;+default:+break;}}
From: Marek Behún <kabel@kernel.org> Date: 2021-03-25 13:14:40
Do a model-specific check for compatible interface:
- 88X3340 does not support XAUI
- 88E21XX does not support XAUI and RXAUI
- 88E21X1 does not support 5gbase-r
Signed-off-by: Marek Behún <kabel@kernel.org>
---
drivers/net/phy/marvell10g.c | 38 ++++++++++++++++++++++++------------
1 file changed, 25 insertions(+), 13 deletions(-)
@@ -543,6 +545,15 @@ static int mv2110_init_interface(struct phy_device *phydev)structmv3310_priv*priv=dev_get_drvdata(&phydev->mdio.dev);intmactype;+/* Check that the PHY interface type is compatible */+if(phydev->interface!=PHY_INTERFACE_MODE_SGMII&&+phydev->interface!=PHY_INTERFACE_MODE_2500BASEX&&+(phydev->interface!=PHY_INTERFACE_MODE_5GBASER||+!priv->has_5g)&&+phydev->interface!=PHY_INTERFACE_MODE_10GBASER&&+phydev->interface!=PHY_INTERFACE_MODE_USXGMII)+return-ENODEV;+mactype=phy_read_mmd(phydev,MDIO_MMD_PMAPMD,MV_PMA_21X0_PORT_CTRL);if(mactype<0)returnmactype;
@@ -573,6 +584,17 @@ static int mv3310_init_interface(struct phy_device *phydev)structmv3310_priv*priv=dev_get_drvdata(&phydev->mdio.dev);intmactype;+/* Check that the PHY interface type is compatible */+if(phydev->interface!=PHY_INTERFACE_MODE_SGMII&&+phydev->interface!=PHY_INTERFACE_MODE_2500BASEX&&+phydev->interface!=PHY_INTERFACE_MODE_5GBASER&&+(phydev->interface!=PHY_INTERFACE_MODE_XAUI||+priv->model==MV_MODEL_88X3340)&&+phydev->interface!=PHY_INTERFACE_MODE_RXAUI&&+phydev->interface!=PHY_INTERFACE_MODE_10GBASER&&+phydev->interface!=PHY_INTERFACE_MODE_USXGMII)+return-ENODEV;+mactype=phy_read_mmd(phydev,MDIO_MMD_VEND2,MV_V2_PORT_CTRL);if(mactype<0)returnmactype;
@@ -610,16 +632,6 @@ static int mv3310_config_init(struct phy_device *phydev){interr;-/* Check that the PHY interface type is compatible */-if(phydev->interface!=PHY_INTERFACE_MODE_SGMII&&-phydev->interface!=PHY_INTERFACE_MODE_2500BASEX&&-phydev->interface!=PHY_INTERFACE_MODE_5GBASER&&-phydev->interface!=PHY_INTERFACE_MODE_XAUI&&-phydev->interface!=PHY_INTERFACE_MODE_RXAUI&&-phydev->interface!=PHY_INTERFACE_MODE_10GBASER&&-phydev->interface!=PHY_INTERFACE_MODE_USXGMII)-return-ENODEV;-phydev->mdix_ctrl=ETH_TP_MDI_AUTO;/* Power up so reset works */
From: Russell King - ARM Linux admin <linux@armlinux.org.uk> Date: 2021-03-25 15:55:51
On Thu, Mar 25, 2021 at 02:12:49PM +0100, Marek Behún wrote:
quoted hunk
@@ -443,12 +446,24 @@ static int mv3310_probe(struct phy_device *phydev) switch (phydev->drv->phy_id) { case MARVELL_PHY_ID_88X3310:+ ret = phy_read_mmd(phydev, MDIO_MMD_PMAPMD, MV_PMA_XGSTAT);+ if (ret < 0)+ return ret;++ has_macsec = !(ret & MV_PMA_XGSTAT_NO_MACSEC);+ if (nports == 4) priv->model = MV_MODEL_88X3340; else if (nports == 1) priv->model = MV_MODEL_88X3310; break;
The 88X3310 and 88X3340 can be differentiated by bit 3 in the revision.
In other words, 88X3310 is 0x09a0..0x09a7, and 88X3340 is
0x09a8..0x09af. We could add a separate driver structure, which would
then allow the kernel to print a more specific string via standard
methods, like we do for other PHYs. Not sure whether that would work
for the 88X21x0 family though.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
From: Marek Behún <kabel@kernel.org> Date: 2021-03-25 16:57:37
On Thu, 25 Mar 2021 15:54:52 +0000
Russell King - ARM Linux admin [off-list ref] wrote:
On Thu, Mar 25, 2021 at 02:12:49PM +0100, Marek Behún wrote:
quoted
@@ -443,12 +446,24 @@ static int mv3310_probe(struct phy_device *phydev) switch (phydev->drv->phy_id) { case MARVELL_PHY_ID_88X3310:+ ret = phy_read_mmd(phydev, MDIO_MMD_PMAPMD, MV_PMA_XGSTAT);+ if (ret < 0)+ return ret;++ has_macsec = !(ret & MV_PMA_XGSTAT_NO_MACSEC);+ if (nports == 4) priv->model = MV_MODEL_88X3340; else if (nports == 1) priv->model = MV_MODEL_88X3310; break;
The 88X3310 and 88X3340 can be differentiated by bit 3 in the revision.
In other words, 88X3310 is 0x09a0..0x09a7, and 88X3340 is
0x09a8..0x09af. We could add a separate driver structure, which would
then allow the kernel to print a more specific string via standard
methods, like we do for other PHYs. Not sure whether that would work
for the 88X21x0 family though.
OK I will look into this. What are your thoughts on the other patches?
Marek
From: Marek Behún <kabel@kernel.org> Date: 2021-03-25 20:30:16
On Thu, 25 Mar 2021 15:54:52 +0000
Russell King - ARM Linux admin [off-list ref] wrote:
The 88X3310 and 88X3340 can be differentiated by bit 3 in the revision.
In other words, 88X3310 is 0x09a0..0x09a7, and 88X3340 is
0x09a8..0x09af. We could add a separate driver structure, which would
then allow the kernel to print a more specific string via standard
methods, like we do for other PHYs. Not sure whether that would work
for the 88X21x0 family though.
According to release notes it seems that we can also differentiate
88E211X from 88E218X (via bit 3 in register 1.3):
88E211X has 0x09B9
88E218X has 0x09B1
but not 88E2110 from 88E2111
nor 88E2180 from 88E2181.
These can be differentiated via register
3.0004.7
(bit 7 of MDIO_MMD_PCS.MDIO_SPEED., which says whether device is capable
of 5g speed)
I propose creating separate structures for mv88x3340 and mv88e218x.
We can then print the remaining info as
"(not) macsec/ptp capable"
or
"(not) 5g capable"
What do you think?
Marek
On Thu, 25 Mar 2021 15:54:52 +0000
Russell King - ARM Linux admin [off-list ref] wrote:
quoted
The 88X3310 and 88X3340 can be differentiated by bit 3 in the revision.
In other words, 88X3310 is 0x09a0..0x09a7, and 88X3340 is
0x09a8..0x09af. We could add a separate driver structure, which would
then allow the kernel to print a more specific string via standard
methods, like we do for other PHYs. Not sure whether that would work
for the 88X21x0 family though.
According to release notes it seems that we can also differentiate
88E211X from 88E218X (via bit 3 in register 1.3):
88E211X has 0x09B9
88E218X has 0x09B1
but not 88E2110 from 88E2111
nor 88E2180 from 88E2181.
These can be differentiated via register
3.0004.7
(bit 7 of MDIO_MMD_PCS.MDIO_SPEED., which says whether device is capable
of 5g speed)
If the PHY ID's are the same but you can use this register to
differentiate the two versions, then you could implement the
match_phy_device callback. This would allow you to have separate
PHY drivers. This is just meant to say you have this option, I don't
know the context good enough to state whether it's the better one.
I propose creating separate structures for mv88x3340 and mv88e218x.
We can then print the remaining info as
"(not) macsec/ptp capable"
or
"(not) 5g capable"
What do you think?
Marek
From: Marek Behún <kabel@kernel.org> Date: 2021-03-25 20:55:11
On Thu, 25 Mar 2021 21:44:21 +0100
Heiner Kallweit [off-list ref] wrote:
On 25.03.2021 21:29, Marek Behún wrote:
quoted
On Thu, 25 Mar 2021 15:54:52 +0000
Russell King - ARM Linux admin [off-list ref] wrote:
quoted
The 88X3310 and 88X3340 can be differentiated by bit 3 in the revision.
In other words, 88X3310 is 0x09a0..0x09a7, and 88X3340 is
0x09a8..0x09af. We could add a separate driver structure, which would
then allow the kernel to print a more specific string via standard
methods, like we do for other PHYs. Not sure whether that would work
for the 88X21x0 family though.
According to release notes it seems that we can also differentiate
88E211X from 88E218X (via bit 3 in register 1.3):
88E211X has 0x09B9
88E218X has 0x09B1
but not 88E2110 from 88E2111
nor 88E2180 from 88E2181.
These can be differentiated via register
3.0004.7
(bit 7 of MDIO_MMD_PCS.MDIO_SPEED., which says whether device is capable
of 5g speed)
If the PHY ID's are the same but you can use this register to
differentiate the two versions, then you could implement the
match_phy_device callback. This would allow you to have separate
PHY drivers. This is just meant to say you have this option, I don't
know the context good enough to state whether it's the better one.
Nice, didn't know about that. But I fear whether this would always work
for the 88X3310 vs 88X3310P, it is possible that this feature is only
recognizable if the firmware in the PHY is already running.
I shall look into this.
Marek
From: Russell King - ARM Linux admin <linux@armlinux.org.uk> Date: 2021-03-26 09:08:23
On Thu, Mar 25, 2021 at 09:54:14PM +0100, Marek Behún wrote:
On Thu, 25 Mar 2021 21:44:21 +0100
Heiner Kallweit [off-list ref] wrote:
quoted
On 25.03.2021 21:29, Marek Behún wrote:
quoted
On Thu, 25 Mar 2021 15:54:52 +0000
Russell King - ARM Linux admin [off-list ref] wrote:
quoted
The 88X3310 and 88X3340 can be differentiated by bit 3 in the revision.
In other words, 88X3310 is 0x09a0..0x09a7, and 88X3340 is
0x09a8..0x09af. We could add a separate driver structure, which would
then allow the kernel to print a more specific string via standard
methods, like we do for other PHYs. Not sure whether that would work
for the 88X21x0 family though.
According to release notes it seems that we can also differentiate
88E211X from 88E218X (via bit 3 in register 1.3):
88E211X has 0x09B9
88E218X has 0x09B1
but not 88E2110 from 88E2111
nor 88E2180 from 88E2181.
These can be differentiated via register
3.0004.7
(bit 7 of MDIO_MMD_PCS.MDIO_SPEED., which says whether device is capable
of 5g speed)
If the PHY ID's are the same but you can use this register to
differentiate the two versions, then you could implement the
match_phy_device callback. This would allow you to have separate
PHY drivers. This is just meant to say you have this option, I don't
know the context good enough to state whether it's the better one.
Nice, didn't know about that. But I fear whether this would always work
for the 88X3310 vs 88X3310P, it is possible that this feature is only
recognizable if the firmware in the PHY is already running.
The ID registers aren't programmable and contain the proper IDs even if
there isn't firmware loaded (I've had such a PHY here.)
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
From: Marek Behún <kabel@kernel.org> Date: 2021-03-26 11:12:33
On Fri, 26 Mar 2021 09:07:34 +0000
Russell King - ARM Linux admin [off-list ref] wrote:
quoted
Nice, didn't know about that. But I fear whether this would always work
for the 88X3310 vs 88X3310P, it is possible that this feature is only
recognizable if the firmware in the PHY is already running.
The ID registers aren't programmable and contain the proper IDs even if
there isn't firmware loaded (I've had such a PHY here.)
Yes, but the macsec feature bit is in register
MDIO_MMD_PMAPMD.MV_PMA_XGSTAT.12 (1.c001.12)
But it says "This bit is valid upon completion of reset (1.0.15 = 0)",
so it seems we can use this. :)
Marek