From nobody Tue Dec 2 01:30:04 2025 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (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 208E134A78C for ; Fri, 21 Nov 2025 11:36:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763724969; cv=none; b=icf/HZf0AskJgUUi+Y9sCZ8UFUg200VqdQFAcC4FqxXF7ocxdc46C6U1iU5kWPvAgX6O4q4iFranE/U2ESevdGnbUwUBcrLkbhyJaYQbuhRaWzJSvRxiYa6iqPhWrdFqmPBD19t4NRr7xOhmfZ/yC0+1eSJyT3iLRvY3hMreJKg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763724969; c=relaxed/simple; bh=ZuNR+n37++XWeuZmswx8Jk/VFwASvL7IpG6/C6NgGj4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TZygmJtT47wrYJH7HfzMj5EQ5KFD6N0iapZl2PYz19AJmoFC1AW0qrDKsS5ps35SnQt2ZaVJgMees74S1Urz4iXhfG+ogQSzCYCg/R8BOO4x01cYe9O+ABU/WuV8uqErhSEQpN5qqW703/NyQmRRd7bIeQglwCs+fEedKG0W3eE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=hPauthpu; arc=none smtp.client-ip=209.85.128.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hPauthpu" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-477a219db05so12534815e9.2 for ; Fri, 21 Nov 2025 03:36:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763724965; x=1764329765; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=aVGvRm888PHJPhrnHWR5oOq8+UrzZ+D6x/y+ufMZnjU=; b=hPauthpuV/avzJKlAqyXmBaXDSZUdBBAIzf6jN4MfIL2U4s9yk8ijzLBxUT3XkPw/4 Nz1pA7YiKLH/IqqqkDIV26U9H43YMSbSaP8T3Nnt10Gr0modGsUGr9nxVE9KlKWUjrIH tzjRkJcoVRkn9/OpA8etXggrJB6rUP5DNmzXKNE9HSstTZABk4kkFwJvwFFGKJH5Cvyb BgfLSM+8yIh9gSd9BYplU9kdXwlVJKQMqqUOQ4aeKx2M9hwIsGYAny70SB303OKRDSZl jInjWnmCtGvyONc58e/QuenApo8xPV5s08H/P51awyMB0CMbA4b9MDdkTzGavJAzDV5b Lbiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763724965; x=1764329765; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=aVGvRm888PHJPhrnHWR5oOq8+UrzZ+D6x/y+ufMZnjU=; b=dV0I91dQ+csUW6463U8rBBIVvqJIhO9IZR5mKIBQpu1kqLHUoebs0lxmeJ5VhDBWvK oSiU9Ai5q93dXeUpPGpTpryNOETQG1/DGMUIDXz1Brzwx7g0UBviVryIQoPJ8ko7XkFX k34ZEhzA0gAlNjoOD85uFogQVP0oXEPy3UrAG113iONOFz2/33XnMBe8te1FTr6ExYky st7l8n/LTAtjPl79dnUKksPwAC4pLrRxsD/UcRISuNjDoSh/nZpPzpzzRYX7cSqTv2L/ YUj12pzUxldF1c5g+IfosFmrl+T6WC50ym1eEWnTBm4edNEmwO2V83w7jkAS3wYVKUq5 dTfQ== X-Forwarded-Encrypted: i=1; AJvYcCWQCEnnNW4yuNOxkQskhZpuIjw+yg1uiO/f5+Hy8Kk+MgG9GQ6ALM7jrNw0e3u2GgZ9lvcmgteWmTcpqsY=@vger.kernel.org X-Gm-Message-State: AOJu0YyL+7dlB8gu9iBmY9jcLsN1ize9E4hTM3pA32JMV9jIPWH+GfOd 4+cIPgS0dYdqjBkVX/DGXnU2KUg4B88MN1FoBytD/D6i1bsVdHaOx3ZJ X-Gm-Gg: ASbGnctkGwboRrywCYApBYEoh2HOEO/7KrOPn1WhYlB0t01XY4C2halqCaGD6u3Okf/ 8mbqN1BbLGsbg0IatE5NoyeS8nEG2pKYcBdf5dt1hEa/KiN2KElHubH2+bpBKsn0lhH/Bz6xHSm LwtQ6cLkNuLbe+1HZikrPMKc5w7IxR3NiJfaRhPG7On2UpTB4YTwmgYwqHMxbe7JG1FAWCASYvs dig1FIPwKrHfnENbcexW+Wji6FXBFwagI0H/vJSZs7f/0nzIf6XQD6T15r+HAOKY42i2gr9fLOu +goE+9R+0c3lePojzEKJsiF5BYQvxF+rx7aTof0j4wfcipt6ExqzfCyT1AeNor0I00qVpb29Ol0 wBsLY6i5PCpG7GqeekivYy9SI3UI/I6IvlNCOeUVx+A9BpH6MngKgD9ZFFz2xLwjeeHpjTtrf95 H2Dr+8DBRF9FF6HAtD7gG7GdBK47jGkmx/3Vc= X-Google-Smtp-Source: AGHT+IGP6qqVCFXHN+cAZp1IvVwnJnp7t5C04e1RX3baXyzOnx75Ofa1ghx3/gF3/D/CgYSw36Gteg== X-Received: by 2002:a05:600c:4f82:b0:477:952d:fc11 with SMTP id 5b1f17b1804b1-477c11175a9mr22994005e9.16.1763724964758; Fri, 21 Nov 2025 03:36:04 -0800 (PST) Received: from iku.Home ([2a06:5906:61b:2d00:9cce:8ab9:bc72:76cd]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-477bf3558d5sm38732465e9.1.2025.11.21.03.36.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Nov 2025 03:36:04 -0800 (PST) From: Prabhakar X-Google-Original-From: Prabhakar To: =?UTF-8?q?Cl=C3=A9ment=20L=C3=A9ger?= , Andrew Lunn , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Simon Horman , Philipp Zabel , Russell King , Geert Uytterhoeven , Magnus Damm Cc: linux-renesas-soc@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar Subject: [PATCH net-next 01/11] net: dsa: tag_rzn1_a5psw: Drop redundant ETH_P_DSA_A5PSW definition Date: Fri, 21 Nov 2025 11:35:27 +0000 Message-ID: <20251121113553.2955854-2-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251121113553.2955854-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20251121113553.2955854-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Lad Prabhakar Remove the locally defined ETH_P_DSA_A5PSW protocol value from tag_rzn1_a5psw.c. The macro is already provided by , which is included by this file, making the local definition redundant. Signed-off-by: Lad Prabhakar Reviewed-by: Vladimir Oltean --- net/dsa/tag_rzn1_a5psw.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/dsa/tag_rzn1_a5psw.c b/net/dsa/tag_rzn1_a5psw.c index 69d51221b1e5..201782b4f8dc 100644 --- a/net/dsa/tag_rzn1_a5psw.c +++ b/net/dsa/tag_rzn1_a5psw.c @@ -24,7 +24,6 @@ =20 #define A5PSW_NAME "a5psw" =20 -#define ETH_P_DSA_A5PSW 0xE001 #define A5PSW_TAG_LEN 8 #define A5PSW_CTRL_DATA_FORCE_FORWARD BIT(0) /* This is both used for xmit tag and rcv tagging */ --=20 2.52.0 From nobody Tue Dec 2 01:30:04 2025 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (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 D611A34AB12 for ; Fri, 21 Nov 2025 11:36:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763724970; cv=none; b=rm2VVp/XXX4cEK6MmGcjy2YqYLF3X5JKw9R0aRgexu4lZGuyPN9hvZ+Th+/PPG2e5nF6IjDJu2zhFmr7GEabCnqxEjDymXyYQPASF638m5JOiVRM6RdMJV1KCyZ+Bg8KC1vDEin/u9bBSGxzfbq7TyjnzpDSRKOGGx6lRFGje5E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763724970; c=relaxed/simple; bh=yCB3+ezRSYEUQgdD1MGZqHvmALaN2Xqrg4u25F6U+GY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=T6mk+snvvAT6QlmGZ4pq7t2zQ9yW9qmJ/W7SRCsJ48q6VZSSgAN2u/leEISA8DMFEuLT7LxsRbxcFod3XD3jVNghI5c8jHszonsnpyBvc4f9o1razi4Xh/nNWZtIBeHwFDkximD9oYHei5UAVxPpUrCxvYygqEwGCm488oiLihY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=afavU62X; arc=none smtp.client-ip=209.85.128.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="afavU62X" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-47778b23f64so10999855e9.0 for ; Fri, 21 Nov 2025 03:36:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763724966; x=1764329766; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JNyX5XLD0/DFtoBC+0XRb33jjMogv+sdoEl7ypxAYys=; b=afavU62XJ+1Jst0o6endtEU8qKpuJh/kCG9bVUx5284yNjNgvsHT8UgM0c4R1TMlaf LvDkftf7Y0dQXVvqU9yB8aNuw+oA4+VUJURzqdRWzc66MB1ggI6Ghr/zdjESyErOUhIC zNGd1+KMDgfWWX51iSoPKekDJCTU3mJcnJasbhRydLKYwE9fr86PLZRP9fVbaOYirY7D zNbMLZ23aZsztZDaY5vYfadh5osRwAdLnQanFnrgIUNPArT8VcNcV6pkLVV1+L7x80Ol Uq5UxrC5fhdrTl6Wb5oEcnJwjK3KoQweVlZSU5C0flPqMYObGVffP3nVMaDWLSOZbzEp DzpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763724966; x=1764329766; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=JNyX5XLD0/DFtoBC+0XRb33jjMogv+sdoEl7ypxAYys=; b=ZM5aPqwLWhhD6nJ8AfSKMX7ar4CEK/EMI7kN97wweFyE4B+H57T+OyS117t+Ya7LEp UK2qy7qtfNViQUHcjlW3lkroJ8mjXmX20fxvIma3afc6AqpWM1Z6Br+Kv00EcPxKIkTy R1UqJ5VQ4mDt/uRQFzkh2X6xymcUOxuJpr2svqiHP/M575dKAPn/S4I3jxZP5thfW/0R SPR4RHtmm6oApdKl+aAUnFAMGBDJiOkr6Q69oyrLspx3catfRbRjvpQ+p9JkB+PVlz9U r0ZwmSx4zxJIzBQPp16wuPjB8sBfu+bcUp0ynJRBvN8kUKFt+F35cNF+J6cJlRqKL0Hu BQ0Q== X-Forwarded-Encrypted: i=1; AJvYcCVpoZtjZetKodzhw4UjzUWoTgOf0IdxDtytGGRGb9dxmbPlRpZjpc5xpbaz7BdAalynzC8MfuxHZC5vbkM=@vger.kernel.org X-Gm-Message-State: AOJu0Yz3yJ8iHBZqymKjVBzadYGpxyVXe+GOYqmoyqot6U9QasE2WpGk SEtoOaJ3DPAxryzhuEzTR/ejWRStodqL6yrsQM92gEXm3OU8cCBUk9b1 X-Gm-Gg: ASbGncvix54aiJJLTsunAufv6vyJPup+D8hyxJqxgOyxbwf2o7Tqf2mwyPEbnSR7sZp nVhLWDPO35F2peUb3Fs1H+h1bQfhRileEM2RcMTJdToNBLeWOybQnvaByOgNGqeME3NLnDoYxzU NVQufQVsF43edx4CDA79WH6PdUyUXrWqipImQEOE+NUIQxJRvruLBgxPpMq/8IfEmAc16MX68SO 1ymgtIkSmr716KBpEWgtpSRU9c0f80jko9IjSly1l8ZNZMEpjbvKBV1LgoLqgiGTIH6zBDW8o/O SNGVX5ZyB0iSResqkw++5JmXqI4EYXGLR5aTBqqyVzjP7FwirtCp996b2rB7M90IiLxB50lJc6Q xh7SHNRmGJd46Gxw7xL8ljg8kaGzbMB0rqBnwaMD2Q85Ur2S7HU9gjioNMyRX7rTpDmp25Momru c89H9QvwGFk391S7S5Rq6Du9b6o91CrhyZjYc= X-Google-Smtp-Source: AGHT+IFYrXJyawAYVnBufzc2lSXEab8S9Pyq28aFqYNuy0VZ1V9zJtn/NXRS/Rqd3af0vd+gooHTQQ== X-Received: by 2002:a05:600c:1f1a:b0:45d:f81d:eae7 with SMTP id 5b1f17b1804b1-477c114f45fmr18432865e9.28.1763724965793; Fri, 21 Nov 2025 03:36:05 -0800 (PST) Received: from iku.Home ([2a06:5906:61b:2d00:9cce:8ab9:bc72:76cd]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-477bf3558d5sm38732465e9.1.2025.11.21.03.36.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Nov 2025 03:36:05 -0800 (PST) From: Prabhakar X-Google-Original-From: Prabhakar To: =?UTF-8?q?Cl=C3=A9ment=20L=C3=A9ger?= , Andrew Lunn , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Simon Horman , Philipp Zabel , Russell King , Geert Uytterhoeven , Magnus Damm Cc: linux-renesas-soc@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar Subject: [PATCH net-next 02/11] net: dsa: tag_rzn1_a5psw: Add RZ/T2H ETHSW tag protocol and register ethsw tag driver Date: Fri, 21 Nov 2025 11:35:28 +0000 Message-ID: <20251121113553.2955854-3-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251121113553.2955854-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20251121113553.2955854-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Lad Prabhakar Add an explicit tag protocol for the RZ/T2H ETHSW and register a separate ethsw tag driver so the existing A5PSW tag implementation can be reused for RZ/T2H without code duplication. The ETHSW IP on RZ/T2H shares substantial commonality with the A5PSW IP on RZ/N1, and the current tag driver does not touch the register fields that differ between the two blocks. Expose a distinct DSA protocol and a second dsa_device_ops to let consumers select the RZ/T2H tag format while keeping the proven A5PSW handling unchanged. Signed-off-by: Lad Prabhakar --- include/net/dsa.h | 2 ++ include/uapi/linux/if_ether.h | 2 +- net/dsa/tag_rzn1_a5psw.c | 21 +++++++++++++++++++-- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/include/net/dsa.h b/include/net/dsa.h index 97d5f401cfcf..81302315e493 100644 --- a/include/net/dsa.h +++ b/include/net/dsa.h @@ -57,6 +57,7 @@ struct tc_action; #define DSA_TAG_PROTO_BRCM_LEGACY_FCS_VALUE 29 #define DSA_TAG_PROTO_YT921X_VALUE 30 #define DSA_TAG_PROTO_MXL_GSW1XX_VALUE 31 +#define DSA_TAG_PROTO_RZT2H_ETHSW_VALUE 32 =20 enum dsa_tag_protocol { DSA_TAG_PROTO_NONE =3D DSA_TAG_PROTO_NONE_VALUE, @@ -91,6 +92,7 @@ enum dsa_tag_protocol { DSA_TAG_PROTO_VSC73XX_8021Q =3D DSA_TAG_PROTO_VSC73XX_8021Q_VALUE, DSA_TAG_PROTO_YT921X =3D DSA_TAG_PROTO_YT921X_VALUE, DSA_TAG_PROTO_MXL_GSW1XX =3D DSA_TAG_PROTO_MXL_GSW1XX_VALUE, + DSA_TAG_PROTO_RZT2H_ETHSW =3D DSA_TAG_PROTO_RZT2H_ETHSW_VALUE, }; =20 struct dsa_switch; diff --git a/include/uapi/linux/if_ether.h b/include/uapi/linux/if_ether.h index 2c93b7b731c8..61f64cb38b08 100644 --- a/include/uapi/linux/if_ether.h +++ b/include/uapi/linux/if_ether.h @@ -118,7 +118,7 @@ #define ETH_P_YT921X 0x9988 /* Motorcomm YT921x DSA [ NOT AN OFFICIALLY R= EGISTERED ID ] */ #define ETH_P_EDSA 0xDADA /* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED= ID ] */ #define ETH_P_DSA_8021Q 0xDADB /* Fake VLAN Header for DSA [ NOT AN OFFIC= IALLY REGISTERED ID ] */ -#define ETH_P_DSA_A5PSW 0xE001 /* A5PSW Tag Value [ NOT AN OFFICIALLY REG= ISTERED ID ] */ +#define ETH_P_DSA_A5PSW 0xE001 /* A5PSW/ETHSW Tag Value [ NOT AN OFFICIAL= LY REGISTERED ID ] */ #define ETH_P_IFE 0xED3E /* ForCES inter-FE LFB type */ #define ETH_P_AF_IUCV 0xFBFB /* IBM af_iucv [ NOT AN OFFICIALLY REGISTE= RED ID ] */ =20 diff --git a/net/dsa/tag_rzn1_a5psw.c b/net/dsa/tag_rzn1_a5psw.c index 201782b4f8dc..66619986fa71 100644 --- a/net/dsa/tag_rzn1_a5psw.c +++ b/net/dsa/tag_rzn1_a5psw.c @@ -23,6 +23,7 @@ */ =20 #define A5PSW_NAME "a5psw" +#define ETHSW_NAME "ethsw" =20 #define A5PSW_TAG_LEN 8 #define A5PSW_CTRL_DATA_FORCE_FORWARD BIT(0) @@ -108,8 +109,24 @@ static const struct dsa_device_ops a5psw_netdev_ops = =3D { .rcv =3D a5psw_tag_rcv, .needed_headroom =3D A5PSW_TAG_LEN, }; +MODULE_ALIAS_DSA_TAG_DRIVER(DSA_TAG_PROTO_A5PSW, A5PSW_NAME); +DSA_TAG_DRIVER(a5psw_netdev_ops); + +static const struct dsa_device_ops ethsw_netdev_ops =3D { + .name =3D ETHSW_NAME, + .proto =3D DSA_TAG_PROTO_RZT2H_ETHSW, + .xmit =3D a5psw_tag_xmit, + .rcv =3D a5psw_tag_rcv, + .needed_headroom =3D A5PSW_TAG_LEN, +}; +MODULE_ALIAS_DSA_TAG_DRIVER(DSA_TAG_PROTO_RZT2H_ETHSW, ETHSW_NAME); +DSA_TAG_DRIVER(ethsw_netdev_ops); + +static struct dsa_tag_driver *dsa_tag_driver_array[] =3D { + &DSA_TAG_DRIVER_NAME(a5psw_netdev_ops), + &DSA_TAG_DRIVER_NAME(ethsw_netdev_ops), +}; +module_dsa_tag_drivers(dsa_tag_driver_array); =20 MODULE_DESCRIPTION("DSA tag driver for Renesas RZ/N1 A5PSW switch"); MODULE_LICENSE("GPL v2"); -MODULE_ALIAS_DSA_TAG_DRIVER(DSA_TAG_PROTO_A5PSW, A5PSW_NAME); -module_dsa_tag_driver(a5psw_netdev_ops); --=20 2.52.0 From nobody Tue Dec 2 01:30:04 2025 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 D39CF34B421 for ; Fri, 21 Nov 2025 11:36:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763724970; cv=none; b=I4QPkAwd/EhjtRLzN2sj030Y2IGWtjoOUvL30/kRKtw+/uLPILF8GGAMEmuRn/g8br9FbTj2vugDR6iRlYUx5D0XlLhSuuRRRWtLPT0ZA/X2WSDa3YZRVs2yMFeVujfh34sBpqgY5HE9tOmrrKcSxxj4N54LKpIWISRGiy3Us9U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763724970; c=relaxed/simple; bh=txNrbR4kjc/pY51+xvNJPPLRbwZbm/EM4zTlrSM5lhA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qp+qkY2n6EClWXNPkHqAgQuhj6QKiaGhRySX35XQGFTAxqqle6t0zJ+oPf/JeMOUiGE/1wcP2EDJsXP/fZp/T+UtfPvF1rspn8wf/nuLrkalBo9OsJkamPI6gj8O3DdIb0FZ0/05BEQjknhxClh3l+mA+zGLyb6VC94S9tW4I34= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=dTfJ7ThJ; arc=none smtp.client-ip=209.85.128.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dTfJ7ThJ" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-47778b23f64so10999945e9.0 for ; Fri, 21 Nov 2025 03:36:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763724967; x=1764329767; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xkXvNfxvuRshzrX3T7DmPxZ6UESlXh/M5H4rR5c5zXs=; b=dTfJ7ThJI1xlL7R/hBx5DVskgFPSntxVjwwKejb4CYoAxxLtjIgMl87b1CByEQ0uKC FPDgneU8bOz1kJteTQXaPLV1zA4eKIldW33vFgFMzVXipjLxpLatmNBtLy+mcMRzJ2gP i+KlT+v3wwhZQvgxTJVT8l84NdBxjF92SM6FRGAgKZJ/tX2h4wxJicKQHY+OmJ4U2YiC Ho0EkTI+v67vh2ck2RcTn5ufXuK+qyI69Jk0YQC1GVfOzGe8JLTycHeI5PvoQT6kpObf f+Nv+IwVX19l2jnmB7P6N5WEBjORUZEBNpmhxfxGTm0RnlXtnRPF1uP9FDGDxulvjoWW QfiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763724967; x=1764329767; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=xkXvNfxvuRshzrX3T7DmPxZ6UESlXh/M5H4rR5c5zXs=; b=m6jID2iwCVNfDLYgw9sUlCeIiM6Y1PPEZOt+o2sM1cnMJD3cPpTEdHpnmaATehrHsg QOOH8dDH0RAzX9AgnAPG+D+avtOfYsW2povONXDkhcjlWJ7f3YSnG+kCVHbImMsSwTM4 n1bNvmG1+25TyWbeIWzWtQrEHLuFZgPtMB/bqF1eeeWYwKTWLpchUMH+xuBpT3AnoUXN Kvy4pJVOCnQTYctuHsi648I/ZdedMxNU8qHNlr9nNXJyvV8xMnXH+ka7ecefPFNFH2Rh LcjXORiRiv9wYNE7WC9C1TYKaFqEqRDEvm2h77dT/4H++EF9c/F07oKSImr9fLcYv3Y4 HPAw== X-Forwarded-Encrypted: i=1; AJvYcCUN1pdLtHJc/wuDiFqoyzvniwIUAMqaVwMJCeMSGwxDsVnbW2KabsluwVS6m+B5OWoXzrJT1c2iAwWzG0A=@vger.kernel.org X-Gm-Message-State: AOJu0Yz7YaSDvUjaodP99Idw9vVSoKUPCdjeVYp/41sbvOJC+cygQTTI TCE/NgZtCq5Az+LIX0EJMbmu9Ejg6svhoyOXAbahbY9kYbIwH6Fqc8vQ X-Gm-Gg: ASbGncse6rVPwYT7rh8y/EXuZnzgKrX9NFvBu8njljXuhqdLW29w3w8QBgIEH5JDlm1 de+jAc8A3N2EedhsOKk0vFKHEj9Axg8P6RE8wyksk+zTk763arjM99iiZjr1FWhNowqzhg21r7h RbMd9gEGmJoRaD0dK+F80RYbSyDacUvckxORxbEqSlKVgihjhmZlsuSKDdgypnBorQeAnWTZN0S G9zx1iqssjveqts/HbKkyDTkU6xratzUDm7eEmUBu0+Gzlr/H6WfG+XrwHwvIpuAHfy64p1ihqE NgHb7vyyrFnXVZKIEGwQIiZ8jfB6OQi6/aXF+PbAdCyjBQlU1Ge/vVtYL/LXOjsnzfBq9mhqATa 2+iHy6JergtV/KSs27gt113F8INSATeZtso0bXelhdgzUscm0PyJco8d2VxwmJH0QPT5EuaGkyd g1Ao60VDIAYyTWG0NR4bWWDZKpJ2NH6FGJrzA= X-Google-Smtp-Source: AGHT+IFBmFYvdBEIuzrTSbSnwbk43MBJtoPoX7HxLBKhni5O1VX3pQuLjHyH3K2qpXRDhjoQjPVdbQ== X-Received: by 2002:a05:600c:c492:b0:477:429b:3b93 with SMTP id 5b1f17b1804b1-477c1143089mr17859875e9.18.1763724966973; Fri, 21 Nov 2025 03:36:06 -0800 (PST) Received: from iku.Home ([2a06:5906:61b:2d00:9cce:8ab9:bc72:76cd]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-477bf3558d5sm38732465e9.1.2025.11.21.03.36.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Nov 2025 03:36:06 -0800 (PST) From: Prabhakar X-Google-Original-From: Prabhakar To: =?UTF-8?q?Cl=C3=A9ment=20L=C3=A9ger?= , Andrew Lunn , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Simon Horman , Philipp Zabel , Russell King , Geert Uytterhoeven , Magnus Damm Cc: linux-renesas-soc@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar Subject: [PATCH net-next 03/11] net: dsa: Kconfig: Expand config description to cover RZ/T2H and RZ/N2H ETHSW Date: Fri, 21 Nov 2025 11:35:29 +0000 Message-ID: <20251121113553.2955854-4-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251121113553.2955854-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20251121113553.2955854-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Lad Prabhakar Update the Kconfig entry for the RZN1 A5PSW tag driver to reflect that the same tagging format is also used by the ETHSW blocks found in Renesas RZ/T2H and RZ/N2H SoCs. Signed-off-by: Lad Prabhakar --- net/dsa/Kconfig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/dsa/Kconfig b/net/dsa/Kconfig index f86b30742122..a00eb3bdcd0f 100644 --- a/net/dsa/Kconfig +++ b/net/dsa/Kconfig @@ -159,11 +159,11 @@ config NET_DSA_TAG_RTL8_4 switches with 8 byte protocol 4 tags, such as the Realtek RTL8365MB-VC. =20 config NET_DSA_TAG_RZN1_A5PSW - tristate "Tag driver for Renesas RZ/N1 A5PSW switch" + tristate "Tag driver for Renesas RZ/N1 A5PSW and RZ/{T2H,N2H} ETHSW switc= hes" help Say Y or M if you want to enable support for tagging frames for - Renesas RZ/N1 embedded switch that uses an 8 byte tag located after - destination MAC address. + Renesas RZ/N1 A5PSW and RZ/{T2H,N2H} ETHSW embedded switches that use + an 8-byte tag located after the destination MAC address. =20 config NET_DSA_TAG_LAN9303 tristate "Tag driver for SMSC/Microchip LAN9303 family of switches" --=20 2.52.0 From nobody Tue Dec 2 01:30:04 2025 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (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 789E634C806 for ; Fri, 21 Nov 2025 11:36:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763724973; cv=none; b=mudgoR6hUnl3rGtlRpKsCp60k85nrHkVffBwSp98Ful2kKzc/I5ig+JbAj/SvfysciSF3/anaAnJgDBI+oXtBly54r/hoBb/jkc1NIK/vnxgRwMSQDtiSRQbdBjvyM1BxvavGy+0l7K3nPpp36Y6EIOH/8LgZQKW4sA1g3iYO7c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763724973; c=relaxed/simple; bh=0Xgb/9mVJW7hgkTLSLU7Gx7yPxUxQ8+vHGmiAdW12gM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=CJO0X8Heb/gRHEN6i1jAT8wAR9Apj3sp3iIxhQeYVDNHInSCIsffqhDn+/2aZebKqnnpxE1armA4DMO9VNeiie09LtSOO0yN2o9vLnUe2rQ1d5ECXF/XSW/ebTtMS5zwpO21DOnt1Rv/Mz9mkh0I/QILYQkUExgU5A/m5EVVLDA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=nbFJyN4H; arc=none smtp.client-ip=209.85.128.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nbFJyN4H" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-4779cc419b2so20671105e9.3 for ; Fri, 21 Nov 2025 03:36:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763724968; x=1764329768; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=pd7t5fWnxoD0F7D4K2dQCGmFIg70xqNr7m8gGGuPbaI=; b=nbFJyN4Hj9g+nBvD0Y++wvFDzXFMN0Mhxkfc3GwwPx0lcAOYXneRfgyPiOS1dkJ/PK yQx6iTkolkXEdWthL3VPZQWzE8VTjp+zVxP2vGqJJNob3+S/Oup/4nM5LrekqUMH7fsN 7koo6YeQHBbF6VuOZFrDikpYwUJ6rL1F9niO678xRPt2lPv0akZsdhFJ95viCAtB3/HQ tdpBOBtU+lhoSiiolrLSb25kMprzX9h5gTQfO5DdwrlkXVGnSZI69tYohyglJBiYMKpe cAukk7pAD/J8oE9FH9uS3UXDVHF9dyW4azeJ5tst6+DVM3DtIvah0CZU1k80hVDZmJMP DaTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763724968; x=1764329768; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=pd7t5fWnxoD0F7D4K2dQCGmFIg70xqNr7m8gGGuPbaI=; b=FmMrFlzQMQbbfnMc28gd1JyptgluA6GnKYwoOhbjNTXQbwiY8GGEUwVseyWiuWq+Tw 2gvmMPACjT1sgGKgyFqDk0GQb3o6hbX6GDqYIOFW56hSUHoVPPGrz39G3aZVS4+anZ1J kUeex52WXWA7zE9ck/OsFroLhVqx7y5/XQKSYVMx4O2eKSoH1IMNtrhdO0jFLUGJci7V QthBU3JtKN33JkVbC59KCh7orRgW0HAnhMDatWEsh+eckmYVZdmVqBPgmrXasg9r15pM 5mXc65p0CAWitlxmNk+Wy/itsPq1r8XopEWi3hZsFWaaGwL7Mocqc0aPmEc2QVQWnaOw P0JA== X-Forwarded-Encrypted: i=1; AJvYcCUUT7OQXFjVekS8V+zDNwgzFiPywKTCI8P41piyqwpxTDp99fSQrfVmwSTmTe2lyD6anZvBDPGTQxwA2/I=@vger.kernel.org X-Gm-Message-State: AOJu0Yyd9shQapzWNDNxstsS3hKpiUrfQb4iGTnJutnhWAzveMVOxPgz Zi4/5iWb0IeLSKOlGsxeJZ8GTcTC5MUB2VWHDFJA6gXC/q92OaGOd3AQ X-Gm-Gg: ASbGncu0zLuB7R0S4Kq7j/Qhb+4Ygoxr1oB71txOmSokM3YAht3EtnO1mxDXnjBNquY EWNNE0ciOczq5+jJDU224roqPHxO0IbrAkDnOu+zYJCluSGdH2vieXRk6SUFOLXR0BWL7YoluuJ adPMUCiZKyaCp3HYBfw0na3kM7V4Gt5Ekn38tRXrNGa+jlES6HqJZFXPs4GEtpHV7KRa1fGiUQt 2vqfRycVuCZpubs9paiKKEpSOCm1BqfuJIQ7TEZ+ajmMpixCcvn/J1+JwYIJq+Cz3vzGwYnJH1+ BL0s+ShvpO+7Q/LdM9fuHMFSp/K7iM+QccFjg+fkw61bdIk1AUIDUXCmLDhSVVt0gaLZsVbhH8+ o8pmaBrNDYFGyOQvLe0aCwWLBpw3zN+lErOzYC0ilsTjrYp3m39UXNwFNwA2+EO39iAfRmFnN+w TiRPkYB56urGo68zMIG2Pgb0lc9dOOG5Rqqzk= X-Google-Smtp-Source: AGHT+IG+78NQPeUTwdJOOwmZ3xZrTkwqNVC7lhMKcp2TAKbxx/0UaQzB+YMUlWDYO5m22REoRHO+8w== X-Received: by 2002:a05:600c:5252:b0:477:582e:7a81 with SMTP id 5b1f17b1804b1-477c110328amr19217505e9.4.1763724968166; Fri, 21 Nov 2025 03:36:08 -0800 (PST) Received: from iku.Home ([2a06:5906:61b:2d00:9cce:8ab9:bc72:76cd]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-477bf3558d5sm38732465e9.1.2025.11.21.03.36.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Nov 2025 03:36:07 -0800 (PST) From: Prabhakar X-Google-Original-From: Prabhakar To: =?UTF-8?q?Cl=C3=A9ment=20L=C3=A9ger?= , Andrew Lunn , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Simon Horman , Philipp Zabel , Russell King , Geert Uytterhoeven , Magnus Damm Cc: linux-renesas-soc@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar Subject: [PATCH net-next 04/11] dt-bindings: net: dsa: renesas,rzn1-a5psw: Add RZ/T2H and RZ/N2H ETHSW support Date: Fri, 21 Nov 2025 11:35:30 +0000 Message-ID: <20251121113553.2955854-5-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251121113553.2955854-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20251121113553.2955854-1-prabhakar.mahadev-lad.rj@bp.renesas.com> 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 From: Lad Prabhakar Extend the A5PSW DSA binding to cover the ETHSW variant used on newer Renesas RZ/T2H and RZ/N2H SoCs. ETHSW is derived from the A5PSW switch found on RZ/N1 but differs in register layout, clocking and interrupt topology, and exposes four ports in total (including the CPU/management port) instead of five. Update the schema to describe these differences by adding dedicated compatible strings for RZ/T2H and RZ/N2H, tightening requirements on clocks, resets and interrupts, and documenting the expanded 24-interrupt set used by ETHSW for timestamping and timer functions. Conditional validation ensures that RZ/T2H/RZ/N2H instances provide the correct resources while keeping the original A5PSW constraints intact. Use the RZ/T2H compatible string as the fallback for RZ/N2H, reflecting that both SoCs integrate the same ETHSW IP. Add myself as a co-maintainer of the binding to support ongoing work on the ETHSW family across RZ/T2H and RZ/N2H devices. Signed-off-by: Lad Prabhakar --- .../bindings/net/dsa/renesas,rzn1-a5psw.yaml | 154 +++++++++++++++--- 1 file changed, 130 insertions(+), 24 deletions(-) diff --git a/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.y= aml b/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml index ea285ef3e64f..ec15ea4deeb0 100644 --- a/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml +++ b/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml @@ -4,43 +4,108 @@ $id: http://devicetree.org/schemas/net/dsa/renesas,rzn1-a5psw.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# =20 -title: Renesas RZ/N1 Advanced 5 ports ethernet switch +title: Renesas RZ/N1 A5PSW and RZ/T2H, RZ/N2H ETHSW Ethernet Switch =20 maintainers: - Cl=C3=A9ment L=C3=A9ger + - Lad Prabhakar =20 -description: | - The advanced 5 ports switch is present on the Renesas RZ/N1 SoC family a= nd - handles 4 ports + 1 CPU management port. +description: > + This binding describes the Ethernet switch IPs used on Renesas SoCs: =20 -allOf: - - $ref: dsa.yaml#/$defs/ethernet-ports + - The A5PSW (Advanced 5-Port Switch) found on the RZ/N1 family, which + provides 4 external ports and 1 CPU/management port. + - The ETHSW (Ethernet Switch) found on the RZ/T2H and RZ/N2H families, + which is derived from the A5PSW IP with some register layout + differences, additional timestamping support, and a total of 4 ports + including the CPU/management port. =20 properties: compatible: - items: - - enum: - - renesas,r9a06g032-a5psw - - const: renesas,rzn1-a5psw + oneOf: + - items: + - enum: + - renesas,r9a06g032-a5psw + - const: renesas,rzn1-a5psw + + - const: renesas,r9a09g077-ethsw + + - items: + - const: renesas,r9a09g087-ethsw + - const: renesas,r9a09g077-ethsw =20 reg: maxItems: 1 =20 interrupts: - items: - - description: Device Level Ring (DLR) interrupt - - description: Switch interrupt - - description: Parallel Redundancy Protocol (PRP) interrupt - - description: Integrated HUB module interrupt - - description: Receive Pattern Match interrupt + oneOf: + - items: + - description: Device Level Ring (DLR) interrupt + - description: Switch interrupt + - description: Parallel Redundancy Protocol (PRP) interrupt + - description: Integrated HUB module interrupt + - description: Receive Pattern Match interrupt + + - items: + - description: Switch interrupt + - description: Device Level Ring (DLR) interrupt + - description: Parallel Redundancy Protocol (PRP) interrupt + - description: Integrated HUB module interrupt + - description: Receive Pattern Match interrupt 0 + - description: Receive Pattern Match interrupt 1 + - description: Receive Pattern Match interrupt 2 + - description: Receive Pattern Match interrupt 3 + - description: Receive Pattern Match interrupt 4 + - description: Receive Pattern Match interrupt 5 + - description: Receive Pattern Match interrupt 6 + - description: Receive Pattern Match interrupt 7 + - description: Receive Pattern Match interrupt 8 + - description: Receive Pattern Match interrupt 9 + - description: Receive Pattern Match interrupt 10 + - description: Receive Pattern Match interrupt 11 + - description: Switch timer pulse output interrupt 0 + - description: Switch timer pulse output interrupt 1 + - description: Switch timer pulse output interrupt 2 + - description: Switch timer pulse output interrupt 3 + - description: Switch TDMA timer output interrupt 0 + - description: Switch TDMA timer output interrupt 1 + - description: Switch TDMA timer output interrupt 2 + - description: Switch TDMA timer output interrupt 3 =20 interrupt-names: - items: - - const: dlr - - const: switch - - const: prp - - const: hub - - const: ptrn + oneOf: + - items: + - const: dlr + - const: switch + - const: prp + - const: hub + - const: ptrn + + - items: + - const: switch + - const: dlr + - const: prp + - const: hub + - const: ptrn0 + - const: ptrn1 + - const: ptrn2 + - const: ptrn3 + - const: ptrn4 + - const: ptrn5 + - const: ptrn6 + - const: ptrn7 + - const: ptrn8 + - const: ptrn9 + - const: ptrn10 + - const: ptrn11 + - const: tp0 + - const: tp1 + - const: tp2 + - const: tp3 + - const: tdma0 + - const: tdma1 + - const: tdma2 + - const: tdma3 =20 power-domains: maxItems: 1 @@ -50,14 +115,21 @@ properties: unevaluatedProperties: false =20 clocks: + minItems: 2 items: - description: AHB clock used for the switch register interface - description: Switch system clock + - description: Timestamp clock =20 clock-names: + minItems: 2 items: - const: hclk - const: clk + - const: ts + + resets: + maxItems: 1 =20 ethernet-ports: type: object @@ -73,14 +145,48 @@ properties: phandle pointing to a PCS sub-node compatible with renesas,rzn1-miic.yaml# =20 -unevaluatedProperties: false - required: - compatible - reg - clocks - clock-names - power-domains + - interrupts + - interrupt-names + +allOf: + - $ref: dsa.yaml#/$defs/ethernet-ports + + - if: + properties: + compatible: + contains: + const: renesas,r9a09g077-ethsw + then: + properties: + interrupts: + minItems: 24 + interrupt-names: + minItems: 24 + clocks: + minItems: 3 + clock-names: + minItems: 3 + required: + - resets + else: + properties: + interrupts: + maxItems: 5 + interrupt-names: + maxItems: 5 + clocks: + maxItems: 2 + clock-names: + maxItems: 2 + resets: false + +unevaluatedProperties: false =20 examples: - | --=20 2.52.0 From nobody Tue Dec 2 01:30:04 2025 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (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 E0065349B04 for ; Fri, 21 Nov 2025 11:36:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763724973; cv=none; b=VHXIz/I/iMgdlsXCr17verT/chGTgaH+qL/SXrQPfzSInVhKiiFkQWDUXDlvZav90eJ7XM6adYIjOp9CzxtUQSVQbB6SiYe71Usk4p+AOloNOMTs0j2mvX/N3Bd8aBIJ7P9IVt+ox0xBYoQfJVmurMhoJck63qnw6k/AYrfVe3U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763724973; c=relaxed/simple; bh=4sC+YEMBQOAmZLe09rnzCJD1y8NBOeODeC/IvVPodoY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KOyIOAEDK9jGZB/b0bvEZXYZBfOaPKwxEI0+gDfG+ssXyzrrX0PlGPDNIzGuM2Cem0zcbbinokM/9EoGYM3UIoykni/1aZern7W+pAmcRlU2el40feq6z/NBBMvrFNHg8WWG8/NsP7Vl6do+YKUwiVir0mtxS8bqJ68hX1coubA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=R3nEU9cJ; arc=none smtp.client-ip=209.85.128.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="R3nEU9cJ" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-477aa218f20so12348195e9.0 for ; Fri, 21 Nov 2025 03:36:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763724969; x=1764329769; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=nJZypyy2Lhm+4dU+VDEY7IcdBp0UiWAwJvLyr9kbDD8=; b=R3nEU9cJ/55hZDUN7H+6XrohhMuw+E7eOaa9/UW1oZvboIh/RusxBOZLJz2zkYZhK2 dryK8rIfZioskIcMe7d4YUAIC+qUXiirOBZ0Xga9ux2Bnj6uN4qXtBK7VsQ2IaqLEuus TFUBaMevnectWQjfETUcesKnzDVPLxnspN6APVkCcaxY3gW4CLFFOoWRDAQW685+fIED /UcLvFGJEkNe/Q48Ak92V78lKrUAGfpOfusZuGRPdlH6auE2VDnIMtx1fgxsIgKWSUvd NHlNoPg2EMNZ6Lvg/GVc3EQZ4uk57BNCBYx8AZ//K5t+gbraiyujEZZg809vABLxldgY +M0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763724969; x=1764329769; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=nJZypyy2Lhm+4dU+VDEY7IcdBp0UiWAwJvLyr9kbDD8=; b=u0+irKVo8+jj/rPRiqsAwc3cn3JkLpGJU1KuX7wt8jT8L70SOjw2aO5u2DYnEfFCCj bw7aLDZMC0CaSXYpfrygMLQstRXLk2T+DRkqacvli8QiKcStQIWn+j5U7dQNXu7bER5d HHyf9bLMm8npPrs8rsNH16HR7li64W8N67qUhAqho0UMT/RsoR8pZ5xEd9AxK/fQ9pG5 gH9wpkyMcIQbscttmvBrBGbN0cMLE6fXjekDoRer1tzHeEgXGOKD/nW7wqTVIxi3H0V3 10cGBKq3H2oWxeYL0eihgDIbnINd0GMmN0rb9X8nMyZpJTaIFTReeUOukr4FL1LE1htk 5x+A== X-Forwarded-Encrypted: i=1; AJvYcCX5vEU1yxVOJmK9xzHyr4qKjzno4hzdWlIbof85+VhT715ziNIPx+Y6RJSAWPQlM6EWlevk0/aT2YpcD1Q=@vger.kernel.org X-Gm-Message-State: AOJu0YwQRXvvKI9YGcK6T72enMEMqKSwNkovvPVDlxwtUd9A62rkqUlK ibElNdkcdMSDzIW6WK5b5YN28zhVT43Sylt7ceVCS+Cr5yyc9JxQYaCH X-Gm-Gg: ASbGncvQY9hm/DV0UL1K0h1fBwLubQzIHQ9xHXjph9Afmsmau/wP+PpbF8XBryHHYxR 6DkMLPpWmHGK7HyMDll/MbGfD0TnjH3U4HPXk+yMyFdpg7BfkQn/cH11+WZXVFteE3hAndUi/Td W3JNJm6UkWK7t87aLyrI5HtQ8tIOaLqtEypEQc/hibD1xoKCkVugi1y2vqfVp+m2SVl4OIcG5q3 e3H5tab20ggKCKAdwe6d0eb/mM9bp7jNSlcf5bFhJ8CTq0vCLLW+uTQtwrYe+W+zyzgxicy4A5+ vQjEw+gAISzbmvu4LuN22Lrs+wabpq12oIZeuh8yYfxpAkynpp0hh81isttywwWFoo7P8vNbA1m HOahOO8C7aI4u4Ay5s++yUhi1+gAEVWm8rl/+bePYNq/PufQmSPnCMGhfrPU9jsyk9w0GTJpn0u xG4gLKnZVpxmjGeVN92/aHt8+KfMN3sXJ3hhI= X-Google-Smtp-Source: AGHT+IHeGiEbepIxQ4oItmULN0g5LjudPiuJcNy16zrM/slmw7LOo2HakFym0E4guUaNMPuSEBhQuQ== X-Received: by 2002:a05:600c:1ca0:b0:477:75eb:a643 with SMTP id 5b1f17b1804b1-477c0165b4emr25487105e9.4.1763724969090; Fri, 21 Nov 2025 03:36:09 -0800 (PST) Received: from iku.Home ([2a06:5906:61b:2d00:9cce:8ab9:bc72:76cd]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-477bf3558d5sm38732465e9.1.2025.11.21.03.36.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Nov 2025 03:36:08 -0800 (PST) From: Prabhakar X-Google-Original-From: Prabhakar To: =?UTF-8?q?Cl=C3=A9ment=20L=C3=A9ger?= , Andrew Lunn , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Simon Horman , Philipp Zabel , Russell King , Geert Uytterhoeven , Magnus Damm Cc: linux-renesas-soc@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar Subject: [PATCH net-next 05/11] net: dsa: rzn1-a5psw: Add support for optional reset control Date: Fri, 21 Nov 2025 11:35:31 +0000 Message-ID: <20251121113553.2955854-6-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251121113553.2955854-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20251121113553.2955854-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Lad Prabhakar Add support for an optional reset control to the RZN1 A5PSW driver. Obtain the reset line using devm_reset_control_get_optional_exclusive_deasserted() during probe to ensure that the Ethernet switch (ETHSW) block is properly released from reset before initialization. This change prepares the driver for use on Renesas RZ/T2H and RZ/N2H SoCs, where the ETHSW IP block is connected to a dedicated reset line that must be controlled by software. Signed-off-by: Lad Prabhakar Reviewed-by: Philipp Zabel Reviewed-by: Vladimir Oltean --- drivers/net/dsa/rzn1_a5psw.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/net/dsa/rzn1_a5psw.c b/drivers/net/dsa/rzn1_a5psw.c index 1635255f58e4..7b84585a5415 100644 --- a/drivers/net/dsa/rzn1_a5psw.c +++ b/drivers/net/dsa/rzn1_a5psw.c @@ -13,6 +13,7 @@ #include #include #include +#include #include =20 #include "rzn1_a5psw.h" @@ -1205,6 +1206,7 @@ static int a5psw_pcs_get(struct a5psw *a5psw) static int a5psw_probe(struct platform_device *pdev) { struct device *dev =3D &pdev->dev; + struct reset_control *reset; struct device_node *mdio; struct dsa_switch *ds; struct a5psw *a5psw; @@ -1241,6 +1243,12 @@ static int a5psw_probe(struct platform_device *pdev) goto free_pcs; } =20 + reset =3D devm_reset_control_get_optional_exclusive_deasserted(dev, NULL); + if (IS_ERR(reset)) { + ret =3D PTR_ERR(reset); + goto free_pcs; + } + mdio =3D of_get_available_child_by_name(dev->of_node, "mdio"); if (mdio) { ret =3D a5psw_probe_mdio(a5psw, mdio); --=20 2.52.0 From nobody Tue Dec 2 01:30:04 2025 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (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 626FE34CFD3 for ; Fri, 21 Nov 2025 11:36:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763724974; cv=none; b=WSCeM6G8K+kg3Eur/w5qycmpF+OFGld00xfz9foxETxvqdDnfOhDwNi+qryh3dfEULUBgWMlpLOdVWkOvQqAq5ve2okwZtbyAywFTEIofPC5qU6EGf0PvIfXqt++DrpZXGRfnbRB5/yvgQ6B8dYOtBd7ISEvoeDp7ZW5zUy4rrQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763724974; c=relaxed/simple; bh=xi4sh3FWtiB0LYCCMtopckE7TQGE1bfmOXtNGBBIM70=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KoJz1ljfmcKWVi92F8N65vlxKGniH/VwvSSLXgDL6afQwbuSGdpVjkljtN9CQE4usZwY6rpyaz18On5NssWRZuc21QqBfNY5m9PA1bs3LY8kwR+dTchZds8KMcT4QntPrFvCNEKc0uJBO3GW+u8HKHv7Yl044jRBrcy8D360qNc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=VS1Avchq; arc=none smtp.client-ip=209.85.128.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VS1Avchq" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-4779a4fc95aso20115955e9.1 for ; Fri, 21 Nov 2025 03:36:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763724970; x=1764329770; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=N9sEYxfIc+hTJanUfmeG/Zn1IoRVtGcDqfv+PR900MI=; b=VS1AvchqQM6J69U0zX5vkoTP13ntQUlAasyJxogHtph7oIuVka4FkL8UyHa9RljRVZ fG8Ex0BOHTRBamWv9NJSaHqaYETEArxH1Gpu5IofTZbe8pSJF3/P1zhsFMRAkreAM5ut RB3Yu02HQR0qwqkS7faVf+yneoJDXV9dnPzOBQ9HbAmTrGYmmR47HCsU2f8Bo6o17b3m bJl0L4MwlOgo+PCRh5K4SMJ5BDCTOprlz6JBQuBRkj4tuntCPmHXReaC6MZ4h4hhss8x ls7fS3Pp9UQpCjG/BBt3ivIL1XqtvNMw3OdWMg31f1xfnWrMuB4QpwjvzWcNf9aYNTpY Ny6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763724970; x=1764329770; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=N9sEYxfIc+hTJanUfmeG/Zn1IoRVtGcDqfv+PR900MI=; b=o+YIYUPtsE5Vqt4qEpPTTI8TfWZiPkSx7Vl0mh6UdRzasldvq+IOVTB5w6X8IVZ5/z 3Kec6UG46HxD1nlF4qD+Rg9EynnKbw8XJirO3gya+Mxlei8h5dTvJdzoDDaooCqGkNgM ybAKBVcOJqxEVaUlfZajF3BoFsAXQjw2LMngd7PnRqOsLsuQtyHcA1V7Y3JcyHcZiEpI XksnlYk5XJCUZ4H7Wh1dmHjpZsf68e64xwgh8KuuQqP7Ohi9tvoFbbDeFUIbfJIMYkom 3Ox5gs6sOL4Rf7NlLlxnnpo0cnHgKknMdyFHvHVtQx+RHpi7dcj9s9RNjxdZ0mMmepsZ duLQ== X-Forwarded-Encrypted: i=1; AJvYcCVh2nwqu5sQ18q9Ucm3Vw4arLTzX4Tn/sUt1UBNnr+4wiQ7i5/KkgaRSNrpgHvfuPXLxKFZKaOwBgr1MQc=@vger.kernel.org X-Gm-Message-State: AOJu0YzxOzga9dUbPzK429RnspnKre906yL1ug35Z3ljtDmJOk9vp/PN sKVpijWGl7S6br8rkjftFqCDAWoVYg9eaTz491OWYreqxpysO3nwqRQ6 X-Gm-Gg: ASbGncuhLV1yKgO6O+ielscggCn6kQxkX37c165UMP7QfJELwHRX9Ea2l1tCu9qWBxt xhQ3mWVx8B4gfmIXMwl2kq2RZLGE1N+3sy2y9V4jerRt5lEGhh9lDitekKySo0FTn1TTx/p+O5I aLflZbqLwGq/Q2SyaLhrnGHPWrIagzAkPBSRJTwWflQi4Q6O7QUk5LTDMGXCF+v7+1tn4DeDctt /QVen99xhGnbso6r/ibZjzIyNUg2m7087Kfm+6iEGJVV3U3+c/hlT1roZ6fBpmK/iBrn1mekQ6/ xTewxtUFv8EW/xBdtjb8n6svj7nPDsTLinERJo7T+XKNoSj7h82Pl4qRJRjdszfAZd/VYoGDqs3 7eB26XiqxGIFgWy8l37DWBCUJk5kHd3OlUV11CJR3KeKY+N9ZrrNRiBNud6DTRwgcA+jGk2suv1 sSpOaU6ORzyXL324je77Wo4UDSKQd4fWLapAE= X-Google-Smtp-Source: AGHT+IG8sodXE9jGGGGmRK8fUP5qopeWa6ybgnzrniJ/tIyx/pp8y+wH2VWEpAL/y76pv8RXGMAlww== X-Received: by 2002:a05:600c:1e89:b0:477:a1bb:c58e with SMTP id 5b1f17b1804b1-477c04cfddcmr23130495e9.7.1763724970251; Fri, 21 Nov 2025 03:36:10 -0800 (PST) Received: from iku.Home ([2a06:5906:61b:2d00:9cce:8ab9:bc72:76cd]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-477bf3558d5sm38732465e9.1.2025.11.21.03.36.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Nov 2025 03:36:09 -0800 (PST) From: Prabhakar X-Google-Original-From: Prabhakar To: =?UTF-8?q?Cl=C3=A9ment=20L=C3=A9ger?= , Andrew Lunn , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Simon Horman , Philipp Zabel , Russell King , Geert Uytterhoeven , Magnus Damm Cc: linux-renesas-soc@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar Subject: [PATCH net-next 06/11] net: dsa: rzn1-a5psw: Add support for optional timestamp clock Date: Fri, 21 Nov 2025 11:35:32 +0000 Message-ID: <20251121113553.2955854-7-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251121113553.2955854-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20251121113553.2955854-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Lad Prabhakar Add support for an optional "ts" (timestamp) clock to the RZN1 A5PSW driver. Some SoC variants provide a dedicated clock source for timestamping or time synchronization features within the Ethernet switch IP. Request and enable this clock during probe if defined in the device tree. If the clock is not present, the driver continues to operate normally. This change prepares the driver for Renesas RZ/T2H and RZ/N2H SoCs, where the Ethernet switch includes a timestamp clock input. Signed-off-by: Lad Prabhakar --- drivers/net/dsa/rzn1_a5psw.c | 7 +++++++ drivers/net/dsa/rzn1_a5psw.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/drivers/net/dsa/rzn1_a5psw.c b/drivers/net/dsa/rzn1_a5psw.c index 7b84585a5415..99098bc06efe 100644 --- a/drivers/net/dsa/rzn1_a5psw.c +++ b/drivers/net/dsa/rzn1_a5psw.c @@ -1243,6 +1243,13 @@ static int a5psw_probe(struct platform_device *pdev) goto free_pcs; } =20 + a5psw->ts =3D devm_clk_get_optional_enabled(dev, "ts"); + if (IS_ERR(a5psw->ts)) { + dev_err(dev, "failed get ts clock\n"); + ret =3D PTR_ERR(a5psw->ts); + goto free_pcs; + } + reset =3D devm_reset_control_get_optional_exclusive_deasserted(dev, NULL); if (IS_ERR(reset)) { ret =3D PTR_ERR(reset); diff --git a/drivers/net/dsa/rzn1_a5psw.h b/drivers/net/dsa/rzn1_a5psw.h index d54acedac194..81be30d6c55f 100644 --- a/drivers/net/dsa/rzn1_a5psw.h +++ b/drivers/net/dsa/rzn1_a5psw.h @@ -236,6 +236,7 @@ union lk_data { * @base: Base address of the switch * @hclk: hclk_switch clock * @clk: clk_switch clock + * @ts: Timestamp clock * @dev: Device associated to the switch * @mii_bus: MDIO bus struct * @mdio_freq: MDIO bus frequency requested @@ -251,6 +252,7 @@ struct a5psw { void __iomem *base; struct clk *hclk; struct clk *clk; + struct clk *ts; struct device *dev; struct mii_bus *mii_bus; struct phylink_pcs *pcs[A5PSW_PORTS_NUM - 1]; --=20 2.52.0 From nobody Tue Dec 2 01:30:04 2025 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (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 77DA134D396 for ; Fri, 21 Nov 2025 11:36:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763724976; cv=none; b=SXCDvFbNOaRyNU5RBBQI17MYNWkFc/cBIJsfBpjsi5oecIgeC67A1CmetgJpmHlcmW2LiEhIZLYJVE6CKKtjHk7cm7FHgmGVyD53tlc8Z0Sy3Ivi7H6pgoRkM6isIG5Yjx5E3x870SMicDMvhEeBJtDrjFdSErEHI1aKO/OEOEY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763724976; c=relaxed/simple; bh=J9bbhlK2abRtODzOWkRv049W2G9nmFT+wPa+YCN2ze8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EGutxZck6DlrRgNPoDDdXNfZc/gMUXvBJ1N6rUGn8fOm7sbrbkbdjLWotp5hGc43VdFW8R0XUQn6fWPFiFJZBOB6yAl41VZL7jY3qq7Z8iARcyEaxrGmkGs52uC1Hp1ydcr4DiNebEQSVFE1/CpA/yScVbfW6PsFXz1ZmtIQuu8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=lZFpOWqi; arc=none smtp.client-ip=209.85.128.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lZFpOWqi" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-47789cd2083so11736955e9.2 for ; Fri, 21 Nov 2025 03:36:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763724971; x=1764329771; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Qu2kzCH7a9rdHz1PcQb+OvB7oiG265tCyETgvREK4Pg=; b=lZFpOWqiH4ECwnBabIfhUIKOfrK5+MQ/VuoGrwVDWN6b5jkWBA7pwzksh1L3HvZ8mD 7cyR1eqqmiRZIv27dV3IBqKbrBcITHgACfxicrtB82DHHxEOPwQ5acSl0Jado2QEHdaM d6FHc1wWGlDWWyj/wmkCmSsFH5S+PFZ8dQdDdIzX4QA5BRuAtI8ttlYAYRno8HYwxina MEatwBTkcUEuKfSKemZn7NrQ1qc7FP92VYLsbzdKMnoNO8Due/Gk5oaid4GAQNU8BCqu +idmTT9AoucpemXds3sSSNG+v2AYQ0l4Sjd19ZNEooHDWHIfoN7OlswEpN2gnB7DCCiN xUlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763724972; x=1764329772; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Qu2kzCH7a9rdHz1PcQb+OvB7oiG265tCyETgvREK4Pg=; b=BTGteG/o3F/9nqDYmDCb0NZ7hod9Nu9VZA5rGhTMxuRfF57hWNGYk58HZvHF/xOcTd VNYHAWCFYlk762DoJzvZZ0vKtTWjsADkw27U+SCFOU72WejhNs+XZ4WJaxBhHGJB0mnx 00+3m33n3ngs9tEKDnKCxkRHCAAholFt48j5cqepW4iA0p+fSAbphu/YgKj106swt7S9 2VHPRu20ZSN/MPce3Htlu/x2dIhejidodaRKoeUh2h932rZTxAFfLxZqoO37jWzW/ies YDO1+g442JZ58Y5oHt5NApGiSNvqclhq6wiL4N6TGzfQB6eF7H7IA31i0qf/boil/WRZ Xrvw== X-Forwarded-Encrypted: i=1; AJvYcCXgdL+IYjZEnfGEOa/A7uYsijuL4m7j0UXs7xdE8UQIQm5MZfFTtVB/u6haRtIK5TCZvb99IPdGjMbTH/c=@vger.kernel.org X-Gm-Message-State: AOJu0YxoBeaqMrAslldFgEyjXnSoo3btswFlrse7jC6I6uC7lGqBf75C /AjPXJAx3LjCPlot+YitnBfC8nUxRaOLks0ah8m5VB0dqgzGIOQi+/gD X-Gm-Gg: ASbGnct6Q2Q95Sh4GVWwKR+9yfSuyKkgLTlRZE9ccoHM/ESKBoCv1R7BwpwAoflwor/ P5RUhKsboWOBrHmIT/tzGmsW1ELvufYFsAhIQzaPVyg4QhKRvFKBV0Yf6LDQRsVO1L5PnQ3RgKD v6R5Puexe32qHSyq/WygyBAaIfhu9KD5mYDjP9kWa5opaHQyyRv3u1TIaSKQBM/HLW1L+NQ9MIZ NpO9Cs6Hxm2zDkuxMCOhridLHHXRndItc3T2WgyFbb+Y+GclYDYCWHDy38L7UenHDvfgJ8h80y2 a1jk9dY1IkeU+LTWAHM3LY7n95ltY7eOpMmUEVI+VquaN9y7hygGcNMP8BcLP7Nf/lKgxHSxbz4 pws31XS7PMH62YdiBRBcRiEffWoPALUe4239vLq0/gZqjkQBsrp7V2nQ1y1Iwr0lDeYJSGQOaiC zVQwSBSC8vGcoXA2ZedFTepPx2OgUx7M0UcYI= X-Google-Smtp-Source: AGHT+IHJfGnMJvpbU4mjRm3yacg24pgKSDc6DAnZqzokWG1QDvI/YfVxDvtrLFX3uGvN42B9PR/hpA== X-Received: by 2002:a05:600c:8b16:b0:475:dd8d:2f52 with SMTP id 5b1f17b1804b1-477c115dc85mr15823345e9.32.1763724971434; Fri, 21 Nov 2025 03:36:11 -0800 (PST) Received: from iku.Home ([2a06:5906:61b:2d00:9cce:8ab9:bc72:76cd]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-477bf3558d5sm38732465e9.1.2025.11.21.03.36.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Nov 2025 03:36:10 -0800 (PST) From: Prabhakar X-Google-Original-From: Prabhakar To: =?UTF-8?q?Cl=C3=A9ment=20L=C3=A9ger?= , Andrew Lunn , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Simon Horman , Philipp Zabel , Russell King , Geert Uytterhoeven , Magnus Damm Cc: linux-renesas-soc@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar Subject: [PATCH net-next 07/11] net: dsa: rzn1-a5psw: Make switch topology configurable via OF data Date: Fri, 21 Nov 2025 11:35:33 +0000 Message-ID: <20251121113553.2955854-8-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251121113553.2955854-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20251121113553.2955854-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Lad Prabhakar Move the switch topology description-the number of ports and the CPU-port index-out of hard-coded constants and into SoC-specific OF match data. The driver previously assumed a fixed 5-port layout with the last port acting as the CPU port. That assumption does not hold for newer Renesas variants, and embedding it in the code made the driver inflexible and error-prone. Introduce a small a5psw_of_data structure carrying both the total number of ports and the CPU-port identifier, and rely on this data everywhere the driver previously used fixed values. This ensures that port loops, PCS allocation, management-port setup, and bridge bookkeeping all reflect the actual hardware configuration. Making these attributes runtime-selectable allows the driver to support RZ/T2H and RZ/N2H SoCs which use different port counts and CPU-port assignments-without rewriting common logic or forking the driver, while preserving correct behaviour on existing RZN1 systems. Signed-off-by: Lad Prabhakar --- drivers/net/dsa/rzn1_a5psw.c | 26 +++++++++++++++++--------- drivers/net/dsa/rzn1_a5psw.h | 17 ++++++++++++++--- 2 files changed, 31 insertions(+), 12 deletions(-) diff --git a/drivers/net/dsa/rzn1_a5psw.c b/drivers/net/dsa/rzn1_a5psw.c index 99098bc06efe..d957b6d40f05 100644 --- a/drivers/net/dsa/rzn1_a5psw.c +++ b/drivers/net/dsa/rzn1_a5psw.c @@ -382,13 +382,14 @@ static void a5psw_port_bridge_leave(struct dsa_switch= *ds, int port, struct dsa_bridge bridge) { struct a5psw *a5psw =3D ds->priv; + unsigned int cpu_port =3D a5psw->of_data->cpu_port; =20 a5psw->bridged_ports &=3D ~BIT(port); =20 a5psw_port_set_standalone(a5psw, port, true); =20 /* No more ports bridged */ - if (a5psw->bridged_ports =3D=3D BIT(A5PSW_CPU_PORT)) + if (a5psw->bridged_ports =3D=3D BIT(cpu_port)) a5psw->br_dev =3D NULL; } =20 @@ -924,20 +925,21 @@ static void a5psw_vlan_setup(struct a5psw *a5psw, int= port) static int a5psw_setup(struct dsa_switch *ds) { struct a5psw *a5psw =3D ds->priv; + unsigned int cpu_port =3D a5psw->of_data->cpu_port; int port, vlan, ret; struct dsa_port *dp; u32 reg; =20 - /* Validate that there is only 1 CPU port with index A5PSW_CPU_PORT */ + /* Validate that there is only 1 CPU port with index matching cpu_port */ dsa_switch_for_each_cpu_port(dp, ds) { - if (dp->index !=3D A5PSW_CPU_PORT) { + if (dp->index !=3D cpu_port) { dev_err(a5psw->dev, "Invalid CPU port\n"); return -EINVAL; } } =20 /* Configure management port */ - reg =3D A5PSW_CPU_PORT | A5PSW_MGMT_CFG_ENABLE; + reg =3D cpu_port | A5PSW_MGMT_CFG_ENABLE; a5psw_reg_writel(a5psw, A5PSW_MGMT_CFG, reg); =20 /* Set pattern 0 to forward all frame to mgmt port */ @@ -1147,7 +1149,7 @@ static void a5psw_pcs_free(struct a5psw *a5psw) { int i; =20 - for (i =3D 0; i < ARRAY_SIZE(a5psw->pcs); i++) { + for (i =3D 0; i < a5psw->of_data->nports - 1; i++) { if (a5psw->pcs[i]) miic_destroy(a5psw->pcs[i]); } @@ -1174,7 +1176,7 @@ static int a5psw_pcs_get(struct a5psw *a5psw) goto free_pcs; } =20 - if (reg >=3D ARRAY_SIZE(a5psw->pcs)) { + if (reg >=3D a5psw->of_data->nports - 1) { ret =3D -ENODEV; goto free_pcs; } @@ -1223,7 +1225,8 @@ static int a5psw_probe(struct platform_device *pdev) if (IS_ERR(a5psw->base)) return PTR_ERR(a5psw->base); =20 - a5psw->bridged_ports =3D BIT(A5PSW_CPU_PORT); + a5psw->of_data =3D of_device_get_match_data(dev); + a5psw->bridged_ports =3D BIT(a5psw->of_data->cpu_port); =20 ret =3D a5psw_pcs_get(a5psw); if (ret) @@ -1268,7 +1271,7 @@ static int a5psw_probe(struct platform_device *pdev) =20 ds =3D &a5psw->ds; ds->dev =3D dev; - ds->num_ports =3D A5PSW_PORTS_NUM; + ds->num_ports =3D a5psw->of_data->nports; ds->ops =3D &a5psw_switch_ops; ds->phylink_mac_ops =3D &a5psw_phylink_mac_ops; ds->priv =3D a5psw; @@ -1310,8 +1313,13 @@ static void a5psw_shutdown(struct platform_device *p= dev) platform_set_drvdata(pdev, NULL); } =20 +static const struct a5psw_of_data rzn1_of_data =3D { + .nports =3D 5, + .cpu_port =3D 4, +}; + static const struct of_device_id a5psw_of_mtable[] =3D { - { .compatible =3D "renesas,rzn1-a5psw", }, + { .compatible =3D "renesas,rzn1-a5psw", .data =3D &rzn1_of_data }, { /* sentinel */ }, }; MODULE_DEVICE_TABLE(of, a5psw_of_mtable); diff --git a/drivers/net/dsa/rzn1_a5psw.h b/drivers/net/dsa/rzn1_a5psw.h index 81be30d6c55f..d1b2cc5b43e6 100644 --- a/drivers/net/dsa/rzn1_a5psw.h +++ b/drivers/net/dsa/rzn1_a5psw.h @@ -195,8 +195,7 @@ #define A5PSW_aCarrierSenseErrors 0x924 =20 #define A5PSW_VLAN_TAG(prio, id) (((prio) << 12) | (id)) -#define A5PSW_PORTS_NUM 5 -#define A5PSW_CPU_PORT (A5PSW_PORTS_NUM - 1) +#define A5PSW_MAX_PORTS 4 #define A5PSW_MDIO_DEF_FREQ 2500000 #define A5PSW_MDIO_TIMEOUT 100 #define A5PSW_JUMBO_LEN (10 * SZ_1K) @@ -231,6 +230,16 @@ union lk_data { struct fdb_entry entry; }; =20 +/** + * struct a5psw_of_data - OF data structure + * @nports: Number of ports in the switch + * @cpu_port: CPU port number + */ +struct a5psw_of_data { + unsigned int nports; + unsigned int cpu_port; +}; + /** * struct a5psw - switch struct * @base: Base address of the switch @@ -238,6 +247,7 @@ union lk_data { * @clk: clk_switch clock * @ts: Timestamp clock * @dev: Device associated to the switch + * @of_data: Pointer to OF data * @mii_bus: MDIO bus struct * @mdio_freq: MDIO bus frequency requested * @pcs: Array of PCS connected to the switch ports (not for the CPU) @@ -254,8 +264,9 @@ struct a5psw { struct clk *clk; struct clk *ts; struct device *dev; + const struct a5psw_of_data *of_data; struct mii_bus *mii_bus; - struct phylink_pcs *pcs[A5PSW_PORTS_NUM - 1]; + struct phylink_pcs *pcs[A5PSW_MAX_PORTS]; struct dsa_switch ds; struct mutex lk_lock; spinlock_t reg_lock; --=20 2.52.0 From nobody Tue Dec 2 01:30:04 2025 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (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 9CCF034B430 for ; Fri, 21 Nov 2025 11:36:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763724977; cv=none; b=fnHYzpsCFe1OSaHmkAurJVtbk1vm0cd5mxVijRajZ0KWPtiDG4LqoA5+Owy+8JnyuUrV/wmN3zzJsk5KjWmb8OnWvLcsNinjZ+NVPg7b82BSR1hr7DlOwc2iyP8ZWA/DHL7h5qA1SVJ8SHl3OSg/TPC1VyDJR8nlf+WdEMCy+UQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763724977; c=relaxed/simple; bh=a9iHaZ5PPXBHrtyzxvPI+cAOuvyT4cROkSXb5P8Mt6U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fF3/6/Z8Qc4AQHR7gYBguKgK9dekGFn5X4pEhzy85e5Y075Kz8xCLQenWmWR74nppcLKOXnCI5k5cSOozoTJD3NNyYAsiJkTeFjWj6V0MMzg+BDkQMO0cM3cIzLEU5rhY8lencZ2c03B5NSIsUNR+ackwRblpXw69Mz1YNjkGtg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=YW9fLdb+; arc=none smtp.client-ip=209.85.128.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YW9fLdb+" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-4775ae77516so21168485e9.1 for ; Fri, 21 Nov 2025 03:36:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763724973; x=1764329773; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Lx8a6006lMaIvKt+PGJnSU2GzWYSKMGOtHoKCCD0pMI=; b=YW9fLdb+EO6TZMgofMV8Ph0YTD+RB7UELOpxI/upS6e8bZEKiapU0hSXO9E9jnFkjt i4D6YmdF974iv0UBFxAPuQo/74iwbNTgOodhw3PYut90PFfP0ob236AV4QdZQ5nmYK7P QQZyE5cLO3plwvU+hy+5ZErVB3TbYs8xcKttAPlnKkEOfZ3P3umNwkIs6KGCXX0SYrLo pG8xzjCmcpliz4XHhk9rvqDm0wd4TM+IqjP5T+Gn3UUWfnHfebLMyW2BequPTz/8MYrc PZ/1obhei0iA7WMazNk4S3FmzqVtYZmu9z7vu8XFg+l5lJE1+Ply/+RtIyZqyWicWoHm sX1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763724973; x=1764329773; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Lx8a6006lMaIvKt+PGJnSU2GzWYSKMGOtHoKCCD0pMI=; b=gNFWMHA0ETgitdCISSCq/rkEm57N6Ox7EU99V7GadEGyP7EXg5+YFA2Ue8OzZ/XWgq kWgwVl3ARsWIqsN5p4gfjb7joLchO9iDSBi5r2TcXW3+Ds2t2xYD6Pe44arX4wNcdUdU +qXCdwWPxUH1BMCvxK+H+9QHDecgCbZBOSjBp8jEn+BWp5UEbED7WIqDXWHXz83+pPM1 u5j4ZbHT1iT7Fiep9QvGKqnwpBas+YnXTyf0yQP35S5b69ojp0JidKFwBEn4KF/pbFtQ BZFHqFCUpP5WfzXNnpJNqLXskljQLhnEIeQpac/33AVmpUtA59JgZamCBlMFIkMFfo6z no9w== X-Forwarded-Encrypted: i=1; AJvYcCV3cMoiVNgfB2yPXPg8GuNqatP5plHqS8JmZBQnSr8dWBCK4sMABUQ+onZMitdFw5d5okVr+88/moHdFZ8=@vger.kernel.org X-Gm-Message-State: AOJu0YyhEXaRJKrt/p1uWZiqVjh9kdhSyg27e45mPc8KiP961BCeeDsY joBMyjKSjWlkNcYvR9eDqja3ZeqLE12w67GAZEiDfngVNR+Lm5xdgtV2 X-Gm-Gg: ASbGncueSg4ntoqlhAGqSgMV0NFCNB13KyrCWo47QHqETu66WwI9GWK7esAxmUPfAQz g1SJZCN1Ox+qDsUsuAYclhkLk2gNKBPhRd0mnxdbGY5xhoNNZvWnXcpzoszdCGsKIbqe5li09vC lqFsfhaIg2LrcYSkrVfQyUohK3OOkQ+pE7J2T74rUrjx4QkxweMbWKYNAmzldhYlkOf2uVQLoF8 s5oEUSp5pnogqTutsIalko4UolrxYwnzR39o9EjyYIgT/6Iyn9ki/uXxJX8rKrTgwDXRIp85QgU Dy7/bzRI4wIrRSPRmt6JE1yH9Ta6uVVShs2izRecwiYil7889t7CU6dRLMw3I7Ey2IuRJAAqIgH d8tcjdgKkejZJhzT7KPiyw1F5OI67fNAQ5gg4jlPQEdG/xNL5fDsS029B/cKVvmW7GYotHKYzZI /F3lpIhOz7uceW83dJmMn1HZHmpoY5RZUFSsUrgxFDNFthvkOguFSewCV9 X-Google-Smtp-Source: AGHT+IFto1VNl0X8Iz8e3+Q8ER8AySeVHn7wevr1XBc4yThGtBjhnSMYfEV+qBCobpXwA5EM85iirQ== X-Received: by 2002:a05:600c:3592:b0:477:9b35:3e36 with SMTP id 5b1f17b1804b1-477c10c873amr20494465e9.2.1763724972625; Fri, 21 Nov 2025 03:36:12 -0800 (PST) Received: from iku.Home ([2a06:5906:61b:2d00:9cce:8ab9:bc72:76cd]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-477bf3558d5sm38732465e9.1.2025.11.21.03.36.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Nov 2025 03:36:11 -0800 (PST) From: Prabhakar X-Google-Original-From: Prabhakar To: =?UTF-8?q?Cl=C3=A9ment=20L=C3=A9ger?= , Andrew Lunn , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Simon Horman , Philipp Zabel , Russell King , Geert Uytterhoeven , Magnus Damm Cc: linux-renesas-soc@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar Subject: [PATCH net-next 08/11] net: dsa: rzn1-a5psw: Make DSA tag protocol configurable via OF data Date: Fri, 21 Nov 2025 11:35:34 +0000 Message-ID: <20251121113553.2955854-9-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251121113553.2955854-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20251121113553.2955854-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Lad Prabhakar Update the RZN1 A5PSW driver to obtain the DSA tag protocol from device-specific data instead of using a hard-coded value. Add a new `tag_proto` field to `struct a5psw_of_data` and use it in `a5psw_get_tag_protocol()` to return the appropriate protocol for each SoC. This allows future SoCs such as RZ/T2H and RZ/N2H, which use the DSA_TAG_PROTO_RZT2H_ETHSW tag format, to share the same driver infrastructure without code duplication. Signed-off-by: Lad Prabhakar --- drivers/net/dsa/rzn1_a5psw.c | 5 ++++- drivers/net/dsa/rzn1_a5psw.h | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/dsa/rzn1_a5psw.c b/drivers/net/dsa/rzn1_a5psw.c index d957b6d40f05..dc42a409eaef 100644 --- a/drivers/net/dsa/rzn1_a5psw.c +++ b/drivers/net/dsa/rzn1_a5psw.c @@ -97,7 +97,9 @@ static enum dsa_tag_protocol a5psw_get_tag_protocol(struc= t dsa_switch *ds, int port, enum dsa_tag_protocol mp) { - return DSA_TAG_PROTO_RZN1_A5PSW; + struct a5psw *a5psw =3D ds->priv; + + return a5psw->of_data->tag_proto; } =20 static void a5psw_port_pattern_set(struct a5psw *a5psw, int port, int patt= ern, @@ -1316,6 +1318,7 @@ static void a5psw_shutdown(struct platform_device *pd= ev) static const struct a5psw_of_data rzn1_of_data =3D { .nports =3D 5, .cpu_port =3D 4, + .tag_proto =3D DSA_TAG_PROTO_RZN1_A5PSW, }; =20 static const struct of_device_id a5psw_of_mtable[] =3D { diff --git a/drivers/net/dsa/rzn1_a5psw.h b/drivers/net/dsa/rzn1_a5psw.h index d1b2cc5b43e6..0fef32451e4f 100644 --- a/drivers/net/dsa/rzn1_a5psw.h +++ b/drivers/net/dsa/rzn1_a5psw.h @@ -234,10 +234,12 @@ union lk_data { * struct a5psw_of_data - OF data structure * @nports: Number of ports in the switch * @cpu_port: CPU port number + * @tag_proto: DSA tag protocol used by the switch */ struct a5psw_of_data { unsigned int nports; unsigned int cpu_port; + enum dsa_tag_protocol tag_proto; }; =20 /** --=20 2.52.0 From nobody Tue Dec 2 01:30:04 2025 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (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 DE9BB34D93D for ; Fri, 21 Nov 2025 11:36:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763724978; cv=none; b=F0l/sv+s21zh/5H+e8956FGW6/jy2NC+3qBEcB15AgLFPL8w+nDJjGYN04SbEwWW8v4wQxk9xntCjRhnWPqqH+eh4I+NoSWWwJPG37dfpGH24TVxmWx723myTTEggKIwoUIqYfvji7hfecpM3ew4LAnMxUf0fsrHd7SAfzvnWxM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763724978; c=relaxed/simple; bh=iV5547O2Jkc5KxmhzNymYPOd0IDQwWkKNkuGqo67YKM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tzyyI6JhPu/giOJM9SgtdlbTZqBDkgLKvrQaHtJvhAMiKQK0bGoTuctKNG993y+0BiSfPK/H0bbLqAfLzIFJf0qHl1h4zyBd8tzA4x3NpYAzQRJ/4JqPVXdW/fvdgfrqUtohcYHoqtArczzcUoSMz7aW6M7NVg+JK/a+jM8ibZM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=TBh9lvWP; arc=none smtp.client-ip=209.85.128.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="TBh9lvWP" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-47790b080e4so10608625e9.3 for ; Fri, 21 Nov 2025 03:36:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763724974; x=1764329774; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BL9yVtMaskxLuPDjF5CARhK40Dj9w0uig2rqjbmy1/w=; b=TBh9lvWPl5qCRjt4wm/sUSifj8jSsSY1iO707TIGFAs9gDc2y+HpmHNNrmd6jYIHOr DC8ZS57NmuPuKvYD5fIIbeGqWAxCKKULLafZzgY5hbovc6JTn6QUQtv1qf8gb4dkUXSD WEpmw9K4IvmbmBgwI6BKwvaN7xKhfIOkUPILxevhFFPUXWbirFVjVn55cB9Da0qqqLHU 2JKY5NrEoPH8vMMC0EhpNWoiSdss0tER2t8zcsWNDGl8EW7ZR9rak3lZiH/oxghN+kGI nNhrZeffgVjAjnngBs/AIOhpCqaQQIv5DiCw8wEvz0a3KhWHlmFoI759n3yvq3m8YmQ/ XsJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763724974; x=1764329774; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=BL9yVtMaskxLuPDjF5CARhK40Dj9w0uig2rqjbmy1/w=; b=xHLbI3kQBMTXN2YGLcJuqkyJ3WZLfjRCrYfcn25P2oag/+pqTX+NYsHi9WFd9UPktC H+26lIdwO0S/sRGG4jGzArSDLjCYXXtiVXb4v8ArqeKe8tKwfz7rv8XidsFgSzK2tjGA bjGxpE7uxt+yR27+lZ1FBiBF5PtLfQ5ub8Bo0GtTFbHdCiYVvtWzDjU+4/pGz0MD4Bh5 6KMM1k8PF1RzCNT7PUrerNv1xHgvr+nBk+ppe3fUkMYENQXYT4zHtUtn3+apQU+o0x4+ gKWQqYsnG+rJTb+kWyvRFEwwsx2CpmShaRY7XpWk+aoLe6w7R473la/ApmFno7AcWuYj ljcg== X-Forwarded-Encrypted: i=1; AJvYcCXP8/p/uh+acv5g8U1efSyT3hTqbtKWCvu19ihQYqr6bduy1FW8hVKW3WiPua2smcrdVzTquSg3SoS596A=@vger.kernel.org X-Gm-Message-State: AOJu0YxlNemUvn04n0pIf51+fsSO3g9kLAi1A9+uzR72bNIbqWYsfJLb ekkwPCFjfgkHv4H3n19/KIevtLDoBvFReiGInLmkxq6OEWOO2Ayu+MWW X-Gm-Gg: ASbGncvSd2Awf5iiAqgWY1HLBn9C1mc5wGZSma9KgCk5DqwkHZHcZ5fqtOnFsKsdLWp 2+YCzuag4+qj3EMayl6fio2Ev5g856O6qKOknkSPtmOo/bcTYJJMKw2oRcJSnWGh+N7ccZZNT49 qO410bgbHAxjriZRamFgDqGk+9+zIU7/IjrCj5RLVjZoa8HDbzAvdfTUKK+4VGeigaMG4U0wk5X 9QSqO4YWECCvG3w1buw93eJ5YBmK1QJpgEZFX/xiZkyiMvZB1Odxpw+VS3o/Om48jzm/jpgzaWM LAJBPIAWJihbGMAr6vnyT8CIrNdaYQfE38j851BGS3oFfLAtHomSIMxyrKymy4ACmYM9y0PX4el 7wOMhMx5O2sKR4a9MJl+5tYpjLwtbCOCHaLKO8Hqjmtli8z4DAtFnfl6/shVNP2hgmvGmg1CtdP Klf6cXWkNbU8PnpGBgfRZuAn9iDQTXA20HIF0= X-Google-Smtp-Source: AGHT+IH36k8lUJuOn97e5nXbz9w9MMFZJjRypq3XClPag4vI3s41hFu6V390MCHf+PjbZXWUpQ6F2A== X-Received: by 2002:a05:600c:4f82:b0:477:952d:fc11 with SMTP id 5b1f17b1804b1-477c11175a9mr22999955e9.16.1763724973805; Fri, 21 Nov 2025 03:36:13 -0800 (PST) Received: from iku.Home ([2a06:5906:61b:2d00:9cce:8ab9:bc72:76cd]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-477bf3558d5sm38732465e9.1.2025.11.21.03.36.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Nov 2025 03:36:13 -0800 (PST) From: Prabhakar X-Google-Original-From: Prabhakar To: =?UTF-8?q?Cl=C3=A9ment=20L=C3=A9ger?= , Andrew Lunn , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Simon Horman , Philipp Zabel , Russell King , Geert Uytterhoeven , Magnus Damm Cc: linux-renesas-soc@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar Subject: [PATCH net-next 09/11] net: dsa: rzn1-a5psw: Add support for management port frame length adjustment Date: Fri, 21 Nov 2025 11:35:35 +0000 Message-ID: <20251121113553.2955854-10-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251121113553.2955854-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20251121113553.2955854-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Lad Prabhakar Extend the RZN1 A5PSW driver to support SoC-specific adjustments to the management (CPU) port frame length. Some SoCs, such as the RZ/T2H and RZ/N2H, require additional headroom on the management port to account for a special management tag added to frames. Without this adjustment, frames may be incorrectly detected as oversized and subsequently discarded. Introduce a new field, `management_port_frame_len_adj`, in `struct a5psw_of_data` to represent this adjustment, and apply it in `a5psw_port_change_mtu()` when configuring the frame length for the CPU port. This change prepares the driver for use on RZ/T2H and RZ/N2H SoCs. Signed-off-by: Lad Prabhakar --- drivers/net/dsa/rzn1_a5psw.c | 4 ++++ drivers/net/dsa/rzn1_a5psw.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/drivers/net/dsa/rzn1_a5psw.c b/drivers/net/dsa/rzn1_a5psw.c index dc42a409eaef..82f4236a726e 100644 --- a/drivers/net/dsa/rzn1_a5psw.c +++ b/drivers/net/dsa/rzn1_a5psw.c @@ -211,6 +211,10 @@ static int a5psw_port_change_mtu(struct dsa_switch *ds= , int port, int new_mtu) struct a5psw *a5psw =3D ds->priv; =20 new_mtu +=3D ETH_HLEN + A5PSW_EXTRA_MTU_LEN + ETH_FCS_LEN; + + if (dsa_is_cpu_port(ds, port)) + new_mtu +=3D a5psw->of_data->management_port_frame_len_adj; + a5psw_reg_writel(a5psw, A5PSW_FRM_LENGTH(port), new_mtu); =20 return 0; diff --git a/drivers/net/dsa/rzn1_a5psw.h b/drivers/net/dsa/rzn1_a5psw.h index 0fef32451e4f..41c910d534cf 100644 --- a/drivers/net/dsa/rzn1_a5psw.h +++ b/drivers/net/dsa/rzn1_a5psw.h @@ -235,11 +235,15 @@ union lk_data { * @nports: Number of ports in the switch * @cpu_port: CPU port number * @tag_proto: DSA tag protocol used by the switch + * @management_port_frame_len_adj: Adjustment to apply to management + * port frame length to account for accepting a frame with special + * management tag. */ struct a5psw_of_data { unsigned int nports; unsigned int cpu_port; enum dsa_tag_protocol tag_proto; + unsigned int management_port_frame_len_adj; }; =20 /** --=20 2.52.0 From nobody Tue Dec 2 01:30:04 2025 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (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 02E9E34E741 for ; Fri, 21 Nov 2025 11:36:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763724980; cv=none; b=fB64hyxXoopNmIHWvIfhDpA00QKs12MTNOe6/4Z1+u/VEePlXnKoEYWGY120vFVkAf+wrUwJCyLBg+aqE5IL+wxFVc7fus8bTjPR77/Ld3Zc8TP9zCckge+Nq5brjPQLyvCtAw7YN/HukbdmEVUDjgnMtlVoovjE1FZqq9M3ZiY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763724980; c=relaxed/simple; bh=p0Zq4gARic389z5cUOv02yKuHJQNu/nVWEGHNiC33nw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FRfExMTiDYwTvFEHU42FMir4zGNqds5pSDH/Vspb8TNODfHSr4EdFWb1NvW/Q4j3I4s/0WGHtMo5AsVdGzof9CdnjmpkJhmYv2xkaQAVMbrBUnmReT0vZsKIsm4edXSa8mUw3Qq+wKQ8IN64BlrYZxA9QAePl2banvtKhKHMN+0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=J9HanB4/; arc=none smtp.client-ip=209.85.128.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="J9HanB4/" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-47795f6f5c0so12708835e9.1 for ; Fri, 21 Nov 2025 03:36:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763724975; x=1764329775; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=M398mpeozAislS4NsyHxHxkyx50MVbfvXAZ3uGjRUmM=; b=J9HanB4/BlxP5FZaTF8VRM2BjuTjaAj3BZlYLw/Q18MyMyXmaKkETwKRQhi2EgzOY4 DOerkTXesDmXg4COahSg7Dj32LrMm/35Lx1g4cQT6vnZzufGWgg99aNqJ/x9foShzxOD CPCwOFtdl2mB7B7NGsJH6UL/wVQnr0IWSPMGxB5WHA18HjplzsxkIDGr8mvg+V1isbkg qIoGsJnE+NRF1x0pHUc9QEf2taVdYyhAYZbgExvo1SSCYacbLgae+B8LcHCkkeZIyO2H iVSR/uWBo9lPXwv2w4OWlGVzJ6E8qetfinDyVYMahF5AKvFHnHidRyVyJf0JLliOxfEo gsPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763724975; x=1764329775; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=M398mpeozAislS4NsyHxHxkyx50MVbfvXAZ3uGjRUmM=; b=qNGL5gDCtKVans5lnuCQXThM2RFSzCm3lOBKPAAeMFzOXKEj7RU32eyHwTpsN0iVDX QW718IqGtGz1Np3Jpb/ePtZg+HTFsaqmPggGo2r2t+Qw+Cy38gNwOgX6y/BZWBII7zM0 CzHd2Kxv+06ZFdsBzluaOnt78s+0O9k3ddeZNQ7xx9VYcvySI8EPrFwPe49qDR/eWxVW akUas3kPQStPzXto7UoVig2jqlZIyUOVzeHb0+tuj5fC0N4PYXwTXmF35hPnIiDKvtUH xnEKD+Jq/j+kvI5AA8Y2vaReO2TPv+cTIgNvnZzpa8eJWNSctfDG0ACbjShAcdC0n7YR KX4w== X-Forwarded-Encrypted: i=1; AJvYcCVWy0BaEd6aj0WdEZiVO/j0X+X0+WLux5G2KQO9ISSG3WtroGMUtkyDw6Sq7+OzmrY3TaGxf6ARSz1J9EA=@vger.kernel.org X-Gm-Message-State: AOJu0Yx6zwz+DYUKuFA5edn9njpn0qn/STfgKG1jk6ceodHB+dcUBKpV XJiK2bfYt7C7bzGYwrYRPNT9k43HV2z8TjhLLtpL7ebhKbEYfBuJ/edy X-Gm-Gg: ASbGnctfdmlZltH/v5lYfLxnxc0Tx12sLJXr+R5NT5jl2bIt3/G/yjMlEwo1NQgpia+ dVuPcrmoXLjsIFDuslGD4TOs0mkPkSV6huFYluSzZguDPK9MW3AQwiVjeJdt+Kv4SJ05LsD/pGW aK4It9r+Ob8TvEN9IszXV60OqL4t7hpBdLb7E6SEg2PsLPM/0anDsJwh+Cd5OECGXIoKkB9buqu EQkPQrw0xL1xR2nrKExiuvRjOHElBKc1wNK6PrboQtikc1hxo3xwOjWi6ne6okM7b4Ec6v5JTuo +ZRZgFwEXk6Q3nnsasZoyTShyB6T78tzUexXA7lfPoJfjgjcG1xqLbRbTzSXAkfy3asYvey/iSM B6ldWqyf0dOMzMCAPr745j0PPBdcKP60KDGsbD23DEFdK3pBFY3STSn7Zc97WzXJoeDKk9leVFx K4m5C/HiaumxHE3sOYi6+3aTWDtKZipW3vBK4= X-Google-Smtp-Source: AGHT+IHGSARKVH87wKwqZXU+BypHZzYVsPLPqyAMU3sI2rXwgt9jOGXsb6RjgLHXNLjhSt8AyQ5uqg== X-Received: by 2002:a05:600c:c8c:b0:477:73e9:dbe7 with SMTP id 5b1f17b1804b1-477c01f52cdmr22433365e9.35.1763724974873; Fri, 21 Nov 2025 03:36:14 -0800 (PST) Received: from iku.Home ([2a06:5906:61b:2d00:9cce:8ab9:bc72:76cd]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-477bf3558d5sm38732465e9.1.2025.11.21.03.36.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Nov 2025 03:36:14 -0800 (PST) From: Prabhakar X-Google-Original-From: Prabhakar To: =?UTF-8?q?Cl=C3=A9ment=20L=C3=A9ger?= , Andrew Lunn , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Simon Horman , Philipp Zabel , Russell King , Geert Uytterhoeven , Magnus Damm Cc: linux-renesas-soc@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar Subject: [PATCH net-next 10/11] net: dsa: rzn1-a5psw: Add support for RZ/T2H Ethernet switch Date: Fri, 21 Nov 2025 11:35:36 +0000 Message-ID: <20251121113553.2955854-11-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251121113553.2955854-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20251121113553.2955854-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Lad Prabhakar Add device tree match data and configuration for the Renesas RZ/T2H SoC Ethernet switch. The RZ/T2H uses the same A5PSW switch IP as RZ/N1 but with four ports, the DSA tagging protocol `DSA_TAG_PROTO_RZT2H_ETHSW`, and an additional 8-byte management port frame length adjustment. This prepares the driver to handle RZ/T2H and compatible RZ/N2H Ethernet switch instances. Signed-off-by: Lad Prabhakar --- drivers/net/dsa/rzn1_a5psw.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/net/dsa/rzn1_a5psw.c b/drivers/net/dsa/rzn1_a5psw.c index 82f4236a726e..9f85a4526bd2 100644 --- a/drivers/net/dsa/rzn1_a5psw.c +++ b/drivers/net/dsa/rzn1_a5psw.c @@ -1319,6 +1319,13 @@ static void a5psw_shutdown(struct platform_device *p= dev) platform_set_drvdata(pdev, NULL); } =20 +static const struct a5psw_of_data rzt2h_of_data =3D { + .nports =3D 4, + .cpu_port =3D 3, + .tag_proto =3D DSA_TAG_PROTO_RZT2H_ETHSW, + .management_port_frame_len_adj =3D 40, +}; + static const struct a5psw_of_data rzn1_of_data =3D { .nports =3D 5, .cpu_port =3D 4, @@ -1326,6 +1333,7 @@ static const struct a5psw_of_data rzn1_of_data =3D { }; =20 static const struct of_device_id a5psw_of_mtable[] =3D { + { .compatible =3D "renesas,r9a09g077-ethsw", .data =3D &rzt2h_of_data }, { .compatible =3D "renesas,rzn1-a5psw", .data =3D &rzn1_of_data }, { /* sentinel */ }, }; --=20 2.52.0 From nobody Tue Dec 2 01:30:04 2025 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 3495534E749 for ; Fri, 21 Nov 2025 11:36:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763724980; cv=none; b=PJilRuj4YkuhHvKoqNfcTWMf4Glzqn+N2kx1CTO1z5uPk7gA9menruCiV3II72ok6WxX9QC8qDjkrbzlK+OojixRsqt1e6uNGkK++zonTXQzp1ZueWN1ebR9c6oFhG8MQMPugD0tdPjuxNAtxGg2ZYdKqYoEeT/KhO1ZkZKySrM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763724980; c=relaxed/simple; bh=hchXSgygJWBcEWG+hD4fRh8j8Qkfp0pxrBvdqBRJ3ko=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=psdsESBZYCYVuWuYhI8dSi+eciC/6SId4pnKUwDdXLlT3Ymcve+IuJdho23fWwNtW8o3BJSsF+oRazk0PmfuBV2AsAjNkq+3FmwWCro2EXwvWiZxyXT+YLYnXUieWeXlTF16kHv+RA5Z1wlQC16nzlomB5I0pC8uE21tYQbLSN8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=hpy1b+Pz; arc=none smtp.client-ip=209.85.128.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hpy1b+Pz" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-47796a837c7so12607485e9.0 for ; Fri, 21 Nov 2025 03:36:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763724976; x=1764329776; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Nacbc5WMY0LOOZ8qaHyu8WlhOPDhH+6WVnm9Wyr/V+w=; b=hpy1b+PzjxQSWT/euyRXu6nYKCSF4IB5UCCXN65JFfcfEPzxIN9lhjI2J7PrVB6tPb MhyFK1u3urL/IqlQW30E07/lQP5x0hnuhjvANm0P84IbAjZJ62MmxFD9j0eCC4YySWOo cV3S/jtEwOkdnyK2s7N4WHO/6Yh6EWhXBCdwuugs8OrYI2odVPoQ1pIW6WJcaN3dkKZO yXLum70BSh9zAT0mtS8wgEBjPeGKHutTfM1mpZ4UTwdmyeY1FWw2YLX9Iz4G0mrGPaV+ a1sNd4ex7UpNGj/CYAMuhDIa0R/QEZtdP6VX76aGOv+dwX5aj1TxI4VBKUbRmM7cEMYy Rw6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763724976; x=1764329776; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Nacbc5WMY0LOOZ8qaHyu8WlhOPDhH+6WVnm9Wyr/V+w=; b=earxAxaLEgqDoQ5R9cXbukeRDmvXDdMDAcq69kdK7LeIOYlLRSiwCHf0BXSyyQtxij NkBonpJyZRjpyctmyrL0COrTYWOKQsAUdKfKAh58d5YEgevZFAkcTUUsGmU4Q4IKBAwY zN2SjhI0DL9ycn8YoqiMFCFlsc+/svFiwh3vG5fmjiI7jpmaiM8lW/yQuJ0cQTxPz+vK 3e3mCk6kI7bNj0LlfdXkBhsjzM17KbBsGIGMk1/tJoKPJVCfB+sRzkxQzNYnS+96vcou OdYb7Hj0P60gQ70DvUZtuZMrCCLZIjAB26aknojKaFFS+D5ah/Jk80feJKKMwh7/2c7Y tLXA== X-Forwarded-Encrypted: i=1; AJvYcCXWaVjCf0Me2nm2uvcvV7UuWr/afdoj6jos2Lyhj/bNrSha04TyUkM4+a1wgjDt74568m9/b7PxdoDmxSU=@vger.kernel.org X-Gm-Message-State: AOJu0YxK/Nm6oQJBgiEjNvBnPKXTORrVgqp3bPJHfxWUCZ5PQZeP24Xx wmYitSmjYGl3UqA2TgVSfeffrskZQhmv6vq+3DN5MQFXGKO/4NkJZBaF X-Gm-Gg: ASbGnctsctwcghqyr2cmjBL75buI4kQ3OrB75220t9dbonl/6rAahVxJIefcksnRRMc tbaPUdWtClLM6mMgMYSE07l5KIYtDWHDsIKRwqZkIFUcoOMmJHxn59dNkGmqGHlM63YuxF/tGtd a+mh3Pfmgjo8q/b5T4WJWLF8XJhfaEnysU//8mWXq2nuj4TDsv2wLArpTWkaPa+IQvcVrqb7VSe olD1HNT3lHQItYa+T1qPKkwrk5Cy4G8yVN/WeTLvs3jmKrP5zwQZqOSL1HZIo1MKwXW2zg3Ghk7 mNAxpP+ifRkGDmsvuikfM5epAQZfavK4jxzG5A8aT4IkU+m3lopRKH2b/+gY2XzUJeG5UUtaELx uMnjrkhsfsonB9oHjUufZkWJQVEjHUlkce0wJQlVoooxRlyEJScL/DIqxcuNnR5ww54xPSU/W6c ZIbLipmUsYy2B1vGkwvIpSVHO/mdYtOCqrMqw= X-Google-Smtp-Source: AGHT+IG2HURpS3BsfaEjL3nAImQmP3zOqLnyYh4zvU/JiS2Ijzmk0gOHYb3O9eu50FjD0hI6GGLg8g== X-Received: by 2002:a05:600c:3593:b0:46e:32dd:1b1a with SMTP id 5b1f17b1804b1-477c0162f1fmr24084985e9.7.1763724976029; Fri, 21 Nov 2025 03:36:16 -0800 (PST) Received: from iku.Home ([2a06:5906:61b:2d00:9cce:8ab9:bc72:76cd]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-477bf3558d5sm38732465e9.1.2025.11.21.03.36.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Nov 2025 03:36:15 -0800 (PST) From: Prabhakar X-Google-Original-From: Prabhakar To: =?UTF-8?q?Cl=C3=A9ment=20L=C3=A9ger?= , Andrew Lunn , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Simon Horman , Philipp Zabel , Russell King , Geert Uytterhoeven , Magnus Damm Cc: linux-renesas-soc@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar Subject: [PATCH net-next 11/11] net: dsa: Kconfig: Enable support for RZ/T2H and RZ/N2H SoCs Date: Fri, 21 Nov 2025 11:35:37 +0000 Message-ID: <20251121113553.2955854-12-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251121113553.2955854-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20251121113553.2955854-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Lad Prabhakar Update the Kconfig entry for the Renesas RZ/N1 A5PSW Ethernet switch driver to depend on ARCH_RENESAS instead of ARCH_RZN1. This allows the driver to be built for other Renesas SoCs that integrate a similar Ethernet switch IP, such as RZ/T2H and RZ/N2H. Also update the help text and prompt to reflect support for the ETHSW variant used on these SoCs. Signed-off-by: Lad Prabhakar Reviewed-by: Vladimir Oltean --- drivers/net/dsa/Kconfig | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/net/dsa/Kconfig b/drivers/net/dsa/Kconfig index 7eb301fd987d..9c44c530ebb1 100644 --- a/drivers/net/dsa/Kconfig +++ b/drivers/net/dsa/Kconfig @@ -85,13 +85,14 @@ source "drivers/net/dsa/xrs700x/Kconfig" source "drivers/net/dsa/realtek/Kconfig" =20 config NET_DSA_RZN1_A5PSW - tristate "Renesas RZ/N1 A5PSW Ethernet switch support" - depends on OF && (ARCH_RZN1 || COMPILE_TEST) + tristate "Renesas RZ/N1 A5PSW and RZ/{T2H,N2H} ETHSW Ethernet switch supp= ort" + depends on OF && (ARCH_RENESAS || COMPILE_TEST) select NET_DSA_TAG_RZN1_A5PSW select PCS_RZN1_MIIC help - This driver supports the A5PSW switch, which is embedded in Renesas - RZ/N1 SoC. + This driver supports the Advanced 5-Port Switch (A5PSW) found on + Renesas RZ/N1 SoCs, and the Ethernet Switch (ETHSW) found on + Renesas RZ/T2H and RZ/N2H SoCs. =20 config NET_DSA_KS8995 tristate "Micrel KS8995 family 5-ports 10/100 Ethernet switches" --=20 2.52.0