From patchwork Tue Mar 5 11:40:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Diogo Ivo X-Patchwork-Id: 13582384 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 AA5C2C54798 for ; Tue, 5 Mar 2024 12:51:15 +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=1z1iMoZXF8oQyRgcquU0jSwEyBUIw+z8mp692i513RM=; b=KF78I0J1NbM7+g /4olOgLRIxU4ptSshRVqodDQIvPA1XOhbiOwNhPRyRXpL3WHKeb+HXcLr4OLIN8fP2fXvYOixf8J/ jdZFM+WQqoKlL/9DnxNyf3NZlKBseizqMSvgLPo61sPIVVUaylrx1dVRALb1lQwrWNaNniWb6zAW2 rzNgiDlighUYd4mhFL0SaBm1dy3ijDgBpztGH8cDSeKZg6IieOYPzE/SxG1KPiFJlyC4wdiWikRz2 ZE1KEvfgrfvSDehgiYOfMa7zI1CDkpKaqQ6XmmxGZKxcnf7cdTDGZPFavc8+R2MoMTXw8lkYwsyNV 0ricdqHk+yq8bWi1tPlg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhUG8-0000000DdLv-3jvb; Tue, 05 Mar 2024 12:51:04 +0000 Received: from mta-64-227.siemens.flowmailer.net ([185.136.64.227]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhTBB-0000000DPbY-1tb4 for linux-arm-kernel@lists.infradead.org; Tue, 05 Mar 2024 11:42:13 +0000 Received: by mta-64-227.siemens.flowmailer.net with ESMTPSA id 2024030511410618a2937db52a61202b for ; Tue, 05 Mar 2024 12:41:06 +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=nN0Ca7xhtbXq2GssHPWBntXxAJeOwM4KuECniTkDiME=; b=G8YGJFRrNAL+bVNK3ZC5N/KgHN1UPv+HakxGu5aO23kjugWgnggfnKyHesA5lGiv8s5HDb X/lQhwORJ6vEdOE00dByB68NpdBtYBZ5RwaSymRmwD72dZROv1RYz3bz/yk58k1c11WMSDiW bYaQ9CX2nBR1EbXHPu//Qn2ZgKQaE=; 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 v4 05/10] net: ti: icssg-prueth: Add SR1.0-specific description bits Date: Tue, 5 Mar 2024 11:40:25 +0000 Message-ID: <20240305114045.388893-6-diogo.ivo@siemens.com> In-Reply-To: <20240305114045.388893-1-diogo.ivo@siemens.com> References: <20240305114045.388893-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-20240305_034158_839958_8CB38FE1 X-CRM114-Status: GOOD ( 12.18 ) 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 --- 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) {