Skip to content

Commit e235851

Browse files
committed
qualcommax: update qca8k fixed link patch to v2
Update the qca8k fixed link patch to v2 that is pending upstream. Signed-off-by: Robert Marko <robimarko@gmail.com>
1 parent 9b3f3a7 commit e235851

4 files changed

Lines changed: 134 additions & 25 deletions

target/linux/qualcommax/patches-6.12/0750-net-dsa-qca8k-add-support-for-force-mode-for-fixed-link-topology.patch

Lines changed: 128 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,151 @@
1-
From 486e857206fa494a8aaff7d5aa5de2eade034538 Mon Sep 17 00:00:00 2001
2-
From: George Moussalem <george.moussalem@outlook.com>
3-
Date: Wed, 03 Jun 2026 11:56:40 +0400
4-
Subject: [PATCH next-next] net: dsa: qca8k: Add support for force mode for fixed link topology
5-
MIME-Version: 1.0
1+
From patchwork Fri Jun 5 08:11:29 2026
62
Content-Type: text/plain; charset="utf-8"
3+
MIME-Version: 1.0
74
Content-Transfer-Encoding: 7bit
8-
Message-Id: <20260603-qca8337-force-mode-v1-1-44a4600c9213@outlook.com>
5+
X-Patchwork-Submitter: George Moussalem <george.moussalem@outlook.com>
6+
X-Patchwork-Id: 14612861
7+
X-Patchwork-Delegate: kuba@kernel.org
8+
Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org
9+
[10.30.226.201])
10+
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
11+
(No client certificate requested)
12+
by smtp.subspace.kernel.org (Postfix) with ESMTPS id A30B6495510;
13+
Fri, 5 Jun 2026 08:11:31 +0000 (UTC)
14+
Authentication-Results: smtp.subspace.kernel.org;
15+
arc=none smtp.client-ip=10.30.226.201
16+
ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
17+
t=1780647091; cv=none;
18+
b=izElTZnAl4VU4jMwjDaYCFw9xgx5Jdm3nvzLj6yKtIxqBkHhndvHgZTl1ps4ZXGZY7WuzqrPlnZzKvjqbmLl9zMojNhz9bfdRUSxAHckbIK7FvDAqJkdGnW7vUVhM2Y2vqBfHF8y99Y7jlplG33EUJvsGus3U3Nwb3XrMMA+TEk=
19+
ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
20+
s=arc-20240116; t=1780647091; c=relaxed/simple;
21+
bh=wVsP7qwG8BJu2wprX0HV2M1fTkH7tQV3G1mR8NtSBaw=;
22+
h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc;
23+
b=YkSoB8rVHO59IG66zmiHuYuyYWLzbyGnZ4+Pyj30JYpjAyBu7MB3zgNmma5FE0yJ7yiQycoKrPcRux8qX7HpzavyQwPsDNmhSJ3eRqrE70gLAOVn8Aia4AnJW0rE5tcNyS6PhhYfflZLwAMqrMF9wuhVOgl8HQ/nT/H2Xry/x8Q=
24+
ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
25+
dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org
26+
header.b=Hbrnqrg9; arc=none smtp.client-ip=10.30.226.201
27+
Authentication-Results: smtp.subspace.kernel.org;
28+
dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org
29+
header.b="Hbrnqrg9"
30+
Received: by smtp.kernel.org (Postfix) with ESMTPS id 4CA61C2BCC6;
31+
Fri, 5 Jun 2026 08:11:31 +0000 (UTC)
32+
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
33+
s=k20201202; t=1780647091;
34+
bh=wVsP7qwG8BJu2wprX0HV2M1fTkH7tQV3G1mR8NtSBaw=;
35+
h=From:Date:Subject:To:Cc:Reply-To:From;
36+
b=Hbrnqrg9RhUWrD93DON6WYHKiUY/P9JoQoOKcBb0/KJWXzbzKUzy1aiEPRDNCz74l
37+
unOk46jE02c/euDZYR1gDWxh9Uxacss0xlUunTTj86g+Uk7iSNaM04wzH4DGgAqWuP
38+
QOK6c9mcDNCgEQ6otxAJVE8JDdQ6Rci/uyPf3YSW6lk2Xc5jca5/hSBn1Ed49K5Ycp
39+
e3VdODdZns9EJlfW2FyX1pLCLijdAZOhdw0+BdfL7Jl8v1NW3lPx68kX0BRG1rAFRs
40+
fIOgpgls+EJeJW0zsiaY65LScSz0F1I6vkcMUyGlEv/qY6jPK7TwZ9GbG+DUyC7SF3
41+
jl5FVBD61KZUQ==
42+
Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org
43+
(localhost.localdomain [127.0.0.1])
44+
by smtp.lore.kernel.org (Postfix) with ESMTP id 305B6CD6E5D;
45+
Fri, 5 Jun 2026 08:11:31 +0000 (UTC)
46+
Date: Fri, 05 Jun 2026 12:11:29 +0400
47+
Subject: [PATCH next-next v2] net: dsa: qca8k: Add support for force mode
48+
for fixed link topology
49+
Precedence: bulk
50+
X-Mailing-List: netdev@vger.kernel.org
51+
List-Id: <netdev.vger.kernel.org>
52+
List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
53+
List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
54+
MIME-Version: 1.0
55+
Message-Id: <20260605-qca8337-force-mode-v2-1-d9a6b6545bfa@outlook.com>
56+
X-B4-Tracking: v=1; b=H4sIAAAAAAAC/32NTQ6CMBCFr0Jm7ZjSYlFX3sOwKGUqjdLRFgmGc
57+
HcrB3Dzki/vb4FE0VOCc7FApMknzyGD3BVgexNuhL7LDFJILbRQ+LLmqFSNjqMlHLgjdK1tzUG
58+
edFVpyMVnJOfnbfQKgeYRfwJNtnqfRo6f7W4qt8C/5anEEq1xta6Fc6ZVF36PD+b73vIAzbquX
59+
0/JJvLBAAAA
960
X-Change-ID: 20260603-qca8337-force-mode-fbcba5296446
61+
To: Andrew Lunn <andrew@lunn.ch>, Vladimir Oltean <olteanv@gmail.com>,
62+
"David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>,
63+
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
64+
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
65+
George Moussalem <george.moussalem@outlook.com>
66+
X-Mailer: b4 0.14.3
67+
X-Developer-Signature: v=1; a=ed25519-sha256; t=1780647089; l=3187;
68+
i=george.moussalem@outlook.com; s=20250321; h=from:subject:message-id;
69+
bh=/1K49g/Q0+wrB8ffa0QJHaW9eANv5Yae+dqQkwbdI4U=;
70+
b=Xn7RwqPiLUqBSMkfjxaoyatDwqn+EhlJZVxXog3mgyAtwLsVAImKiBsVWVvKVPlXJ//K6hwlv
71+
IPyVfdFw1CBAI5t89drX8j9nLQevPmF9+g75OyKnuqOsk4jD9ZFIckZ
72+
X-Developer-Key: i=george.moussalem@outlook.com; a=ed25519;
73+
pk=/PuRTSI9iYiHwcc6Nrde8qF4ZDhJBlUgpHdhsIjnqIk=
74+
X-Endpoint-Received: by B4 Relay for george.moussalem@outlook.com/20250321
75+
with auth_id=364
76+
X-Original-From: George Moussalem <george.moussalem@outlook.com>
77+
Reply-To: george.moussalem@outlook.com
78+
From: George Moussalem <george.moussalem@outlook.com>
79+
X-Patchwork-Delegate: kuba@kernel.org
80+
81+
From: George Moussalem <george.moussalem@outlook.com>
1082

1183
A fixed link topology is commonly used to connect this switch (on port
1284
0 or 6) to a SoC's MAC over SGMII. When inband negotiation is not used,
1385
the switch needs to be configured to operate in force mode. As such,
1486
enable support for force mode.
1587

88+
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
1689
Signed-off-by: George Moussalem <george.moussalem@outlook.com>
1790
---
18-
drivers/net/dsa/qca/qca8k-8xxx.c | 6 +++++-
19-
drivers/net/dsa/qca/qca8k.h | 1 +
20-
2 files changed, 6 insertions(+), 1 deletion(-)
91+
Changes in v2:
92+
- Added check for QCA8337 switch ID and build up the register mask
93+
accordingly before writing the force mode bit to avoid overwriting the
94+
bit on switches other than QCA8337 for which there's no documentation
95+
on whether force mode is supported or not.
96+
- Added comment to state that regardless of port used (0 or 6), the
97+
force mode bit is written to the PORT0 PAD register as per vendor SDK.
98+
- Link to v1: https://lore.kernel.org/r/20260603-qca8337-force-mode-v1-1-caf7670ffab3@outlook.com
99+
---
100+
drivers/net/dsa/qca/qca8k-8xxx.c | 22 ++++++++++++++++------
101+
drivers/net/dsa/qca/qca8k.h | 1 +
102+
2 files changed, 17 insertions(+), 6 deletions(-)
103+
104+
105+
---
106+
base-commit: b7bee4ca5688e30ca50fbc87b1b8f7eed7006c17
107+
change-id: 20260603-qca8337-force-mode-fbcba5296446
108+
109+
Best regards,
21110

22111
--- a/drivers/net/dsa/qca/qca8k-8xxx.c
23112
+++ b/drivers/net/dsa/qca/qca8k-8xxx.c
24-
@@ -1611,10 +1611,14 @@ static int qca8k_pcs_config(struct phyli
113+
@@ -1538,7 +1538,7 @@ static int qca8k_pcs_config(struct phyli
114+
{
115+
struct qca8k_priv *priv = pcs_to_qca8k_pcs(pcs)->priv;
116+
int cpu_port_index, ret, port;
117+
- u32 reg, val;
118+
+ u32 mask, reg, val;
119+
120+
port = pcs_to_qca8k_pcs(pcs)->port;
121+
switch (port) {
122+
@@ -1611,11 +1611,21 @@ static int qca8k_pcs_config(struct phyli
25123
if (priv->ports_config.sgmii_tx_clk_falling_edge)
26124
val |= QCA8K_PORT0_PAD_SGMII_TXCLK_FALLING_EDGE;
27125

28-
+ if (neg_mode == PHYLINK_PCS_NEG_OUTBAND)
29-
+ val |= QCA8K_PORT_PAD_SGMII_FORCE_MODE;
30-
+
31-
if (val)
32-
ret = qca8k_rmw(priv, reg,
33-
QCA8K_PORT0_PAD_SGMII_RXCLK_FALLING_EDGE |
126+
- if (val)
127+
- ret = qca8k_rmw(priv, reg,
128+
- QCA8K_PORT0_PAD_SGMII_RXCLK_FALLING_EDGE |
34129
- QCA8K_PORT0_PAD_SGMII_TXCLK_FALLING_EDGE,
35-
+ QCA8K_PORT0_PAD_SGMII_TXCLK_FALLING_EDGE |
36-
+ QCA8K_PORT_PAD_SGMII_FORCE_MODE,
37-
val);
130+
- val);
131+
+ mask = (val) ? (QCA8K_PORT0_PAD_SGMII_RXCLK_FALLING_EDGE |
132+
+ QCA8K_PORT0_PAD_SGMII_TXCLK_FALLING_EDGE) : 0;
133+
+
134+
+ /*
135+
+ * (Un)set force mode on QCA8337 only, don't include it in the mask for
136+
+ * others. It is written to the PORT0 PAD register for both port 0 and 6.
137+
+ */
138+
+ if (priv->switch_id == QCA8K_ID_QCA8337) {
139+
+ if (neg_mode == PHYLINK_PCS_NEG_OUTBAND)
140+
+ val |= QCA8K_PORT_PAD_SGMII_FORCE_MODE;
141+
+ mask |= QCA8K_PORT_PAD_SGMII_FORCE_MODE;
142+
+ }
143+
+
144+
+ if (mask)
145+
+ ret = qca8k_rmw(priv, reg, mask, val);
38146

39147
return 0;
148+
}
40149
--- a/drivers/net/dsa/qca/qca8k.h
41150
+++ b/drivers/net/dsa/qca/qca8k.h
42151
@@ -58,6 +58,7 @@

target/linux/qualcommax/patches-6.12/0752-net-dsa-qca8k-support-PHY-to-PHY-CPU-link.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Signed-off-by: Ziyang Huang <hzyitc@outlook.com>
4747
return -EINVAL;
4848
}
4949

50-
@@ -1955,7 +1957,7 @@ qca8k_setup(struct dsa_switch *ds)
50+
@@ -1961,7 +1963,7 @@ qca8k_setup(struct dsa_switch *ds)
5151

5252
cpu_port = qca8k_find_cpu_port(ds);
5353
if (cpu_port < 0) {

target/linux/qualcommax/patches-6.12/0754-net-dsa-qca8k-use-correct-CPU-port-when-having-multi.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Signed-off-by: Ziyang Huang <hzyitc@outlook.com>
4040
static int
4141
qca8k_setup_of_pws_reg(struct qca8k_priv *priv)
4242
{
43-
@@ -1952,15 +1934,9 @@ qca8k_setup(struct dsa_switch *ds)
43+
@@ -1958,15 +1940,9 @@ qca8k_setup(struct dsa_switch *ds)
4444
{
4545
struct qca8k_priv *priv = ds->priv;
4646
struct dsa_port *dp;
@@ -57,7 +57,7 @@ Signed-off-by: Ziyang Huang <hzyitc@outlook.com>
5757
/* Parse CPU port config to be later used in phy_link mac_config */
5858
ret = qca8k_parse_port_config(priv);
5959
if (ret)
60-
@@ -2045,17 +2021,12 @@ qca8k_setup(struct dsa_switch *ds)
60+
@@ -2051,17 +2027,12 @@ qca8k_setup(struct dsa_switch *ds)
6161
if (ret)
6262
return ret;
6363

@@ -76,7 +76,7 @@ Signed-off-by: Ziyang Huang <hzyitc@outlook.com>
7676

7777
ret = qca8k_rmw(priv, QCA8K_PORT_LOOKUP_CTRL(port),
7878
QCA8K_PORT_LOOKUP_MEMBER,
79-
@@ -2063,6 +2034,11 @@ qca8k_setup(struct dsa_switch *ds)
79+
@@ -2069,6 +2040,11 @@ qca8k_setup(struct dsa_switch *ds)
8080
if (ret)
8181
return ret;
8282

target/linux/qualcommax/patches-6.12/0755-net-dsa-qca8k-implement-ds-ops-preferred_default_loc.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Signed-off-by: Ziyang Huang <hzyitc@outlook.com>
1111

1212
--- a/drivers/net/dsa/qca/qca8k-8xxx.c
1313
+++ b/drivers/net/dsa/qca/qca8k-8xxx.c
14-
@@ -1738,6 +1738,18 @@ qca8k_get_tag_protocol(struct dsa_switch
14+
@@ -1744,6 +1744,18 @@ qca8k_get_tag_protocol(struct dsa_switch
1515
return DSA_TAG_PROTO_QCA;
1616
}
1717

@@ -30,7 +30,7 @@ Signed-off-by: Ziyang Huang <hzyitc@outlook.com>
3030
static int qca8k_port_change_master(struct dsa_switch *ds, int port,
3131
struct net_device *master,
3232
struct netlink_ext_ack *extack)
33-
@@ -2138,6 +2150,7 @@ static const struct dsa_switch_ops qca8k
33+
@@ -2144,6 +2156,7 @@ static const struct dsa_switch_ops qca8k
3434
.get_phy_flags = qca8k_get_phy_flags,
3535
.port_lag_join = qca8xxx_port_lag_join,
3636
.port_lag_leave = qca8xxx_port_lag_leave,

0 commit comments

Comments
 (0)