Xavier TC358743

@mmkunzendorf

Yes this is interesting and I think I’m missing something. Suppose we used “extperiph2” for a reference clock. According to the clk_tree we would be using a 24 Mhz Clock signal from the board/SOM and sending it to the tc358743 chip.
But according to the Toshiba spec it needs a 26/27 Mhz or 42 Mhz for a ref clock.

So this makes sense with what I see in the driver and the device tree as it’s all hardcoded to 27 Mhz. Based on what we see in the clk_tree there are no clocks running at 27 Mhz. Somebody figured they could just hardcode it.

DT
refclk_hz = <27000000>; // refclk_hz -> regclk

Driver

// state->pdata.refclk_hz = clk_get_rate(refclk);
state->pdata.refclk_hz = 27000000;

However what doesn’t make any sense to me is that in the driver function “tc358743_probe_of” there are all these lines of code that are getting and using the clock signal but they are commented out. Ex:
// refclk = devm_clk_get(dev, "cam_mclk1");

So, the question becomes… where is the tc358743 chip getting it’s ref clock signal? In my mind one cannot just hardcode a reference clock value and it just works.

Update:
So I modified the driver code to get the clock from extperiph1 and then I print it out (it appears in dmesg on boot).
driver code
refclk = devm_clk_get(dev, "extperiph1");

dmesg output
[ 3.583164] tc358743 clk_get_rate 37090909

And what we see that we get is the value from the clk_tree. This is what I expected but not what I wanted.

extperiph1                     0   37090909    0    0

I also saw this line was commented out. Don’t understand why but thought it might help to have it back in there having to do with csi endpoints but it didn’t do anythng of value:

state->bus = endpoint->bus.mipi_csi2;

I updated the DTSI file with this :

 i2c@3180000 {  /* I2C_0, "adapter" 0 */
.
.
.
// Trying to make sense of these reference clocks
            //clocks = <&bpmp_clks TEGRA194_CLK_EXTPERIPH1>, <&bpmp_clks TEGRA194_CLK_PLLP_OUT0>;
            clocks = <&bpmp_clks TEGRA194_CLK_EXTPERIPH1>;
            //clock-names = “extperiph1”, “pllp_grtba”;
            clock-names = "extperiph1";
            clock-frequency = <27000000>;
            mclk = "cam_mclk1";

Now in the clk_tree I get :
extperiph1 1 27200000 1 1 vdd_core@635808

Still same results when I try and capture video. But now the clock line appears like it’s in use and the frequency changed. However the frequency is off slightly.

think the clock should be ```
extperiph2 not extperiph1

@edward.dow

Was trying to replicate you results, but were not able to get extperiph1 to change i frequency. So i might need to do more testing. Maybe you can upload your current device tree and driver?, to see if there is anything I’m missing.

As i read documentation, extperiph1 is for camera port 1, so if this frequency can be adjusted down to 27MHz, it might make more sense to port the driver for port 1?

@edward.dow

I made some modifications to the driver, so were able to replicate your results with the clock frequency. Getting same result with 27.2MHz.

I tried porting the device tree to port 0, and was able to get the i2c to talk with tc358743, however i still got the same result with no signal.

Still have the error on the GPIO, so guess that would be worth looking in to.
Another thing that could be interesting, is to look at the clock pulse with a scope, unfortunately I’m correctly traveling, and don’t have access to one.

Attached is my current device tree and driver for camera port 0.

tc358743.c (72.5 KB)
tegra194-xavier-tc358743_clk_test_port0.dtsi (6.0 KB)

@mmkunzendorf

Good to know you have got the same results. I suppose that means we are both doing something wrong. :-)

GPIO:
I noticed in your dtsi file you still have 22000000 for the address of the device tree. Didn’t you point out it should be 2200000? However I don’t think it matters too much at this point because it doesn’t make a difference when I change it. I try and see if I can figure out why we are getting “reset_gpio = -517” when we try and do a reset.

Found this in the tc358743.c. Again a bunch of commented code and a TODO statement. I’m thinking this function does nothing at this point.

static void tc358743_gpio_reset(struct tc358743_state *state)
{

        usleep_range(5000, 10000);
        // TODO: Re-implement the reset GPIO!
        //~ gpiod_set_value(state->reset_gpio, 1);
    // gpio_set_value((int)state->reset_gpio, 1);
        usleep_range(1000, 2000);
    // gpio_set_value((int)state->reset_gpio, 0);
        //~ gpiod_set_value(state->reset_gpio, 0);
        msleep(20);
}

I2C:
So I was thinking that the i2c was already talking to to the chip? I don’t think the driver would load properly and show that it’s in use if we couldn’t talk to the chip over i2c. Also, I can change the HDMI input and it will report the new resolution. I’ve been thinking the problem is at is the VI to NVCSI transitions. It’s like video is on the chip but we can’t get it off the chip to the MIPI lines.

Have save travels and I hope it’s somewhere fun!

@mmkunzendorf

Good news:
Solved the negative value in the reset-gpio by changing this line in the dsti file:


// Old code
// reset-gpios = <&gpio 151 0>; 

//New code
reset-gpios = <&tegra_main_gpio CAM0_PWDN GPIO_ACTIVE_HIGH>;

I now get: reset_gpio = 412

Bad news: It didn’t help to capture video.

@edward.dow

Thanks for pointing out the @2200000 mistake:)
Got the same result after changing the settings.

I looked a bit into this line:
interrupts = <TEGRA194_MAIN_GPIO(E, 6) GPIO_ACTIVE_HIGH>;

And could see that (E, 6) were the same used in the device tree for Jetson Nano.
From Pinmux spreadsheet, i found that (E, 6) is GPIO13.

On Jetson NX GPIO13 is (N,1) so Changed the line to:
interrupts = <TEGRA194_MAIN_GPIO(N, 1) GPIO_ACTIVE_HIGH>;

But im still seing the same results.

I tried comparing the dmesg beween my jetson nano and the NX, there is some differences:

Jetson Nano:
[ 3.780665] tc358743 6-000f: after tc358743_init_interrupts, irq: 137
Jetson NX:
[ 5.288766] tc358743 9-000f: before tc358743_init_interrupts, irq: 0

Not sure if that indicates we have some problems with the interrupts?

jetson_nano_dmesg.txt (8.6 KB)
jetson_nx_dmesg.txt (7.1 KB)

I don’t any read out of resolution on my HDMI, not sure what makes the difference between our setups

@edward.dow

I also notice that there were some kind of imx219 error messages doing boot, think it would be worth looking into, that we don’t have another driver/ device tree blocking our signal.

@mmkunzendorf

Pinmux:
I sure am confused. I grabbed that line from the
“tegra194-camera-jakku-rbpcv2-imx219.dtsi” file. I just assumed since it was in the source code by default it would be correct. Maybe not?

When reading the spreadsheet are we looking at the GPIO column?
Example:
TEGRA194_MAIN_GPIO(N, 1) corresponds to the cell in the GPIO column GPIO3_PN.01 ?

Interrupts:
Here’s what I see when I grep out interrupts in dmesg:

dmesg|grep -i interrupts

[    3.624164] tc358743 2-000f: before tc358743_init_interrupts, irq: 296
[    3.627280] tc358743 2-000f: after tc358743_init_interrupts, irq: 296
[    3.627590] tc358743 2-000f: tc358743_enable_interrupts: cable connected = 1
[    3.635809] tc358743 2-000f: tc358743_enable_interrupts: cable connected = 1

Setup:
I’m using the Xavier NX Dev Kit with a Waveshare HDMI-CSI bridge board.
https://www.waveshare.com/hdmi-to-csi-adapter.htm
When I first started looking at bridge boards I was seeing cameras that worked on the Raspberry Pi also worked on the Jetson line up. So I figured this might work, but it didn’t. Even wrote Waveshare to ask them about drivers but they just said it won’t work. Later, I realized that it had the TC358743 chip so thought it might be worth a shot.

IMX219 error:
I don’t see anything in the dmesg with this error.

@edward.dow

Still not possible for me to get anything on the tc358743_init_interrupts.
I have a B101 and a cheap board from ebay, both working on my Jetson Nano.

Just ordered one of those: Adafruit CSI or DSI Cable Extender Thingy for Raspberry Pi : ID 3671 : $2.95 : Adafruit Industries, Unique & fun DIY electronics and kits
Hope I will be able to get some usefully data out with my scope.

GPIO:
I have used the signal name, to coclude it was GPIO13. But also a bit confused.

Building Device tree:
I’m getting this warnings when building my device tree:

tmp.dts: Warning (gpios_property): property 'gpio' size (21) is invalid, expected multiple of 4 in node /__symbols__
tmp.dts: Warning (interrupts_property): Missing interrupt-controller or interrupt-map property in /host1x/gpio@2200000
tmp.dts: Warning (interrupts_property): Missing #interrupt-cells in interrupt-parent /host1x/gpio@2200000

Do you see the same?

@mmkunzendorf

Setup:
The B101 is the Auvidea board correct? Yeah the cheap ebay board might be the same one I have. I think I got mine from Amazon.
Cable Extender is just to make probing the lines easier?

GPIO:
I’m glad I’m not the only one. That pinmux sheet and all the other docs don’t translate into readable dts/dtsi files for me. Furthermore, it seems like there are multiple ways to to write these files so everyone I look at seems different.

Building Device tree:
I don’t see those warnings.
Are you building from the source code or using the dtc utility to uncomile and recompile?
I’m building from the source. Here’s what my output looks like:

make: Entering directory '/opt/Linux_for_Tegra/source/public/kernel/kernel-4.9'
make[1]: Entering directory '/opt/Linux_for_Tegra/source/public/build'
  CHK     scripts/mod/devicetable-offsets.h
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-a00-00-base.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-a00-00-ape-cam.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-a00-00-edp.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-a00-00-dsi-hdmi-dp.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-c03-00-dsi-hdmi-dp.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-a00-00-dsi-dp.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-hdmi-primary-p3310-1000-c03-00.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-hdmi-primary-p3310-1000-a00-00.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-a00-00-base-mods-display.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-a00-00-imx185_v1.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-a00-00-imx274.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-a00-00-lc898212.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-hdmi-primary-p3310-1000-a00-00-imx274.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-hdmi-primary-p3310-1000-c03-00-imx274.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-c03-00-ape-cam.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-c03-00-base.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-c03-00-imx185_v1.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-c03-00-dsi-dp.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-c03-00-dsi-hdmi-hdmi.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-c03-00-dsi-hdmi-hdmi-imx274-hdmiin.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-c00-00-auo-1080p-edp.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-e3313-1000-a00-00-e2598.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3489-1000-a00-00-ucm1.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3489-1000-a00-00-ucm2.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3489-1000-a00-00-e2598.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3489-0888-a00-00-base.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3489-0888-a00-00-e2598.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-as-0888.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/lanai/kernel-dts/tegra186-p3636-0001-p3509-0000-a01.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/lanai/kernel-dts/tegra186-p3636-0002-p3509-0000-a01.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/lanai/kernel-dts/tegra186-p3636-0002-lanai.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t19x/jakku/kernel-dts/tegra194-p3668-all-p3509-0000.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t19x/jakku/kernel-dts/tegra194-p3668-all-p3509-0000-kexec.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t19x/galen/kernel-dts/tegra194-p2888-0001-p2822-0000.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t19x/galen/kernel-dts/tegra194-p2888-0001-p2822-0000-imx274-hdmi.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t19x/galen/kernel-dts/tegra194-p2888-0001-p2822-0000-imx185_v1.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t19x/galen/kernel-dts/tegra194-p2888-0001-p2822-0000-maxn.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t19x/galen/kernel-dts/tegra194-p2888-0001-e3366-1199.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t19x/galen/kernel-dts/tegra194-p2888-0006-p2822-0000.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t19x/galen/kernel-dts/tegra194-p2888-0006-e3366-1199.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t19x/galen/kernel-dts/tegra194-p2888-as-0006-p2822-0000.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t19x/galen/kernel-dts/tegra194-p2888-as-p3668-p2822-0000.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t19x/mccoy/kernel-dts/tegra194-p2888-0004-e3900-0000.dtb
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-a00-overlay.dtbo
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-c03-00-base-hdr40.dtbo
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-c03-00-base-adafruit-sph0645lm4h.dtbo
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-c03-00-base-fe-pi-audio.dtbo
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-c03-00-base-respeaker-4-mic-array.dtbo
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/lanai/kernel-dts/tegra186-p3636-0001-p3509-0000-a01-adafruit-sph0645lm4h.dtbo
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/lanai/kernel-dts/tegra186-p3636-0001-p3509-0000-a01-fe-pi-audio.dtbo
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/lanai/kernel-dts/tegra186-p3636-0001-p3509-0000-a01-hdr40.dtbo
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/lanai/kernel-dts/tegra186-p3636-0001-p3509-0000-a01-respeaker-4-mic-array.dtbo
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t19x/jakku/kernel-dts/tegra194-p3668-all-p3509-0000-hdr40.dtbo
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t19x/jakku/kernel-dts/tegra194-p3668-all-p3509-0000-adafruit-sph0645lm4h.dtbo
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t19x/jakku/kernel-dts/tegra194-p3668-all-p3509-0000-fe-pi-audio.dtbo
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t19x/jakku/kernel-dts/tegra194-p3668-all-p3509-0000-respeaker-4-mic-array.dtbo
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t19x/galen/kernel-dts/tegra194-p2888-0001-p2822-0000-hdr40.dtbo
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t19x/galen/kernel-dts/tegra194-p2888-0001-p2822-0000-adafruit-sph0645lm4h.dtbo
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t19x/galen/kernel-dts/tegra194-p2888-0001-p2822-0000-fe-pi-audio.dtbo
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t19x/galen/kernel-dts/tegra194-p2888-0001-p2822-0000-respeaker-4-mic-array.dtbo
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t19x/mccoy/kernel-dts/tegra194-p2888-0004-e3900-0000-hdr40.dtbo
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t19x/mccoy/kernel-dts/tegra194-p2888-0004-e3900-0000-adafruit-sph0645lm4h.dtbo
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t19x/mccoy/kernel-dts/tegra194-p2888-0004-e3900-0000-fe-pi-audio.dtbo
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t19x/mccoy/kernel-dts/tegra194-p2888-0004-e3900-0000-respeaker-4-mic-array.dtbo
cp -u arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-a00-00-base.dtb arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-a00-00-ape-cam.dtb arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-a00-00-edp.dtb arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-a00-00-dsi-hdmi-dp.dtb arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-c03-00-dsi-hdmi-dp.dtb arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-a00-00-dsi-dp.dtb arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-hdmi-primary-p3310-1000-c03-00.dtb arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-hdmi-primary-p3310-1000-a00-00.dtb arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-a00-00-base-mods-display.dtb arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-a00-00-imx274.dtb arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-a00-00-imx185_v1.dtb arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-a00-00-lc898212.dtb arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-hdmi-primary-p3310-1000-a00-00-imx274.dtb arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-hdmi-primary-p3310-1000-c03-00-imx274.dtb arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-c03-00-ape-cam.dtb arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-c03-00-base.dtb arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-c03-00-imx185_v1.dtb arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-c03-00-dsi-dp.dtb arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-c03-00-dsi-hdmi-hdmi.dtb arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-c03-00-dsi-hdmi-hdmi-imx274-hdmiin.dtb arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-c00-00-auo-1080p-edp.dtb arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-e3313-1000-a00-00-e2598.dtb arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3489-1000-a00-00-ucm1.dtb arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3489-1000-a00-00-ucm2.dtb arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3489-1000-a00-00-e2598.dtb arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3489-0888-a00-00-base.dtb arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3489-0888-a00-00-e2598.dtb arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-as-0888.dtb arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/lanai/kernel-dts/tegra186-p3636-0001-p3509-0000-a01.dtb arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/lanai/kernel-dts/tegra186-p3636-0002-p3509-0000-a01.dtb arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/lanai/kernel-dts/tegra186-p3636-0002-lanai.dtb arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t19x/jakku/kernel-dts/tegra194-p3668-all-p3509-0000.dtb arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t19x/jakku/kernel-dts/tegra194-p3668-all-p3509-0000-kexec.dtb arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t19x/galen/kernel-dts/tegra194-p2888-0001-p2822-0000.dtb arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t19x/galen/kernel-dts/tegra194-p2888-0001-p2822-0000-imx274-hdmi.dtb arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t19x/galen/kernel-dts/tegra194-p2888-0001-p2822-0000-imx185_v1.dtb arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t19x/galen/kernel-dts/tegra194-p2888-0001-p2822-0000-maxn.dtb arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t19x/galen/kernel-dts/tegra194-p2888-0001-e3366-1199.dtb arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t19x/galen/kernel-dts/tegra194-p2888-0006-p2822-0000.dtb arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t19x/galen/kernel-dts/tegra194-p2888-0006-e3366-1199.dtb arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t19x/galen/kernel-dts/tegra194-p2888-as-0006-p2822-0000.dtb arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t19x/galen/kernel-dts/tegra194-p2888-as-p3668-p2822-0000.dtb arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t19x/mccoy/kernel-dts/tegra194-p2888-0004-e3900-0000.dtb arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-a00-overlay.dtbo arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-c03-00-base-hdr40.dtbo arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-c03-00-base-adafruit-sph0645lm4h.dtbo arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-c03-00-base-fe-pi-audio.dtbo arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-c03-00-base-respeaker-4-mic-array.dtbo arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/lanai/kernel-dts/tegra186-p3636-0001-p3509-0000-a01-adafruit-sph0645lm4h.dtbo arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/lanai/kernel-dts/tegra186-p3636-0001-p3509-0000-a01-fe-pi-audio.dtbo arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/lanai/kernel-dts/tegra186-p3636-0001-p3509-0000-a01-hdr40.dtbo arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t18x/lanai/kernel-dts/tegra186-p3636-0001-p3509-0000-a01-respeaker-4-mic-array.dtbo arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t19x/jakku/kernel-dts/tegra194-p3668-all-p3509-0000-hdr40.dtbo arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t19x/jakku/kernel-dts/tegra194-p3668-all-p3509-0000-adafruit-sph0645lm4h.dtbo arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t19x/jakku/kernel-dts/tegra194-p3668-all-p3509-0000-fe-pi-audio.dtbo arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t19x/jakku/kernel-dts/tegra194-p3668-all-p3509-0000-respeaker-4-mic-array.dtbo arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t19x/galen/kernel-dts/tegra194-p2888-0001-p2822-0000-hdr40.dtbo arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t19x/galen/kernel-dts/tegra194-p2888-0001-p2822-0000-adafruit-sph0645lm4h.dtbo arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t19x/galen/kernel-dts/tegra194-p2888-0001-p2822-0000-fe-pi-audio.dtbo arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t19x/galen/kernel-dts/tegra194-p2888-0001-p2822-0000-respeaker-4-mic-array.dtbo arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t19x/mccoy/kernel-dts/tegra194-p2888-0004-e3900-0000-hdr40.dtbo arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t19x/mccoy/kernel-dts/tegra194-p2888-0004-e3900-0000-adafruit-sph0645lm4h.dtbo arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t19x/mccoy/kernel-dts/tegra194-p2888-0004-e3900-0000-fe-pi-audio.dtbo arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t19x/mccoy/kernel-dts/tegra194-p2888-0004-e3900-0000-respeaker-4-mic-array.dtbo arch/arm64/boot/dts/
make[1]: Leaving directory '/opt/Linux_for_Tegra/source/public/build'
make: Leaving directory '/opt/Linux_for_Tegra/source/public/kernel/kernel-4.9'

@mmkunzendorf

I’m able to record 720p video with the hdmi to csi converter! Thanks to ShaneCCC for pointing out the issue.

The device tree should set the bus-width = <2>;

Here’s my dsti file: tegra194-xavier-tc358743.dtsi (5.9 KB)

Here are the commands I used to capture the video. It’s just one frame to verify it was working.

v4l2-ctl --device /dev/video0 --set-fmt-video=width=1280,height=720,pixelformat=UYVY

v4l2-ctl --device /dev/video0 --stream-mmap --stream-to=frame.raw --stream-count=1

convert -size 1280x720 -depth 16 uyvy:frame.raw frame.png

@edward.dow

That is awesome news, great work:)
I tried with your device tree, but was not able to get it up an running correctly at this point.

How with the kernel module, how did you end up using the clock?

@mmkunzendorf

I’m not sure about the kernel mod/driver code and the clock. I know we were looking at that trying to figure out. It gets set in the both the device tree and the driver. None of the changes we made to clocks seemed to do anything to get us closer to capturing video as we were still getting the same errors, but maybe it helped in the long run. I’m still a bit confused how the clocks are being used and where they get set.

Driver:

refclk = devm_clk_get(dev, "extperiph1");
        if (IS_ERR(refclk)) {
                if (PTR_ERR(refclk) != -EPROBE_DEFER)
                        dev_err(dev, "failed to get refclk from extperiph1: %ld\n",
                                PTR_ERR(refclk));
        //      return PTR_ERR(refclk);
         }

          clk_prepare_enable(refclk);
         state->pdata.refclk_hz = clk_get_rate(refclk);
         clk_set_rate(refclk,27000000);  // this will set it to 27200000 
         state->pdata.refclk_hz = 27000000; // hardcode to 27000000

Device Tree (DT)

            clocks = <&bpmp_clks TEGRA194_CLK_EXTPERIPH1>;
            clock-names = "extperiph1";
            clock-frequency = <27000000>;
            mclk = "cam_mclk1";
            refclk_hz = <27000000>;  // refclk_hz -> regclk

       

@edward.dow

Finally got it working:)

For anyone interested, I made this gist with my notes on how to get it working:
gist

@mmkunzendorf
That’s awesome! I was just wondering yesterday if you had made any progress. Hopefully this post as well as the gist will help someone else trying to get this working.

@mmkunzendorf

I’ve been looking for a way to detect audio.

Running the following:
v4l2-ctl -d /dev/video0 --all

Output:
User Controls
** audio_sampling_rate 0x00981980 (int) : min=0 max=768000 step=1 default=0 value=48000 flags=read-only**
** audio_present 0x00981981 (bool) : default=0 value=1 flags=read-only**

So it would appear you could query the chip to determine if audio is present. However the only way I can get this to change is by pulling the HDMI cable from the bridge board. If I have an HDMI video going into it with no audio it still shows up as audio is present.

@edward.dow

I’ve have not worked with the Audio at all, only needed the video signal, but would be nice having it working for future use.

If you connect a HDMI cable, with audio already disable, do the driver still shows, that audio is present?
Or is it only, if you go from having audio to no audio?

@mmkunzendorf

Yes, if I have video with no audio playing and reboot the Xavier it shows up as audio is present.

If I disconnect the HDMI cable and rerun the v4l2 command it shows the audio is gone.

Maybe the user control is misnamed and should be cable_plugged_in.