* Re: [PATCH 2/3] ARM64: add tegra-vi support in T210 device-tree
[not found] ` <20150922121730.GC1417-AwZRO8vwLAwmlAP/+Wk3EA@public.gmane.org>
@ 2015-09-23 1:26 ` Bryan Wu
0 siblings, 0 replies; 3+ messages in thread
From: Bryan Wu @ 2015-09-23 1:26 UTC (permalink / raw)
To: Thierry Reding
Cc: hansverk-FYB4Gu1CFyUAvxtiuMwx3w,
linux-media-u79uwXL29TY76Z2rM5mHXA,
ebrower-DDmLM1+adcrQT0dZR+AlfA, jbang-DDmLM1+adcrQT0dZR+AlfA,
swarren-DDmLM1+adcrQT0dZR+AlfA, davidw-DDmLM1+adcrQT0dZR+AlfA,
gfitzer-DDmLM1+adcrQT0dZR+AlfA, bmurthyv-DDmLM1+adcrQT0dZR+AlfA,
linux-tegra-u79uwXL29TY76Z2rM5mHXA
On 09/22/2015 05:17 AM, Thierry Reding wrote:
> Hi Bryan,
>
> This patchset really needs to be Cc'ed to linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
> it's becoming impossible to track it otherwise.
My bad, I copied and pasted old git send-email command line.
> On Mon, Sep 21, 2015 at 11:55:54AM -0700, Bryan Wu wrote:
> [...]
>> diff --git a/arch/arm64/boot/dts/nvidia/tegra210.dtsi b/arch/arm64/boot/dts/nvidia/tegra210.dtsi
>> index 1168bcd..3f6501f 100644
>> --- a/arch/arm64/boot/dts/nvidia/tegra210.dtsi
>> +++ b/arch/arm64/boot/dts/nvidia/tegra210.dtsi
>> @@ -109,9 +109,181 @@
>>
>> vi@0,54080000 {
>> compatible = "nvidia,tegra210-vi";
>> - reg = <0x0 0x54080000 0x0 0x00040000>;
>> + reg = <0x0 0x54080000 0x0 0x800>;
> This now no longer matches the address map in the TRM.
That's because we split out the CSI parts from VI.
>> interrupts = <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>;
>> status = "disabled";
>> + clocks = <&tegra_car TEGRA210_CLK_VI>,
>> + <&tegra_car TEGRA210_CLK_CSI>,
>> + <&tegra_car TEGRA210_CLK_PLL_C>;
>> + clock-names = "vi", "csi", "parent";
>> + resets = <&tegra_car 20>;
>> + reset-names = "vi";
>> +
>> + power-domains = <&pmc TEGRA_POWERGATE_VENC>;
> As an aside, this will currently prevent the driver from probing because
> the generic power domain code will return -EPROBE_DEFER if this property
> is encountered but the corresponding driver (for the PMC) hasn't
> registered any power domains yet. So until the PMC driver changes have
> been merged we can't add these power-domains properties.
>
> That's not something for you to worry about, though. I'll make sure to
> strip this out if it happens to get merged before the PMC driver changes
> and add it back it afterwards.
OK, need I strip this out and provide a separated patch which waiting
for the PMC changes merged?
>> +
>> + iommus = <&mc TEGRA_SWGROUP_VI>;
>> +
>> + ports {
>> + #address-cells = <1>;
>> + #size-cells = <0>;
>> +
>> + port@0 {
>> + reg = <0>;
>> +
>> + vi_in0: endpoint {
>> + remote-endpoint = <&csi_out0>;
>> + };
>> + };
>> + port@1 {
>> + reg = <1>;
>> +
>> + vi_in1: endpoint {
>> + remote-endpoint = <&csi_out1>;
>> + };
>> + };
>> + port@2 {
>> + reg = <2>;
>> +
>> + vi_in2: endpoint {
>> + remote-endpoint = <&csi_out2>;
>> + };
>> + };
>> + port@3 {
>> + reg = <3>;
>> +
>> + vi_in3: endpoint {
>> + remote-endpoint = <&csi_out3>;
>> + };
>> + };
>> + port@4 {
>> + reg = <4>;
>> +
>> + vi_in4: endpoint {
>> + remote-endpoint = <&csi_out4>;
>> + };
>> + };
>> + port@5 {
>> + reg = <5>;
>> +
>> + vi_in5: endpoint {
>> + remote-endpoint = <&csi_out5>;
>> + };
>> + };
>> +
>> + };
>> + };
>> +
>> + csi@0,54080838 {
> I think this and its siblings should be children of the vi node. They
> are within the same memory aperture according to the TRM and the fact
> that the VI needs to reference the "CSI" clock indicates that the
> coupling is tighter than this current DT layout makes it out to be.
>
>> + compatible = "nvidia,tegra210-csi";
>> + reg = <0x0 0x54080838 0x0 0x700>;
> Some of the internal register documentation indicates that the register
> range actually starts at an offset of 0x800, it just so happens that we
> don't use any of the registers from 0x800 to 0x837. So I think this
> needs to be adapted.
Right, in the driver we don't use those registers from 0x800 to 0x837.
>> + clocks = <&tegra_car TEGRA210_CLK_CILAB>;
>> + clock-names = "cil";
>> +
>> + ports {
>> + #address-cells = <1>;
>> + #size-cells = <0>;
>> +
>> + port@0 {
>> + reg = <0>;
>> + #address-cells = <1>;
>> + #size-cells = <0>;
>> + csi_in0: endpoint@0 {
>> + reg = <0x0>;
>> + };
>> + csi_out0: endpoint@1 {
>> + reg = <0x1>;
>> + remote-endpoint = <&vi_in0>;
>> + };
>> + };
>> + port@1 {
>> + reg = <1>;
>> + #address-cells = <1>;
>> + #size-cells = <0>;
>> + csi_in1: endpoint@0 {
>> + reg = <0>;
>> + };
>> + csi_out1: endpoint@1 {
>> + reg = <1>;
>> + remote-endpoint = <&vi_in1>;
>> + };
>> + };
>> + };
> This, and the ports subnode of the vi node, is *a lot* of lines to
> describe what's effectively a hard-coded association. Nothing in here
> can be configured, so I doubt that it is necessary to describe the VI
> to this extent in DT.
It actually can be changed but it's not very common.
Like CSIA -> PPB and CSIB->PPA.
> It's quite difficult to judge because we don't have an actual use-case
> yet where real sensors need to be hooked up. Do we have some internal
> boards that we can use to prototype this from a DT point of view? What
> we'd need is just something that has any sensor connected to one of the
> CSI ports so we can see what we really need to fully describe such a
> setup.
It's doable we remove these hard configuration in DT and setup those
media links in hard code of driver.
I'm just not sure we might have some changeable connection between VI
and CSI in the future Tegra chips.
I'm working on adding the real sensor to this driver, device tree
binding is quite standard as in our DT video-devices.txt binding file.
csi_in0 has a remote-endpoint = <&sensor1>;
sensor1 has a remote-endpoint = <&csi_in0>;
> I'm reluctant to apply something like this, or the corresponding
> binding, without at least having attempted to describe a real user.
>
> Thierry
I understand your concern let's find a good way to solve this problem.
Since it's kind of fixed connections between VI and CSI, I can put those
media links setup hard coded in the driver.
Thanks,
-Bryan
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 0/3 RFC v3] media: platform: add NVIDIA Tegra VI driver
@ 2015-09-23 1:30 Bryan Wu
2015-09-23 1:30 ` [PATCH 2/3] ARM64: add tegra-vi support in T210 device-tree Bryan Wu
0 siblings, 1 reply; 3+ messages in thread
From: Bryan Wu @ 2015-09-23 1:30 UTC (permalink / raw)
To: hansverk-FYB4Gu1CFyUAvxtiuMwx3w,
linux-media-u79uwXL29TY76Z2rM5mHXA,
treding-DDmLM1+adcrQT0dZR+AlfA
Cc: ebrower-DDmLM1+adcrQT0dZR+AlfA, jbang-DDmLM1+adcrQT0dZR+AlfA,
swarren-DDmLM1+adcrQT0dZR+AlfA, davidw-DDmLM1+adcrQT0dZR+AlfA,
gfitzer-DDmLM1+adcrQT0dZR+AlfA, bmurthyv-DDmLM1+adcrQT0dZR+AlfA,
linux-tegra-u79uwXL29TY76Z2rM5mHXA
This patchset add and enable V4L2 driver for latest NVIDIA Tegra
Video Input hardware controller.
It's based on the staging/work branch of Thierry Reding Tegra
upstream kernel github repo, which is based on 4.2-rc1.
(https://github.com/thierryreding/linux/tree/staging/work)
v4:
- fix all the coding style issues
- solve all the minor problems pointed out by Hans Verkuil
v3:
- rework on the locking code related to kthread
- remove some dead code
- other fixes
v2:
- allocate kthread for each channel instead of workqueue
- create tegra-csi as a separated V4L2 subdevice
- define all the register bits needed in this driver
- add device tree binding document
- update things according to Hans and Thierry's review.
Bryan Wu (3):
[media] v4l: tegra: Add NVIDIA Tegra VI driver
ARM64: add tegra-vi support in T210 device-tree
Documentation: DT bindings: add VI and CSI bindings
.../bindings/gpu/nvidia,tegra20-host1x.txt | 211 +++++-
arch/arm64/boot/dts/nvidia/tegra210-p2571-e01.dts | 8 +
arch/arm64/boot/dts/nvidia/tegra210.dtsi | 174 ++++-
drivers/media/platform/Kconfig | 1 +
drivers/media/platform/Makefile | 2 +
drivers/media/platform/tegra/Kconfig | 10 +
drivers/media/platform/tegra/Makefile | 3 +
drivers/media/platform/tegra/tegra-channel.c | 802 +++++++++++++++++++++
drivers/media/platform/tegra/tegra-core.c | 252 +++++++
drivers/media/platform/tegra/tegra-core.h | 162 +++++
drivers/media/platform/tegra/tegra-csi.c | 566 +++++++++++++++
drivers/media/platform/tegra/tegra-vi.c | 581 +++++++++++++++
drivers/media/platform/tegra/tegra-vi.h | 213 ++++++
13 files changed, 2978 insertions(+), 7 deletions(-)
create mode 100644 drivers/media/platform/tegra/Kconfig
create mode 100644 drivers/media/platform/tegra/Makefile
create mode 100644 drivers/media/platform/tegra/tegra-channel.c
create mode 100644 drivers/media/platform/tegra/tegra-core.c
create mode 100644 drivers/media/platform/tegra/tegra-core.h
create mode 100644 drivers/media/platform/tegra/tegra-csi.c
create mode 100644 drivers/media/platform/tegra/tegra-vi.c
create mode 100644 drivers/media/platform/tegra/tegra-vi.h
--
2.1.4
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 2/3] ARM64: add tegra-vi support in T210 device-tree
2015-09-23 1:30 [PATCH 0/3 RFC v3] media: platform: add NVIDIA Tegra VI driver Bryan Wu
@ 2015-09-23 1:30 ` Bryan Wu
0 siblings, 0 replies; 3+ messages in thread
From: Bryan Wu @ 2015-09-23 1:30 UTC (permalink / raw)
To: hansverk, linux-media, treding
Cc: ebrower, jbang, swarren, davidw, gfitzer, bmurthyv, linux-tegra
Following device tree support for Tegra VI now:
- "vi" node which might have 6 ports/endpoints
- in TPG mode, "vi" node don't need to define any ports/endpoints
- ports/endpoints defines the link between VI and external sensors.
Signed-off-by: Bryan Wu <pengw@nvidia.com>
---
arch/arm64/boot/dts/nvidia/tegra210-p2571-e01.dts | 8 +
arch/arm64/boot/dts/nvidia/tegra210.dtsi | 174 +++++++++++++++++++++-
2 files changed, 181 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/nvidia/tegra210-p2571-e01.dts b/arch/arm64/boot/dts/nvidia/tegra210-p2571-e01.dts
index d4ee460..534ada52 100644
--- a/arch/arm64/boot/dts/nvidia/tegra210-p2571-e01.dts
+++ b/arch/arm64/boot/dts/nvidia/tegra210-p2571-e01.dts
@@ -7,6 +7,14 @@
model = "NVIDIA Tegra210 P2571 reference board (E.1)";
compatible = "nvidia,p2571-e01", "nvidia,tegra210";
+ host1x@0,50000000 {
+ vi@0,54080000 {
+ status = "okay";
+
+ avdd-dsi-csi-supply = <&vdd_dsi_csi>;
+ };
+ };
+
pinmux: pinmux@0,700008d4 {
pinctrl-names = "boot";
pinctrl-0 = <&state_boot>;
diff --git a/arch/arm64/boot/dts/nvidia/tegra210.dtsi b/arch/arm64/boot/dts/nvidia/tegra210.dtsi
index 1168bcd..3f6501f 100644
--- a/arch/arm64/boot/dts/nvidia/tegra210.dtsi
+++ b/arch/arm64/boot/dts/nvidia/tegra210.dtsi
@@ -109,9 +109,181 @@
vi@0,54080000 {
compatible = "nvidia,tegra210-vi";
- reg = <0x0 0x54080000 0x0 0x00040000>;
+ reg = <0x0 0x54080000 0x0 0x800>;
interrupts = <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>;
status = "disabled";
+ clocks = <&tegra_car TEGRA210_CLK_VI>,
+ <&tegra_car TEGRA210_CLK_CSI>,
+ <&tegra_car TEGRA210_CLK_PLL_C>;
+ clock-names = "vi", "csi", "parent";
+ resets = <&tegra_car 20>;
+ reset-names = "vi";
+
+ power-domains = <&pmc TEGRA_POWERGATE_VENC>;
+
+ iommus = <&mc TEGRA_SWGROUP_VI>;
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+
+ vi_in0: endpoint {
+ remote-endpoint = <&csi_out0>;
+ };
+ };
+ port@1 {
+ reg = <1>;
+
+ vi_in1: endpoint {
+ remote-endpoint = <&csi_out1>;
+ };
+ };
+ port@2 {
+ reg = <2>;
+
+ vi_in2: endpoint {
+ remote-endpoint = <&csi_out2>;
+ };
+ };
+ port@3 {
+ reg = <3>;
+
+ vi_in3: endpoint {
+ remote-endpoint = <&csi_out3>;
+ };
+ };
+ port@4 {
+ reg = <4>;
+
+ vi_in4: endpoint {
+ remote-endpoint = <&csi_out4>;
+ };
+ };
+ port@5 {
+ reg = <5>;
+
+ vi_in5: endpoint {
+ remote-endpoint = <&csi_out5>;
+ };
+ };
+
+ };
+ };
+
+ csi@0,54080838 {
+ compatible = "nvidia,tegra210-csi";
+ reg = <0x0 0x54080838 0x0 0x700>;
+ clocks = <&tegra_car TEGRA210_CLK_CILAB>;
+ clock-names = "cil";
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ csi_in0: endpoint@0 {
+ reg = <0x0>;
+ };
+ csi_out0: endpoint@1 {
+ reg = <0x1>;
+ remote-endpoint = <&vi_in0>;
+ };
+ };
+ port@1 {
+ reg = <1>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ csi_in1: endpoint@0 {
+ reg = <0>;
+ };
+ csi_out1: endpoint@1 {
+ reg = <1>;
+ remote-endpoint = <&vi_in1>;
+ };
+ };
+ };
+ };
+
+ csi@1,54081038 {
+ compatible = "nvidia,tegra210-csi";
+ reg = <0x0 0x54081038 0x0 0x700>;
+ clocks = <&tegra_car TEGRA210_CLK_CILCD>;
+ clock-names = "cil";
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@2 {
+ reg = <2>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ csi_in2: endpoint@0 {
+ reg = <0>;
+ };
+
+ csi_out2: endpoint@1 {
+ reg = <1>;
+ remote-endpoint = <&vi_in2>;
+ };
+ };
+ port@3 {
+ reg = <3>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ csi_in3: endpoint@0 {
+ reg = <0>;
+ };
+
+ csi_out3: endpoint@1 {
+ reg = <1>;
+ remote-endpoint = <&vi_in3>;
+ };
+ };
+ };
+ };
+
+ csi@2,54081838 {
+ compatible = "nvidia,tegra210-csi";
+ reg = <0x0 0x54081838 0x0 0x700>;
+ clocks = <&tegra_car TEGRA210_CLK_CILE>;
+ clock-names = "cil";
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@4 {
+ reg = <4>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ csi_in4: endpoint@0 {
+ reg = <0>;
+ };
+ csi_out4: endpoint@1 {
+ reg = <1>;
+ remote-endpoint = <&vi_in4>;
+ };
+ };
+ port@5 {
+ reg = <5>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ csi_in5: endpoint@0 {
+ reg = <0>;
+ };
+ csi_out5: endpoint@1 {
+ reg = <1>;
+ remote-endpoint = <&vi_in5>;
+ };
+ };
+ };
};
tsec@0,54100000 {
--
2.1.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 0/3 RFC v5] media: platform: add NVIDIA Tegra VI driver
@ 2015-11-11 19:50 Bryan Wu
[not found] ` <1447271448-30056-1-git-send-email-pengw-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Bryan Wu @ 2015-11-11 19:50 UTC (permalink / raw)
To: hansverk-FYB4Gu1CFyUAvxtiuMwx3w,
linux-media-u79uwXL29TY76Z2rM5mHXA,
treding-DDmLM1+adcrQT0dZR+AlfA,
linux-tegra-u79uwXL29TY76Z2rM5mHXA
Cc: ebrower-DDmLM1+adcrQT0dZR+AlfA, jbang-DDmLM1+adcrQT0dZR+AlfA,
swarren-DDmLM1+adcrQT0dZR+AlfA, davidw-DDmLM1+adcrQT0dZR+AlfA,
bmurthyv-DDmLM1+adcrQT0dZR+AlfA
This patchset add and enable V4L2 driver for latest NVIDIA Tegra
Video Input hardware controller.
It's based on the staging/work branch of Thierry Reding Tegra
upstream kernel github repo, which is based on 4.3.0-next-20151106.
(https://github.com/thierryreding/linux/tree/staging/work)
v5:
- Introduce 2 kthreads for capture
Use one kthread to start capture a frame and wait for next frame
start. Before waiting, it will move the current buffer to another queue
which will be handled by the second kthread.
The second kthread (capture_done) will wait for memory output done
sync point event and hand over the buffer to videobuffer2 framework as
capture done.
- Fix building issue after upstream V4L2 API changed
- Fix one potential race condition
Increase syncpoint max value before arming syncshot capture
- Remove freezer in kthread since it's problematic according latest
discussion in 2015 Kernel Summit
- Verify with a real sensor module (OV5693)
v4:
- fix all the coding style issues
- solve all the minor problems pointed out by Hans Verkuil
v3:
- rework on the locking code related to kthread
- remove some dead code
- other fixes
v2:
- allocate kthread for each channel instead of workqueue
- create tegra-csi as a separated V4L2 subdevice
- define all the register bits needed in this driver
- add device tree binding document
- update things according to Hans and Thierry's review.
Bryan Wu (3):
[media] v4l: tegra: Add NVIDIA Tegra VI driver
ARM64: add tegra-vi support in T210 device-tree
Documentation: DT bindings: add VI and CSI bindings
.../display/tegra/nvidia,tegra20-host1x.txt | 211 ++++-
arch/arm64/boot/dts/nvidia/tegra210-p2571.dts | 8 +
arch/arm64/boot/dts/nvidia/tegra210.dtsi | 174 ++++-
drivers/media/platform/Kconfig | 1 +
drivers/media/platform/Makefile | 2 +
drivers/media/platform/tegra/Kconfig | 10 +
drivers/media/platform/tegra/Makefile | 3 +
drivers/media/platform/tegra/tegra-channel.c | 849 +++++++++++++++++++++
drivers/media/platform/tegra/tegra-core.c | 254 ++++++
drivers/media/platform/tegra/tegra-core.h | 162 ++++
drivers/media/platform/tegra/tegra-csi.c | 560 ++++++++++++++
drivers/media/platform/tegra/tegra-vi.c | 732 ++++++++++++++++++
drivers/media/platform/tegra/tegra-vi.h | 213 ++++++
13 files changed, 3172 insertions(+), 7 deletions(-)
create mode 100644 drivers/media/platform/tegra/Kconfig
create mode 100644 drivers/media/platform/tegra/Makefile
create mode 100644 drivers/media/platform/tegra/tegra-channel.c
create mode 100644 drivers/media/platform/tegra/tegra-core.c
create mode 100644 drivers/media/platform/tegra/tegra-core.h
create mode 100644 drivers/media/platform/tegra/tegra-csi.c
create mode 100644 drivers/media/platform/tegra/tegra-vi.c
create mode 100644 drivers/media/platform/tegra/tegra-vi.h
--
2.1.4
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-11-11 19:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1442861755-22743-1-git-send-email-pengw@nvidia.com>
[not found] ` <1442861755-22743-3-git-send-email-pengw@nvidia.com>
[not found] ` <20150922121730.GC1417@ulmo.nvidia.com>
[not found] ` <20150922121730.GC1417-AwZRO8vwLAwmlAP/+Wk3EA@public.gmane.org>
2015-09-23 1:26 ` [PATCH 2/3] ARM64: add tegra-vi support in T210 device-tree Bryan Wu
2015-09-23 1:30 [PATCH 0/3 RFC v3] media: platform: add NVIDIA Tegra VI driver Bryan Wu
2015-09-23 1:30 ` [PATCH 2/3] ARM64: add tegra-vi support in T210 device-tree Bryan Wu
-- strict thread matches above, loose matches on Subject: below --
2015-11-11 19:50 [PATCH 0/3 RFC v5] media: platform: add NVIDIA Tegra VI driver Bryan Wu
[not found] ` <1447271448-30056-1-git-send-email-pengw-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2015-11-11 19:50 ` [PATCH 2/3] ARM64: add tegra-vi support in T210 device-tree Bryan Wu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).