From patchwork Thu Jun 20 06:40:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Furong Xu <0x1207@gmail.com> X-Patchwork-Id: 13704880 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 26B81C2BA18 for ; Thu, 20 Jun 2024 06:41:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=Dj4QZeFx+AVC51p11hlg4kzbDA2elF0sWu+Rp1qJlwA=; b=pjFRe9JQn40zN6jiwec6FVhVzR epllDmuwGrHSe5aVCJymR0SR8/YYBdFsjmMYLNkIfS4xgl8bcvOCln0p2rp8Tc/iWwZ1cZdni4gFi x3RftBPlkfhCQuFuw2fovGL0QxPNjW6becFrZQnmWsCaZQ+2I4IT1tHUOoLG+CGM/Em82dNaFeZgd uLlx3gkr97ftwnQO1Zr4KrNlrE9iTl+Tfm3aKFaApY4EnM9QbaJ4/Mxb4qObUcNSF8ezHEPvYv1KD oZUAkGIJKKNMYx/x3sHkvMlO0NgZv826ez6S9V6/J9Lt/Qv/irGcDuyh0hmxXMOCdpltwHXv+eMwF 3VhG5X/g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sKBTj-00000003psH-2rHY; Thu, 20 Jun 2024 06:41:03 +0000 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sKBTg-00000003pqR-1ogz for linux-arm-kernel@lists.infradead.org; Thu, 20 Jun 2024 06:41:02 +0000 Received: by mail-pj1-x102a.google.com with SMTP id 98e67ed59e1d1-2bfdae7997aso487238a91.2 for ; Wed, 19 Jun 2024 23:40:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718865659; x=1719470459; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Dj4QZeFx+AVC51p11hlg4kzbDA2elF0sWu+Rp1qJlwA=; b=JaOXx5J9p9YgC/E4RjvUcemHKVllPZM//7PRP7D6GfLrzsLlZ9V9OYzeo314cEeHTy W9gMWpAxTeA6DBw5QZ02VdDCsvz+eTYjAKn7QAut8HIo5nTjK+t7Y6Eo3OOp1GeJFI+n 7RsPoM5y3/yfhfaoKKscZmh96NR8OfEkXGZs5LS7632SnKXUlDR50PdG6Dck4sSsSTCO Y8EVtXS/+v4pHLxaz0Aj+8ke56/yw7WyIZQDDuFz3SCe7iDGipGzOLvhwisT5T7VtHu4 VkKCaUAoOgtY/lBXHSRgqncRCkFMmnbcagjCfqfyBGtrSI5YnMzXcAszIMfH+O/PJr3S nzKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718865659; x=1719470459; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Dj4QZeFx+AVC51p11hlg4kzbDA2elF0sWu+Rp1qJlwA=; b=RU5jWid47LreFhT70BnfB4QPODyuPJnBT06AZNAY1UByrJHwWMqfH90lzkjIJOmqzE PgFgENvtiYjZiXi/DbMQNMYsZhJyuvtLaAfdmamL59YZZt8a6jZX2kZNlMViOFDTpud9 jfwaCnzV+lRc9cg52KqdeeHSwquUXDSA8We/ydae/LHNj6wjemV5sAvgw0FYxPUV7eBs AhD7fHSy++FxuPsiqa6DY1EyQJJnHMxL+zwBPEqDSZNYNK6FOvQwgEOb+n/1gajFpWzM HZGCkCDw82DY+RSF5bLr4ynBvxxNU0sq/Yedym76MCLl4Zjn342U0Jo/0auTr34QOEuU KN1A== X-Forwarded-Encrypted: i=1; AJvYcCWVOhWjx4bj8gE9mz1c1MN/aACrFUNXceDQef7lZLo2mMvep/p7yFEBVRAiU01ZC5xHm3oQ9aG+DlEfhAuIsFdCAp0QhzlbqQaw5sa5pdi75wdztWA= X-Gm-Message-State: AOJu0YyTYAjLmLx/1d+CD/1xZiuzvSJXejEgYQaCVENsWXZrUEgzniVI nsJFNkjDmJeZZB7GauETqOUriFKXgw8SUFTlcZdKTSf0IIz0WL6N X-Google-Smtp-Source: AGHT+IFNC7FgO9HSN1gJ1UcHOVjndxJnOiiessKD+THr8O0UlSmH6s/UeMfmg86hakwBC98pUI/Xuw== X-Received: by 2002:a17:90a:ea92:b0:2c4:b300:1b4c with SMTP id 98e67ed59e1d1-2c7b5cc49f5mr4163646a91.24.1718865659045; Wed, 19 Jun 2024 23:40:59 -0700 (PDT) Received: from localhost.localdomain ([129.146.253.192]) by smtp.googlemail.com with ESMTPSA id 98e67ed59e1d1-2c7e50f7c90sm862442a91.9.2024.06.19.23.40.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jun 2024 23:40:58 -0700 (PDT) From: Furong Xu <0x1207@gmail.com> To: "David S. Miller" , Alexandre Torgue , Jose Abreu , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Joao Pinto , Simon Horman Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, xfr@outlook.com, rock.xu@nio.com, Furong Xu <0x1207@gmail.com> Subject: [PATCH net-next v1] net: stmmac: init more plat members from DT Date: Thu, 20 Jun 2024 14:40:04 +0800 Message-Id: <20240620064004.573280-1-0x1207@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240619_234100_492118_443F144B X-CRM114-Status: UNSURE ( 9.52 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org A new option to init some useful members of plat_stmmacenet_data from DT. Signed-off-by: Furong Xu <0x1207@gmail.com> --- drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index 54797edc9b38..b86cfb2570ab 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c @@ -497,6 +497,8 @@ stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac) of_property_read_u32(np, "rx-fifo-depth", &plat->rx_fifo_size); + of_property_read_u32(np, "host-dma-width", &plat->host_dma_width); + plat->force_sf_dma_mode = of_property_read_bool(np, "snps,force_sf_dma_mode"); @@ -561,6 +563,8 @@ stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac) plat->pmt = 1; if (of_property_read_bool(np, "snps,tso")) plat->flags |= STMMAC_FLAG_TSO_EN; + if (of_property_read_bool(np, "snps,no-sph")) + plat->flags |= STMMAC_FLAG_SPH_DISABLE; } if (of_device_is_compatible(np, "snps,dwmac-3.610") || @@ -573,8 +577,11 @@ stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac) if (of_device_is_compatible(np, "snps,dwxgmac")) { plat->has_xgmac = 1; plat->pmt = 1; + of_property_read_u32(np, "max-frame-size", &plat->maxmtu); if (of_property_read_bool(np, "snps,tso")) plat->flags |= STMMAC_FLAG_TSO_EN; + if (of_property_read_bool(np, "snps,no-sph")) + plat->flags |= STMMAC_FLAG_SPH_DISABLE; } dma_cfg = devm_kzalloc(&pdev->dev, sizeof(*dma_cfg),