From nobody Fri Oct 3 13:32:03 2025 Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C908324A058; Mon, 1 Sep 2025 04:58:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.160.252.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756702735; cv=none; b=FT9Xu3gERjmNLHlcXB+dMPjJreApaucOTc0ba3r6rJkjmRrLLS6imOpzCsHxly6ZAv+dWk1M64Fr/ZLndi2JZ6Y0lEj4IEb01WN+3Pne8OFaG4NX/qFtCAznSMke6JJf4Ud0FS9M/i6YyCkJRShTCDpDKfrj26324Fq8BxAS39o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756702735; c=relaxed/simple; bh=OUKs8ugCR+zskrC7MQ9iU6VRrIIcaZkBvkxwAXYin2s=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=XHypEJbAfN6NsI0t0r2R+L5silS76aYSNP931+Ixszi8tw7/AM79c2kLJansMIqJ6BuWRBKWpjFFm+xZbgqoFGFGxPKKfEZiSJ4xqj/bS7HjE2HUtZOj5fN2cqXdtueCp5DywIsdImQFmJ+xC+wGRQLMEXbbmbICZaCjL2vScCM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; arc=none smtp.client-ip=210.160.252.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com X-CSE-ConnectionGUID: HwCf2ubNQjiT8vQ8Di/dQQ== X-CSE-MsgGUID: idnWsNIXTq+u5T/40PuzPg== Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 01 Sep 2025 13:58:53 +0900 Received: from [127.0.1.1] (unknown [10.226.78.19]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 15B25400F309; Mon, 1 Sep 2025 13:58:49 +0900 (JST) From: Michael Dege Date: Mon, 01 Sep 2025 06:58:08 +0200 Subject: [PATCH net-next v5 4/4] net: renesas: rswitch: add modifiable ageing time 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 Message-Id: <20250901-add_l2_switching-v5-4-5f13e46860d5@renesas.com> References: <20250901-add_l2_switching-v5-0-5f13e46860d5@renesas.com> In-Reply-To: <20250901-add_l2_switching-v5-0-5f13e46860d5@renesas.com> To: Yoshihiro Shimoda , =?utf-8?q?Niklas_S=C3=B6derlund?= , Paul Barker , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Michael Dege , Nikita Yushchenko X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1756702712; l=1694; i=michael.dege@renesas.com; s=20250523; h=from:subject:message-id; bh=OUKs8ugCR+zskrC7MQ9iU6VRrIIcaZkBvkxwAXYin2s=; b=GUyNSR1xPiXO6v0lzwJEPSQqXe8+baxcx4DY9Xi/KyGn3XuiMfr64p8CfVQ56qm5FcKwYrj20 1SWvDbbjkhEB/cQJZ5MCDNWXRjtg1Unl22v6WwqkN3d/yojV/Lp/9GA X-Developer-Key: i=michael.dege@renesas.com; a=ed25519; pk=+gYTlVQ3/MlOju88OuKnXA7MlapP4lYqJn1F81HZGSo= Allow the setting of the MAC table aging in the R-Car S4 Rswitch using the SWITCHDEV_ATTR_ID_BRIDGE_AGEING_TIME attribute. Signed-off-by: Michael Dege --- drivers/net/ethernet/renesas/rswitch_l2.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/net/ethernet/renesas/rswitch_l2.c b/drivers/net/ethern= et/renesas/rswitch_l2.c index 49a24464dbb0cf3f3219a0699fc4671ddd71ef03..4a69ec77d69c600530189f3f5e8= 6da165022bc4e 100644 --- a/drivers/net/ethernet/renesas/rswitch_l2.c +++ b/drivers/net/ethernet/renesas/rswitch_l2.c @@ -193,6 +193,24 @@ static int rswitch_netdevice_event(struct notifier_blo= ck *nb, return NOTIFY_OK; } =20 +static int rswitch_update_ageing_time(struct net_device *ndev, clock_t tim= e) +{ + struct rswitch_device *rdev =3D netdev_priv(ndev); + u32 reg_val; + + if (!is_rdev(ndev)) + return -ENODEV; + + if (!FIELD_FIT(FWMACAGC_MACAGT, time)) + return -EINVAL; + + reg_val =3D FIELD_PREP(FWMACAGC_MACAGT, time); + reg_val |=3D FWMACAGC_MACAGE | FWMACAGC_MACAGSL; + iowrite32(reg_val, rdev->priv->addr + FWMACAGC); + + return 0; +} + static int rswitch_port_attr_set(struct net_device *ndev, const void *ctx, const struct switchdev_attr *attr, struct netlink_ext_ack *extack) @@ -200,6 +218,8 @@ static int rswitch_port_attr_set(struct net_device *nde= v, const void *ctx, switch (attr->id) { case SWITCHDEV_ATTR_ID_PORT_STP_STATE: return rswitch_port_update_stp_state(ndev, attr->u.stp_state); + case SWITCHDEV_ATTR_ID_BRIDGE_AGEING_TIME: + return rswitch_update_ageing_time(ndev, attr->u.ageing_time); default: return -EOPNOTSUPP; } --=20 2.50.1