From patchwork Mon Jul 29 13:05:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Kleine-Budde X-Patchwork-Id: 13744934 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 16F8BC3DA4A for ; Mon, 29 Jul 2024 13:13:53 +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:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=k6e/C+PpjEgGdaCCj9f4OBmtjPwaB3u8+lTL5G3ciMM=; b=vNdndRaacEyMtab5MMKhhgK+sl OJiZBo6BA3TYcJ2YWTD9eaRdFaCU+/JmUOLQfRU8nM57L1oU8JXHY0o9P0PG9mT0X8kfq4zKsNh4r rQxMOPd5iqTFbN0kLQferoFgQ4UtSFChKqQL9Zrh+37dokAZFEho6Oxz+OXa+PHzt6twa4h3FG90z uHnDudq37/mciBg0HXpjWYV8IWBSh2JOCSpsFPONaNEDwHd2fTwKE6zjcIfC1TZhvRR01+NIUfc8+ gL7OwevddUlYeRqaiGHCJ8ZkCxJybFUcSnfEglb6it1VfpnutBNicub8xbfpknlUiBNYXG6NanpPd Ue4IqLmA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sYQC8-0000000BO22-08ak; Mon, 29 Jul 2024 13:13:44 +0000 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sYQ5e-0000000BLEC-3wQR for linux-arm-kernel@lists.infradead.org; Mon, 29 Jul 2024 13:07:04 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sYQ5d-0000JV-Nb for linux-arm-kernel@lists.infradead.org; Mon, 29 Jul 2024 15:07:01 +0200 Received: from [2a0a:edc0:0:b01:1d::7b] (helo=bjornoya.blackshift.org) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sYQ5d-00332G-2B for linux-arm-kernel@lists.infradead.org; Mon, 29 Jul 2024 15:07:01 +0200 Received: from dspam.blackshift.org (localhost [127.0.0.1]) by bjornoya.blackshift.org (Postfix) with SMTP id BBD5F310DF1 for ; Mon, 29 Jul 2024 13:07:00 +0000 (UTC) Received: from hardanger.blackshift.org (unknown [172.20.34.65]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by bjornoya.blackshift.org (Postfix) with ESMTPS id 3A13B310D93; Mon, 29 Jul 2024 13:06:51 +0000 (UTC) Received: from [172.20.34.65] (localhost [::1]) by hardanger.blackshift.org (OpenSMTPD) with ESMTP id 3d3deb7a; Mon, 29 Jul 2024 13:06:31 +0000 (UTC) From: Marc Kleine-Budde Date: Mon, 29 Jul 2024 15:05:38 +0200 Subject: [PATCH can-next 07/21] can: rockchip_canfd: add support for rk3568v3 MIME-Version: 1.0 Message-Id: <20240729-rockchip-canfd-v1-7-fa1250fd6be3@pengutronix.de> References: <20240729-rockchip-canfd-v1-0-fa1250fd6be3@pengutronix.de> In-Reply-To: <20240729-rockchip-canfd-v1-0-fa1250fd6be3@pengutronix.de> To: kernel@pengutronix.de, Vincent Mailhol , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner , Philipp Zabel , Elaine Zhang , David Jander Cc: linux-can@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Marc Kleine-Budde X-Mailer: b4 0.15-dev-37811 X-Developer-Signature: v=1; a=openpgp-sha256; l=2433; i=mkl@pengutronix.de; h=from:subject:message-id; bh=z2yadjNJymPA5maKfSyGODDppKc2k/TC+sJTrzWq96Y=; b=owEBbQGS/pANAwAKASg4oj56LbxvAcsmYgBmp5O+ws7SAJLyIe4Go+2uulJCZo5pAvtFSyXxk QEIGesemzWJATMEAAEKAB0WIQRQQLqG4LYE3Sm8Pl8oOKI+ei28bwUCZqeTvgAKCRAoOKI+ei28 b6ULCACTY7pLPKvGmxRhG/GPfALCmf+L46Yi8gSLIttRPhtRKvi1GzurmTFfk9Nch2iuqfyEujo KuAn/dqYBecr+nqlVZuL+KVUPEPZnqb0kRT4C+aKsUvvE4S5qbuS03NGj78JU60TCsHAnAYd5f8 Me5B4At25KRUf8qHhQkwfCNxq773tGxybXTvwtPIeOI+A1RLn2ynrNpl8NUDbsvz+g2e/K4tnAn EsNHXf99lixc7zj/C0lUxOfgIGc9yCWFpcq7rzhe9vXqw7vaAqi/PFhmxyeSHNs2PfaElP/iQU3 1vKrKXuXcNdc/5bkq3OHBpi4zbaif9VFlScySqKVokb+P9Jt X-Developer-Key: i=mkl@pengutronix.de; a=openpgp; fpr=C1400BA0B3989E6FBC7D5B5C2B5EE211C58AEA54 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: mkl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240729_060703_068372_9BEC38BA X-CRM114-Status: GOOD ( 15.88 ) 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 the support for the rk3568v3 SoC, the CAN-FD IP core has 7 documented errata. Signed-off-by: Marc Kleine-Budde --- drivers/net/can/rockchip/rockchip_canfd-core.c | 20 ++++++++++++++++++++ drivers/net/can/rockchip/rockchip_canfd.h | 1 + 2 files changed, 21 insertions(+) diff --git a/drivers/net/can/rockchip/rockchip_canfd-core.c b/drivers/net/can/rockchip/rockchip_canfd-core.c index cc529d5a3028..cd4e951f56d6 100644 --- a/drivers/net/can/rockchip/rockchip_canfd-core.c +++ b/drivers/net/can/rockchip/rockchip_canfd-core.c @@ -35,11 +35,28 @@ static const struct rkcanfd_devtype_data rkcanfd_devtype_data_rk3568v2 = { RKCANFD_QUIRK_CANFD_BROKEN, }; +/* The rk3568 CAN-FD errata sheet as of Tue 07 Nov 2023 11:25:31 +08:00 + * states that only the rk3568v2 is affected by erratum 5, but tests + * with the rk3568v2 and rk3568v3 show that the RX_FIFO_CNT is + * sometimes too high. In contrast to the errata sheet mark rk3568v3 + * as effected by erratum 5, too. + */ +static const struct rkcanfd_devtype_data rkcanfd_devtype_data_rk3568v3 = { + .model = RKCANFD_MODEL_RK3568V3, + .quirks = RKCANFD_QUIRK_RK3568_ERRATUM_1 | RKCANFD_QUIRK_RK3568_ERRATUM_2 | + RKCANFD_QUIRK_RK3568_ERRATUM_5 | RKCANFD_QUIRK_RK3568_ERRATUM_7 | + RKCANFD_QUIRK_RK3568_ERRATUM_8 | RKCANFD_QUIRK_RK3568_ERRATUM_10 | + RKCANFD_QUIRK_RK3568_ERRATUM_11 | RKCANFD_QUIRK_RK3568_ERRATUM_12 | + RKCANFD_QUIRK_CANFD_BROKEN, +}; + static const char *__rkcanfd_get_model_str(enum rkcanfd_model model) { switch (model) { case RKCANFD_MODEL_RK3568V2: return "rk3568v2"; + case RKCANFD_MODEL_RK3568V3: + return "rk3568v3"; } return ""; @@ -770,6 +787,9 @@ static const struct of_device_id rkcanfd_of_match[] = { }, { .compatible = "rockchip,rk3568v2-canfd", .data = &rkcanfd_devtype_data_rk3568v2, + }, { + .compatible = "rockchip,rk3568v3-canfd", + .data = &rkcanfd_devtype_data_rk3568v3, }, { /* sentinel */ }, diff --git a/drivers/net/can/rockchip/rockchip_canfd.h b/drivers/net/can/rockchip/rockchip_canfd.h index 43a6682f3651..c008953ccfc8 100644 --- a/drivers/net/can/rockchip/rockchip_canfd.h +++ b/drivers/net/can/rockchip/rockchip_canfd.h @@ -371,6 +371,7 @@ enum rkcanfd_model { RKCANFD_MODEL_RK3568V2 = 0x35682, + RKCANFD_MODEL_RK3568V3 = 0x35683, }; struct rkcanfd_devtype_data {