* [PATCH v2 0/7] Tegra SoC specific Video Input updates
@ 2026-11-25 11:26 Svyatoslav Ryhel
2026-11-25 11:26 ` [PATCH v2 1/7] dt-bindings: display: tegra: Remove Tegra30 fallback Svyatoslav Ryhel
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: Svyatoslav Ryhel @ 2026-11-25 11:26 UTC (permalink / raw)
To: Thierry Reding, Jonathan Hunter, Sowjanya Komatineni,
Luca Ceresoli, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Mauro Carvalho Chehab, Greg Kroah-Hartman, Svyatoslav Ryhel,
Mikko Perttunen, Hans Verkuil
Cc: linux-media, linux-tegra, dri-devel, devicetree, linux-kernel,
linux-staging
This patchset contains various SoC specific updates for Tegra Video
Input driver:
1. Fixes for Tegra20 and Tegra30 VI configuration (clock adjustments)
2. Moves Tegra210 specific code into tegra210.c from csi.c
3. Addition of Tegra114 CSI support
All changes were tested on:
LG Optimus Vu (P895) Tegra30 device:
- MT9M114 front sensor with complex topology and irregular pad mapping
- IMX111 rear sensor which has simple pixel array and a single pad
ASUS Transformer TF701T Tegra114 device:
- same MT9M114 front sensor
- OV5693 rear sensor which has simple pixel array and a single pad
Nvidia Tegra Note 7 (P1988) Tegra114 device:
- OV5693 rear sensor
They all work and produce images.
The "ARM: tegra: Remove fallback compatible from Tegra30 VI node"
should be applied with "dt-bindings: display: tegra: Remove Tegra30 fallback"
This patchset is based on
https://lore.kernel.org/lkml/20261125110750.223628-1-clamor95@gmail.com/T/#m46981c261c3178126ce806aabddcc38cc33f747e
---
Changes in v2:
- "staging: media: tegra-video: Move driver to media/platform/nvidia"
moved into media-device conversion
- dropped:
"media: tegra-video: vi: Switch to media_entity_remote_source_pad_unique() helper"
"media: tegra-video: vi: Use entity function to check subdev type"
"media: tegra-video: vi: Adjust pad assignment logic"
- fixed schema clock-names configuration for Tegra30 and Tegra114
- added "media: tegra-video: Move Tegra210-specific functions from common CSI"
(Move and staticize the tegra_csi_error_recover() and
tegra_csi_calc_settle_time() helpers from the common CSI file into the
Tegra210-specific code)
Link to v1: https://lore.kernel.org/lkml/20261113161819.36847-1-clamor95@gmail.com/
---
Svyatoslav Ryhel (7):
dt-bindings: display: tegra: Remove Tegra30 fallback
media: tegra-video: vi: Diverge Tegra20 and Tegra30 VI SoC
descriptions
media: tegra-video: Move Tegra210-specific functions from common CSI
dt-bindings: display: tegra: Document Tegra114 CSI
media: tegra-video: Add CSI support for Tegra114
ARM: tegra: Remove fallback compatible from Tegra30 VI node
ARM: tegra: Add CSI node for Tegra114
.../display/tegra/nvidia,tegra20-csi.yaml | 37 +++-
.../display/tegra/nvidia,tegra20-vi.yaml | 5 +-
arch/arm/boot/dts/nvidia/tegra114.dtsi | 34 +++-
arch/arm/boot/dts/nvidia/tegra30.dtsi | 2 +-
.../platform/nvidia/tegra-video/Makefile | 1 +
.../media/platform/nvidia/tegra-video/csi.c | 75 +-------
.../media/platform/nvidia/tegra-video/csi.h | 11 +-
.../platform/nvidia/tegra-video/tegra20.c | 171 ++++++++++++++++--
.../platform/nvidia/tegra-video/tegra210.c | 71 ++++++++
.../media/platform/nvidia/tegra-video/vi.c | 8 +-
.../media/platform/nvidia/tegra-video/vi.h | 8 +-
.../media/platform/nvidia/tegra-video/video.c | 7 +-
12 files changed, 324 insertions(+), 106 deletions(-)
--
2.53.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 1/7] dt-bindings: display: tegra: Remove Tegra30 fallback
2026-11-25 11:26 [PATCH v2 0/7] Tegra SoC specific Video Input updates Svyatoslav Ryhel
@ 2026-11-25 11:26 ` Svyatoslav Ryhel
2026-11-25 11:26 ` [PATCH v2 2/7] media: tegra-video: vi: Diverge Tegra20 and Tegra30 VI SoC descriptions Svyatoslav Ryhel
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Svyatoslav Ryhel @ 2026-11-25 11:26 UTC (permalink / raw)
To: Thierry Reding, Jonathan Hunter, Sowjanya Komatineni,
Luca Ceresoli, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Mauro Carvalho Chehab, Greg Kroah-Hartman, Svyatoslav Ryhel,
Mikko Perttunen, Hans Verkuil
Cc: linux-media, linux-tegra, dri-devel, devicetree, linux-kernel,
linux-staging
After further investigation, I have found that Tegra30 requires a slightly
different programming model than Tegra20—principally, the maximum VI clock
differs by nearly a factor of two. Additionally, Tegra30 does not require
the APB_MISC workaround.
Therefore, remove the fallback compatible and add a dedicated compatible
for Tegra30 VI.
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
---
.../devicetree/bindings/display/tegra/nvidia,tegra20-vi.yaml | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-vi.yaml b/Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-vi.yaml
index bb138277d5e8c..2d5538a1804f9 100644
--- a/Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-vi.yaml
+++ b/Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-vi.yaml
@@ -18,16 +18,13 @@ properties:
oneOf:
- enum:
- nvidia,tegra20-vi
+ - nvidia,tegra30-vi
- nvidia,tegra114-vi
- nvidia,tegra124-vi
- nvidia,tegra210-vi
- nvidia,tegra186-vi
- nvidia,tegra194-vi
- - items:
- - const: nvidia,tegra30-vi
- - const: nvidia,tegra20-vi
-
- items:
- const: nvidia,tegra132-vi
- const: nvidia,tegra124-vi
--
2.53.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 2/7] media: tegra-video: vi: Diverge Tegra20 and Tegra30 VI SoC descriptions
2026-11-25 11:26 [PATCH v2 0/7] Tegra SoC specific Video Input updates Svyatoslav Ryhel
2026-11-25 11:26 ` [PATCH v2 1/7] dt-bindings: display: tegra: Remove Tegra30 fallback Svyatoslav Ryhel
@ 2026-11-25 11:26 ` Svyatoslav Ryhel
2026-11-25 11:26 ` [PATCH v2 3/7] media: tegra-video: Move Tegra210-specific functions from common CSI Svyatoslav Ryhel
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Svyatoslav Ryhel @ 2026-11-25 11:26 UTC (permalink / raw)
To: Thierry Reding, Jonathan Hunter, Sowjanya Komatineni,
Luca Ceresoli, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Mauro Carvalho Chehab, Greg Kroah-Hartman, Svyatoslav Ryhel,
Mikko Perttunen, Hans Verkuil
Cc: linux-media, linux-tegra, dri-devel, devicetree, linux-kernel,
linux-staging
Further investigation shows that the current maximum VI clock rate is too
high for Tegra20 and is better suited for Tegra30. The correct clock
frequency for Tegra20 should be 150 MHz, as it was set prior to the
addition of Tegra30 VI support — a value backed up by the current Tegra20
peripheral OPP table. Tegra30 supports up to 470 MHz for the VI clock,
but this rate is available only on higher-end Tegra30 SoC variants. The
highest clock rate supported across all SoC variants is 300 MHz.
Diverge the Tegra20 and Tegra30 VI SoC descriptions to account for maximum VI
clock limits, setting 150 MHz for Tegra20 and 300 MHz for Tegra30.
Additionally, remove the APB_MISC workaround for Tegra30, as it is Tegra20
specific.
Fixes: 071fa83ded5e ("staging: media: tegra-video: tegra20: increase maximum VI clock frequency")
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
---
.../platform/nvidia/tegra-video/tegra20.c | 22 ++++++++++++++++++-
.../media/platform/nvidia/tegra-video/vi.c | 5 ++++-
.../media/platform/nvidia/tegra-video/vi.h | 5 ++++-
.../media/platform/nvidia/tegra-video/video.c | 3 ++-
4 files changed, 31 insertions(+), 4 deletions(-)
diff --git a/drivers/media/platform/nvidia/tegra-video/tegra20.c b/drivers/media/platform/nvidia/tegra-video/tegra20.c
index f8d2b5e1b4131..c8a8fb3cbba0f 100644
--- a/drivers/media/platform/nvidia/tegra-video/tegra20.c
+++ b/drivers/media/platform/nvidia/tegra-video/tegra20.c
@@ -825,6 +825,15 @@ static const struct tegra_vi_ops tegra20_vi_ops = {
.vi_stop_streaming = tegra20_vi_stop_streaming,
};
+static const struct tegra_vi_ops tegra30_vi_ops = {
+ .channel_host1x_syncpt_init = tegra20_channel_host1x_syncpt_init,
+ .channel_host1x_syncpt_free = tegra20_channel_host1x_syncpt_free,
+ .vi_fmt_align = tegra20_fmt_align,
+ .channel_queue_setup = tegra20_channel_queue_setup,
+ .vi_start_streaming = tegra20_vi_start_streaming,
+ .vi_stop_streaming = tegra20_vi_stop_streaming,
+};
+
#define TEGRA20_VIDEO_FMT(DATA_TYPE, BIT_WIDTH, MBUS_CODE, BPP, FOURCC) \
{ \
.img_dt = TEGRA_IMAGE_DT_##DATA_TYPE, \
@@ -868,7 +877,18 @@ const struct tegra_vi_soc tegra20_vi_soc = {
.ops = &tegra20_vi_ops,
.hw_revision = 1,
.vi_max_channels = 2, /* TEGRA_VI_OUT_1 and TEGRA_VI_OUT_2 */
- .vi_max_clk_hz = 450000000,
+ .vi_max_clk_hz = 150000000,
+ .has_h_v_flip = true,
+};
+
+const struct tegra_vi_soc tegra30_vi_soc = {
+ .video_formats = tegra20_video_formats,
+ .nformats = ARRAY_SIZE(tegra20_video_formats),
+ .default_video_format = &tegra20_video_formats[0],
+ .ops = &tegra30_vi_ops,
+ .hw_revision = 1,
+ .vi_max_channels = 2,
+ .vi_max_clk_hz = 300000000,
.has_h_v_flip = true,
};
diff --git a/drivers/media/platform/nvidia/tegra-video/vi.c b/drivers/media/platform/nvidia/tegra-video/vi.c
index 98411c3f4a037..52384af92d8a6 100644
--- a/drivers/media/platform/nvidia/tegra-video/vi.c
+++ b/drivers/media/platform/nvidia/tegra-video/vi.c
@@ -1408,9 +1408,12 @@ static void tegra_vi_remove(struct platform_device *pdev)
}
static const struct of_device_id tegra_vi_of_id_table[] = {
-#if defined(CONFIG_ARCH_TEGRA_2x_SOC) || defined(CONFIG_ARCH_TEGRA_3x_SOC)
+#if defined(CONFIG_ARCH_TEGRA_2x_SOC)
{ .compatible = "nvidia,tegra20-vi", .data = &tegra20_vi_soc },
#endif
+#if defined(CONFIG_ARCH_TEGRA_3x_SOC)
+ { .compatible = "nvidia,tegra30-vi", .data = &tegra30_vi_soc },
+#endif
#if defined(CONFIG_ARCH_TEGRA_210_SOC)
{ .compatible = "nvidia,tegra210-vi", .data = &tegra210_vi_soc },
#endif
diff --git a/drivers/media/platform/nvidia/tegra-video/vi.h b/drivers/media/platform/nvidia/tegra-video/vi.h
index 44893c5c6e651..965357ebaf0a3 100644
--- a/drivers/media/platform/nvidia/tegra-video/vi.h
+++ b/drivers/media/platform/nvidia/tegra-video/vi.h
@@ -291,9 +291,12 @@ struct tegra_video_format {
u32 fourcc;
};
-#if defined(CONFIG_ARCH_TEGRA_2x_SOC) || defined(CONFIG_ARCH_TEGRA_3x_SOC)
+#if defined(CONFIG_ARCH_TEGRA_2x_SOC)
extern const struct tegra_vi_soc tegra20_vi_soc;
#endif
+#if defined(CONFIG_ARCH_TEGRA_3x_SOC)
+extern const struct tegra_vi_soc tegra30_vi_soc;
+#endif
#if defined(CONFIG_ARCH_TEGRA_210_SOC)
extern const struct tegra_vi_soc tegra210_vi_soc;
#endif
diff --git a/drivers/media/platform/nvidia/tegra-video/video.c b/drivers/media/platform/nvidia/tegra-video/video.c
index 2e84385708bac..d483fb709d127 100644
--- a/drivers/media/platform/nvidia/tegra-video/video.c
+++ b/drivers/media/platform/nvidia/tegra-video/video.c
@@ -123,13 +123,14 @@ static void host1x_video_remove(struct host1x_device *dev)
static const struct of_device_id host1x_video_subdevs[] = {
#if defined(CONFIG_ARCH_TEGRA_2x_SOC) || defined(CONFIG_ARCH_TEGRA_3x_SOC)
{ .compatible = "nvidia,tegra20-vip", },
- { .compatible = "nvidia,tegra20-vi", },
#endif
#if defined(CONFIG_ARCH_TEGRA_2x_SOC)
{ .compatible = "nvidia,tegra20-csi", },
+ { .compatible = "nvidia,tegra20-vi", },
#endif
#if defined(CONFIG_ARCH_TEGRA_3x_SOC)
{ .compatible = "nvidia,tegra30-csi", },
+ { .compatible = "nvidia,tegra30-vi", },
#endif
#if defined(CONFIG_ARCH_TEGRA_210_SOC)
{ .compatible = "nvidia,tegra210-csi", },
--
2.53.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 3/7] media: tegra-video: Move Tegra210-specific functions from common CSI
2026-11-25 11:26 [PATCH v2 0/7] Tegra SoC specific Video Input updates Svyatoslav Ryhel
2026-11-25 11:26 ` [PATCH v2 1/7] dt-bindings: display: tegra: Remove Tegra30 fallback Svyatoslav Ryhel
2026-11-25 11:26 ` [PATCH v2 2/7] media: tegra-video: vi: Diverge Tegra20 and Tegra30 VI SoC descriptions Svyatoslav Ryhel
@ 2026-11-25 11:26 ` Svyatoslav Ryhel
2026-11-25 11:26 ` [PATCH v2 4/7] dt-bindings: display: tegra: Document Tegra114 CSI Svyatoslav Ryhel
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Svyatoslav Ryhel @ 2026-11-25 11:26 UTC (permalink / raw)
To: Thierry Reding, Jonathan Hunter, Sowjanya Komatineni,
Luca Ceresoli, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Mauro Carvalho Chehab, Greg Kroah-Hartman, Svyatoslav Ryhel,
Mikko Perttunen, Hans Verkuil
Cc: linux-media, linux-tegra, dri-devel, devicetree, linux-kernel,
linux-staging
Move and staticize the tegra_csi_error_recover() and
tegra_csi_calc_settle_time() helpers from the common CSI file into the
Tegra210-specific code, since they are used exclusively by the HW rev. 3
Video Input found in Tegra210.
The tegra_csi_calc_settle_time() helper uses a custom MHZ definition
which corresponds to the standard HZ_PER_MHZ. The custom MHZ macro is
replaced by HZ_PER_MHZ, with this change folded into this commit.
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
---
.../media/platform/nvidia/tegra-video/csi.c | 72 -------------------
.../media/platform/nvidia/tegra-video/csi.h | 5 --
.../platform/nvidia/tegra-video/tegra210.c | 70 ++++++++++++++++++
3 files changed, 70 insertions(+), 77 deletions(-)
diff --git a/drivers/media/platform/nvidia/tegra-video/csi.c b/drivers/media/platform/nvidia/tegra-video/csi.c
index aaab884d99f54..fb4b4c0c7cfcd 100644
--- a/drivers/media/platform/nvidia/tegra-video/csi.c
+++ b/drivers/media/platform/nvidia/tegra-video/csi.c
@@ -19,8 +19,6 @@
#include "csi.h"
#include "video.h"
-#define MHZ 1000000
-
/*
* Test pattern generator configuration
*/
@@ -263,65 +261,6 @@ static int tegra_csi_tpg_init_state(struct v4l2_subdev *sd,
return 0;
}
-static unsigned int csi_get_pixel_rate(struct tegra_csi_channel *csi_chan)
-{
- struct v4l2_subdev *subdev = &csi_chan->subdev;
- struct v4l2_subdev *src_subdev;
- struct v4l2_ctrl *ctrl;
- struct media_pad *pad;
-
- pad = media_entity_remote_source_pad_unique(&subdev->entity);
- if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
- dev_err_probe(csi_chan->csi->dev, -ENODEV,
- "failed to get source entity\n");
-
- src_subdev = media_entity_to_v4l2_subdev(pad->entity);
- ctrl = v4l2_ctrl_find(src_subdev->ctrl_handler, V4L2_CID_PIXEL_RATE);
- if (ctrl)
- return v4l2_ctrl_g_ctrl_int64(ctrl);
-
- return 0;
-}
-
-void tegra_csi_calc_settle_time(struct tegra_csi_channel *csi_chan,
- u8 csi_port_num,
- u8 *clk_settle_time,
- u8 *ths_settle_time)
-{
- struct tegra_csi *csi = csi_chan->csi;
- unsigned int cil_clk_mhz;
- unsigned int pix_clk_mhz;
- int clk_idx = (csi_port_num >> 1) + 1;
-
- cil_clk_mhz = clk_get_rate(csi->clks[clk_idx].clk) / MHZ;
- pix_clk_mhz = csi_get_pixel_rate(csi_chan) / MHZ;
-
- /*
- * CLK Settle time is the interval during which HS receiver should
- * ignore any clock lane HS transitions, starting from the beginning
- * of T-CLK-PREPARE.
- * Per DPHY specification, T-CLK-SETTLE should be between 95ns ~ 300ns
- *
- * 95ns < (clk-settle-programmed + 7) * lp clk period < 300ns
- * midpoint = 197.5 ns
- */
- *clk_settle_time = ((95 + 300) * cil_clk_mhz - 14000) / 2000;
-
- /*
- * THS Settle time is the interval during which HS receiver should
- * ignore any data lane HS transitions, starting from the beginning
- * of THS-PREPARE.
- *
- * Per DPHY specification, T-HS-SETTLE should be between 85ns + 6UI
- * and 145ns+10UI.
- * 85ns + 6UI < (Ths-settle-prog + 5) * lp_clk_period < 145ns + 10UI
- * midpoint = 115ns + 8UI
- */
- if (pix_clk_mhz)
- *ths_settle_time = (115 * cil_clk_mhz + 8000 * cil_clk_mhz
- / (2 * pix_clk_mhz) - 5000) / 1000;
-}
-
/*
* Proper CSI configuration
*/
@@ -867,17 +806,6 @@ static int tegra_csi_channel_init(struct tegra_csi_channel *chan)
return 0;
}
-void tegra_csi_error_recover(struct v4l2_subdev *sd)
-{
- struct tegra_csi_channel *csi_chan = to_csi_chan(sd);
- struct tegra_csi *csi = csi_chan->csi;
-
- /* stop streaming during error recovery */
- csi->ops->csi_stop_streaming(csi_chan);
- csi->ops->csi_err_recover(csi_chan);
- csi->ops->csi_start_streaming(csi_chan);
-}
-
static int tegra_csi_channels_init(struct tegra_csi *csi)
{
struct tegra_csi_channel *chan;
diff --git a/drivers/media/platform/nvidia/tegra-video/csi.h b/drivers/media/platform/nvidia/tegra-video/csi.h
index 25aff2581f069..addd1b82685e9 100644
--- a/drivers/media/platform/nvidia/tegra-video/csi.h
+++ b/drivers/media/platform/nvidia/tegra-video/csi.h
@@ -175,9 +175,4 @@ static inline struct tegra_csi_channel *to_csi_chan(struct v4l2_subdev *subdev)
return container_of(subdev, struct tegra_csi_channel, subdev);
}
-void tegra_csi_error_recover(struct v4l2_subdev *subdev);
-void tegra_csi_calc_settle_time(struct tegra_csi_channel *csi_chan,
- u8 csi_port_num,
- u8 *clk_settle_time,
- u8 *ths_settle_time);
#endif
diff --git a/drivers/media/platform/nvidia/tegra-video/tegra210.c b/drivers/media/platform/nvidia/tegra-video/tegra210.c
index 90d984790696f..474f906e8bcc6 100644
--- a/drivers/media/platform/nvidia/tegra-video/tegra210.c
+++ b/drivers/media/platform/nvidia/tegra-video/tegra210.c
@@ -13,6 +13,7 @@
#include <linux/delay.h>
#include <linux/host1x.h>
#include <linux/kthread.h>
+#include <linux/units.h>
#include "csi.h"
#include "vi.h"
@@ -334,6 +335,17 @@ static void tegra_channel_vi_soft_reset(struct tegra_vi_channel *chan,
tegra_vi_write(chan, TEGRA_VI_CFG_CG_CTRL, VI_CG_2ND_LEVEL_EN);
}
+static void tegra_csi_error_recover(struct v4l2_subdev *sd)
+{
+ struct tegra_csi_channel *csi_chan = to_csi_chan(sd);
+ struct tegra_csi *csi = csi_chan->csi;
+
+ /* stop streaming during error recovery */
+ csi->ops->csi_stop_streaming(csi_chan);
+ csi->ops->csi_err_recover(csi_chan);
+ csi->ops->csi_start_streaming(csi_chan);
+}
+
static void tegra_channel_capture_error_recover(struct tegra_vi_channel *chan,
u8 portno)
{
@@ -979,6 +991,64 @@ static void tegra210_csi_error_recover(struct tegra_csi_channel *csi_chan)
tegra210_csi_port_recover(csi_chan, portnos[i]);
}
+static unsigned int csi_get_pixel_rate(struct tegra_csi_channel *csi_chan)
+{
+ struct v4l2_subdev *subdev = &csi_chan->subdev;
+ struct v4l2_subdev *src_subdev;
+ struct v4l2_ctrl *ctrl;
+ struct media_pad *pad;
+
+ pad = media_entity_remote_source_pad_unique(&subdev->entity);
+ if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
+ dev_err_probe(csi_chan->csi->dev, -ENODEV,
+ "failed to get source entity\n");
+
+ src_subdev = media_entity_to_v4l2_subdev(pad->entity);
+ ctrl = v4l2_ctrl_find(src_subdev->ctrl_handler, V4L2_CID_PIXEL_RATE);
+ if (ctrl)
+ return v4l2_ctrl_g_ctrl_int64(ctrl);
+
+ return 0;
+}
+
+static void tegra_csi_calc_settle_time(struct tegra_csi_channel *csi_chan,
+ u8 csi_port_num, u8 *clk_settle_time,
+ u8 *ths_settle_time)
+{
+ struct tegra_csi *csi = csi_chan->csi;
+ unsigned int cil_clk_mhz;
+ unsigned int pix_clk_mhz;
+ int clk_idx = (csi_port_num >> 1) + 1;
+
+ cil_clk_mhz = clk_get_rate(csi->clks[clk_idx].clk) / HZ_PER_MHZ;
+ pix_clk_mhz = csi_get_pixel_rate(csi_chan) / HZ_PER_MHZ;
+
+ /*
+ * CLK Settle time is the interval during which HS receiver should
+ * ignore any clock lane HS transitions, starting from the beginning
+ * of T-CLK-PREPARE.
+ * Per DPHY specification, T-CLK-SETTLE should be between 95ns ~ 300ns
+ *
+ * 95ns < (clk-settle-programmed + 7) * lp clk period < 300ns
+ * midpoint = 197.5 ns
+ */
+ *clk_settle_time = ((95 + 300) * cil_clk_mhz - 14000) / 2000;
+
+ /*
+ * THS Settle time is the interval during which HS receiver should
+ * ignore any data lane HS transitions, starting from the beginning
+ * of THS-PREPARE.
+ *
+ * Per DPHY specification, T-HS-SETTLE should be between 85ns + 6UI
+ * and 145ns+10UI.
+ * 85ns + 6UI < (Ths-settle-prog + 5) * lp_clk_period < 145ns + 10UI
+ * midpoint = 115ns + 8UI
+ */
+ if (pix_clk_mhz)
+ *ths_settle_time = (115 * cil_clk_mhz + 8000 * cil_clk_mhz
+ / (2 * pix_clk_mhz) - 5000) / 1000;
+}
+
static int
tegra210_csi_port_start_streaming(struct tegra_csi_channel *csi_chan,
u8 portno)
--
2.53.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 4/7] dt-bindings: display: tegra: Document Tegra114 CSI
2026-11-25 11:26 [PATCH v2 0/7] Tegra SoC specific Video Input updates Svyatoslav Ryhel
` (2 preceding siblings ...)
2026-11-25 11:26 ` [PATCH v2 3/7] media: tegra-video: Move Tegra210-specific functions from common CSI Svyatoslav Ryhel
@ 2026-11-25 11:26 ` Svyatoslav Ryhel
2026-11-25 11:26 ` [PATCH v2 5/7] media: tegra-video: Add CSI support for Tegra114 Svyatoslav Ryhel
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Svyatoslav Ryhel @ 2026-11-25 11:26 UTC (permalink / raw)
To: Thierry Reding, Jonathan Hunter, Sowjanya Komatineni,
Luca Ceresoli, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Mauro Carvalho Chehab, Greg Kroah-Hartman, Svyatoslav Ryhel,
Mikko Perttunen, Hans Verkuil
Cc: linux-media, linux-tegra, dri-devel, devicetree, linux-kernel,
linux-staging
Add a separate compatible string for the Tegra114 CSI, as it has a
different programming model, uses three additional clocks, and does not
contain MIPI calibration logic.
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
---
.../display/tegra/nvidia,tegra20-csi.yaml | 37 ++++++++++++++++---
1 file changed, 32 insertions(+), 5 deletions(-)
diff --git a/Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-csi.yaml b/Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-csi.yaml
index a1aea9590769f..6296f3ab1d0ce 100644
--- a/Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-csi.yaml
+++ b/Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-csi.yaml
@@ -14,6 +14,7 @@ properties:
enum:
- nvidia,tegra20-csi
- nvidia,tegra30-csi
+ - nvidia,tegra114-csi
reg:
maxItems: 1
@@ -24,12 +25,12 @@ properties:
- description: module clock
- description: PAD A clock
- description: PAD B clock
+ - description: A/B lanes clock
+ - description: C/D lanes clock
+ - description: E lane clock
clock-names:
- items:
- - const: csi
- - const: csia-pad
- - const: csib-pad
+ minItems: 3
avdd-dsi-csi-supply:
description: DSI/CSI power supply. Must supply 1.2 V.
@@ -121,9 +122,35 @@ allOf:
properties:
clocks:
minItems: 3
+ maxItems: 3
clock-names:
- minItems: 3
+ items:
+ - const: csi
+ - const: csia-pad
+ - const: csib-pad
+
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - nvidia,tegra114-csi
+ then:
+ properties:
+ "#nvidia,mipi-calibrate-cells": false
+
+ clocks:
+ minItems: 6
+
+ clock-names:
+ items:
+ - const: csi
+ - const: csia-pad
+ - const: csib-pad
+ - const: cilab
+ - const: cilcd
+ - const: cile
additionalProperties: false
--
2.53.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 5/7] media: tegra-video: Add CSI support for Tegra114
2026-11-25 11:26 [PATCH v2 0/7] Tegra SoC specific Video Input updates Svyatoslav Ryhel
` (3 preceding siblings ...)
2026-11-25 11:26 ` [PATCH v2 4/7] dt-bindings: display: tegra: Document Tegra114 CSI Svyatoslav Ryhel
@ 2026-11-25 11:26 ` Svyatoslav Ryhel
2026-11-25 11:26 ` [PATCH v2 6/7] ARM: tegra: Remove fallback compatible from Tegra30 VI node Svyatoslav Ryhel
2026-11-25 11:26 ` [PATCH v2 7/7] ARM: tegra: Add CSI node for Tegra114 Svyatoslav Ryhel
6 siblings, 0 replies; 8+ messages in thread
From: Svyatoslav Ryhel @ 2026-11-25 11:26 UTC (permalink / raw)
To: Thierry Reding, Jonathan Hunter, Sowjanya Komatineni,
Luca Ceresoli, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Mauro Carvalho Chehab, Greg Kroah-Hartman, Svyatoslav Ryhel,
Mikko Perttunen, Hans Verkuil
Cc: linux-media, linux-tegra, dri-devel, devicetree, linux-kernel,
linux-staging
The VI implementation used in previous generations is fully compatible
with Tegra114 and remains hardware revision 1, making this a relatively
small patch. Tegra114 supports a higher maximum VI clock frequency of
408 MHz, meaning the Tegra30 compatible cannot be used as a fallback.
The CSI block in Tegra114 is more advanced than the one in Tegra30. It
has three additional lane clocks, both CSI A and B ports have two CIL
pads per port, and the MIPI calibration logic has been moved into a
dedicated block. The Tegra114 CSI also supports an additional CSI-C
output, but since there are no known hardware configurations using it,
it is omitted due to a lack of test hardware.
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
---
.../platform/nvidia/tegra-video/Makefile | 1 +
.../media/platform/nvidia/tegra-video/csi.c | 3 +
.../media/platform/nvidia/tegra-video/csi.h | 6 +
.../platform/nvidia/tegra-video/tegra20.c | 149 ++++++++++++++++--
.../platform/nvidia/tegra-video/tegra210.c | 1 +
.../media/platform/nvidia/tegra-video/vi.c | 3 +
.../media/platform/nvidia/tegra-video/vi.h | 3 +
.../media/platform/nvidia/tegra-video/video.c | 4 +
8 files changed, 156 insertions(+), 14 deletions(-)
diff --git a/drivers/media/platform/nvidia/tegra-video/Makefile b/drivers/media/platform/nvidia/tegra-video/Makefile
index 96380b5dbd8bb..787496ad2f442 100644
--- a/drivers/media/platform/nvidia/tegra-video/Makefile
+++ b/drivers/media/platform/nvidia/tegra-video/Makefile
@@ -7,5 +7,6 @@ tegra-video-objs := \
tegra-video-$(CONFIG_ARCH_TEGRA_2x_SOC) += tegra20.o
tegra-video-$(CONFIG_ARCH_TEGRA_3x_SOC) += tegra20.o
+tegra-video-$(CONFIG_ARCH_TEGRA_114_SOC) += tegra20.o
tegra-video-$(CONFIG_ARCH_TEGRA_210_SOC) += tegra210.o
obj-$(CONFIG_VIDEO_TEGRA) += tegra-video.o
diff --git a/drivers/media/platform/nvidia/tegra-video/csi.c b/drivers/media/platform/nvidia/tegra-video/csi.c
index fb4b4c0c7cfcd..617ca44d23026 100644
--- a/drivers/media/platform/nvidia/tegra-video/csi.c
+++ b/drivers/media/platform/nvidia/tegra-video/csi.c
@@ -1017,6 +1017,9 @@ static const struct of_device_id tegra_csi_of_id_table[] = {
#if defined(CONFIG_ARCH_TEGRA_3x_SOC)
{ .compatible = "nvidia,tegra30-csi", .data = &tegra30_csi_soc },
#endif
+#if defined(CONFIG_ARCH_TEGRA_114_SOC)
+ { .compatible = "nvidia,tegra114-csi", .data = &tegra114_csi_soc },
+#endif
#if defined(CONFIG_ARCH_TEGRA_210_SOC)
{ .compatible = "nvidia,tegra210-csi", .data = &tegra210_csi_soc },
#endif
diff --git a/drivers/media/platform/nvidia/tegra-video/csi.h b/drivers/media/platform/nvidia/tegra-video/csi.h
index addd1b82685e9..51667bba74e0b 100644
--- a/drivers/media/platform/nvidia/tegra-video/csi.h
+++ b/drivers/media/platform/nvidia/tegra-video/csi.h
@@ -119,6 +119,8 @@ struct tegra_csi_ops {
* @num_clks: total clocks count
* @tpg_frmrate_table: csi tpg frame rate table with blanking intervals
* @tpg_frmrate_table_size: size of frame rate table
+ * @has_paired_cil: indicates that cil pads are paired per port, this is
+ * specific for Tegra114 where each port has 2 cil pads
*/
struct tegra_csi_soc {
const struct tegra_csi_ops *ops;
@@ -128,6 +130,7 @@ struct tegra_csi_soc {
unsigned int num_clks;
const struct tpg_framerate *tpg_frmrate_table;
unsigned int tpg_frmrate_table_size;
+ bool has_paired_cil;
};
#if defined(CONFIG_ARCH_TEGRA_2x_SOC)
@@ -136,6 +139,9 @@ extern const struct tegra_csi_soc tegra20_csi_soc;
#if defined(CONFIG_ARCH_TEGRA_3x_SOC)
extern const struct tegra_csi_soc tegra30_csi_soc;
#endif
+#if defined(CONFIG_ARCH_TEGRA_114_SOC)
+extern const struct tegra_csi_soc tegra114_csi_soc;
+#endif
#if defined(CONFIG_ARCH_TEGRA_210_SOC)
extern const struct tegra_csi_soc tegra210_csi_soc;
#endif
diff --git a/drivers/media/platform/nvidia/tegra-video/tegra20.c b/drivers/media/platform/nvidia/tegra-video/tegra20.c
index c8a8fb3cbba0f..31cd503df9fa6 100644
--- a/drivers/media/platform/nvidia/tegra-video/tegra20.c
+++ b/drivers/media/platform/nvidia/tegra-video/tegra20.c
@@ -217,8 +217,21 @@ enum tegra_vi_out {
#define CSI_B_PHY_CIL_ENABLE (0x1 << 16)
#define CSI_B_PHY_CIL_DISABLE (0x2 << 16)
#define CSI_B_PHY_CIL_ENABLE_MASK (0x3 << 16)
+#define CSI_C_PHY_CIL_NOP (0x0 << 20)
+#define CSI_C_PHY_CIL_ENABLE (0x1 << 20)
+#define CSI_C_PHY_CIL_DISABLE (0x2 << 20)
+#define CSI_C_PHY_CIL_ENABLE_MASK (0x3 << 20)
+#define CSI_D_PHY_CIL_NOP (0x0 << 24)
+#define CSI_D_PHY_CIL_ENABLE (0x1 << 24)
+#define CSI_D_PHY_CIL_DISABLE (0x2 << 24)
+#define CSI_D_PHY_CIL_ENABLE_MASK (0x3 << 24)
+#define CSI_E_PHY_CIL_NOP (0x0 << 28)
+#define CSI_E_PHY_CIL_ENABLE (0x1 << 28)
+#define CSI_E_PHY_CIL_DISABLE (0x2 << 28)
+#define CSI_E_PHY_CIL_ENABLE_MASK (0x3 << 28)
#define TEGRA_CSI_PHY_CIL_CONTROL0(n) (0x006c + (n) * 4)
#define CSI_CONTINUOUS_CLOCK_MODE_ENABLE BIT(5)
+#define CSI_DEFAULT_CLOCK_SETTLE_TIME 0x5
#define TEGRA_CSI_CSI_PIXEL_PARSER_STATUS 0x0078
#define TEGRA_CSI_CSI_CIL_STATUS 0x007c
#define CSI_MIPI_AUTO_CAL_DONE BIT(15)
@@ -262,6 +275,19 @@ enum tegra_vi_out {
#define CSI_PAD_TERM_REF(n) (((n) & 0x7) << 0)
#define TEGRA_CSI_CSI_CILA_STATUS 0x00d8
#define TEGRA_CSI_CSI_CILB_STATUS 0x00dc
+#define TEGRA_CSI_CSI_CILC_STATUS 0x00e4
+#define TEGRA_CSI_CSI_CILD_STATUS 0x00e8
+#define TEGRA_CSI_PHY_CILC_CONTROL0 0x00f8
+#define TEGRA_CSI_PHY_CILD_CONTROL0 0x00fc
+#define TEGRA_CSI_PHY_CILE_CONTROL0 0x010c
+#define TEGRA_CSI_CSI_CIL_STATUS_2 0x0110
+#define TEGRA_CSI_CSI_CIL_INTERRUPT_MASK_2 0x0114
+#define TEGRA_CSI_CILC_PAD_CONFIG0 0x0128
+#define TEGRA_CSI_CILC_PAD_CONFIG1 0x012c
+#define TEGRA_CSI_CILD_PAD_CONFIG0 0x0130
+#define TEGRA_CSI_CILD_PAD_CONFIG1 0x0134
+#define TEGRA_CSI_CILE_PAD_CONFIG0 0x0138
+#define TEGRA_CSI_CILE_PAD_CONFIG1 0x013c
/* --------------------------------------------------------------------------
* Read and Write helpers
@@ -892,6 +918,17 @@ const struct tegra_vi_soc tegra30_vi_soc = {
.has_h_v_flip = true,
};
+const struct tegra_vi_soc tegra114_vi_soc = {
+ .video_formats = tegra20_video_formats,
+ .nformats = ARRAY_SIZE(tegra20_video_formats),
+ .default_video_format = &tegra20_video_formats[0],
+ .ops = &tegra30_vi_ops,
+ .hw_revision = 1,
+ .vi_max_channels = 2,
+ .vi_max_clk_hz = 408000000,
+ .has_h_v_flip = true,
+};
+
/* --------------------------------------------------------------------------
* MIPI Calibration
*/
@@ -1019,6 +1056,8 @@ static const struct tegra_mipi_ops tegra20_mipi_ops = {
*/
static void tegra20_csi_capture_clean(struct tegra_csi_channel *csi_chan)
{
+ struct tegra_csi *csi = csi_chan->csi;
+
tegra20_csi_write(csi_chan, TEGRA_CSI_VI_INPUT_STREAM_CONTROL, 0);
tegra20_csi_write(csi_chan, TEGRA_CSI_HOST_INPUT_STREAM_CONTROL, 0);
@@ -1034,6 +1073,11 @@ static void tegra20_csi_capture_clean(struct tegra_csi_channel *csi_chan)
tegra20_csi_write(csi_chan, TEGRA_CSI_CIL_MIPI_CAL_STATUS, 0);
tegra20_csi_write(csi_chan, TEGRA_CSI_CLKEN_OVERRIDE, 0);
+ if (csi->soc->has_paired_cil) {
+ tegra20_csi_write(csi_chan, TEGRA_CSI_CSI_CIL_STATUS_2, 0);
+ tegra20_csi_write(csi_chan, TEGRA_CSI_CSI_CIL_INTERRUPT_MASK_2, 0);
+ }
+
tegra20_csi_write(csi_chan, TEGRA_CSI_DEBUG_CONTROL,
CSI_DEBUG_CONTROL_CLR_DBG_CNT_0 |
CSI_DEBUG_CONTROL_CLR_DBG_CNT_1 |
@@ -1044,6 +1088,7 @@ static int tegra20_csi_port_start_streaming(struct tegra_csi_channel *csi_chan,
u8 portno)
{
struct tegra_vi_channel *vi_chan = v4l2_get_subdev_hostdata(&csi_chan->subdev);
+ struct tegra_csi *csi = csi_chan->csi;
int width = vi_chan->format.width;
int height = vi_chan->format.height;
u32 data_type = vi_chan->fmtinfo->img_dt;
@@ -1077,9 +1122,30 @@ static int tegra20_csi_port_start_streaming(struct tegra_csi_channel *csi_chan,
tegra20_csi_write(csi_chan, TEGRA_CSI_PIXEL_STREAM_GAP(port), 0);
tegra20_csi_write(csi_chan, TEGRA_CSI_PIXEL_STREAM_PP_COMMAND(port), 0);
tegra20_csi_write(csi_chan, TEGRA_CSI_PIXEL_STREAM_EXPECTED_FRAME(port), 0);
- tegra20_csi_write(csi_chan, TEGRA_CSI_PHY_CIL_CONTROL0(port), 0);
- tegra20_csi_write(csi_chan, TEGRA_CSI_CIL_PAD_CONFIG0(port), 0);
- tegra20_csi_write(csi_chan, TEGRA_CSI_CIL_PAD_CONFIG1(port), 0);
+
+ if (csi->soc->has_paired_cil) {
+ if (port == PORT_A) {
+ tegra20_csi_write(csi_chan, TEGRA_CSI_PHY_CIL_CONTROL0(port), 0);
+ tegra20_csi_write(csi_chan, TEGRA_CSI_CIL_PAD_CONFIG0(port), 0);
+ tegra20_csi_write(csi_chan, TEGRA_CSI_CIL_PAD_CONFIG1(port), 0);
+
+ tegra20_csi_write(csi_chan, TEGRA_CSI_PHY_CIL_CONTROL0(port + 1), 0);
+ tegra20_csi_write(csi_chan, TEGRA_CSI_CIL_PAD_CONFIG0(port + 1), 0);
+ tegra20_csi_write(csi_chan, TEGRA_CSI_CIL_PAD_CONFIG1(port + 1), 0);
+ } else {
+ tegra20_csi_write(csi_chan, TEGRA_CSI_PHY_CILC_CONTROL0, 0);
+ tegra20_csi_write(csi_chan, TEGRA_CSI_CILC_PAD_CONFIG0, 0);
+ tegra20_csi_write(csi_chan, TEGRA_CSI_CILC_PAD_CONFIG1, 0);
+
+ tegra20_csi_write(csi_chan, TEGRA_CSI_PHY_CILD_CONTROL0, 0);
+ tegra20_csi_write(csi_chan, TEGRA_CSI_CILD_PAD_CONFIG0, 0);
+ tegra20_csi_write(csi_chan, TEGRA_CSI_CILD_PAD_CONFIG1, 0);
+ }
+ } else {
+ tegra20_csi_write(csi_chan, TEGRA_CSI_PHY_CIL_CONTROL0(port), 0);
+ tegra20_csi_write(csi_chan, TEGRA_CSI_CIL_PAD_CONFIG0(port), 0);
+ tegra20_csi_write(csi_chan, TEGRA_CSI_CIL_PAD_CONFIG1(port), 0);
+ }
tegra20_vi_write(vi_chan, TEGRA_VI_VI_CORE_CONTROL, BIT(25 + port)); /* CSI_PP_YUV422 */
@@ -1113,9 +1179,18 @@ static int tegra20_csi_port_start_streaming(struct tegra_csi_channel *csi_chan,
CSI_SKIP_PACKET_THRESHOLD(0x3f) |
(csi_chan->numlanes - 1));
- tegra20_csi_write(csi_chan, TEGRA_CSI_PHY_CIL_CONTROL0(port),
- CSI_CONTINUOUS_CLOCK_MODE_ENABLE |
- 0x5); /* Clock settle time */
+ value = CSI_CONTINUOUS_CLOCK_MODE_ENABLE | CSI_DEFAULT_CLOCK_SETTLE_TIME;
+ if (csi->soc->has_paired_cil) {
+ if (port == PORT_A) {
+ tegra20_csi_write(csi_chan, TEGRA_CSI_PHY_CIL_CONTROL0(port), value);
+ tegra20_csi_write(csi_chan, TEGRA_CSI_PHY_CIL_CONTROL0(port + 1), value);
+ } else {
+ tegra20_csi_write(csi_chan, TEGRA_CSI_PHY_CILC_CONTROL0, value);
+ tegra20_csi_write(csi_chan, TEGRA_CSI_PHY_CILD_CONTROL0, value);
+ }
+ } else {
+ tegra20_csi_write(csi_chan, TEGRA_CSI_PHY_CIL_CONTROL0(port), value);
+ }
tegra20_vi_write(vi_chan, TEGRA_VI_CONT_SYNCPT_CSI_PP_FRAME_START(port),
VI_CONT_SYNCPT_OUT_CONTINUOUS_SYNCPT |
@@ -1127,8 +1202,18 @@ static int tegra20_csi_port_start_streaming(struct tegra_csi_channel *csi_chan,
host1x_syncpt_id(vi_chan->mw_ack_sp[0])
<< VI_CONT_SYNCPT_OUT_SYNCPT_IDX_SFT);
- value = (port == PORT_A) ? CSI_A_PHY_CIL_ENABLE | CSI_B_PHY_CIL_DISABLE :
- CSI_B_PHY_CIL_ENABLE | CSI_A_PHY_CIL_DISABLE;
+ if (csi->soc->has_paired_cil) {
+ if (port == PORT_A)
+ value = CSI_A_PHY_CIL_ENABLE | CSI_B_PHY_CIL_ENABLE |
+ CSI_C_PHY_CIL_DISABLE | CSI_D_PHY_CIL_DISABLE;
+ else
+ value = CSI_A_PHY_CIL_DISABLE | CSI_B_PHY_CIL_DISABLE |
+ CSI_C_PHY_CIL_ENABLE | CSI_D_PHY_CIL_ENABLE;
+ } else {
+ value = (port == PORT_A) ? CSI_A_PHY_CIL_ENABLE | CSI_B_PHY_CIL_DISABLE :
+ CSI_B_PHY_CIL_ENABLE | CSI_A_PHY_CIL_DISABLE;
+ }
+
tegra20_csi_write(csi_chan, TEGRA_CSI_PHY_CIL_COMMAND, value);
tegra20_csi_write(csi_chan, TEGRA_CSI_PIXEL_STREAM_PP_COMMAND(port),
@@ -1157,17 +1242,34 @@ static void tegra20_csi_port_stop_streaming(struct tegra_csi_channel *csi_chan,
dev_dbg(csi->dev, "TEGRA_CSI_CSI_CIL_STATUS 0x%08x\n", value);
tegra20_csi_write(csi_chan, TEGRA_CSI_CSI_CIL_STATUS, value);
+ if (csi->soc->has_paired_cil) {
+ value = tegra20_csi_read(csi_chan, TEGRA_CSI_CSI_CIL_STATUS_2);
+ dev_dbg(csi->dev, "TEGRA_CSI_CSI_CIL_STATUS_2 0x%08x\n", value);
+ tegra20_csi_write(csi_chan, TEGRA_CSI_CSI_CIL_STATUS_2, value);
+ }
+
tegra20_csi_write(csi_chan, TEGRA_CSI_PIXEL_STREAM_PP_COMMAND(port),
CSI_PP_START_MARKER_FRAME_MAX(0xf) |
CSI_PP_DISABLE);
- if (csi_chan->numlanes == 4) {
- tegra20_csi_write(csi_chan, TEGRA_CSI_PHY_CIL_COMMAND,
- CSI_A_PHY_CIL_DISABLE | CSI_B_PHY_CIL_DISABLE);
- } else {
- value = (port == PORT_A) ? CSI_A_PHY_CIL_DISABLE | CSI_B_PHY_CIL_NOP :
- CSI_B_PHY_CIL_DISABLE | CSI_A_PHY_CIL_NOP;
+ if (csi->soc->has_paired_cil) {
+ if (port == PORT_A)
+ value = CSI_A_PHY_CIL_DISABLE | CSI_B_PHY_CIL_DISABLE |
+ CSI_C_PHY_CIL_NOP | CSI_D_PHY_CIL_NOP;
+ else
+ value = CSI_A_PHY_CIL_NOP | CSI_B_PHY_CIL_NOP |
+ CSI_C_PHY_CIL_DISABLE | CSI_D_PHY_CIL_DISABLE;
+
tegra20_csi_write(csi_chan, TEGRA_CSI_PHY_CIL_COMMAND, value);
+ } else {
+ if (csi_chan->numlanes == 4) {
+ tegra20_csi_write(csi_chan, TEGRA_CSI_PHY_CIL_COMMAND,
+ CSI_A_PHY_CIL_DISABLE | CSI_B_PHY_CIL_DISABLE);
+ } else {
+ value = (port == PORT_A) ? CSI_A_PHY_CIL_DISABLE | CSI_B_PHY_CIL_NOP :
+ CSI_B_PHY_CIL_DISABLE | CSI_A_PHY_CIL_NOP;
+ tegra20_csi_write(csi_chan, TEGRA_CSI_PHY_CIL_COMMAND, value);
+ }
}
}
@@ -1215,6 +1317,7 @@ const struct tegra_csi_soc tegra20_csi_soc = {
.csi_max_channels = 2, /* CSI-A and CSI-B */
.clk_names = tegra20_csi_clks,
.num_clks = ARRAY_SIZE(tegra20_csi_clks),
+ .has_paired_cil = false,
};
static const char * const tegra30_csi_clks[] = {
@@ -1229,6 +1332,24 @@ const struct tegra_csi_soc tegra30_csi_soc = {
.csi_max_channels = 2, /* CSI-A and CSI-B */
.clk_names = tegra30_csi_clks,
.num_clks = ARRAY_SIZE(tegra30_csi_clks),
+ .has_paired_cil = false,
+};
+
+static const char * const tegra114_csi_clks[] = {
+ "csi",
+ "csia-pad",
+ "csib-pad",
+ "cilab",
+ "cilcd",
+ "cile",
+};
+
+const struct tegra_csi_soc tegra114_csi_soc = {
+ .ops = &tegra20_csi_ops,
+ .csi_max_channels = 2, /* CSI-A and CSI-B */
+ .clk_names = tegra114_csi_clks,
+ .num_clks = ARRAY_SIZE(tegra114_csi_clks),
+ .has_paired_cil = true,
};
/* --------------------------------------------------------------------------
diff --git a/drivers/media/platform/nvidia/tegra-video/tegra210.c b/drivers/media/platform/nvidia/tegra-video/tegra210.c
index 474f906e8bcc6..5b2a798fc5b09 100644
--- a/drivers/media/platform/nvidia/tegra-video/tegra210.c
+++ b/drivers/media/platform/nvidia/tegra-video/tegra210.c
@@ -1304,4 +1304,5 @@ const struct tegra_csi_soc tegra210_csi_soc = {
.num_clks = ARRAY_SIZE(tegra210_csi_cil_clks),
.tpg_frmrate_table = tegra210_tpg_frmrate_table,
.tpg_frmrate_table_size = ARRAY_SIZE(tegra210_tpg_frmrate_table),
+ .has_paired_cil = false,
};
diff --git a/drivers/media/platform/nvidia/tegra-video/vi.c b/drivers/media/platform/nvidia/tegra-video/vi.c
index 52384af92d8a6..3cbec543c5d86 100644
--- a/drivers/media/platform/nvidia/tegra-video/vi.c
+++ b/drivers/media/platform/nvidia/tegra-video/vi.c
@@ -1414,6 +1414,9 @@ static const struct of_device_id tegra_vi_of_id_table[] = {
#if defined(CONFIG_ARCH_TEGRA_3x_SOC)
{ .compatible = "nvidia,tegra30-vi", .data = &tegra30_vi_soc },
#endif
+#if defined(CONFIG_ARCH_TEGRA_114_SOC)
+ { .compatible = "nvidia,tegra114-vi", .data = &tegra114_vi_soc },
+#endif
#if defined(CONFIG_ARCH_TEGRA_210_SOC)
{ .compatible = "nvidia,tegra210-vi", .data = &tegra210_vi_soc },
#endif
diff --git a/drivers/media/platform/nvidia/tegra-video/vi.h b/drivers/media/platform/nvidia/tegra-video/vi.h
index 965357ebaf0a3..3927f1d827ec5 100644
--- a/drivers/media/platform/nvidia/tegra-video/vi.h
+++ b/drivers/media/platform/nvidia/tegra-video/vi.h
@@ -297,6 +297,9 @@ extern const struct tegra_vi_soc tegra20_vi_soc;
#if defined(CONFIG_ARCH_TEGRA_3x_SOC)
extern const struct tegra_vi_soc tegra30_vi_soc;
#endif
+#if defined(CONFIG_ARCH_TEGRA_114_SOC)
+extern const struct tegra_vi_soc tegra114_vi_soc;
+#endif
#if defined(CONFIG_ARCH_TEGRA_210_SOC)
extern const struct tegra_vi_soc tegra210_vi_soc;
#endif
diff --git a/drivers/media/platform/nvidia/tegra-video/video.c b/drivers/media/platform/nvidia/tegra-video/video.c
index d483fb709d127..55c17e7c930a2 100644
--- a/drivers/media/platform/nvidia/tegra-video/video.c
+++ b/drivers/media/platform/nvidia/tegra-video/video.c
@@ -132,6 +132,10 @@ static const struct of_device_id host1x_video_subdevs[] = {
{ .compatible = "nvidia,tegra30-csi", },
{ .compatible = "nvidia,tegra30-vi", },
#endif
+#if defined(CONFIG_ARCH_TEGRA_114_SOC)
+ { .compatible = "nvidia,tegra114-csi", },
+ { .compatible = "nvidia,tegra114-vi", },
+#endif
#if defined(CONFIG_ARCH_TEGRA_210_SOC)
{ .compatible = "nvidia,tegra210-csi", },
{ .compatible = "nvidia,tegra210-vi", },
--
2.53.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 6/7] ARM: tegra: Remove fallback compatible from Tegra30 VI node
2026-11-25 11:26 [PATCH v2 0/7] Tegra SoC specific Video Input updates Svyatoslav Ryhel
` (4 preceding siblings ...)
2026-11-25 11:26 ` [PATCH v2 5/7] media: tegra-video: Add CSI support for Tegra114 Svyatoslav Ryhel
@ 2026-11-25 11:26 ` Svyatoslav Ryhel
2026-11-25 11:26 ` [PATCH v2 7/7] ARM: tegra: Add CSI node for Tegra114 Svyatoslav Ryhel
6 siblings, 0 replies; 8+ messages in thread
From: Svyatoslav Ryhel @ 2026-11-25 11:26 UTC (permalink / raw)
To: Thierry Reding, Jonathan Hunter, Sowjanya Komatineni,
Luca Ceresoli, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Mauro Carvalho Chehab, Greg Kroah-Hartman, Svyatoslav Ryhel,
Mikko Perttunen, Hans Verkuil
Cc: linux-media, linux-tegra, dri-devel, devicetree, linux-kernel,
linux-staging
Tegra30 now has its own specific compatible string for the VI. Remove the
Tegra20 fallback, as it may interfere with the correct configuration of
the device.
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
---
arch/arm/boot/dts/nvidia/tegra30.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/nvidia/tegra30.dtsi b/arch/arm/boot/dts/nvidia/tegra30.dtsi
index 1e51da329f310..e1f66240ae552 100644
--- a/arch/arm/boot/dts/nvidia/tegra30.dtsi
+++ b/arch/arm/boot/dts/nvidia/tegra30.dtsi
@@ -150,7 +150,7 @@ mpe@54040000 {
};
vi@54080000 {
- compatible = "nvidia,tegra30-vi", "nvidia,tegra20-vi";
+ compatible = "nvidia,tegra30-vi";
reg = <0x54080000 0x00000800>;
interrupts = <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&tegra_car TEGRA30_CLK_VI>;
--
2.53.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 7/7] ARM: tegra: Add CSI node for Tegra114
2026-11-25 11:26 [PATCH v2 0/7] Tegra SoC specific Video Input updates Svyatoslav Ryhel
` (5 preceding siblings ...)
2026-11-25 11:26 ` [PATCH v2 6/7] ARM: tegra: Remove fallback compatible from Tegra30 VI node Svyatoslav Ryhel
@ 2026-11-25 11:26 ` Svyatoslav Ryhel
6 siblings, 0 replies; 8+ messages in thread
From: Svyatoslav Ryhel @ 2026-11-25 11:26 UTC (permalink / raw)
To: Thierry Reding, Jonathan Hunter, Sowjanya Komatineni,
Luca Ceresoli, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Mauro Carvalho Chehab, Greg Kroah-Hartman, Svyatoslav Ryhel,
Mikko Perttunen, Hans Verkuil
Cc: linux-media, linux-tegra, dri-devel, devicetree, linux-kernel,
linux-staging
Add CSI node to Tegra114 device tree.
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
---
arch/arm/boot/dts/nvidia/tegra114.dtsi | 34 +++++++++++++++++++++++++-
1 file changed, 33 insertions(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/nvidia/tegra114.dtsi b/arch/arm/boot/dts/nvidia/tegra114.dtsi
index f2766c11ee6c3..61120658f0687 100644
--- a/arch/arm/boot/dts/nvidia/tegra114.dtsi
+++ b/arch/arm/boot/dts/nvidia/tegra114.dtsi
@@ -53,7 +53,7 @@ host1x@50000000 {
vi@54080000 {
compatible = "nvidia,tegra114-vi";
- reg = <0x54080000 0x00040000>;
+ reg = <0x54080000 0x00000800>;
interrupts = <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&tegra_car TEGRA114_CLK_VI>;
resets = <&tegra_car 20>;
@@ -64,6 +64,38 @@ vi@54080000 {
iommus = <&mc TEGRA_SWGROUP_VI>;
status = "disabled";
+
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ ranges = <0x0 0x54080000 0x4000>;
+
+ csi@800 {
+ compatible = "nvidia,tegra114-csi";
+ reg = <0x800 0x200>;
+ clocks = <&tegra_car TEGRA114_CLK_CSI>,
+ <&tegra_car TEGRA114_CLK_CSIA_PAD>,
+ <&tegra_car TEGRA114_CLK_CSIB_PAD>,
+ <&tegra_car TEGRA114_CLK_CILAB>,
+ <&tegra_car TEGRA114_CLK_CILCD>,
+ <&tegra_car TEGRA114_CLK_CILE>;
+ clock-names = "csi", "csia-pad", "csib-pad",
+ "cilab", "cilcd", "cile";
+ power-domains = <&pd_venc>;
+
+ assigned-clocks = <&tegra_car TEGRA114_CLK_CILAB>,
+ <&tegra_car TEGRA114_CLK_CILCD>,
+ <&tegra_car TEGRA114_CLK_CILE>;
+ assigned-clock-parents = <&tegra_car TEGRA114_CLK_PLL_P>,
+ <&tegra_car TEGRA114_CLK_PLL_P>,
+ <&tegra_car TEGRA114_CLK_PLL_P>;
+ assigned-clock-rates = <102000000>, <102000000>, <102000000>;
+
+ status = "disabled";
+
+ #address-cells = <1>;
+ #size-cells = <0>;
+ };
};
epp@540c0000 {
--
2.53.0
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-11-25 11:26 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-25 11:26 [PATCH v2 0/7] Tegra SoC specific Video Input updates Svyatoslav Ryhel
2026-11-25 11:26 ` [PATCH v2 1/7] dt-bindings: display: tegra: Remove Tegra30 fallback Svyatoslav Ryhel
2026-11-25 11:26 ` [PATCH v2 2/7] media: tegra-video: vi: Diverge Tegra20 and Tegra30 VI SoC descriptions Svyatoslav Ryhel
2026-11-25 11:26 ` [PATCH v2 3/7] media: tegra-video: Move Tegra210-specific functions from common CSI Svyatoslav Ryhel
2026-11-25 11:26 ` [PATCH v2 4/7] dt-bindings: display: tegra: Document Tegra114 CSI Svyatoslav Ryhel
2026-11-25 11:26 ` [PATCH v2 5/7] media: tegra-video: Add CSI support for Tegra114 Svyatoslav Ryhel
2026-11-25 11:26 ` [PATCH v2 6/7] ARM: tegra: Remove fallback compatible from Tegra30 VI node Svyatoslav Ryhel
2026-11-25 11:26 ` [PATCH v2 7/7] ARM: tegra: Add CSI node for Tegra114 Svyatoslav Ryhel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®