Article View: linux.kernel.netdev
Article #4474Re: [PATCH net-next v14 5/5] net: dsa: motorcomm: Add support for Motorcomm YT922x
From: Kyle Switch
Date: Sun, 18 Oct 2026 03:02
Date: Sun, 18 Oct 2026 03:02
95 lines
8985 bytes
8985 bytes
On 10/17/26 04:15, David Yang wrote:
> On Tue, Oct 13, 2026 at 9:11 AM Kyle Switch <kyle.switch@motor-comm.com> wrote:
>> +/* yt922x register lists */
> The indents below look inconsistent. Please adjust to match the existing macros.
Okay.
>
>> +#define YT92XX_PAGE_SELECT 0x1e
>> +#define YT92XX_PAGE 0x1f
>> +#define YT922X_PORTn_STATUS(port) (0x80200 + 4 * (port))
>> +#define YT922X_PORT_LINK_STATE BIT(8)
>> +#define YT922X_PORT_LINK_DUPLEX BIT(7)
>> +#define YT922X_PORT_RX_FC_EN BIT(6)
>> +#define YT922X_PORT_TX_FC_EN BIT(5)
>> +#define YT922X_PORT_SPEED_10 0
>> +#define YT922X_PORT_SPEED_100 1
>> +#define YT922X_PORT_SPEED_1000 2
>> +#define YT922X_PORT_SPEED_10000 3
>> +#define YT922X_PORT_SPEED_2500 4
>> +#define YT922X_PORT_SPEED_5000 5
> Leftover from yt921x_speed.
will be removed and use the macros defined earlier in 921x.
>
>> +/* ISO */
> The comments here (and below) did not provide much information beyond
> the code itself.
>
okay, will remove meaningless code comments.
>> +#define YT922X_PORTn_ISOLATION(port) (0x4 * (port) + 0x180d80)
> (0x180d80 + 4 * (port))
Okay.
>
>> diff --git a/drivers/net/dsa/motorcomm/mdio_bus.c b/drivers/net/dsa/motorcomm/mdio_bus.c
>> index 3aa1111efaa4..a4cb74d0fd90 100644
>> --- a/drivers/net/dsa/motorcomm/mdio_bus.c
>> +++ b/drivers/net/dsa/motorcomm/mdio_bus.c
>> @@ -299,3 +299,42 @@ int yt921x_mbus_ext_init(struct yt921x_priv *priv, struct device_node *mnp)
>>
>> return 0;
>> }
>> +
>> +/* intif extend register read/write api */
>> +int
>> +yt921x_intif_ext_write(struct yt921x_priv *priv, int port, int reg, u16 val)
>> +{
>> + int res;
>> +
>> + if (port > priv->series->max_ports)
>> + return -ENODEV;
>> +
>> + res = yt921x_intif_write(priv, port, YT92XX_PAGE_SELECT, reg);
>> + if (res)
>> + return res;
>> +
>> + res = yt921x_intif_write(priv, port, YT92XX_PAGE, val);
>> + if (res)
>> + return res;
>> +
>> + return 0;
>> +}
>> +
>> +int
>> +yt921x_intif_ext_read(struct yt921x_priv *priv, int port, int reg, u16 *valp)
>> +{
>> + int res;
>> +
>> + if (port > priv->series->max_ports)
>> + return -ENODEV;
>> +
>> + res = yt921x_intif_write(priv, port, YT92XX_PAGE_SELECT, reg);
>> + if (res)
>> + return res;
>> +
>> + res = yt921x_intif_read(priv, port, YT92XX_PAGE, valp);
>> + if (res)
>> + return res;
>> +
>> + return 0;
>> +}
>> diff --git a/drivers/net/dsa/motorcomm/mdio_bus.h b/drivers/net/dsa/motorcomm/mdio_bus.h
>> index e79b725d435b..513a8d2d7618 100644
>> --- a/drivers/net/dsa/motorcomm/mdio_bus.h
>> +++ b/drivers/net/dsa/motorcomm/mdio_bus.h
>> @@ -50,5 +50,7 @@ yt921x_intif_modify(struct yt921x_priv *priv, int port, int reg, u16 mask,
>>
>> int yt921x_mbus_int_init(struct yt921x_priv *priv, struct device_node *mnp);
>> int yt921x_mbus_ext_init(struct yt921x_priv *priv, struct device_node *mnp);
>> +int yt921x_intif_ext_write(struct yt921x_priv *priv, int port, int reg, u16 val);
>> +int yt921x_intif_ext_read(struct yt921x_priv *priv, int port, int reg, u16 *valp);
>>
>> #endif
> intif_ext_* should be placed right after intif_* (if they are still in
> mdio_bus).
okay.
Technical Details
Message-ID:
<b4e5b68e-2ece-4007-bd47-e6432ce70d9a@motor-comm.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-347926-linux-kernel-netdev=dewy.ruReferences:
<20261013011122.1889766-1-kyle.switch@motor-comm.com> <20261013011122.1889766-6-kyle.switch@motor-comm.com> <CAAXyoMPeOmMZ8u=+S9=W=aJ0riSRbkBX9afrcVdfrE4BreO-Hw@mail.gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-347926-linux-kernel-netdev=dewy.ru
From: kyle.switch@motor-comm.com (Kyle Switch)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v14 5/5] net: dsa: motorcomm: Add support for
Motorcomm YT922x
Date: Sun, 18 Oct 2026 11:02:53 +0800
Organization: Usenet Network
Message-ID: <b4e5b68e-2ece-4007-bd47-e6432ce70d9a@motor-comm.com>
References: <20261013011122.1889766-1-kyle.switch@motor-comm.com>
<20261013011122.1889766-6-kyle.switch@motor-comm.com>
<CAAXyoMPeOmMZ8u=+S9=W=aJ0riSRbkBX9afrcVdfrE4BreO-Hw@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="3212351"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:VpvApdGoIoC0BwnSFZvoXaetCPw= sha256:izykhaDt9yFuGVaV5tJnqy9DDXifX+o3A60LZr5Mwsc=
sha1:kMaACn8VVMUuZ9lfijTTl9VnREM= sha256:dhnlpv53HCzU0IE59ygFjLfQvphzUc+uoYZRan+toQ8=
Content-Language: en-US
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
by mail.dewy.ru (Postfix) with ESMTP id A39D81107A3; Sun, 18 Oct 2026 06:03:38 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -2.949
X-Spam-Status: No, score=-2.949 tagged_above=-9999 required=6.31
tests=[DCC_REPUT_70_89=0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25,
MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
SPF_PASS=-0.001, UNPARSEABLE_RELAY=0.001]
autolearn=ham autolearn_force=no
X-Received: from mail.dewy.ru ([127.0.0.1])
by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id X3p-r-4pppGv;
Sun, 18 Oct 2026 06:03:35 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-347926-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=motor-comm.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
by mail.dewy.ru (Postfix) with ESMTPS id 3BB1F1105E2; Sun, 18 Oct 2026 06:03:31 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
by sea.lore.kernel.org (Postfix) with ESMTP id 2101934EB5; Sun, 18 Oct 2026 03:03:15 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id A951437267C;
Sun, 18 Oct 2026 03:03:14 +0000 (UTC)
X-Received: from out28-125.mail.aliyun.com (out28-125.mail.aliyun.com [115.124.28.125])
(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 CA6A7348C76;
Sun, 18 Oct 2026 03:03:10 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.28.125
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1792292594; cv=none; b=KazyWkIVrSAzaxvoTuQI14XtDxl+Ew+2xxS7fdo19Dp+J6mfv2PJ+7KM8ASYX1sWRgX0fQVWpEl9A5v6n37PY/sdE7fj1D0XfozOMgsNba6d7itOC4wM+Ht2lvVggYMyWgHs+4r3OAVH1v8wHg6xL8zQKC9IHbIF6wbZrwsxDR8=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1792292594; c=relaxed/simple;
bh=0KkuGVnbhsWfcdabm/htUrm/DqxpcuxDQZ4lojf2pUA=;
h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:
In-Reply-To:Content-Type; b=HbK/m9coO1QdjjuPAbEjVRR6k1NT5k2j/RXKrnHdKoiUkJE31hJBLTFuu7HUGElsH0fVoK+OFqNxTTbLfwnTx8moGI0g6i0PBE+adHTJVXRRuumVbEs7PM0t0sPocXUrq3RYIyYGL6ssvujvrhOWEmsu4XiviBAuWQYyArVSWyI=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=motor-comm.com; spf=pass smtp.mailfrom=motor-comm.com; arc=none smtp.client-ip=115.124.28.125
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=motor-comm.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=motor-comm.com
X-Alimail-AntiSpam: AC=CONTINUE;BC=0.07857046|-1;CH=green;DM=|CONTINUE|false|;DS=CONTINUE|ham_system_inform|0.00559226-0.000243516-0.994164;FP=11709099924969983668|0|0|0|0|-1|-1|-1;HT=maildocker-contentspam033068016216;MF=kyle.switch@motor-comm.com;NM=1;PH=DS;RN=16;RT=16;SR=0;TI=SMTPD_---.jie8pT0_1792292573;
X-Received: from 10.10.26.192(mailfrom:kyle.switch@motor-comm.com fp:SMTPD_---.jie8pT0_1792292573 cluster:ay29)
by smtp.aliyun-inc.com;
Sun, 18 Oct 2026 11:03:01 +0800
X-Precedence: bulk
X-Mailing-List: netdev@vger.kernel.org
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-User-Agent: Mozilla Thunderbird
X-Cc: andrew@lunn.ch, olteanv@gmail.com, davem@davemloft.net,
edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org,
linux@armlinux.org.uk, netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
ming.xu@motor-comm.com, xiaolin.xu@motor-comm.com,
jianmin.wang@motor-comm.com, wei.zhang@gl-inet.com, sijia.huang@gl-inet.com
X-In-Reply-To: <CAAXyoMPeOmMZ8u=+S9=W=aJ0riSRbkBX9afrcVdfrE4BreO-Hw@mail.gmail.com>