From nobody Mon Feb 9 20:59:11 2026 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 36E3F30C368 for ; Mon, 27 Oct 2025 15:45:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761579913; cv=none; b=ck9bl4/FfGapUmRDnI9GDHRsDpgUpmLrCzroEAGvrz1qmzPArIIA+4iD9sHsnoz9cvsmM9MeqalE3FOOFBvnkwRT7/JStyO4lNS1gNXxaDc9cyBwbCpvXLYd4c17Pj6TVkU5ALMwSQKtNkykauN/D3P6VWqhpu7Q4tC3yKR/a0I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761579913; c=relaxed/simple; bh=Zl99jxf9GqRUfYwhYic7tLWQVs7Z1avi6s/bbIYjffU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ryHiV0T3ELFzhTT/C1rOnGvMUeRVnAym/Zp7kOnjLpJiwv3S2xMv6WE4Vx1qrw+VsUGCH8+eOHLwsDb8aN8x+b+ahFNPZiueELlv7PaspnYEF8AiwhQRNIzsUtGT2eoVo81ajuMI6qJJFyooCTGky0uTEaO+puJb1Lj/Jl2YCOg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=q/4rFPnU; arc=none smtp.client-ip=209.85.128.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="q/4rFPnU" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-46e6a689bd0so48556475e9.1 for ; Mon, 27 Oct 2025 08:45:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1761579909; x=1762184709; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=OicQ1OKV8T/1KX5QBfxYsQT9BwdWiJOdtGfcmUcFvvk=; b=q/4rFPnU/fv4dQG5NLyotxHifdaDdMXgJp0UGTwRCslFf2nPjxgThRj9LkahXr4ZjP /68t3RA5MjKllO3d4obzPEVn2Tqie0e8uSCnK+ePbVFVLQmHQ7qlwT5L5B/LfucTdmEF usomDjNVcoxDPtZyLytX1tOXmNatJlsRVI8lP/4zGWj06ZqccSASHhqoRkY9vUzZfhQ6 D0z9Yl3NQ/ZjD8Cq/3gB7JK1NT2xY7R8s0H0jeSKiZJnHS+HYW3U4nN3TU5LC7sIbftO 2uI+0uuxRlv/6/LECJIwOpd443jzdJk6F6visGJ56ExfxKIpJevTS/RCoEHwHf1R5RzY 4fyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761579909; x=1762184709; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OicQ1OKV8T/1KX5QBfxYsQT9BwdWiJOdtGfcmUcFvvk=; b=mBO+VrFAIfbali/op8Pr5cKglRarOQl5m0tB7oPnPpdwltkwkaHSTpfvW083LqMo6L LElvdCBHZOjvGKFxPDFaGWNoj/UF/hH01V041+V1B/LS45T7jzDaG8rxm1j2zkN8YFvJ gaMkQDrqjbUakZY5EXoaNEee0eiqskoYvpTlcx1puSRyyB9FohbQ+fyiCtNU7jZnAHdg K1ZEwwpg9PYz2YmUYOWW3Qcu19nQzdkZa0Ze22xguCupZjmQ1aioGwQy+OXz/n/oGp7L tMik864we5cbguDAu3eoiMR/6V0MEE/WFBkI1Wgo1cI5v99XEeN30f/Sriey4D+BjzTv kc1w== X-Forwarded-Encrypted: i=1; AJvYcCX1fvqVwqCqafaQ0yhtJLfYCpNsbAvofkHrn9OkuRuHnsbPbUXOmffss0cTHZ4Tx00F3AwV9C+VtZ7/QjY=@vger.kernel.org X-Gm-Message-State: AOJu0Yx5+WipWAv0oA+Ys8ucX22YvSelYJfAPeWFPu0F07oWTDNiRX1k oRSeEaMFKDrGp1Z+H/z/bSgNhw6i4nX/SzZJM9Xdh6lS0aHUXMjkmnfVqGPB/WVRnA8= X-Gm-Gg: ASbGnctG0MR1S5MyrLPX5n6Bz0ZWue5A0dR8Ah3ZH6Aco8X0mThmIT1iFgejmRvPs89 +Qk6Wo77tV6PvFYznMUpxCSHWcijv7oiN7AMltnXlmzMGAKjmqhHUaZY8StYGeqcCU43rndRqLU P2ZDjTunlQhkDf1XwLjAXxfLZ1iSN/Y8UYX3BC3H1iujojN62aHO2M/tgEL0/pXErPYaSLGUME9 1D+X167zpjy/nZmEL9lkRIFWDhhN8fN4KcnuTBHQhLf/wyxY6LCgJb+kTq1CMB+ND2gQkAMfana MrFc06KGoV1fMtxCOlFe+z5kJyrBwLRPtb4LC/vglA89QUfXYbsyy2sd97d3FAk68W49ZfPvmdh xstO64NQaW0MgLPwoMHlPR4vb8khkFBpDLpCWub4op3gDZa2Ryz44fxev1mkmhLmIFyV6vYg= X-Google-Smtp-Source: AGHT+IGnURDzCL6EXlYFgChfMetXN9DLHbDSZlPkZ7qshRFfNPQz3EB5h9snkYgIRzQ1RyekW2OGPA== X-Received: by 2002:a05:600c:3b24:b0:477:58:7cf4 with SMTP id 5b1f17b1804b1-47717df7c8emr1161855e9.4.1761579908909; Mon, 27 Oct 2025 08:45:08 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:c1c6:7dde:fe94:6881]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-475dd477d0esm138708045e9.0.2025.10.27.08.45.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Oct 2025 08:45:07 -0700 (PDT) From: Bartosz Golaszewski Date: Mon, 27 Oct 2025 16:44:52 +0100 Subject: [PATCH v3 4/8] net: stmmac: qcom-ethqos: wrap emac driver data in additional structure Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251027-qcom-sa8255p-emac-v3-4-75767b9230ab@linaro.org> References: <20251027-qcom-sa8255p-emac-v3-0-75767b9230ab@linaro.org> In-Reply-To: <20251027-qcom-sa8255p-emac-v3-0-75767b9230ab@linaro.org> To: Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Richard Cochran , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Alexandre Torgue , Vinod Koul , Giuseppe Cavallaro , Jose Abreu Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=5648; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=cOSA+NoNF7WC2Y1gjjgtDMtaHJ+KGJ3IylBfWUELjyM=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBo/5N7y18ZJr6B/GhKmUSNUtBu9u+ofCQBq/O26 ld3TvaFaLuJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaP+TewAKCRARpy6gFHHX cnwoD/0cxZBAb4XAX91qdtSNuOWe6oX6jeNpN8yk7QsX2VHoodzwPCt6oj6wMspuj4vJ9DxjBPf AP2jLjtIoV5hqOIHm0IhgTYcYRaFDR15GH/TOam2GYeAWLV92aBYmv6IdSBjAutwJgaBc318d6T g2hkFviaHTZEenJLMQEnvI72Q45xskOQC+TvH/yydMDmrQbMzEHN/cFqQ4GUSWsWZm6OseMnhAa iUB6ippCvLUyp7heH/nCGsSHLbhV9UDlKd1JOaow2u1Ulgpx45S5axLLX9/6pqZigvs2rfHzATJ Le+qEqvR7+Uh2+Q9Aws6QSXWlTa4Z3iSiIy5ZbP7bAsTaq9nuZsrL2kpAN1UIKoF/G6Oa7rsBgx +X8w0yx0w1H6U5UejolDHTeX9ZLHVoA850ctVr3h7XGjx/emlBJAo6uPxQ7VQPa0RiZeQ2E7BBE 9xTyHHvZtzzpDpmEczdJpo8406xsjrY3v1SPmY1NOAJnThscNxNoNiUqCsyv7nUHtuxHRU7N0wN /aC5CsoAVcXZwPU1bJaddyFRpmB3ZzvurfMTgH9TO6Of3h56qMhET+WPorex+Xg/jPwotPdFs2b zsSehrtTd1JcZuqiNWbl1mYIvXuR/1nD6z8Y8l3LjqK+mOvqnUU201WCfTRZ0heDj3vpJxm6sQu burt8o4HoSXycxw== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski As the first step in enabling power domain support in the driver, we'll split the device match data and runtime data structures into their general and power-management-specific parts. To allow that: first wrap the emac driver data in another layer which will later be expanded. Signed-off-by: Bartosz Golaszewski --- .../ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 51 ++++++++++++++++--= ---- 1 file changed, 37 insertions(+), 14 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/driv= ers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index ed799da4e4079b4da4b555dd119cce8c6591aa39..2739bc00e7525a5913bd3a5d28d= 9c9a8871fb7cf 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -101,6 +101,10 @@ struct ethqos_emac_driver_data { bool needs_sgmii_loopback; }; =20 +struct ethqos_emac_match_data { + const struct ethqos_emac_driver_data *drv_data; +}; + struct qcom_ethqos { struct platform_device *pdev; void __iomem *rgmii_base; @@ -218,6 +222,10 @@ static const struct ethqos_emac_driver_data emac_v2_3_= 0_data =3D { .has_emac_ge_3 =3D false, }; =20 +static const struct ethqos_emac_match_data emac_qcs404_data =3D { + .drv_data =3D &emac_v2_3_0_data, +}; + static const struct ethqos_emac_por emac_v2_1_0_por[] =3D { { .offset =3D RGMII_IO_MACRO_CONFIG, .value =3D 0x40C01343 }, { .offset =3D SDCC_HC_REG_DLL_CONFIG, .value =3D 0x2004642C }, @@ -234,6 +242,10 @@ static const struct ethqos_emac_driver_data emac_v2_1_= 0_data =3D { .has_emac_ge_3 =3D false, }; =20 +static const struct ethqos_emac_match_data emac_sm8150_data =3D { + .drv_data =3D &emac_v2_1_0_data, +}; + static const struct ethqos_emac_por emac_v3_0_0_por[] =3D { { .offset =3D RGMII_IO_MACRO_CONFIG, .value =3D 0x40c01343 }, { .offset =3D SDCC_HC_REG_DLL_CONFIG, .value =3D 0x2004642c }, @@ -266,6 +278,10 @@ static const struct ethqos_emac_driver_data emac_v3_0_= 0_data =3D { }, }; =20 +static const struct ethqos_emac_match_data emac_sc8280xp_data =3D { + .drv_data =3D &emac_v3_0_0_data, +}; + static const struct ethqos_emac_por emac_v4_0_0_por[] =3D { { .offset =3D RGMII_IO_MACRO_CONFIG, .value =3D 0x40c01343 }, { .offset =3D SDCC_HC_REG_DLL_CONFIG, .value =3D 0x2004642c }, @@ -301,6 +317,10 @@ static const struct ethqos_emac_driver_data emac_v4_0_= 0_data =3D { }, }; =20 +static const struct ethqos_emac_match_data emac_sa8775p_data =3D { + .drv_data =3D &emac_v4_0_0_data, +}; + static int ethqos_dll_configure(struct qcom_ethqos *ethqos) { struct device *dev =3D ðqos->pdev->dev; @@ -764,7 +784,8 @@ static void ethqos_ptp_clk_freq_config(struct stmmac_pr= iv *priv) =20 static int qcom_ethqos_probe(struct platform_device *pdev) { - const struct ethqos_emac_driver_data *data; + const struct ethqos_emac_driver_data *drv_data; + const struct ethqos_emac_match_data *data; struct plat_stmmacenet_data *plat_dat; struct stmmac_resources stmmac_res; struct device *dev =3D &pdev->dev; @@ -815,13 +836,15 @@ static int qcom_ethqos_probe(struct platform_device *= pdev) ethqos->mac_base =3D stmmac_res.addr; =20 data =3D device_get_match_data(dev); - ethqos->por =3D data->por; - ethqos->num_por =3D data->num_por; - ethqos->rgmii_config_loopback_en =3D data->rgmii_config_loopback_en; - ethqos->has_emac_ge_3 =3D data->has_emac_ge_3; - ethqos->needs_sgmii_loopback =3D data->needs_sgmii_loopback; + drv_data =3D data->drv_data; =20 - ethqos->link_clk =3D devm_clk_get(dev, data->link_clk_name ?: "rgmii"); + ethqos->por =3D drv_data->por; + ethqos->num_por =3D drv_data->num_por; + ethqos->rgmii_config_loopback_en =3D drv_data->rgmii_config_loopback_en; + ethqos->has_emac_ge_3 =3D drv_data->has_emac_ge_3; + ethqos->needs_sgmii_loopback =3D drv_data->needs_sgmii_loopback; + + ethqos->link_clk =3D devm_clk_get(dev, drv_data->link_clk_name ?: "rgmii"= ); if (IS_ERR(ethqos->link_clk)) return dev_err_probe(dev, PTR_ERR(ethqos->link_clk), "Failed to get link_clk\n"); @@ -849,14 +872,14 @@ static int qcom_ethqos_probe(struct platform_device *= pdev) plat_dat->ptp_clk_freq_config =3D ethqos_ptp_clk_freq_config; plat_dat->core_type =3D DWMAC_CORE_GMAC4; if (ethqos->has_emac_ge_3) - plat_dat->dwmac4_addrs =3D &data->dwmac4_addrs; + plat_dat->dwmac4_addrs =3D &drv_data->dwmac4_addrs; plat_dat->pmt =3D 1; if (device_property_present(dev, "snps,tso")) plat_dat->flags |=3D STMMAC_FLAG_TSO_EN; if (device_is_compatible(dev, "qcom,qcs404-ethqos")) plat_dat->flags |=3D STMMAC_FLAG_RX_CLK_RUNS_IN_LPI; - if (data->dma_addr_width) - plat_dat->host_dma_width =3D data->dma_addr_width; + if (drv_data->dma_addr_width) + plat_dat->host_dma_width =3D drv_data->dma_addr_width; =20 if (ethqos->serdes_phy) { plat_dat->serdes_powerup =3D qcom_ethqos_serdes_powerup; @@ -871,10 +894,10 @@ static int qcom_ethqos_probe(struct platform_device *= pdev) } =20 static const struct of_device_id qcom_ethqos_match[] =3D { - { .compatible =3D "qcom,qcs404-ethqos", .data =3D &emac_v2_3_0_data}, - { .compatible =3D "qcom,sa8775p-ethqos", .data =3D &emac_v4_0_0_data}, - { .compatible =3D "qcom,sc8280xp-ethqos", .data =3D &emac_v3_0_0_data}, - { .compatible =3D "qcom,sm8150-ethqos", .data =3D &emac_v2_1_0_data}, + { .compatible =3D "qcom,qcs404-ethqos", .data =3D &emac_qcs404_data}, + { .compatible =3D "qcom,sa8775p-ethqos", .data =3D &emac_sa8775p_data}, + { .compatible =3D "qcom,sc8280xp-ethqos", .data =3D &emac_sc8280xp_data}, + { .compatible =3D "qcom,sm8150-ethqos", .data =3D &emac_sm8150_data}, { } }; MODULE_DEVICE_TABLE(of, qcom_ethqos_match); --=20 2.48.1