summaryrefslogtreecommitdiff
path: root/drivers/net/can/rockchip/rockchip_canfd-timestamp.c
diff options
context:
space:
mode:
authorMarc Kleine-Budde <mkl@pengutronix.de>2023-10-11 16:02:32 +0200
committerMarc Kleine-Budde <mkl@pengutronix.de>2024-09-04 14:41:51 +0200
commitff60bfbaf67f219c634cfe89a52250efe8e600d0 (patch)
tree38c5b3ac398d66c4ce9a062d276f813040c9baaf /drivers/net/can/rockchip/rockchip_canfd-timestamp.c
parent8b2f4d01f56c99491f6f107f7a03fedcfb9d2d52 (diff)
can: rockchip_canfd: add driver for Rockchip CAN-FD controller
Add driver for the Rockchip CAN-FD controller. The IP core on the rk3568v2 SoC has 12 documented errata. Corrections for these errata will be added in the upcoming patches. Since several workarounds are required for the TX path, only add the base driver that only implements the RX path. Although the RX path implements CAN-FD support, it's not activated in ctrlmode_supported, as the IP core in the rk3568v2 has problems with receiving or sending certain CAN-FD frames. Tested-by: Alibek Omarov <a1ba.omarov@gmail.com> Acked-by: Heiko Stuebner <heiko@sntech.de> Link: https://patch.msgid.link/20240904-rockchip-canfd-v5-4-8ae22bcb27cc@pengutronix.de Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/can/rockchip/rockchip_canfd-timestamp.c')
-rw-r--r--drivers/net/can/rockchip/rockchip_canfd-timestamp.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/net/can/rockchip/rockchip_canfd-timestamp.c b/drivers/net/can/rockchip/rockchip_canfd-timestamp.c
new file mode 100644
index 000000000000..9301b3ceceb0
--- /dev/null
+++ b/drivers/net/can/rockchip/rockchip_canfd-timestamp.c
@@ -0,0 +1,15 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// Copyright (c) 2023, 2024 Pengutronix,
+// Marc Kleine-Budde <kernel@pengutronix.de>
+//
+
+#include "rockchip_canfd.h"
+
+void rkcanfd_timestamp_init(struct rkcanfd_priv *priv)
+{
+ u32 reg;
+
+ reg = RKCANFD_REG_TIMESTAMP_CTRL_TIME_BASE_COUNTER_ENABLE;
+ rkcanfd_write(priv, RKCANFD_REG_TIMESTAMP_CTRL, reg);
+}