Hi all,
This makes the "internal" phy-mode property generally available and
documented and this allows us to remove some custom parsing code
we had for bcmgenet and bcm_sf2 which both used that specific value.
Florian Fainelli (4):
dt-bindings: Add "internal" as a valid 'phy-mode' property
net: phy: Support "internal" PHY interface
net: bcmgenet: Remove special handling of "internal" phy-mode
net: dsa: bcm_sf2: Remove special handling of "internal" phy-mode
Documentation/devicetree/bindings/net/ethernet.txt | 1 +
drivers/net/dsa/bcm_sf2.c | 16 +++++----------
drivers/net/ethernet/broadcom/genet/bcmmii.c | 24 ++++++++--------------
include/linux/phy.h | 3 +++
4 files changed, 17 insertions(+), 27 deletions(-)
--
2.9.3
A number of Ethernet MACs have internal Ethernet PHYs and the internal
wiring makes it so that this knowledge needs to be available using the
standard 'phy-mode' property.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
Documentation/devicetree/bindings/net/ethernet.txt | 1 +
1 file changed, 1 insertion(+)
@@ -11,6 +11,7 @@ The following properties are common to the Ethernet controllers: the maximum frame size (there's contradiction in ePAPR). - phy-mode: string, operation mode of the PHY interface. This is now a de-facto standard property; supported values are:+ * "internal" * "mii" * "gmii" * "sgmii"
Now that the Device Tree binding has been updated, update the PHY
library phy_interface_t and phy_modes to support the "internal" PHY
interface type.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
include/linux/phy.h | 3 +++
1 file changed, 3 insertions(+)
@@ -251,11 +251,8 @@ int bcmgenet_mii_config(struct net_device *dev)priv->ext_phy=!priv->internal_phy&&(priv->phy_interface!=PHY_INTERFACE_MODE_MOCA);-if(priv->internal_phy)-priv->phy_interface=PHY_INTERFACE_MODE_NA;-switch(priv->phy_interface){-casePHY_INTERFACE_MODE_NA:+casePHY_INTERFACE_MODE_INTERNAL:casePHY_INTERFACE_MODE_MOCA:/* Irrespective of the actually configured PHY speed (100 or*1000)GENETv4onlyhasaninternalGPHYsowewilljustend
@@ -471,7 +468,6 @@ static int bcmgenet_mii_of_init(struct bcmgenet_priv *priv){structdevice_node*dn=priv->pdev->dev.of_node;structdevice*kdev=&priv->pdev->dev;-constchar*phy_mode_str=NULL;structphy_device*phydev=NULL;char*compat;intphy_mode;
@@ -510,23 +506,19 @@ static int bcmgenet_mii_of_init(struct bcmgenet_priv *priv)/* Get the link mode */phy_mode=of_get_phy_mode(dn);+if(phy_mode<0){+dev_err(kdev,"invalid PHY mode property\n");+returnphy_mode;+}+priv->phy_interface=phy_mode;/* We need to specifically look up whether this PHY interface is internal*ornot*before*weeventrytoprobethePHYdriveroverMDIOaswe*mayhaveshutdowntheinternalPHYforpowersavingpurposes.*/-if(phy_mode<0){-ret=of_property_read_string(dn,"phy-mode",&phy_mode_str);-if(ret<0){-dev_err(kdev,"invalid PHY mode property\n");-returnret;-}--priv->phy_interface=PHY_INTERFACE_MODE_NA;-if(!strcasecmp(phy_mode_str,"internal"))-priv->internal_phy=true;-}+if(priv->phy_interface==PHY_INTERFACE_MODE_INTERNAL)+priv->internal_phy=true;/* Make sure we initialize MoCA PHYs with a link down */if(phy_mode==PHY_INTERFACE_MODE_MOCA){
Hi all,
This makes the "internal" phy-mode property generally available and
documented and this allows us to remove some custom parsing code
we had for bcmgenet and bcm_sf2 which both used that specific value.
Sorry for the resend, this is net-next material.
Florian Fainelli (4):
dt-bindings: Add "internal" as a valid 'phy-mode' property
net: phy: Support "internal" PHY interface
net: bcmgenet: Remove special handling of "internal" phy-mode
net: dsa: bcm_sf2: Remove special handling of "internal" phy-mode
Documentation/devicetree/bindings/net/ethernet.txt | 1 +
drivers/net/dsa/bcm_sf2.c | 16 +++++----------
drivers/net/ethernet/broadcom/genet/bcmmii.c | 24 ++++++++--------------
include/linux/phy.h | 3 +++
4 files changed, 17 insertions(+), 27 deletions(-)
This makes the "internal" phy-mode property generally available and
documented and this allows us to remove some custom parsing code
we had for bcmgenet and bcm_sf2 which both used that specific value.