From patchwork Wed Oct 16 21:51:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Kleine-Budde X-Patchwork-Id: 13839008 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2EE851D4171 for ; Wed, 16 Oct 2024 21:52:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729115553; cv=none; b=Vr56gZ2NP0Exf46dAunFFMHEqXdneP1zlaJuoO4AnqDti8VDwJ769aFWjMGPs4eUCmvBxoxSbooghIlCwnOm95mO0PdvIPoByANx/KgoDzg64SDscLg+mDex15ZkCWFasAEWp9xPb4n6NCkXWVzUf/3eE+QZP6bofrKGpufDhGk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729115553; c=relaxed/simple; bh=7GtJji14G3kifWiJdk4fDCF5TSs2sCvgJBeyE6WDGs0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=FyNgQtahfaMarnw+SaT9dZNU/IKPvkgI0jJ0jyYV/BKbdcTW+77GR+zyI+wxgtMectUhqHTH00hRo01ZnUsDpmmMngQOBDi5BYSn85WOsLUGnyRyBGGjqe341hOz6URNeEhvF4ntRm2LFu7RfYHkwhtwerTrQfq3XXm/cbYjobQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1t1BwS-0003MX-Kc for imx@lists.linux.dev; Wed, 16 Oct 2024 23:52:28 +0200 Received: from [2a0a:edc0:0:b01:1d::7b] (helo=bjornoya.blackshift.org) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t1BwO-002ORX-S6 for imx@lists.linux.dev; Wed, 16 Oct 2024 23:52:24 +0200 Received: from dspam.blackshift.org (localhost [127.0.0.1]) by bjornoya.blackshift.org (Postfix) with SMTP id 4EF2C3548EA for ; Wed, 16 Oct 2024 21:52:24 +0000 (UTC) Received: from hardanger.blackshift.org (unknown [172.20.34.65]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by bjornoya.blackshift.org (Postfix) with ESMTPS id 3627C354880; Wed, 16 Oct 2024 21:52:20 +0000 (UTC) Received: from [172.20.34.65] (localhost [::1]) by hardanger.blackshift.org (OpenSMTPD) with ESMTP id be551a47; Wed, 16 Oct 2024 21:52:18 +0000 (UTC) From: Marc Kleine-Budde Date: Wed, 16 Oct 2024 23:51:53 +0200 Subject: [PATCH net-next 05/13] net: fec: fec_restart(): introduce a define for FEC_ECR_SPEED Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241016-fec-cleanups-v1-5-de783bd15e6a@pengutronix.de> References: <20241016-fec-cleanups-v1-0-de783bd15e6a@pengutronix.de> In-Reply-To: <20241016-fec-cleanups-v1-0-de783bd15e6a@pengutronix.de> To: Wei Fang , Shenwei Wang , Clark Wang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Richard Cochran Cc: imx@lists.linux.dev, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de, Marc Kleine-Budde X-Mailer: b4 0.15-dev-dedf8 X-Developer-Signature: v=1; a=openpgp-sha256; l=1217; i=mkl@pengutronix.de; h=from:subject:message-id; bh=7GtJji14G3kifWiJdk4fDCF5TSs2sCvgJBeyE6WDGs0=; b=owEBbQGS/pANAwAKASg4oj56LbxvAcsmYgBnEDWFQWZhrYZZkfdVhV0Jk/Nfh9q7WlZQzjSul hPTCO1BEJaJATMEAAEKAB0WIQRQQLqG4LYE3Sm8Pl8oOKI+ei28bwUCZxA1hQAKCRAoOKI+ei28 byqWB/0afSRnTRSECfSjxdtzoGolxiFb4HYpV2P73zfe1yozkI6gXgDXT18McR6n3aAWF4L4bx5 Nn89bAutGj1L/8DXa95MBR5ZBZu9nQ1fkrrRz+JAQL+ipm8WQTk+2EcCDQOCjBVQiV8TYEouwaU cVHaECBe48qFKg2mXcJ32kHi6YypNnolHI6BeYGVHgbb5gk58O0uoFs0k7a5egU0E2Y1LkEDI6O 3rIEw0I2Ec8rgoQFFMvCqIkUStsQtrnqqr0hmVojY/iHj76TKNZQDXVFZfBChWF1uU53ebx2Irm XPvVhjR9gM/LphVHnPX4JtVrrPeyZ+X+YzpScGXg+M+Hu5jZ X-Developer-Key: i=mkl@pengutronix.de; a=openpgp; fpr=C1400BA0B3989E6FBC7D5B5C2B5EE211C58AEA54 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: mkl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: imx@lists.linux.dev Instead of open coding the bit mask to configure for 1000 MBit/s add a define for it. Signed-off-by: Marc Kleine-Budde Reviewed-by: Wei Fang Reviewed-by: Frank Li --- drivers/net/ethernet/freescale/fec_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index c57039cc83228dcd980a8fdbc18cd3eab2dfe1a5..2ee7e4765ba3163fb0d158e60b534b171da26c22 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -276,6 +276,7 @@ MODULE_PARM_DESC(macaddr, "FEC Ethernet MAC address"); #define FEC_ECR_MAGICEN BIT(2) #define FEC_ECR_SLEEP BIT(3) #define FEC_ECR_EN1588 BIT(4) +#define FEC_ECR_SPEED BIT(5) #define FEC_ECR_BYTESWP BIT(8) /* FEC RCR bits definition */ #define FEC_RCR_LOOP BIT(0) @@ -1160,7 +1161,7 @@ fec_restart(struct net_device *ndev) /* 1G, 100M or 10M */ if (ndev->phydev) { if (ndev->phydev->speed == SPEED_1000) - ecntl |= (1 << 5); + ecntl |= FEC_ECR_SPEED; else if (ndev->phydev->speed == SPEED_100) rcntl &= ~FEC_RCR_10BASET; else