diff options
author | Alexandre TORGUE <alexandre.torgue@st.com> | 2016-04-01 05:37:33 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-04-02 20:23:09 -0400 |
commit | ee2ae1ed46251dcbdcc2c59b5e30f664ddfbacb1 (patch) | |
tree | cd6dc625f4b2dcdbe88c11b1b21045b2647bcee7 | |
parent | 36ff7c1e94a5d43a0ea2d386b211087f77669017 (diff) |
stmmac: add new DT platform entries for GMAC4
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>
-rw-r--r-- | Documentation/devicetree/bindings/net/stmmac.txt | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 7 | ||||
-rw-r--r-- | include/linux/stmmac.h | 2 |
3 files changed, 11 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/net/stmmac.txt b/Documentation/devicetree/bindings/net/stmmac.txt index 6605d19601c2..4d302db657c0 100644 --- a/Documentation/devicetree/bindings/net/stmmac.txt +++ b/Documentation/devicetree/bindings/net/stmmac.txt | |||
@@ -59,6 +59,8 @@ Optional properties: | |||
59 | - snps,fb: fixed-burst | 59 | - snps,fb: fixed-burst |
60 | - snps,mb: mixed-burst | 60 | - snps,mb: mixed-burst |
61 | - snps,rb: rebuild INCRx Burst | 61 | - snps,rb: rebuild INCRx Burst |
62 | - snps,tso: this enables the TSO feature otherwise it will be managed by | ||
63 | MAC HW capability register. | ||
62 | - mdio: with compatible = "snps,dwmac-mdio", create and register mdio bus. | 64 | - mdio: with compatible = "snps,dwmac-mdio", create and register mdio bus. |
63 | 65 | ||
64 | Examples: | 66 | Examples: |
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index cf37ea558ecc..effaa4ff5ab7 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | |||
@@ -284,6 +284,13 @@ stmmac_probe_config_dt(struct platform_device *pdev, const char **mac) | |||
284 | plat->pmt = 1; | 284 | plat->pmt = 1; |
285 | } | 285 | } |
286 | 286 | ||
287 | if (of_device_is_compatible(np, "snps,dwmac-4.00") || | ||
288 | of_device_is_compatible(np, "snps,dwmac-4.10a")) { | ||
289 | plat->has_gmac4 = 1; | ||
290 | plat->pmt = 1; | ||
291 | plat->tso_en = of_property_read_bool(np, "snps,tso"); | ||
292 | } | ||
293 | |||
287 | if (of_device_is_compatible(np, "snps,dwmac-3.610") || | 294 | if (of_device_is_compatible(np, "snps,dwmac-3.610") || |
288 | of_device_is_compatible(np, "snps,dwmac-3.710")) { | 295 | of_device_is_compatible(np, "snps,dwmac-3.710")) { |
289 | plat->enh_desc = 1; | 296 | plat->enh_desc = 1; |
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index e6bc30a42a74..ffdaca9c01af 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h | |||
@@ -137,5 +137,7 @@ struct plat_stmmacenet_data { | |||
137 | void (*exit)(struct platform_device *pdev, void *priv); | 137 | void (*exit)(struct platform_device *pdev, void *priv); |
138 | void *bsp_priv; | 138 | void *bsp_priv; |
139 | struct stmmac_axi *axi; | 139 | struct stmmac_axi *axi; |
140 | int has_gmac4; | ||
141 | bool tso_en; | ||
140 | }; | 142 | }; |
141 | #endif | 143 | #endif |