🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #5454

[PATCH net-next v16 0/5] net: dsa: motorcomm: add support yt922x driver

#5454
From: Kyle Switch
Date: Tue, 20 Oct 2026 11:11
98 lines
11023 bytes
This patchset mainly adds support for the yt922x series to the dsa driver.
Currently, only the yt9224 in the yt922x series is supported, and the
corresponding tag handling for yt922x is added.

At the same time, it optimizes the max ports boundary check in the
existing code, and initializes the dsa switch based on the chipid.

changes in v16:
1) Add missing break in switch case to prevent fall-through in
   yt922x_port_config()

changes in v15:
1) Revert the use of GENMASK_U16() to replace GENMASK(), so as to
   facilitate adaptation to scenarios with more ports in the future.
2) Group functions with the same functionality together in mdio_bus.c.
3) Remove meaningless code comments.
4) Renaming parameters in yt922x_pcs_get_state().
5) Add neg_mode and advertising handle.

changes in v14:
1) Replace the goto-based skip_extmode_check path with an early
   conditional in yt921x_chip_detect().

changes in v13:
1) Fix a compilation error in patch1 only.
   The change is limited to the yt92xx_register_switch function:
   - Replace yt921x_priv with dsa_to_yt921x_priv
   - Replace to_device with yt921x_priv_to_device

changes in v12:
1) Rebase the code.
2) Delete origin patch4 and patch5 about MIB init and remove operation.
3) Optimize error message logging.
4) Add documents about yt922x tag.

changes in v11:
1) Initialize ctrl variable inside yt922x_port_up().
2) Update maitainer for new file.

changes in v10:
1) Rebase the code.

changes in v9:
patch 1: 1) Add a dev_err() when chipid mismatch.
patch 3: 1) Using GENMASK_U* to replace GENMASK

changes in v8:
patch 1: 1) Add a lock operation to acquire the chip ID during the probe()
         stage.
         2) Remove meaningless changes.
patch 3: Modify the changelog description.
patch 6: 1) Remove sds_init() in this patch.
         2) Code refactoring, including yt922x_sds_phyaddr_get() and
            yt921x_needs_extmode_check()
         3) In yt921x_intif_ext_write() and yt921x_intif_ext_read(),
            add a boundary check for phyaddr. The reason is that the
            phyaddr of the top ext register is 9, so max_ports should
            be used for the check to include it.
         4) In the yt922x driver, added initialization of yt921x_port
            for exporting priv.

changes in v7:
patch 1: Fix the series_lookup() redundancy issue.
         Fix the dsa->priv initialization and the code style issue.
patch 6: Move psc definition to yt921x_port
         Fix psc_get_state() and an_restart().
         Use the existing yt921x driver interface for the duplicated
         logic for chip_reset().
         Move the yt922x_cpu_port_set() to chip_setup_dsa() to align
         with yt921x function.

Kyle Switch (5):
  net: dsa: motorcomm: initialize dsa_switch based on chipid
  net: dsa: motorcomm: use max_ports in series for port bounds checking
  net: dsa: motorcomm: use fixed-width GENMASK_U*() helpers
  net: dsa: tag_yt922x: add support for Motorcomm YT922x tags
  net: dsa: motorcomm: Add support for Motorcomm YT922x

 MAINTAINERS                          |   2 +
 drivers/net/dsa/motorcomm/Kconfig    |   7 +-
 drivers/net/dsa/motorcomm/Makefile   |   1 +
 drivers/net/dsa/motorcomm/chip.c     | 575 ++++++++++++++++++++++++++-
 drivers/net/dsa/motorcomm/chip.h     | 101 +++++
 drivers/net/dsa/motorcomm/mdio_bus.c |  48 ++-
 drivers/net/dsa/motorcomm/mdio_bus.h |   4 +
 drivers/net/dsa/motorcomm/pcs-922x.c | 282 +++++++++++++
 drivers/net/dsa/motorcomm/pcs.h      |   1 +
 include/net/dsa.h                    |   2 +
 net/dsa/Kconfig                      |   6 +
 net/dsa/Makefile                     |   1 +
 net/dsa/tag_yt922x.c                 | 122 ++++++
 13 files changed, 1135 insertions(+), 17 deletions(-)
 create mode 100644 drivers/net/dsa/motorcomm/pcs-922x.c
 create mode 100644 net/dsa/tag_yt922x.c

-- 
2.25.1
Technical Details
Message-ID: <20261020111115.3072180-1-kyle.switch@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-349241-linux-kernel-netdev=dewy.ru

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-349241-linux-kernel-netdev=dewy.ru
From: kyle.switch@motor-comm.com (Kyle Switch)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net-next v16 0/5] net: dsa: motorcomm: add support yt922x driver
Date: Tue, 20 Oct 2026 19:11:10 +0800
Organization: Usenet Network
Message-ID: <20261020111115.3072180-1-kyle.switch@motor-comm.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="3839256"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:WNQndYe5U83BymERxNB1QEvmZ2Q= sha256:JXZOg7Fe4mVLXvAinPoV4Gh1115Iat0JWyWBkS3keXU=
	sha1:e3a1bFdMa3vbUrTRyVFTzND5Rg8= sha256:LVojCov51cNyAE/qOYqkiKqBypne+96iMxBuJACOBMU=
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 4D71F110CB9; Tue, 20 Oct 2026 14:13:36 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.049
X-Spam-Status: No, score=-3.049 tagged_above=-9999 required=6.31
	tests=[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 M3rsikhSQgQZ;
	Tue, 20 Oct 2026 14:13:33 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-349241-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 sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id B844E110C7C; Tue, 20 Oct 2026 14:13:30 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sto.lore.kernel.org (Postfix) with ESMTP id 3496360A61C; Tue, 20 Oct 2026 11:12:10 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=fail;
	t=1792494696;
	b=eMOB582+ZJSUC8c+hXHZES1gSYkize8Wk9nqyIpw5mHG+n70Y8blN4hLzntYv/Ql+h68
	 aFObN/1zVw7kgPOEyG0yZo5guN8sL8MLWinsUefqgwdjGkxFhDrc6tgAv5b38eWCXTJBZ
	 tqxJKSKJVLbVfhycz8RO1KdZK6X0hHFqJNcEh8+5AyvuQBPTgiGOEuSREMPkeTA0+P+mV
	 k0V8FHRm/Fnx2XoPb0uPWXRW8Zr+5dajf4n7B60a+LpFsl8NVYoTcg7KB2Xc89rB4VU+N
	 wfv9QUkUF32YgIWwr1NoDTUEsONkOj2ZjKuRCIPII6WkKmJOZ2GObFYBkNFxcPO/iPA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792494696;
	h=X-Original-To:Received:DMARC-Filter:X-Alimail-AntiSpam:Received:From:
	 To:Cc:Subject:Date:Message-Id:X-Mailer:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version:Content-Transfer-Encoding;
	bh=TsxZ27lckDppbBF1+Em1eKtgJzqPsvL4hFQhvEVmK0k=;
	b=FltrA+aZFNYvbTJS6u7l3AL6kizOzprf/klqRJJreeCguTWlSs/Fyrl4cRCQSdQqwv1c
	 xEsrN/wDd4F//JFUbT2voWcElrWiQWNpLTZ2ata8LYMjsxl+SEbNgQ3G6t+fSSPPR0Aj+
	 4rC329o9dH7XnjCobKoMNj83UJspP9596KljKrhD0OZDlIe0wu7xAzPuIFD4FvaUeY1Kv
	 QXyk7K6FT+o3A4vDzcH05b1mbjxWUbQn5pCV42OZ5n44nPXUYMLSB2z1IRg/COHSpGD5k
	 81c6oxWjVt3U+9ZxJVU0wB2j9YEIxgFFtSpnpRwIMR1HeAvIIQSdJbNZLa5r1Naf/UA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dmarc=pass header.from=motor-comm.com;
	spf=pass smtp.mailfrom=motor-comm.com;
	arc=fail smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 3FD0560A262B;
	Tue, 20 Oct 2026 11:11:36 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=115.124.28.77
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1792494687;
	b=WYeIForDkIonoNHGqcfKU8413oFsSZ4rrEFQU0mtvbA0O+AcjQza6KnlaxgueyPX+3zu
	 qIeOQw3C3fsXRUD3Ik3+wq4AIqHNU6u/3C8l2OT6LrFEpu1Pi5Ly/4Xs1tnMEvxwoaqwi
	 uRAlhSCn33JB32KgNzJtEBTH5xKAmlhNe4zqSpHv76C6xMqTMLtkSZxHub+kvFieXyvf8
	 ZJaTRqeCJmv05m/1MPbNuIa8plcZs988C/BOFC4P/1bEAaf1cymcZMae8SuJRE4L6oHZF
	 4m2skVjhyrYtFIM3XLmy8pfJbN36nNpR3hsHk+gygP6Nn9PFfUWhtwMlblDGkoATTzg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792494687;
	h=DMARC-Filter:X-Alimail-AntiSpam:Received:From:To:Cc:Subject:Date:
	 Message-Id:X-Mailer:MIME-Version:Content-Transfer-Encoding;
	bh=TsxZ27lckDppbBF1+Em1eKtgJzqPsvL4hFQhvEVmK0k=;
	b=GUOLcEjWMGSOm4wp4BnWVC+wuzOyL9+UCVOXdCsLzU2nFfPm64s+f14BhvEc4sGn4l31
	 X1W3ybNMxPpcnUIB9tMkxe4c4UlmQz9iPoTs5k3VVfObrr4k2PMU8TCUZe6iY/u+zkhPv
	 v7BIWOomVTGaHVnnCdS9VifuGGYVS6D2ZoqZp+Ruq82L9KV9DOdpG1JKU8izhabKRV/vC
	 amZr1r0aGNn8psRGfmDbQicKEbYEHwKHfdeXT5FB5YJ2m7px86UdInRlAYvW8cgvmZ1tP
	 mqhSBoedHDHleIfkSEoFl6Jv0BxOfHr0Bhgz1Fp1xv6I0UxZjcDE1cIRq4yvouupb/A==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=motor-comm.com;
	spf=pass smtp.mailfrom=motor-comm.com;
	arc=none smtp.remote-ip=115.124.28.77
X-Received: from out28-77.mail.aliyun.com (out28-77.mail.aliyun.com [115.124.28.77])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id E1BDF606A31B;
	Tue, 20 Oct 2026 11:11:23 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org E1BDF606A31B
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.0745382|-1;CH=green;DM=|CONTINUE|false|;DS=CONTINUE|ham_system_inform|0.048354-0.00145881-0.950187;FP=16713164124569783476|14|2|17|0|-1|-1|-1;HT=maildocker-contentspam033037028158;MF=kyle.switch@motor-comm.com;NM=1;PH=DS;RN=16;RT=16;SR=0;TI=SMTPD_---.jlqQGzu_1792494675;
X-Received: from motor-comm.com(mailfrom:kyle.switch@motor-comm.com fp:SMTPD_---.jlqQGzu_1792494675 cluster:ay29)
          by smtp.aliyun-inc.com;
          Tue, 20 Oct 2026 19:11:20 +0800
X-Cc: 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-Mailer: git-send-email 2.25.1
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list