NVPPS not switching to gpio mode for providing PPS input externally

Please provide the following info (tick the boxes after creating this topic):
Software Version
DRIVE OS 6.0.8.1
DRIVE OS 6.0.6
DRIVE OS 6.0.5
DRIVE OS 6.0.4 (rev. 1)
DRIVE OS 6.0.4 SDK
other

Target Operating System
Linux
QNX
other

Hardware Platform
DRIVE AGX Orin Developer Kit (940-63710-0010-300)
DRIVE AGX Orin Developer Kit (940-63710-0010-200)
DRIVE AGX Orin Developer Kit (940-63710-0010-100)
DRIVE AGX Orin Developer Kit (940-63710-0010-D00)
DRIVE AGX Orin Developer Kit (940-63710-0010-C00)
DRIVE AGX Orin Developer Kit (not sure its number)
other

SDK Manager Version
1.9.3.10904
other

Host Machine Version
native Ubuntu Linux 20.04 Host installed with SDK Manager
native Ubuntu Linux 20.04 Host installed with DRIVE OS Docker Containers
native Ubuntu Linux 18.04 Host installed with DRIVE OS Docker Containers
other

Hello ,

I am trying to enable NVPPS and use external 1PPS to control my camera. I am feeding it via external cable harness pin 68. In my application I am doing the below.

struct nvpps_params params = {NVPPS_MODE_GPIO, NVPPS_TSC_COUNTER};
if (ioctl(fd, NVPPS_SETPARAMS, &params) != 0) {
printf(“ERR: ioctl failed for NVPPS_SETPARAMS err %s\n”,
strerror(errno));
return false;
}

But if I do dmesg I see " unable to switch mode. Only timer mode supported".

Below is my fsync group setting and nvpps setting. They both are enabled.

	fsync-groups {
		status = "okay";
		fsync-group@0 {
			id = <0>;
			status = "okay";
			generators = <&gen0>, <&gen1>, <&gen2>, <&gen3>;
		};
	};
nvpps {
	compatible = "nvidia,tegra194-nvpps";
	#address-cells = <1>;
	#size-cells = <1>;
	reg = <0x0 0xc6a0104 0x0 0x118>;
	interface = "mgbe2_0";
	sec_interface = "eqos_0";
	status = "okay";
};

How do i get the NVPPS in gpio mode running to provide external pps and try sync all cameras?

Thanks!!
Jishnu

I am wondering if its because I have not added gpio info to my dts nvpps node. Something like this below.

nvpps {
	compatible = "nvidia,tegra194-nvpps";
	#address-cells = <1>;
	#size-cells = <1>;
	reg = <0x0 0xc6a0104 0x0 0x118>;
	gpios = <&tegra_aon_gpio TEGRA234_AON_GPIO(EE, 6) GPIO_ACTIVE_HIGH>; 
	interface = "mgbe2_0";
	sec_interface = "eqos_0";
	status = "okay";
};

But then again I am not sure of this value "gpios = <&tegra_aon_gpio TEGRA234_AON_GPIO(EE, 6) GPIO_ACTIVE_HIGH>; " How to find the right value for pin 68 of external cable harness?

Please refer to the following code snippet from /drive/drive-linux/kernel/source/oss_src/nvidia-oot/drivers/nvpps/nvpps_main.c.

static int set_mode(struct nvpps_device_data *pdev_data, u32 mode)
{
        int     err = 0;
        if (mode != pdev_data->evt_mode) {
                switch (mode) {
                        case NVPPS_MODE_GPIO:
                                if (!pdev_data->only_timer_mode) {
...
                                } else {
                                        dev_err(pdev_data->dev, "unable to switch mode. Only timer mode is supported\n");
                                        err = -EINVAL;
                                }
                                break;
...
static int nvpps_probe(struct platform_device *pdev)
{
...
        err = of_get_gpio(np, 0);
        if (err == -EPROBE_DEFER) {
                return err;
        } else if (err < 0) {
                dev_warn(&pdev->dev, "PPS GPIO not provided in DT, only Timer mode available\n");
                pdev_data->only_timer_mode = true;
        }

Let me check it internally and get back to you.

HI @VickNV

Yes I referred to this code snippet and we see the below as well.

	err = of_get_gpio(np, 0);
	if (err == -EPROBE_DEFER) {
		return err;
	} else if (err < 0) {
		dev_warn(&pdev->dev, "PPS GPIO not provided in DT, only Timer mode available\n");
		pdev_data->only_timer_mode = true;
	} else {
		pdev_data->gpio_pin = (unsigned int)err;
		dev_info(&pdev->dev, "gpio_pin(%d)\n", pdev_data->gpio_pin);

Our intention is to set pdev_data->only_timer_mode = true; to false ie enter else loop so that the above snippet you shared goes inside if and is set appropriately.

Then again we come back to the same question, a proper entry of gpio pin is needed. I think we both are mostly on the same page. Could you please check internally and help me with the exact TEGRA234_AON_GPIO number .

I couldn’t figure out which is the right pinmux document/header file for drive orin and also the mapping part to external pin. I think I am looking at gp60 from the hardware document, but i don’t see the exact mapping .

Kindly help me out.

Thanks!!
Jishnu

This is the proper configuration for the pin on the harness.

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