From patchwork Mon Jul 13 13:20:37 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 2642 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mxe881.netcup.net (Postfix) with ESMTPS id 1FBB81C2B88 for ; Mon, 13 Jul 2026 15:30:55 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=qualcomm.com; dkim=pass header.d=oss.qualcomm.com; spf=pass (sender IP is 172.234.253.10) smtp.mailfrom=linux-sunxi+bounces-24407-noreply=patchwork.local@lists.linux.dev smtp.helo=sea.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.234.253.10 as permitted sender) client-ip=172.234.253.10; envelope-from=linux-sunxi+bounces-24407-noreply=patchwork.local@lists.linux.dev; helo=sea.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sea.lore.kernel.org (Postfix) with ESMTP id 8DB97314A968 for ; Mon, 13 Jul 2026 13:23:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BDAB8435EC7; Mon, 13 Jul 2026 13:21:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="LPTTBmz2"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="RDmDlKjG" X-Original-To: linux-sunxi@lists.linux.dev Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 75309426EC5 for ; Mon, 13 Jul 2026 13:21:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783948901; cv=none; b=RbVhUM7WqwcNFMwHjPf/5ZVAej1eEheTxSo0HbeDxUft6CP4naNew+mCCzImEOnXPz9OjQUk3Y27+B3FqlXJGRycCXNmyYIOGhdbRdok9/VfUvhXBS6nbmKZMBAhp2QyNYjy+XNbVIjCQ6iWHdBeQIjpXnGgss2yMSoRQuaHuFM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783948901; c=relaxed/simple; bh=6sLA5MwnRnvx5ahGg42dP42VZ5Uj0hEZ80jvCL+QkJs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=F/60wkDxz8ZGYJ+vExpp31KhR72unNw/LvXta+P+AIDqbHhtppmcUVDRztDUA9tMkkuU9UPAB+bRAZzRyS6LjEmTDfuxjIvcTlqKzhHfqT1weM4fliima3DoaVcUtMLkBj2UpsmfGnPawysfGqloGAHfpJnb65boP6pHbLqmytc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=LPTTBmz2; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=RDmDlKjG; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66DCEC1e1304637 for ; Mon, 13 Jul 2026 13:21:37 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= kZVfYVIvZDWgS16VLGdHQkMZZirnrupFmTaCF7qGBc8=; b=LPTTBmz2tWUvklQZ 4w8qumFJeCIts8FsDBLzgtgmLmYfaPEXCkAMXr83lS9TifnOO8dfBqTqGLVJZjjE EaYmGmv7+ktoqoxELlKoy+2i4vzxFyXaFHbMUCPLts/v1wrGxluhlEHQQHy70nfn lGjL46Z2iuMJtbKcWgy6+snBXl62qpzQVPaP1DwTfXtRjPn6iQ6+VxRRWGVZVkTH +RthcJQasZ9G+nPUGjZd/L5djbL/UIpdWO8Lhc0X4c+lQfWucvS0tF0f3hDgr7N8 hohiDIsCwQz4sN7faey4JNeqBMmC4eIfNiQSc6gCGD5z7CznLNbiX6ZihcnaPbYM 7yGoPA== Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fcwk9rsw0-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 13 Jul 2026 13:21:37 +0000 (GMT) Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-51c1a9764f0so53866641cf.1 for ; Mon, 13 Jul 2026 06:21:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1783948896; x=1784553696; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=kZVfYVIvZDWgS16VLGdHQkMZZirnrupFmTaCF7qGBc8=; b=RDmDlKjGxgkYZHkYxquqZVbN8sCZ0zViKsPN3YfVi4t8uP5jbXO5KXTiyvBKh1FQ2D pSveX7I4fFXzfjDjwCfg7dRjPaCdox1esN3cyTk4a2k2lsHSun1PucAvoNHRr9lJdURX +2e4vcVQHwAYQzTOATMTEvYgC4v5wrwztpQMwQ4MXyIN7eE2l9saiIE0re2PY/37nRc0 IpXvPKud9iJDBU4VQO7Eik68c1DR0Z4fYEG7PuSH9l3qQ7+D8hIePcj9O6CPIThw13fN eYENx1/2er4Isuo/HCSkf/Sn2qBbdQKI6J8ggJ/E0fQrpXqglLytf03kB8iHyERrMbZD JQPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783948896; x=1784553696; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=kZVfYVIvZDWgS16VLGdHQkMZZirnrupFmTaCF7qGBc8=; b=KtuYMCJ6HHT4yEc6MTqhPdUII16fTCDWoWZ+agXgo/uKkyxpKx5fFDCv975mRmlwHx SJx/JdRB9vCqvdqsPF+qYSjq+bJ0VL0v1RMV2Anjp0U19Z55F6N9olZXri+JB0GtcUlN BQt875dTKgaQ14a94KsTYLh7Y69cBiyv3IdPp9p7F3TvXgNE0XNMtgLVJiIhenQ63HAy 87E7uRg+CskVDvd80sSKCf425laWaEF0LtZoMjpY2MigMsaP3sIsF7S0T3nvksjXGDvh EjvUGOVD184Mfm9BBu09zdulhcZuVOm+t20d0bnJyF+KuYhUYM1RyzxF/zWK35hUZ9/J +MkQ== X-Forwarded-Encrypted: i=1; AHgh+Ro3iytiHCuEZWpt4fxlnHpMJ2OPxiEYlgzV1K9xyeBsr54SFBnEvISb1HTz7qUP3bKm/yTX9U3onbgaww==@lists.linux.dev X-Gm-Message-State: AOJu0Yz4UprxiaEq3My/8orroBHcoIA5S0P1HitE5j+gX5j49wO+qDfY kIghHGfcbsppak2V4dRV73zMS/hFkgk01CkkldTZHzskc23fUGdQUSYM2tEvU32a0y+Mw9dnsWe 7uWHcJWkkVc+dCZLDgrHLSxs+lM1AG1r+UVcvJ+3FrU+UltzysIMXgTiHl85hjU7XFA== X-Gm-Gg: AfdE7ckqgAh9amm4qo2+hudfzk/qE2+J5q3CgBRzyNmk8m2yNebDC2KpYOlCxQTR2+X bGkkR2m6GibhI1VV8dD1Sfy0k3F+8hAT0lkaB5bVP6VP5whjTPOB3TH6VDZ9wB9RIzguMui6QmR DZTCjTNOp22SAmhbxpSHgfViJtJYH4TN6d/iFug8rSwRQyu/wZrA2d4MxwP4cV7VZbuxnZCPgvZ OLsdap+2U17hp8HW64oCypzPmfTLYXlc3Y0RJyNdCrg5ftYg7OmJSDcwag7qjfDM0k9xSu9+tp5 jlJGsXRtYWyroFEbCYLFyEJDxiojTZhdUK6Wrko/6XSccvKbPYiw0HrV/pww5tf28NBuyY7hEhl ekwkMlDAQ6pHgeFWz49P53TaCp7qssbdgjxV/tG0d X-Received: by 2002:ac8:5cd4:0:b0:51a:8c9b:6499 with SMTP id d75a77b69052e-51cbf363dc8mr93366171cf.61.1783948896300; Mon, 13 Jul 2026 06:21:36 -0700 (PDT) X-Received: by 2002:ac8:5cd4:0:b0:51a:8c9b:6499 with SMTP id d75a77b69052e-51cbf363dc8mr93365531cf.61.1783948895804; Mon, 13 Jul 2026 06:21:35 -0700 (PDT) Received: from brgl-qcom.local ([2a01:cb1d:dc:7e00:8881:83b8:89fa:1a2a]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-493eb6f3dcdsm354561715e9.3.2026.07.13.06.21.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2026 06:21:34 -0700 (PDT) From: Bartosz Golaszewski Date: Mon, 13 Jul 2026 15:20:37 +0200 Subject: [PATCH net-next v13 08/10] net: stmmac: qcom-ethqos: reuse the address of ethqos_emac_driver_data Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260713-qcom-sa8255p-emac-v13-8-119f8699ef8e@oss.qualcomm.com> References: <20260713-qcom-sa8255p-emac-v13-0-119f8699ef8e@oss.qualcomm.com> In-Reply-To: <20260713-qcom-sa8255p-emac-v13-0-119f8699ef8e@oss.qualcomm.com> To: Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Alexandre Torgue , Vinod Koul , Giuseppe Cavallaro , Chen-Yu Tsai , Jernej Skrabec , Neil Armstrong , Kevin Hilman , Jerome Brunet , Shawn Guo , Fabio Estevam , Jan Petrous , s32@nxp.com, Mohd Ayaan Anwar , Romain Gantois , Geert Uytterhoeven , Magnus Damm , Maxime Ripard , Christophe Roullier , Bartosz Golaszewski , Radu Rendec 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, Drew Fustini , linux-sunxi@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-mips@vger.kernel.org, imx@lists.linux.dev, linux-renesas-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, sophgo@lists.linux.dev, linux-riscv@lists.infradead.org, brgl@kernel.org, Bartosz Golaszewski , Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=5580; i=bartosz.golaszewski@oss.qualcomm.com; h=from:subject:message-id; bh=6sLA5MwnRnvx5ahGg42dP42VZ5Uj0hEZ80jvCL+QkJs=; b=owEBbQKS/ZANAwAKAQWdLsv/NoTDAcsmYgBqVOY7WoNWK1fKVT3AeUhvoZN7mOQTGCailFb2O 0U8Uq1MWjyJAjMEAAEKAB0WIQSR5RMt5bVGHXuiZfwFnS7L/zaEwwUCalTmOwAKCRAFnS7L/zaE w1bJD/9rL0/b5pecDupw06V5+gDcMleg47Bp4Mj7c0bklOTgY38+9tAIEY1SLjLB7HwKOq1nqO1 dq4hv8Fzi1RD++rxkUrQold1tLfhGWfOD7AWhFokRPSl3ebXb4UJJqBLEUpybGawZXGb83TjRQp TqQuY/OFOse9hQpLrXmnjRa7HhD3bpWH03G/U0OrEuJgSkZTKivy9x9EBTukzmONTUI4CDKI5B7 06IMnO8pk62ZFboVjxTYIkcE33flA06idPLRtgn+TLMo0HUbjS9ev9F66IQUB0Wf2oI6cj2F9HQ bT0Vo879IpyBDA3UI8/bUeT5ZpHpMnag47OsAvtCie56SMBsYzQlpx252so7ZAYKsYZAAKndTCt 02Gsy7+tuMhxZLaWxu25gb+eQVAcPjjeGVKfXRDRQ2llgESiKBZ1suHws8QKRO7a/ou3vEcbSvY TkjQzAmNmDN/31aYfD9yGiPkwzuCc3iN4Cm2svIMRR59VtUGdi+das4vQZ4AbF28v3ka7RtPJQ3 tutb3bPvbrnMITPys1sJm0UN1M6xGLJFAky2b/TtJFqs8IYm7ABoVAMDEi73Z4+qePbfSVhsJO7 b94O6zEbexT8kdm6o+6NRK4c6kovWN6IfUrXXTeK57CoDiEsf4wzC81a33bYQvAkDNk6St8CbHB bp1Zor92Ha8l7uw== X-Developer-Key: i=bartosz.golaszewski@oss.qualcomm.com; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzEzMDEzOSBTYWx0ZWRfXxWlIKOsNbZbG dqKud2PCxUJW8TIVqEQa1VUTO1enIY6rahop6F1nzeREdP7pM6xcgvWszVVg8K9b2FBk957Kp0j +K5silev3qrmm2cQz52c1rohackvINcVadNyLG51CpWhHupOWyYA3lwsa4k67R32Mtwri9zJkMG o3rMBxJuspk5tJGfUtAqac4yWM+X4tI7OvW3Ig9Euxv5GEcbUZYNz4pZrmeHw8+UkfkCHwptUlX 2MbIfnoGBXenmxsfGPUbxUS/uUnmRtgTyBedcvlgmOdNYp0r7X5Mp9ZUozSBcErDYzVWTbn4Un/ VVQs1NzLTG5eoM/o2xUUZRtjAwQ5kUmYm8MZPx46tGXkGgn8HcosQjCd4I/NYGxKniBEKvx3cgi K4eCYH07wcwp+wRyxUgUSArIxZhC8xYrqjzzynMlokVYKp7REjYFYRooH+WZNTHRY1puJegCBPm MIj08sbQWmHDhEw3PpQ== X-Proofpoint-ORIG-GUID: JUixWlaCavKzDaa9UArP_lQxmAoB5Z9o X-Authority-Analysis: v=2.4 cv=UMHt2ify c=1 sm=1 tr=0 ts=6a54e661 cx=c_pps a=JbAStetqSzwMeJznSMzCyw==:117 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yx91gb_oNiZeI1HMLzn7:22 a=EUspDBNiAAAA:8 a=fhsz3KazkzAS9s_vSxIA:9 a=QEXdDO2ut3YA:10 a=uxP6HrT_eTzRwkO_Te1X:22 X-Proofpoint-GUID: JUixWlaCavKzDaa9UArP_lQxmAoB5Z9o X-Proofpoint-Spam-Info: AW1haW4tMjYwNzEzMDEzOSBTYWx0ZWRfXwTvjZ8HHsNmv n9M3LMjWjyXbrvVYUBaspmyCr86ahhXCzZU9yQvmtRnOtHk7/UB4HuKGqsYVyUy/Q+MavMFA9kx Wm9gLH6ocREyWhapCmLla0NAUUWpcPw= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-13_03,2026-07-10_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 impostorscore=0 spamscore=0 clxscore=1015 adultscore=0 malwarescore=0 lowpriorityscore=0 phishscore=0 suspectscore=0 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607130139 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [3.34 / 15.00]; RBL_SENDERSCORE(2.00)[172.234.253.10:from]; SUSPICIOUS_RECIPS(1.50)[]; MAILLIST(-0.15)[generic]; MIME_GOOD(-0.10)[text/plain]; BAD_REP_POLICIES(0.10)[]; HAS_LIST_UNSUB(-0.01)[]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; FROM_HAS_DN(0.00)[]; PRECEDENCE_BULK(0.00)[]; TAGGED_RCPT(0.00)[dt,netdev,renesas]; FUZZY_BLOCKED(0.00)[rspamd.com]; R_DKIM_ALLOW(0.00)[qualcomm.com:s=qcppdkim1]; RCVD_COUNT_SEVEN(0.00)[8]; DBL_BLOCKED_OPENRESOLVER(0.00)[qualcomm.com:email,qualcomm.com:dkim,sea.lore.kernel.org:rdns,sea.lore.kernel.org:helo]; RCPT_COUNT_TWELVE(0.00)[49]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_NEQ_ENVFROM(0.00)[bartosz.golaszewski@oss.qualcomm.com,linux-sunxi@lists.linux.dev]; TAGGED_FROM(0.00)[bounces-24407-noreply=patchwork.local]; R_SPF_ALLOW(0.00)[+ip4:172.234.253.10]; DKIM_TRACE(0.00)[qualcomm.com:+]; TO_DN_SOME(0.00)[]; FORGED_SENDER_MAILLIST(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a01:cb1d:dc:7e00:8881:83b8:89fa:1a2a:received,209.85.160.200:received,205.220.180.131:received,100.90.174.1:received]; ASN(0.00)[asn:63949, ipnet:172.234.224.0/19, country:SG]; DMARC_POLICY_ALLOW(0.00)[qualcomm.com,reject]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FREEMAIL_TO(0.00)[kernel.org,lunn.ch,davemloft.net,google.com,redhat.com,gmail.com,foss.st.com,st.com,linaro.org,baylibre.com,oss.nxp.com,nxp.com,oss.qualcomm.com,bootlin.com,glider.be,rendec.net]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[172.234.253.10:from] X-Rspamd-Queue-Id: 1FBB81C2B88 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Instead of needlessly copying the fields of ethqos_emac_driver_data into struct qcom_ethqos, just use the address of the former as a reference. It's .rodata after all. This is done in order to avoid having either two calls to of_device_get_match_data() or having to extend the latter with another field when adding support for SCMI. Signed-off-by: Bartosz Golaszewski --- .../ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 37 ++++++++-------------- 1 file changed, 14 insertions(+), 23 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index e083d7d55782ec8310e9375e466be00213667457..43384960278b87a95f14f23c45442d2bbf75d882 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -103,12 +103,7 @@ struct qcom_ethqos { struct clk *link_clk; struct phy *serdes_phy; phy_interface_t phy_mode; - - const struct ethqos_emac_por *rgmii_por; - unsigned int num_rgmii_por; - bool rgmii_config_loopback_en; - bool has_emac_ge_3; - bool needs_sgmii_loopback; + const struct ethqos_emac_driver_data *data; }; static u32 rgmii_readl(struct qcom_ethqos *ethqos, unsigned int offset) @@ -189,7 +184,7 @@ static int ethqos_set_clk_tx_rate(void *bsp_priv, struct clk *clk_tx_i, static void qcom_ethqos_set_sgmii_loopback(struct qcom_ethqos *ethqos, bool enable) { - if (!ethqos->needs_sgmii_loopback || + if (!ethqos->data->needs_sgmii_loopback || (ethqos->phy_mode != PHY_INTERFACE_MODE_2500BASEX && ethqos->phy_mode != PHY_INTERFACE_MODE_SGMII)) return; @@ -323,7 +318,7 @@ static int ethqos_dll_configure(struct qcom_ethqos *ethqos) /* Set DLL_EN */ rgmii_setmask(ethqos, SDCC_DLL_CONFIG_DLL_EN, SDCC_HC_REG_DLL_CONFIG); - if (!ethqos->has_emac_ge_3) { + if (!ethqos->data->has_emac_ge_3) { rgmii_clrmask(ethqos, SDCC_DLL_MCLK_GATING_EN, SDCC_HC_REG_DLL_CONFIG); @@ -353,7 +348,7 @@ static int ethqos_dll_configure(struct qcom_ethqos *ethqos) rgmii_setmask(ethqos, SDCC_DLL_CONFIG2_DDR_CAL_EN, SDCC_HC_REG_DLL_CONFIG2); - if (!ethqos->has_emac_ge_3) { + if (!ethqos->data->has_emac_ge_3) { rgmii_clrmask(ethqos, SDCC_DLL_CONFIG2_DLL_CLOCK_DIS, SDCC_HC_REG_DLL_CONFIG2); @@ -433,7 +428,7 @@ static int ethqos_rgmii_macro_init(struct qcom_ethqos *ethqos, int speed) rgmii_clrmask(ethqos, RGMII_CONFIG2_RSVD_CONFIG15, RGMII_IO_MACRO_CONFIG2); - if (speed == SPEED_1000 || ethqos->has_emac_ge_3) + if (speed == SPEED_1000 || ethqos->data->has_emac_ge_3) rgmii_setmask(ethqos, RGMII_CONFIG2_RX_PROG_SWAP, RGMII_IO_MACRO_CONFIG2); else @@ -457,7 +452,7 @@ static int ethqos_rgmii_macro_init(struct qcom_ethqos *ethqos, int speed) * in practice this becomes PRG_RCLK_DLY = 52 * 4 / * (2 * RX delay ns) */ - if (ethqos->has_emac_ge_3) { + if (ethqos->data->has_emac_ge_3) { /* 0.9 ns */ prg_rclk_dly = 115; } else { @@ -473,7 +468,7 @@ static int ethqos_rgmii_macro_init(struct qcom_ethqos *ethqos, int speed) SDCC_HC_REG_DDR_CONFIG); } - if (ethqos->rgmii_config_loopback_en) + if (ethqos->data->rgmii_config_loopback_en) loopback = RGMII_CONFIG_LOOPBACK_EN; else loopback = 0; @@ -496,9 +491,9 @@ static void ethqos_fix_mac_speed_rgmii(void *bsp_priv, dev = ðqos->pdev->dev; /* Reset to POR values and enable clk */ - for (i = 0; i < ethqos->num_rgmii_por; i++) - rgmii_writel(ethqos, ethqos->rgmii_por[i].value, - ethqos->rgmii_por[i].offset); + for (i = 0; i < ethqos->data->num_rgmii_por; i++) + rgmii_writel(ethqos, ethqos->data->rgmii_por[i].value, + ethqos->data->rgmii_por[i].offset); ethqos_set_func_clk_en(ethqos); @@ -512,7 +507,7 @@ static void ethqos_fix_mac_speed_rgmii(void *bsp_priv, rgmii_setmask(ethqos, SDCC_DLL_CONFIG_PDN, SDCC_HC_REG_DLL_CONFIG); - if (ethqos->has_emac_ge_3) { + if (ethqos->data->has_emac_ge_3) { if (speed == SPEED_1000) { rgmii_writel(ethqos, 0x1800000, SDCC_TEST_CTL); rgmii_writel(ethqos, 0x2C010800, SDCC_USR_CTL); @@ -539,7 +534,7 @@ static void ethqos_fix_mac_speed_rgmii(void *bsp_priv, SDCC_HC_REG_DLL_CONFIG); /* Set USR_CTL bit 26 with mask of 3 bits */ - if (!ethqos->has_emac_ge_3) + if (!ethqos->data->has_emac_ge_3) rgmii_updatel(ethqos, GENMASK(26, 24), BIT(26), SDCC_USR_CTL); @@ -750,11 +745,7 @@ static int qcom_ethqos_probe(struct platform_device *pdev) "Failed to map rgmii resource\n"); data = of_device_get_match_data(dev); - ethqos->rgmii_por = data->rgmii_por; - ethqos->num_rgmii_por = data->num_rgmii_por; - ethqos->rgmii_config_loopback_en = data->rgmii_config_loopback_en; - ethqos->has_emac_ge_3 = data->has_emac_ge_3; - ethqos->needs_sgmii_loopback = data->needs_sgmii_loopback; + ethqos->data = data; ethqos->link_clk = devm_clk_get(dev, data->link_clk_name ?: "rgmii"); if (IS_ERR(ethqos->link_clk)) @@ -791,7 +782,7 @@ static int qcom_ethqos_probe(struct platform_device *pdev) plat_dat->dump_debug_regs = rgmii_dump; plat_dat->ptp_clk_freq_config = ethqos_ptp_clk_freq_config; plat_dat->core_type = DWMAC_CORE_GMAC4; - if (ethqos->has_emac_ge_3) + if (data->has_emac_ge_3) plat_dat->dwmac4_addrs = &data->dwmac4_addrs; plat_dat->pmt = true; if (of_property_read_bool(np, "snps,tso"))