From 3b15e0cfa6741fbafe083707138efbcb55fca592 Mon Sep 17 00:00:00 2001 From: Serge Semin Date: Sat, 7 Aug 2021 13:03:57 +0300 Subject: net: stmmac: Parse "max-frame-size" DT-prop for any IP-core Indeed there is nothing DW MAC v3.x-specific in that property, while MTU can be platform-specific for any DW MAC IP-core. Move the "max-frame-size" DT-property read operation to the root path of the stmmac_probe_config_dt() method. Signed-off-by: Serge Semin --- drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index e912383156e7c..27a1561b22ae6 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c @@ -508,6 +508,15 @@ stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac) if (of_property_read_u32(np, "snps,data-width", &plat->data_width)) plat->data_width = 16; + /* Note that the max-frame-size parameter as defined in the + * ePAPR v1.1 spec is defined as max-frame-size, it's + * actually used as the IEEE definition of MAC Client + * data, or MTU. The ePAPR specification is confusing as + * the definition is max-frame-size, but usage examples + * are clearly MTUs + */ + of_property_read_u32(np, "max-frame-size", &plat->maxmtu); + plat->force_sf_dma_mode = of_property_read_bool(np, "snps,force_sf_dma_mode"); @@ -527,14 +536,6 @@ stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac) of_device_is_compatible(np, "snps,dwmac-3.70a") || of_device_is_compatible(np, "snps,dwmac-3.72a") || of_device_is_compatible(np, "snps,dwmac")) { - /* Note that the max-frame-size parameter as defined in the - * ePAPR v1.1 spec is defined as max-frame-size, it's - * actually used as the IEEE definition of MAC Client - * data, or MTU. The ePAPR specification is confusing as - * the definition is max-frame-size, but usage examples - * are clearly MTUs - */ - of_property_read_u32(np, "max-frame-size", &plat->maxmtu); of_property_read_u32(np, "snps,multicast-filter-bins", &plat->multicast_filter_bins); of_property_read_u32(np, "snps,perfect-filter-entries", -- cgit v1.2.3