From patchwork Tue Mar 26 11:06:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Diogo Ivo X-Patchwork-Id: 13603929 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 9E62FCD11DD for ; Tue, 26 Mar 2024 11:08:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id: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=viLQAPzvo+ckkHPAKUgY/+XeULn+vGXPPIRHdT7Mazg=; b=JZ34jpPYCgxFFf mk1MPBKel4mq32Qyfwy7XdTdQfHE49SgjIE+G3u9rjfw3/EdokapPeObqnpy84nQiFwyNUoLdJ/8T ZshSfbbmJ3mItRsfujPiU4k/A4i817al23ShDuQaS6xyZE4V09mVHuSNPbvseYjuVOZJtUqsWJARr RekB3S2Zy0yMgHuqO5UniKHXZK8sQSPv93aFoZo9gxXzfVSuV2s4YG39UCW5sZPrh0Lk6Zz/1IiVA 1vKijP3DTRjCne9lLpb/KE9cnZPy3W3LaAUyL7WswxcTmiI5wTLn3B8G4aLR8wRIkj0Lx/CWIDo2J Bfe2Tr2bYaX/6RuumeZw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rp4eh-00000004B8Y-2TQX; Tue, 26 Mar 2024 11:07:47 +0000 Received: from mta-64-225.siemens.flowmailer.net ([185.136.64.225]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rp4eM-00000004AuW-1G0I for linux-arm-kernel@lists.infradead.org; Tue, 26 Mar 2024 11:07:28 +0000 Received: by mta-64-225.siemens.flowmailer.net with ESMTPSA id 20240326110719fa5c71b432c7667ea8 for ; Tue, 26 Mar 2024 12:07:19 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=diogo.ivo@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=i9EuIKJ+Vnn+Q5+e2Ldg3hHmhPjZ55BBwH6LBJTz9Mk=; b=G4SlJ/tVOhOOm/3rHGNXxXsOXfAJoyfzHXDm4vD3RGn99YWe9XajA0ZmtpsL9upJcWMlrx kG1ZeUyshWQeyAOo27brVwcPKwrDk9E/pLolNDcC3CubiBGnxgXrSKigWjQYJiCNv2i9ncZF 8lGM7dn6BOPQeve8REvYxd5ab4qvc=; From: Diogo Ivo To: danishanwar@ti.com, rogerq@kernel.org, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, andrew@lunn.ch, linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org Cc: Diogo Ivo , jan.kiszka@siemens.com Subject: [PATCH net-next v5 05/10] net: ti: icssg-prueth: Add SR1.0-specific description bits Date: Tue, 26 Mar 2024 11:06:55 +0000 Message-ID: <20240326110709.26165-6-diogo.ivo@siemens.com> In-Reply-To: <20240326110709.26165-1-diogo.ivo@siemens.com> References: <20240326110709.26165-1-diogo.ivo@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1320519:519-21489:flowmailer X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240326_040726_591676_271957BF X-CRM114-Status: GOOD ( 11.70 ) 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 Add a field to distinguish between SR1.0 and SR2.0 in the driver as well as the necessary structures to program SR1.0. Based on the work of Roger Quadros in TI's 5.10 SDK [1]. [1]: https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/tree/?h=ti-linux-5.10.y Co-developed-by: Jan Kiszka Signed-off-by: Jan Kiszka Signed-off-by: Diogo Ivo Reviewed-by: Roger Quadros Reviewed-by: MD Danish Anwar --- Changes in v5: - Added Reviewed-by tag from Danish Changes in v4: - Change cmd_data type to __le32 to eliminate sparse warnings - Add Reviewed-by from Roger (assuming the above change does not invalidate it) drivers/net/ethernet/ti/icssg/icssg_prueth.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/ti/icssg/icssg_prueth.h b/drivers/net/ethernet/ti/icssg/icssg_prueth.h index 5d792e9bade0..c5632a2388a1 100644 --- a/drivers/net/ethernet/ti/icssg/icssg_prueth.h +++ b/drivers/net/ethernet/ti/icssg/icssg_prueth.h @@ -129,6 +129,7 @@ struct prueth_rx_chn { /* data for each emac port */ struct prueth_emac { + bool is_sr1; bool fw_running; struct prueth *prueth; struct net_device *ndev; @@ -157,6 +158,10 @@ struct prueth_emac { int rx_flow_id_base; int tx_ch_num; + /* SR1.0 Management channel */ + struct prueth_rx_chn rx_mgm_chn; + int rx_mgm_flow_id_base; + spinlock_t lock; /* serialize access */ /* TX HW Timestamping */ @@ -167,7 +172,7 @@ struct prueth_emac { u8 cmd_seq; /* shutdown related */ - u32 cmd_data[4]; + __le32 cmd_data[4]; struct completion cmd_complete; /* Mutex to serialize access to firmware command interface */ struct mutex cmd_lock; @@ -251,6 +256,13 @@ struct emac_tx_ts_response { u32 hi_ts; }; +struct emac_tx_ts_response_sr1 { + u32 lo_ts; + u32 hi_ts; + u32 reserved; + u32 cookie; +}; + /* get PRUSS SLICE number from prueth_emac */ static inline int prueth_emac_slice(struct prueth_emac *emac) {