can: rockchip_canfd: add support for rk3568v3
authorMarc Kleine-Budde <mkl@pengutronix.de>
Sun, 19 May 2024 13:25:25 +0000 (15:25 +0200)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Wed, 4 Sep 2024 12:41:51 +0000 (14:41 +0200)
Add the support for the rk3568v3 SoC, the CAN-FD IP core has 7
documented errata.

Tested-by: Alibek Omarov <a1ba.omarov@gmail.com>
Acked-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patch.msgid.link/20240904-rockchip-canfd-v5-7-8ae22bcb27cc@pengutronix.de
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/rockchip/rockchip_canfd-core.c
drivers/net/can/rockchip/rockchip_canfd.h

index 61de6f8..40911bb 100644 (file)
@@ -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 "<unknown>";
@@ -764,6 +781,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 */
        },
index 7321027..9b44633 100644 (file)
 
 enum rkcanfd_model {
        RKCANFD_MODEL_RK3568V2 = 0x35682,
+       RKCANFD_MODEL_RK3568V3 = 0x35683,
 };
 
 struct rkcanfd_devtype_data {