Add the bindings parsing for XGMAC2 IP block.

Signed-off-by: Jose Abreu <joab...@synopsys.com>
Cc: David S. Miller <da...@davemloft.net>
Cc: Joao Pinto <jpi...@synopsys.com>
Cc: Giuseppe Cavallaro <peppe.cavall...@st.com>
Cc: Alexandre Torgue <alexandre.tor...@st.com>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-generic.c   | 2 ++
 drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 6 ++++++
 2 files changed, 8 insertions(+)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-generic.c 
b/drivers/net/ethernet/stmicro/stmmac/dwmac-generic.c
index 3304095c934c..fad503820e04 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-generic.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-generic.c
@@ -78,6 +78,8 @@ static const struct of_device_id dwmac_generic_match[] = {
        { .compatible = "snps,dwmac-4.00"},
        { .compatible = "snps,dwmac-4.10a"},
        { .compatible = "snps,dwmac"},
+       { .compatible = "snps,dwxgmac-2.10"},
+       { .compatible = "snps,dwxgmac"},
        { }
 };
 MODULE_DEVICE_TABLE(of, dwmac_generic_match);
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c 
b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index 72da77b94ecd..3609c7b696c7 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -486,6 +486,12 @@ stmmac_probe_config_dt(struct platform_device *pdev, const 
char **mac)
                plat->force_sf_dma_mode = 1;
        }
 
+       if (of_device_is_compatible(np, "snps,dwxgmac")) {
+               plat->has_xgmac = 1;
+               plat->pmt = 1;
+               plat->tso_en = of_property_read_bool(np, "snps,tso");
+       }
+
        dma_cfg = devm_kzalloc(&pdev->dev, sizeof(*dma_cfg),
                               GFP_KERNEL);
        if (!dma_cfg) {
-- 
2.7.4


Reply via email to