From patchwork Tue Dec 19 17:45:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Diogo Ivo X-Patchwork-Id: 13498724 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 A5C0BC46CA2 for ; Tue, 19 Dec 2023 17:47:18 +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=KCR+NQIaZ8Y+l/n7W2Y1c/b6F4txu+rJM4qOUwzz/3E=; b=CjOy1UdAb7q9IA VGjJ9F99PbXhz/BJyFz0gnbFSbS/8jWiD9qJyAWNG7KZBk/4v2yL7TgWmxShll6HHITcH5WJnTYFw D8Q4Dq/hUW6IcyhXXBEDB1wFhuJC7c+WFPeyQnf9s49BkOsaKayhN29E7N3Fe0yuI6y1S39Y1olY9 r02deaojJm1HdwRqJbx6Gau93SECQlVVv7YK2qmsVhgcfY6IoxD14vDGsfZv4Skv4qIjKQDtT+jzh 0qMPERyq9QIAQlnL7293fsXX52gVDMYenJt2DT5lmaDApaTSYujNFbNCiQf7voTZBO7rSYvxx+zcV z7T0zgGpcY1EtcKNjJXQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rFeBC-00F1ON-2g; Tue, 19 Dec 2023 17:46:54 +0000 Received: from mta-65-228.siemens.flowmailer.net ([185.136.65.228]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rFeAs-00F0zX-2C for linux-arm-kernel@lists.infradead.org; Tue, 19 Dec 2023 17:46:37 +0000 Received: by mta-65-228.siemens.flowmailer.net with ESMTPSA id 20231219174629a4cffa53a8e96ed7f0 for ; Tue, 19 Dec 2023 18:46:29 +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=8sQbeCmWiLFomVY+kxivPzriHLrsmhcfUL/M14qU9XY=; b=EZICCefAuH6CxyplmW1RRn8rSciVnFdivmefU/yU8lhzq0GfppcXncqCy+hLNH6WhtDmcP e1qbgRvlBKzyM2isInFlE5MHN5Gn6f9zF5W70B19qHlqwL5eMVhmju8Icj/1HxUf87GjJk8v Ka8RQzS6vj8fY13maNxLQ336AAxf8=; 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, grygorii.strashko@ti.com, linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org Cc: Diogo Ivo , Jan Kiszka Subject: [RFC PATCH net-next 3/8] net: ti: icssg-prueth: add SR1.0-specific configuration bits Date: Tue, 19 Dec 2023 17:45:41 +0000 Message-ID: <20231219174548.3481-4-diogo.ivo@siemens.com> In-Reply-To: <20231219174548.3481-1-diogo.ivo@siemens.com> References: <20231219174548.3481-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-20231219_094634_885109_8F6D9036 X-CRM114-Status: UNSURE ( 9.97 ) X-CRM114-Notice: Please train this message. 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 fields to differentiate between SR1.0 and SR2.0 in the driver as well as the structures necessary 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 --- drivers/net/ethernet/ti/icssg/icssg_prueth.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/net/ethernet/ti/icssg/icssg_prueth.h b/drivers/net/ethernet/ti/icssg/icssg_prueth.h index 8b6d6b497010..1bdd3d301fde 100644 --- a/drivers/net/ethernet/ti/icssg/icssg_prueth.h +++ b/drivers/net/ethernet/ti/icssg/icssg_prueth.h @@ -127,6 +127,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; @@ -155,6 +156,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 */ @@ -182,10 +187,12 @@ struct prueth_emac { * struct prueth_pdata - PRUeth platform data * @fdqring_mode: Free desc queue mode * @quirk_10m_link_issue: 10M link detect errata + * @is_sr1: device is SR1.0 */ struct prueth_pdata { enum k3_ring_mode fdqring_mode; u32 quirk_10m_link_issue:1; + u32 is_sr1:1; }; /** @@ -224,6 +231,7 @@ struct prueth { struct device_node *eth_node[PRUETH_NUM_MACS]; struct prueth_emac *emac[PRUETH_NUM_MACS]; struct net_device *registered_netdevs[PRUETH_NUM_MACS]; + struct icssg_config_sr1 config[PRUSS_NUM_PRUS]; struct regmap *miig_rt; struct regmap *mii_rt; @@ -236,6 +244,13 @@ struct prueth { struct icss_iep *iep1; }; +struct emac_tx_ts_response_sr1 { + u32 lo_ts; + u32 hi_ts; + u32 reserved; + u32 cookie; +}; + struct emac_tx_ts_response { u32 reserved[2]; u32 cookie;