TC358743 Device Tree Overlay

I am using the verdin imx8mp som and am trying to stream hdmi using the tc358743. I have modified my kernel to include the drivers, and have all the video for linux commands down as i have tested it all on a raspberry pi before hand. What i am missing is the device tree overlay …
will the device tree create video0 so that i can sream or is that created in the driver?
this is the device tree i have so fair
/dts-v1/;
/plugin/;

/ {
fragment@0 {
target = <&i2c2>;

    __overlay__ {
        tc358743: tc358743@f {
            compatible = "toshiba,tc358743";
            reg = <0x0f>;
            clocks = <&tc358743_clk>;
            clock-names = "refclk";

            port@0 {
                reg = <0>;
                tc358743_out: endpoint {
                    remote-endpoint = <&mipi_csi2_in>;
                    data-lanes = <1 2 3 4>;
                    clock-lanes = <0>;
                    link-frequencies = <297000000>;
                    
                };
            };
        };
    };
};

fragment@1 {
    target-path = "/";
    __overlay__ {
        tc358743_clk: tc358743_clk {
            #clock-cells = <0>;
            compatible = "fixed-clock";
            clock-frequency = <27000000>;
            status = "okay";
        };

        reg_mipi_1p0: regulator-mipi-1p0 {
            compatible = "regulator-fixed";
            regulator-name = "mipi_1p0";
            regulator-min-microvolt = <1000000>;
            regulator-max-microvolt = <1000000>;
        };
    };
};

fragment@2 {
    target = <&csi1_bridge>;
    __overlay__ {
        dma-coherent;
        status = "okay";

        port {
            csi1_ep: endpoint {
                remote-endpoint = <&csi1_mipi_ep>;
            };
        };
    };
};

fragment@3 {
    target = <&mipi_csi_1>;
    __overlay__ {
        #address-cells = <1>;
        #size-cells = <0>;
        status = "okay";
        phy-supply = <&reg_mipi_1p0>;
        fsl,csis-hs-settle = <6>; /* 13 */
        fsl,csis-clk-settle = <0>;
        clock-frequency = <333000000>;

        port@0 {
            reg = <0>;
            mipi_csi2_in: endpoint {
                remote-endpoint = <&tc358743_out>;
                data-lanes = <1 2>;
                clock-lanes = <0>;
            };
        };

        port@1 {
            reg = <1>;
            csi1_mipi_ep: endpoint {
                remote-endpoint = <&csi1_ep>;
            };
        };
    };
};

};
what am i missing?

Hi @solaire ,

will the device tree create video0 so that i can sream or is that created in the driver?

As far as I know the devicetree only describes the hardware, including peripherals like the TC358743.

The driver should take care of creating any device abstraction on the OS if it finds its corresponding device described and activated in the devicetree blob.


What OS are you using on the Verdin iMX8M Plus? One of our BSP reference images?

What is the issue exactly? The device entry in /dev/ doesn’t appear? Do you see any related error messages on dmesg?

Best regards,
Lucas Akira

I have the device driver but when i enable it, nothing happens. The problem i have found is that in the device tree TC358743 is not compatible with any of the current nodes in the device tree. what Im struggling to do is making a device tree overlay that can add the TC358743 dynamically to my device tree. The other question i had was that the TC358743 driver currently supported by the kernel (5.15 and up) on the imx8mp is only an i2c driver. So within the device tree i must also include the mipi csi support. This makes the device driver even more complicated … so i was wondering if anyone hand any good tools/workflows that makes working with device drivers more easy.

Hi @solaire ,

Did you test the device tree overlay? Taking a quick look at it I can see that it references csi1_bridge, which as a node that doesn’t exist on the Verdin iMX8M Plus devicetree, only on the Verdin iMX8M Mini.

Remove it and make the appropriate changes to your overlay based on the TC358743 DT bindings:

After that try compiling the overlay based on the article below:

so i was wondering if anyone hand any good tools/workflows that makes working with device drivers more easy.

As far as I’m aware there aren’t many other options apart from reading documentation and doing tests.

The devicetree.org specification is a good place to learn how device trees work in general.

Though there are some common node properties all nodes have, each device has its own specific properties which are documented in the kernel, like the bridge you’re working with.

Best regards,
Lucas Akira