How to enable TSC function to generate camera trigger signals?

Hi Nvidia,

How to enable TSC function to generate camera trigger signals?

We are using Thor custom carrier board, bsp version is “r38.2.1”. Now the A62 pin pinmux is configured as tsc_edge_out0a, and tsc_sig_gen in dts is also set to okay, but there is no PWM signal for the measurement pin.

How to enable PWM signals? What’s the next step?

			soc_gpio25_pdd7 {
				nvidia,pins = "soc_gpio25_pdd7";
				nvidia,function = "tsc_edge_out0a";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
				nvidia,enable-input = <TEGRA_PIN_DISABLE>;
				nvidia,drv-type = <TEGRA_PIN_1X_DRIVER>;
				nvidia,e-io-od = <TEGRA_PIN_DISABLE>;
				nvidia,e-lpbk = <TEGRA_PIN_DISABLE>;
			};
	tsc_sig_gen@c230000 {
		#address-cells = <0x01>;
		#size-cells = <0x01>;
		compatible = "nvidia,tegra264-cam-cdi-tsc";
		ranges = <0x00 0x00 0xc230000 0x10000>;
		reg = <0x00 0xc230000 0x00 0x18>;
		status = "okay";

		generator@380 {
			duty_cycle = <0x19>;
			freq_hz = <0x1e>;
			gpio_pinmux = <0x132 0x1f 0x01>;
			offset_ms = <0x00>;
			phandle = <0x347>;
			reg = <0x380 0x80>;
			status = "okay";
		};

hello liteblue,

please also check below for node settings.
for instance, # cat /proc/device-tree/tsc_sig_gen@c230000/generator@380/status

Is this signal continuously outputting PWM signal after TSC driver loading is completed? Do I need to manually turn it on?

hello liteblue,

according to below..
$public_sources/kernel_src/kernel/nvidia-oot/drivers/media/platform/tegra/cam_fsync/cam_fsync.c

let’s give it a try to add fsync-groups{} into your device tree.
for instance,

                /* EDGE_OUT #0 */
                gen0: generator@380 {
                ...

+               fsync-groups {
+                       status = "okay";
+                       fsync-group@0 {
+                               id = <0>;
+                               status = "okay";
+                               generators = <&gen0>;
+                       };
+               };

Now that I’ve added these dts changes, do I need to​ open the camera and make an ioctl call​ to enable fsync? But no nodes such as /dev/fsync group or /dev/cdi-xxx were generated.

hello liteblue,

let’s check kernel message for the related info. $ sudo dmesg | grep fsync

Hi Jerry,

No log for fsync was found.

The compatible value between DTS and driver does not match. Has this feature not been debugged on Thor yet? How to change it?

	tsc_sig_gen@c230000 {
		#address-cells = <0x01>;
		#size-cells = <0x01>;
		compatible = "nvidia,tegra264-cam-cdi-tsc";
		ranges = <0x00 0x00 0xc230000 0x10000>;
		reg = <0x00 0xc230000 0x00 0x18>;
		status = "okay";

		fsync-groups {
			status = "okay";

			fsync-group@0 {
				generators = <0x25b>;
				id = <0x00>;
				status = "okay";
			};
		};

		generator@380 {
			duty_cycle = <0x19>;
			freq_hz = <0x1e>;
			gpio_pinmux = <0x132 0x1f 0x01>;
			offset_ms = <0x00>;
			phandle = <0x25b>;
			reg = <0x380 0x80>;
			status = "okay";
		};
static const struct of_device_id cam_fsync_of_match[] = {
	{ .compatible = "nvidia,tegra234-cdi-tsc", .data = &tegra234_cam_fsync_features },
	{ .compatible = "nvidia,tegra264-cdi-tsc", .data = &tegra264_cam_fsync_features },
	{ },
};

hello liteblue,

the compatible string should be "nvidia,tegra264-cam-cdi-tsc" according to kernel driver.
for instance, $public_sources/kernel_src/kernel/nvidia-oot/drivers/media/platform/tegra/cdi/cam_cdi_tsc.c

static const struct of_device_id cdi_tsc_of_match[] = {
         { .compatible = "nvidia,tegra234-cam-cdi-tsc", .data = &tegra234_cam_tsc_features },
         { .compatible = "nvidia,tegra264-cam-cdi-tsc", .data = &tegra264_cam_tsc_features },

Okay, so we just need care about source/nvidia-oot/drivers/media/platform/tegra/cdi/cam_cdi_tsc.c ?

Do we really need fsync-groups?

Is there a systematic documentation on how to enable fsync functionality?

hello liteblue,

it looks a probing failure of tsc_sig_gen@c230000, please dig into the code for checking which part causing such error.
you may also check whether a generators debugfs node has created.
i.e. /sys/kernel/debug/tsc_sig_gen@XXX/generator@XXX

unfortunately, there’s no documentation to enable fsync functionality.

I see that there is a fsync-group related usage in Drive OS, but Jetson does not have this usage. Can you provide an example to understand the steps to enable TSC?

By the way, no code for parsing fsync-groups was found in the nvidia-oot source code directory.

This may help tsc_signal_generation


nvidia-oot/drivers/media/platform/tegra/cam_fsync/cam_fsync.c:

nvidia-oot/drivers/media/platform/tegra/fuzz/cam_fsync/cam_fsync.txt:openat$cam_fsync(fd const[AT_FDCWD], file ptr[in, string["/dev/fsync-group"]], flags flags[open_flags], mode const[0]) fd_cam_fsync
nvidia-oot/drivers/media/platform/tegra/cam_fsync/cam_fsync.c:#define CAM_FSYNC_CLASS_NAME    "cam-fsync-groups"
nvidia-oot/drivers/media/platform/tegra/cam_fsync/cam_fsync.c:#define CAM_FSYNC_GROUPS_NODE   "fsync-groups"
nvidia-oot/drivers/media/platform/tegra/cam_fsync/cam_fsync.c:                        "fsync-group");

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.