stmmac: add new DT platform entries for GMAC4
authorAlexandre TORGUE <alexandre.torgue@st.com>
Fri, 1 Apr 2016 09:37:33 +0000 (11:37 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 3 Apr 2016 00:23:09 +0000 (20:23 -0400)
This is to support the snps,dwmac-4.00 and snps,dwmac-4.10a
and related features on the platform driver.
See binding doc for further details.

Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: Alexandre TORGUE <alexandre.torgue@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Documentation/devicetree/bindings/net/stmmac.txt
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
include/linux/stmmac.h

index 6605d19601c2a6bcce217ef02a60f5afb42e0d55..4d302db657c0bcb33039feb4fdd47e27d105e4c7 100644 (file)
@@ -59,6 +59,8 @@ Optional properties:
        - snps,fb: fixed-burst
        - snps,mb: mixed-burst
        - snps,rb: rebuild INCRx Burst
+       - snps,tso: this enables the TSO feature otherwise it will be managed by
+           MAC HW capability register.
 - mdio: with compatible = "snps,dwmac-mdio", create and register mdio bus.
 
 Examples:
index cf37ea558ecc965543e9f8da7a10ebe715e20f15..effaa4ff5ab7b43a19f0db167e8c94a8a734f425 100644 (file)
@@ -284,6 +284,13 @@ stmmac_probe_config_dt(struct platform_device *pdev, const char **mac)
                plat->pmt = 1;
        }
 
+       if (of_device_is_compatible(np, "snps,dwmac-4.00") ||
+           of_device_is_compatible(np, "snps,dwmac-4.10a")) {
+               plat->has_gmac4 = 1;
+               plat->pmt = 1;
+               plat->tso_en = of_property_read_bool(np, "snps,tso");
+       }
+
        if (of_device_is_compatible(np, "snps,dwmac-3.610") ||
                of_device_is_compatible(np, "snps,dwmac-3.710")) {
                plat->enh_desc = 1;
index e6bc30a42a7494d4626412a4b63641b1008e2ad0..ffdaca9c01af57d895f4d9a4ce53995366709135 100644 (file)
@@ -137,5 +137,7 @@ struct plat_stmmacenet_data {
        void (*exit)(struct platform_device *pdev, void *priv);
        void *bsp_priv;
        struct stmmac_axi *axi;
+       int has_gmac4;
+       bool tso_en;
 };
 #endif