]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
net: mvpp2: Read phy-speed from DT to select between 1GB and 2.5GB SGMII
authorStefan Roese <sr@denx.de>
Wed, 22 Mar 2017 13:15:40 +0000 (14:15 +0100)
committerStefan Roese <sr@denx.de>
Wed, 29 Mar 2017 05:43:20 +0000 (07:43 +0200)
Read the "phy-speed" DT property to differentiate between 1 and 2.5GB
SGMII operations. Please note that its unclear right now, if this
DT property will be accepted in mainline Linux. If not, we need to
revisit this code and change it to use the accepted property.

Signed-off-by: Stefan Roese <sr@denx.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
drivers/net/mvpp2.c

index 1c83884d19d4d6a386985d22a78ba000d4a78d95..245a760e2771d5fc0f1f36db509b6ce1dd273e6d 100644 (file)
@@ -839,6 +839,8 @@ struct mvpp2_port {
        unsigned int duplex;
        unsigned int speed;
 
+       unsigned int phy_speed;         /* SGMII 1Gbps vs 2.5Gbps */
+
        struct mvpp2_bm_pool *pool_long;
        struct mvpp2_bm_pool *pool_short;
 
@@ -3852,6 +3854,15 @@ static int phy_info_parse(struct udevice *dev, struct mvpp2_port *port)
                return -EINVAL;
        }
 
+       /*
+        * ToDo:
+        * Not sure if this DT property "phy-speed" will get accepted, so
+        * this might change later
+        */
+       /* Get phy-speed for SGMII 2.5Gbps vs 1Gbps setup */
+       port->phy_speed = fdtdec_get_int(gd->fdt_blob, port_node,
+                                        "phy-speed", 1000);
+
        phyaddr = fdtdec_get_int(gd->fdt_blob, phy_node, "reg", 0);
 
        port->id = id;