Skip to content

Commit 9ffc30a

Browse files
committed
Merge tag 'tegra-for-5.8-media' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into arm/drivers
media: tegra: Changes for v5.8-rc1 This contains a V4L2 video capture driver for Tegra210. * tag 'tegra-for-5.8-media' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: media: tegra-video: Do not enable COMPILE_TEST MAINTAINERS: correct path in TEGRA VIDEO DRIVER media: tegra-video: Make tegra210_video_formats static MAINTAINERS: Add Tegra Video driver section media: tegra-video: Add Tegra210 Video input driver dt-bindings: i2c: tegra: Document Tegra210 VI I2C dt-bindings: tegra: Add VI and CSI bindings dt-bindings: cpufreq: Add binding for NVIDIA Tegra20/30 dt-bindings: memory: tegra: Add external memory controller binding for Tegra210 dt-bindings: clock: tegra: Remove PMC clock IDs dt-bindings: clock: tegra: Add clock ID for CSI TPG clock Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnd Bergmann <[email protected]>
2 parents 19207ea + ba8f668 commit 9ffc30a

File tree

22 files changed

+3457
-43
lines changed

22 files changed

+3457
-43
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
Binding for NVIDIA Tegra20 CPUFreq
2+
==================================
3+
4+
Required properties:
5+
- clocks: Must contain an entry for the CPU clock.
6+
See ../clocks/clock-bindings.txt for details.
7+
- operating-points-v2: See ../bindings/opp/opp.txt for details.
8+
- #cooling-cells: Should be 2. See ../thermal/thermal.txt for details.
9+
10+
For each opp entry in 'operating-points-v2' table:
11+
- opp-supported-hw: Two bitfields indicating:
12+
On Tegra20:
13+
1. CPU process ID mask
14+
2. SoC speedo ID mask
15+
16+
On Tegra30:
17+
1. CPU process ID mask
18+
2. CPU speedo ID mask
19+
20+
A bitwise AND is performed against these values and if any bit
21+
matches, the OPP gets enabled.
22+
23+
- opp-microvolt: CPU voltage triplet.
24+
25+
Optional properties:
26+
- cpu-supply: Phandle to the CPU power supply.
27+
28+
Example:
29+
regulators {
30+
cpu_reg: regulator0 {
31+
regulator-name = "vdd_cpu";
32+
};
33+
};
34+
35+
cpu0_opp_table: opp_table0 {
36+
compatible = "operating-points-v2";
37+
38+
opp@456000000 {
39+
clock-latency-ns = <125000>;
40+
opp-microvolt = <825000 825000 1125000>;
41+
opp-supported-hw = <0x03 0x0001>;
42+
opp-hz = /bits/ 64 <456000000>;
43+
};
44+
45+
...
46+
};
47+
48+
cpus {
49+
cpu@0 {
50+
compatible = "arm,cortex-a9";
51+
clocks = <&tegra_car TEGRA20_CLK_CCLK>;
52+
operating-points-v2 = <&cpu0_opp_table>;
53+
cpu-supply = <&cpu_reg>;
54+
#cooling-cells = <2>;
55+
};
56+
};

Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.txt

Lines changed: 60 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,30 @@ of the following host1x client modules:
4040

4141
Required properties:
4242
- compatible: "nvidia,tegra<chip>-vi"
43-
- reg: Physical base address and length of the controller's registers.
43+
- reg: Physical base address and length of the controller registers.
4444
- interrupts: The interrupt outputs from the controller.
45-
- clocks: Must contain one entry, for the module clock.
45+
- clocks: clocks: Must contain one entry, for the module clock.
4646
See ../clocks/clock-bindings.txt for details.
47-
- resets: Must contain an entry for each entry in reset-names.
48-
See ../reset/reset.txt for details.
49-
- reset-names: Must include the following entries:
50-
- vi
47+
- Tegra20/Tegra30/Tegra114/Tegra124:
48+
- resets: Must contain an entry for each entry in reset-names.
49+
See ../reset/reset.txt for details.
50+
- reset-names: Must include the following entries:
51+
- vi
52+
- Tegra210:
53+
- power-domains: Must include venc powergate node as vi is in VE partition.
54+
- Tegra210 has CSI part of VI sharing same host interface and register space.
55+
So, VI device node should have CSI child node.
56+
57+
- csi: mipi csi interface to vi
58+
59+
Required properties:
60+
- compatible: "nvidia,tegra210-csi"
61+
- reg: Physical base address offset to parent and length of the controller
62+
registers.
63+
- clocks: Must contain entries csi, cilab, cilcd, cile, csi_tpg clocks.
64+
See ../clocks/clock-bindings.txt for details.
65+
- power-domains: Must include sor powergate node as csicil is in
66+
SOR partition.
5167

5268
- epp: encoder pre-processor
5369

@@ -309,13 +325,44 @@ Example:
309325
reset-names = "mpe";
310326
};
311327

312-
vi {
313-
compatible = "nvidia,tegra20-vi";
314-
reg = <0x54080000 0x00040000>;
315-
interrupts = <0 69 0x04>;
316-
clocks = <&tegra_car TEGRA20_CLK_VI>;
317-
resets = <&tegra_car 100>;
318-
reset-names = "vi";
328+
vi@54080000 {
329+
compatible = "nvidia,tegra210-vi";
330+
reg = <0x0 0x54080000 0x0 0x700>;
331+
interrupts = <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>;
332+
assigned-clocks = <&tegra_car TEGRA210_CLK_VI>;
333+
assigned-clock-parents = <&tegra_car TEGRA210_CLK_PLL_C4_OUT0>;
334+
335+
clocks = <&tegra_car TEGRA210_CLK_VI>;
336+
power-domains = <&pd_venc>;
337+
338+
#address-cells = <1>;
339+
#size-cells = <1>;
340+
341+
ranges = <0x0 0x0 0x54080000 0x2000>;
342+
343+
csi@838 {
344+
compatible = "nvidia,tegra210-csi";
345+
reg = <0x838 0x1300>;
346+
assigned-clocks = <&tegra_car TEGRA210_CLK_CILAB>,
347+
<&tegra_car TEGRA210_CLK_CILCD>,
348+
<&tegra_car TEGRA210_CLK_CILE>,
349+
<&tegra_car TEGRA210_CLK_CSI_TPG>;
350+
assigned-clock-parents = <&tegra_car TEGRA210_CLK_PLL_P>,
351+
<&tegra_car TEGRA210_CLK_PLL_P>,
352+
<&tegra_car TEGRA210_CLK_PLL_P>;
353+
assigned-clock-rates = <102000000>,
354+
<102000000>,
355+
<102000000>,
356+
<972000000>;
357+
358+
clocks = <&tegra_car TEGRA210_CLK_CSI>,
359+
<&tegra_car TEGRA210_CLK_CILAB>,
360+
<&tegra_car TEGRA210_CLK_CILCD>,
361+
<&tegra_car TEGRA210_CLK_CILE>,
362+
<&tegra_car TEGRA210_CLK_CSI_TPG>;
363+
clock-names = "csi", "cilab", "cilcd", "cile", "csi_tpg";
364+
power-domains = <&pd_sor>;
365+
};
319366
};
320367

321368
epp {

Documentation/devicetree/bindings/i2c/nvidia,tegra20-i2c.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ Required properties:
3535
Due to above changes, Tegra114 I2C driver makes incompatible with
3636
previous hardware driver. Hence, tegra114 I2C controller is compatible
3737
with "nvidia,tegra114-i2c".
38+
nvidia,tegra210-i2c-vi: Tegra210 has one I2C controller that is part of the
39+
host1x domain and typically used for camera use-cases. This VI I2C
40+
controller is mostly compatible with the programming model of the
41+
regular I2C controllers with a few exceptions. The I2C registers start
42+
at an offset of 0xc00 (instead of 0), registers are 16 bytes apart
43+
(rather than 4) and the controller does not support slave mode.
3844
- reg: Should contain I2C controller registers physical address and length.
3945
- interrupts: Should contain I2C controller interrupts.
4046
- address-cells: Address cells for I2C device address.
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/memory-controllers/nvidia,tegra210-emc.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: NVIDIA Tegra210 SoC External Memory Controller
8+
9+
maintainers:
10+
- Thierry Reding <[email protected]>
11+
- Jon Hunter <[email protected]>
12+
13+
description: |
14+
The EMC interfaces with the off-chip SDRAM to service the request stream
15+
sent from the memory controller.
16+
17+
properties:
18+
compatible:
19+
const: nvidia,tegra210-emc
20+
21+
reg:
22+
maxItems: 3
23+
24+
clocks:
25+
items:
26+
- description: external memory clock
27+
28+
clock-names:
29+
items:
30+
- const: emc
31+
32+
interrupts:
33+
items:
34+
- description: EMC general interrupt
35+
36+
memory-region:
37+
$ref: /schemas/types.yaml#/definitions/phandle
38+
description:
39+
phandle to a reserved memory region describing the table of EMC
40+
frequencies trained by the firmware
41+
42+
nvidia,memory-controller:
43+
$ref: /schemas/types.yaml#/definitions/phandle
44+
description:
45+
phandle of the memory controller node
46+
47+
required:
48+
- compatible
49+
- reg
50+
- clocks
51+
- clock-names
52+
- nvidia,memory-controller
53+
54+
additionalProperties: false
55+
56+
examples:
57+
- |
58+
#include <dt-bindings/clock/tegra210-car.h>
59+
#include <dt-bindings/interrupt-controller/arm-gic.h>
60+
61+
reserved-memory {
62+
#address-cells = <1>;
63+
#size-cells = <1>;
64+
ranges;
65+
66+
emc_table: emc-table@83400000 {
67+
compatible = "nvidia,tegra210-emc-table";
68+
reg = <0x83400000 0x10000>;
69+
};
70+
};
71+
72+
external-memory-controller@7001b000 {
73+
compatible = "nvidia,tegra210-emc";
74+
reg = <0x7001b000 0x1000>,
75+
<0x7001e000 0x1000>,
76+
<0x7001f000 0x1000>;
77+
clocks = <&tegra_car TEGRA210_CLK_EMC>;
78+
clock-names = "emc";
79+
interrupts = <GIC_SPI 78 IRQ_TYPE_LEVEL_HIGH>;
80+
memory-region = <&emc_table>;
81+
nvidia,memory-controller = <&mc>;
82+
};

MAINTAINERS

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16598,6 +16598,16 @@ M: Laxman Dewangan <[email protected]>
1659816598
S: Supported
1659916599
F: drivers/spi/spi-tegra*
1660016600

16601+
TEGRA VIDEO DRIVER
16602+
M: Thierry Reding <[email protected]>
16603+
M: Jonathan Hunter <[email protected]>
16604+
M: Sowjanya Komatineni <[email protected]>
16605+
16606+
16607+
S: Maintained
16608+
F: Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.txt
16609+
F: drivers/staging/media/tegra-video/
16610+
1660116611
TEGRA XUSB PADCTL DRIVER
1660216612
M: JC Kuo <[email protected]>
1660316613
S: Supported

drivers/staging/media/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ source "drivers/staging/media/sunxi/Kconfig"
3434

3535
source "drivers/staging/media/tegra-vde/Kconfig"
3636

37+
source "drivers/staging/media/tegra-video/Kconfig"
38+
3739
source "drivers/staging/media/ipu3/Kconfig"
3840

3941
source "drivers/staging/media/soc_camera/Kconfig"

drivers/staging/media/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ obj-$(CONFIG_VIDEO_IMX_MEDIA) += imx/
44
obj-$(CONFIG_VIDEO_MESON_VDEC) += meson/vdec/
55
obj-$(CONFIG_VIDEO_OMAP4) += omap4iss/
66
obj-$(CONFIG_VIDEO_SUNXI) += sunxi/
7+
obj-$(CONFIG_VIDEO_TEGRA) += tegra-video/
78
obj-$(CONFIG_TEGRA_VDE) += tegra-vde/
89
obj-$(CONFIG_VIDEO_HANTRO) += hantro/
910
obj-$(CONFIG_VIDEO_IPU3_IMGU) += ipu3/
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# SPDX-License-Identifier: GPL-2.0-only
2+
config VIDEO_TEGRA
3+
tristate "NVIDIA Tegra VI driver"
4+
depends on TEGRA_HOST1X
5+
select VIDEO_V4L2
6+
select MEDIA_CONTROLLER
7+
select VIDEOBUF2_DMA_CONTIG
8+
help
9+
Choose this option if you have an NVIDIA Tegra SoC.
10+
11+
To compile this driver as a module, choose M here: the module
12+
will be called tegra-video.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
tegra-video-objs := \
3+
video.o \
4+
vi.o \
5+
csi.o
6+
7+
tegra-video-$(CONFIG_ARCH_TEGRA_210_SOC) += tegra210.o
8+
obj-$(CONFIG_VIDEO_TEGRA) += tegra-video.o
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
TODO list
2+
* Currently driver supports Tegra build-in TPG only with direct media links
3+
from CSI to VI. Add kernel config CONFIG_VIDEO_TEGRA_TPG and update the
4+
driver to do TPG Vs Sensor media links based on CONFIG_VIDEO_TEGRA_TPG.
5+
* Add real camera sensor capture support.
6+
* Add Tegra CSI MIPI pads calibration.
7+
* Add MIPI clock Settle time computation based on the data rate.
8+
* Add support for Ganged mode.
9+
* Add RAW10 packed video format support to Tegra210 video formats.
10+
* Add support for suspend and resume.
11+
* Make sure v4l2-compliance tests pass with all of the above implementations.

0 commit comments

Comments
 (0)