Hi,
I’ve been trying to get this HDMI-to-CSI module that uses the tc358743 chip running for three weeks now and I’m still not able to see video0 in /dev
Here’s my output from media-ctl
bsg1@nano2gb:~$ media-ctl -p -d /dev/media0
Media controller API version 0.1.0
Media device information
------------------------
driver vi
model NVIDIA Tegra Video Input Device
serial
bus info
hw revision 0x3
driver version 0.0.0
Device topology
- entity 1: nvcsi--1 (2 pads, 0 link)
type V4L2 subdev subtype Unknown flags 0
pad0: Sink
pad1: Source
Here’s a list of my process and if someone has time to review and let me know where I may have gone wrong that would be greatly appreciated.
I’ve been building a kernel natively on my jetson nano 2gb device using this L4T Jetson Nano + TX1 R32.4.3 Sources as the source.
cd ~/Linux_for_Tegra/source/public/kernel/kernel-4.9
make O=~/new-kernel LOCALVERSION=-tegra tegra_defconfig
make O=~/new-kernel LOCALVERSION=-tegra menuconfig
-> Device Drivers
-> Multimedia support (MEDIA_SUPPORT [=Y])
-> I2C Encoders, decoders, sensors and other helper chips --->
<*> Toshiba TC358743 decoder
Save file as .config
From
https://gist.github.com/nyacg/becd94a029355825a05f633f38a25b46
- tc358743.c
→ ~/Linux_for_Tegra/source/public/kernel/kernel-4.9/drivers/media/i2c/tc358743.c
- tc358743_regs.h
→ ~/Linux_for_Tegra/source/public/kernel/kernel-4.9/drivers/media/i2c/tc358743_regs.h
- tc358743.h
→ ~/Linux_for_Tegra/source/public/kernel/kernel-4.9/include/media/i2c/tc358743.h
cd ~/Linux_for_Tegra/source/public/hardware/nvidia/platform/t210/porg/kernel-dts/
nano tegra210-porg-p3448-common.dtsi
- Comment out lines:
#include "porg-platforms/tegra210-porg-camera-rbpcv2-imx219.dtsi"
#include "porg-platforms/tegra210-porg-camera-rbpcv2-dual-imx219.dtsi"
#include "porg-plugin-manager/tegra210-porg-plugin-manager.dtsi"
cd ~/Linux_for_Tegra/source/public/hardware/nvidia/platform/t210/batuu/kernel-dts
wget https://gist.githubusercontent.com/nyacg/becd94a029355825a05f633f38a25b46/raw/74d4bebf7ab3fa7b98fb1007cf8d2936e45db553/tegra210-tc358743.dtsi
nano tegra210-p3448-0003-p3542-0000.dts
- Add line:
#include "tegra210-tc358743.dtsi"
make O=~/new-kernel/ LOCALVERSION=-tegra -j4 --output-sync=target
sudo cp ~/new-kernel/arch/arm64/boot/Image /boot
sudo cp ~/new-kernel/arch/arm64/boot/dts/* /boot/dtb
cd ~/Linux_for_Tegra/source/public/kernel/kernel-4.9
sudo make O=~/new-kernel LOCALVERSION=-tegra modules_install
sudo reboot
Does this process look correct?
Does this device tree for the jetson nano 2gb look correct?
#include <dt-bindings/media/camera.h>
#include <dt-bindings/platform/t210/t210.h>
#include <dt-bindings/gpio/gpio.h>
/ {
host1x {
vi_base: vi {
num-channels = <1>; // Change 4->2
ports {
#address-cells = <1>;
#size-cells = <0>;
vi_port1: port@0 {
status = "okay";
reg = <0>;
tc358743_vi_in1: endpoint {
status = "okay";
port-index = <0>; /* CSI-B */
bus-width = <2>; /* Use CSI-B only */
remote-endpoint = <&tc358743_csi_out0>;
};
};
};
};
csi_base: nvcsi {
num-channels = <1>;
#address-cells = <1>;
#size-cells = <0>;
channel@0 {
reg = <0>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
status = "okay";
reg = <0>;
tc358743_csi_in0: endpoint@0 {
status = "okay";
port-index = <0>;
bus-width = <2>;
remote-endpoint = <&tc358743_out1>;
};
};
port@1 {
reg = <1>;
status = "okay";
#address-cells = <1>;
#size-cells = <0>;
tc358743@0f {
status = "okay";
tc358743_csi_out0: endpoint@1 {
status = "okay";
remote-endpoint = <&tc358743_vi_in1>;
};
};
};
};
};
i2c@546c0000 { /* I2C_PM, "adapter" 6 */
status = "okay";
#address-cells = <1>;
#size-cells = <0>;
tc358743@0f {
status = "okay";
compatible = "tc358743";
reg = <0x0f>; /* shifted by 2 */
mclk = "cam_mclk1";
reset-gpios = <&gpio 149 0>;
refclk_hz = <27000000>; // refclk_hz -> regclk
interrupt-parent = <&gpio>;
interrupts = <TEGRA_GPIO(E, 6) GPIO_ACTIVE_HIGH>;
/* Physical dimensions of sensor */
physical_w = "4.713";
physical_h = "3.494";
/* Sensor Model */
sensor_model ="tc358743";
ddc5v_delay = <2>;
enable_hdcp = "false";
lineinitcnt = <0xe80>;
lptxtimecnt = <0x003>;
tclk_headercnt = <0x1403>;
tclk_trailcnt = <0x00>;
ths_headercnt = <0x0103>;
twakeup = <0x4882>;
tclk_postcnt = <0x008>;
ths_trailcnt = <0x02>;
hstxvregcnt = <0>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
tc358743_out1: endpoint {
port-index = <0>; /* CSI A */
bus-width = <2>;
data-lanes = <1 2>;
clock-lanes = <0>;
clock-noncontinuous;
link-frequencies = /bits/ 64 <297000000>;
remote-endpoint = <&tc358743_csi_in0>;
};
};
};
};
};
};
tegra-camera-platform {
status = "okay";
compatible = "nvidia, tegra-camera-platform";
num_csi_lanes = <2>; // Changed 2 -> 4
max_lane_speed = <1500000>;
min_bits_per_pixel = <16>;
vi_peak_byte_per_pixel = <2>;
vi_bw_margin_pct = <25>;
max_pixel_rate = <750000>;
isp_peak_byte_per_pixel = <5>;
isp_bw_margin_pct = <25>;
/**
* The general guideline for naming badge_info contains 3 parts, and is as follows,
* The first part is the camera_board_id for the module; if the module is in a FFD
* platform, then use the platform name for this part.
* The second part contains the position of the module, ex. “rear” or “front”.
* The third part contains the last 6 characters of a part number which is found
* in the module's specsheet from the vender.
*/
modules {
module1 {
status = "okay";
badge = "tc358743_top_i2c6_b";
position = "front";
orientation = "1";
drivernode0 {
drivernode0 {
status = "okay";
/* Declare PCL support driver (classically known as guid) */
pcl_id = "v4l2_sensor";
/* Driver's v4l2 device name */
devname = "tc358743 6-000f";
/* Declare the device-tree hierarchy to driver instance */
proc-device-tree = "/proc/device-tree/host1x/i2c@546c0000/tc358743@0f";
};
};
};
};
};
Any suggestions for debugging?
Thanks in advance for the help!
Jamie