From patchwork Tue Aug 13 07:42:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: MD Danish Anwar X-Patchwork-Id: 13761490 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 77CF2C52D7C for ; Tue, 13 Aug 2024 07:46:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date :Subject:CC:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=9DxTtPjhqkhtEwby4OxHVrNjHh8UouPTMewaWsgVjB4=; b=uoxbiFwpOj+8fyL2qpRH4bQjAm i9tGXojJsHrh+SgzuWn7RTyyJbR5Y/y1ZFwEeUcQMjZ9h9ZDUu/PCRX9KKPrr7mLrwtKOkc8Af+ly MI8UBjqoryj1FwJ0Qqd3czPJnc3+D/ZBMZDoOjJQ++fm6/Q76mntwSGtsyFuqVcpO7MeDEbtYzrJa reiKRrmHxZ/Mpc2e3gRoBfk62SPYHi7O+o5+YbiVmNZDiqznf9RuTFvahyTFSOkVrAuEGZ9FCYN1K B/oV4eojTVtNtwPpMl1JTaSajv24Ne0Dol/T8EjOI1ErJ2Rot3O27RQHTEae3gB2EDkwqIE4+UvOg LprrIdWw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sdmEA-00000002mCL-24Ue; Tue, 13 Aug 2024 07:45:58 +0000 Received: from lelv0143.ext.ti.com ([198.47.23.248]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sdmBE-00000002lMu-3A2d for linux-arm-kernel@lists.infradead.org; Tue, 13 Aug 2024 07:42:59 +0000 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 47D7gg5Q063915; Tue, 13 Aug 2024 02:42:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1723534962; bh=9DxTtPjhqkhtEwby4OxHVrNjHh8UouPTMewaWsgVjB4=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=SLVP6D50dp3Hrcn0aoGb4CM+i5yLZrYOEtwmsSFtqcYHYJVfojHPaNgpIzqjz24dk a5wwKvAw3b8FSf9M9xwbpFFv6CPXX08a0+BmehZSSoCCVqxipDfXnS03FI+oeKriR6 jmFflWUldDwawhY57G5vl09goqh1Dtm+fa4aLLP8= Received: from DLEE106.ent.ti.com (dlee106.ent.ti.com [157.170.170.36]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 47D7ggcA031434 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 13 Aug 2024 02:42:42 -0500 Received: from DLEE112.ent.ti.com (157.170.170.23) by DLEE106.ent.ti.com (157.170.170.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Tue, 13 Aug 2024 02:42:41 -0500 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DLEE112.ent.ti.com (157.170.170.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Tue, 13 Aug 2024 02:42:42 -0500 Received: from lelv0854.itg.ti.com (lelv0854.itg.ti.com [10.181.64.140]) by lelvsmtp6.itg.ti.com (8.15.2/8.15.2) with ESMTP id 47D7gg84025749; Tue, 13 Aug 2024 02:42:42 -0500 Received: from localhost (danish-tpc.dhcp.ti.com [10.24.69.25]) by lelv0854.itg.ti.com (8.14.7/8.14.7) with ESMTP id 47D7gfEX008731; Tue, 13 Aug 2024 02:42:41 -0500 From: MD Danish Anwar To: Dan Carpenter , Andrew Lunn , Jan Kiszka , Vignesh Raghavendra , Javier Carrasco , Jacob Keller , Diogo Ivo , Simon Horman , Richard Cochran , Paolo Abeni , Jakub Kicinski , Eric Dumazet , "David S. Miller" CC: , , , , Roger Quadros , Subject: [PATCH net-next v2 3/7] net: ti: icssg-prueth: Stop hardcoding def_inc Date: Tue, 13 Aug 2024 13:12:29 +0530 Message-ID: <20240813074233.2473876-4-danishanwar@ti.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240813074233.2473876-1-danishanwar@ti.com> References: <20240813074233.2473876-1-danishanwar@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240813_004256_912449_FEA6091F X-CRM114-Status: GOOD ( 11.91 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The def_inc is stored in icss_iep structure. Currently default increment (ns per clock tick) is hardcoded to 4 (Clock frequency being 250 MHz). Change this to use the iep->def_inc variable as the iep structure is now accessible to the driver files. Signed-off-by: MD Danish Anwar Reviewed-by: Roger Quadros --- drivers/net/ethernet/ti/icssg/icssg_prueth.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/ti/icssg/icssg_prueth.c b/drivers/net/ethernet/ti/icssg/icssg_prueth.c index 613bd8de6eb8..c93071e05c37 100644 --- a/drivers/net/ethernet/ti/icssg/icssg_prueth.c +++ b/drivers/net/ethernet/ti/icssg/icssg_prueth.c @@ -365,7 +365,8 @@ static void prueth_iep_settime(void *clockops_data, u64 ns) sc_desc.cyclecounter0_set = cyclecount & GENMASK(31, 0); sc_desc.cyclecounter1_set = (cyclecount & GENMASK(63, 32)) >> 32; sc_desc.iepcount_set = ns % cycletime; - sc_desc.CMP0_current = cycletime - 4; //Count from 0 to (cycle time)-4 + /* Count from 0 to (cycle time) - emac->iep->def_inc */ + sc_desc.CMP0_current = cycletime - emac->iep->def_inc; memcpy_toio(sc_descp, &sc_desc, sizeof(sc_desc));