From patchwork Thu Nov 7 17:02:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Chevallier X-Patchwork-Id: 13866788 X-Patchwork-Delegate: kuba@kernel.org Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) (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 ED133218926; Thu, 7 Nov 2024 17:03:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.193 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730998992; cv=none; b=lRK4RLrbkNAxhU4i6Pc7o2qbDeYkxfx4pzZFxpFgJ//gJgUu4YONUAoU8tq91yPqzmv6j/4OOl+q67W5rnu6x2TgerCDK/AWZ1OZg04dDiMUleBeGh2SfSoei+Bk+OqYTaH81tmpztMXS8rhS4RgI3rrx/ALpRfpvVi0jMoJqFw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730998992; c=relaxed/simple; bh=k0yu1/Y5rJI29hQ/Px/qnbUakHKIlZNEvsiA2wA1xcE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=C9bA9HMWdEID+16hAi9yuxMQXZyKXl+sxRIIJpoYu/Yn6JvTWE7Nd6InSLTyp8fCt/vcQa81ryGuA+GO1h0SLZV717UB18PD7+P3TvU3uLsv0qvFIB/Vwe8GPs5RjB13qkfxH+ESoUqfRQ+0uDSq7NiJ3n/cBF6owv4ENIjiNik= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=onUeVimL; arc=none smtp.client-ip=217.70.183.193 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="onUeVimL" Received: by mail.gandi.net (Postfix) with ESMTPSA id DA5CF24000F; Thu, 7 Nov 2024 17:03:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1730998988; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ieXv3A9kxi1oiDoWVCrTOD/LdxKXt/5GSXMVPC2fY/Q=; b=onUeVimLn8ullBgTFXI7baXvAnAAGSkhEmAY8tektIzmNlAMO6JAFQz8uGqrO0bRCTRgAZ j6MMuSTh2LjyYUcgPV8IlUorg2+tnJ3uP2CL6PKmhG8zuG2Jw1Wuvp9NObSlQP/5fjZE82 INPQvnNlWZ0eEW2mfK2aiBdtCln1iol5W03mZ1cyQgQaiKLp56I1KfHTzMapyopiKqFjfG Joyy0vdhg7bebRqKGEFzYdUgwLBBle+cMMe9GtTsIvkLw7flwkBe7xtMdfSKT1gqoBrlaW BY7n1tYhqm+Z0MpR5L079xYvA/g8YtnKvrrV8+m0066lKzt9ZbWX3/+HtqMg/A== From: Maxime Chevallier To: davem@davemloft.net, Andrew Lunn , Jakub Kicinski , Eric Dumazet , Paolo Abeni , Russell King , Christophe Leroy , Heiner Kallweit Cc: Maxime Chevallier , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com, Herve Codina , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , linuxppc-dev@lists.ozlabs.org Subject: [PATCH net-next 5/7] net: freescale: ucc_geth: Simplify frame length check Date: Thu, 7 Nov 2024 18:02:52 +0100 Message-ID: <20241107170255.1058124-6-maxime.chevallier@bootlin.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241107170255.1058124-1-maxime.chevallier@bootlin.com> References: <20241107170255.1058124-1-maxime.chevallier@bootlin.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-GND-Sasl: maxime.chevallier@bootlin.com X-Patchwork-Delegate: kuba@kernel.org The frame length check is configured when the phy interface is setup. However, it's configured according to an internal flag that is always false. So, just make so that we disable the relevant bit in the MACCFG2 register upon accessing it for other MAC configuration operations. Signed-off-by: Maxime Chevallier Reviewed-by: Andrew Lunn --- drivers/net/ethernet/freescale/ucc_geth.c | 21 +++------------------ drivers/net/ethernet/freescale/ucc_geth.h | 1 - 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c index 13b8f8401c81..052f06d6f312 100644 --- a/drivers/net/ethernet/freescale/ucc_geth.c +++ b/drivers/net/ethernet/freescale/ucc_geth.c @@ -1205,22 +1205,6 @@ static int init_mac_station_addr_regs(u8 address_byte_0, return 0; } -static int init_check_frame_length_mode(int length_check, - u32 __iomem *maccfg2_register) -{ - u32 value = 0; - - value = in_be32(maccfg2_register); - - if (length_check) - value |= MACCFG2_LC; - else - value &= ~MACCFG2_LC; - - out_be32(maccfg2_register, value); - return 0; -} - static int init_preamble_length(u8 preamble_length, u32 __iomem *maccfg2_register) { @@ -1304,6 +1288,9 @@ static int adjust_enet_interface(struct ucc_geth_private *ugeth) /* Set MACCFG2 */ maccfg2 = in_be32(&ug_regs->maccfg2); + + /* Disable frame length check */ + maccfg2 &= ~MACCFG2_LC; maccfg2 &= ~MACCFG2_INTERFACE_MODE_MASK; if ((ugeth->max_speed == SPEED_10) || (ugeth->max_speed == SPEED_100)) @@ -1365,8 +1352,6 @@ static int adjust_enet_interface(struct ucc_geth_private *ugeth) put_device(&tbiphy->mdio.dev); } - init_check_frame_length_mode(ug_info->lengthCheckRx, &ug_regs->maccfg2); - ret_val = init_preamble_length(ug_info->prel, &ug_regs->maccfg2); if (ret_val != 0) { if (netif_msg_probe(ugeth)) diff --git a/drivers/net/ethernet/freescale/ucc_geth.h b/drivers/net/ethernet/freescale/ucc_geth.h index c08a56b7c9fe..11e490398f18 100644 --- a/drivers/net/ethernet/freescale/ucc_geth.h +++ b/drivers/net/ethernet/freescale/ucc_geth.h @@ -1088,7 +1088,6 @@ struct ucc_geth_info { u8 miminumInterFrameGapEnforcement; u8 backToBackInterFrameGap; int ipAddressAlignment; - int lengthCheckRx; u32 mblinterval; u16 nortsrbytetime; u8 fracsiz;