Run Jetpack 4.2.2 with Auvidea J120 board

Let me share how to get the J120 working with Jetpack 4.2.2.
Jetpack 4.2.2 as well as 4.2.1 contain a number of changes to the device tree compared to Jetpack 4.2.
That seems to be the reason why I could not get my TX2 working with the latest Version 2 of the Auvidea firmware when I moved from 4.2 to 4.2.2.

I am attaching my edited .dtsi files here which contain all changes needed to run the J120 along with JP 4.2.2 you may use when you compile the kernel.

Please follow the instructions here to compile the kernel manually and to flash it to your TX2:
https://developer.ridgerun.com/wiki/index.php?title=Compiling_Jetson_TX2_source_code_L4T_32.1
Before step 3, you need to copy the attached .dts and .dtsi files into the respective

..../t18x/common

and

..../t18x/quill

directories.
After flashing the kernel, you can continue to install the Jetpack libraries by using SDKManager as usual.

As far as I could test, you get one USB3.0, one USB 2.0 and one microUSB 2.0 port operational.

Known issues:

  • no OTG support on the microUSB port - so you are not able to flash the TX2 from a host computer when mounted on the J120 (for flashing, you need to switch to the Development Board) I am not sure if that ever worked with the J120 Rev 8 though…
  • Fan is always on. There is no access to the fan. This issue also persisted with the official Auvidea firmware 2.0 and JP 4.2

If anyone of the experts here has an idea to get fan control working along with the J120, I would highly appreciate it - Thanks!
tegra186-quill-p3310-1000-.zip (6.44 KB)

1 Like

Some more evidence on the fan issue. When I check the logs, I see the error:

apsync@apsync:~$ dmesg | grep -i fan
[    0.000000] 	Build-time adjustment of leaf fanout to 64.
[    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=64, nr_cpu_ids=6
[    1.199170] thermal thermal_zone7: Registering thermal zone thermal_zone7 for type thermal-fan-est
[    1.365827] pwm_fan_driver: probe of fixed-regulators:regulator@13 failed with error -22
[    1.366027] FAN: coudln't get the regulator
apsync@apsync:~$

The problem seems that the Auvidea J120 firmware changes in the device tree look for the following file which seems to be missing in Jetpack 4.2.x:

/sys/devices/fixed-regulators/fixed-regulators:regulator@13/regulator/regulator.19/pwm-fan-vdd-fan

So either the device tree change introduced in the Auvidea J120 firmware 2.0 is incorrect or this file is missing in my installation. This is the entry for the fan in the Auvidea modified device tree in file tegra186-quill-p3310-1000-a00-00-base.dts:

fixed-regulators {
		vdd_fan: regulator@13 {
			status = "okay";
			compatible = "pwm-fan";
			gpio = <&tegra_main_gpio TEGRA_MAIN_GPIO(J, 6) GPIO_ACTIVE_LOW>;  
		};
	};

	pwm_fan_shared_data: pfsd {
		status = "okay";
		num_resources = <0>;
		secret = <47>;
		active_steps = <10>;
		active_rpm = <0 1000 2000 3000 4000 5000 6000 7000 10000 11000>;
		rpm_diff_tolerance = <2>;
		active_rru = <40 2 1 1 1 1 1 1 1 1>;
		active_rrd = <40 2 1 1 1 1 1 1 1 1>;
		state_cap_lookup = <2 2 2 2 3 3 3 4 4 4>;
		pwm_period = <45334>;
		pwm_id = <3>;
		step_time = <100>; 
		state_cap = <7>;
		active_pwm_max = <256>;
		tach_period = <1000>;
		pwm_gpio = <&tegra_main_gpio TEGRA_MAIN_GPIO(J, 6) GPIO_ACTIVE_LOW>;
	};
	pwm-fan {
		status = "okay";
		compatible = "pwm-fan";
		#pwm-cells = <1>;
		pwms = <&tegra_pwm4 0 45334>;
		shared_data = <&pwm_fan_shared_data>;
		active_pwm = <0 80 120 160 255 255 255 255 255 255>;
	};

Would be great if someone of the @Auvidea support team could have a look.
Thanks!

I also found fan control to be broken, both with Auvidea 2.0 firmware and the patch given at https://devtalk.nvidia.com/default/topic/1055499/jetson-tx2/tx2-amp-auvidea-j120-setup-jetpack4-2/post/5351299/#5351299

There are multiple issues:
The driver (kernel/nvidia/drivers/thermal/pwm_fan.c) matches the first node it finds with

compatible = "pwm-fan"

and calls pwm_fan_probe on it. For me that node is vdd_fan rather than the intended node, pwm-fan. That can be worked around by changing of_pwm_fan_match in pwm_fan.c, but then pwm_fan_probe’s gpio_request call fails with EBUSY because vdd_fan claims that gpio pin. The gpio_request also fails if you revert Auvidea’s change of vdd_fan compatible, making it

"compatible = "regulator-fixed-sync";

. I also tried removing

gpio = <&tegra_main_gpio TEGRA_MAIN_GPIO(J, 6) GPIO_ACTIVE_LOW>;

but the fan didn’t move.

Currently I’ve disabled pwm-fan in devicetree and set up a constant pulsewidth on boot:

echo 0 >/sys/class/pwm/pwmchip3/export
echo 45334 >/sys/class/pwm/pwmchip3/pwm0/period
echo 10000 >/sys/class/pwm/pwmchip3/pwm0/duty_cycle 
echo 1 >/sys/class/pwm/pwmchip3/pwm0/enable

This is not responsive to temperature at all, but at least its neither off nor full blast.

Does anyone have any ideas on how to make pwm_fan_probe()'s gpio_request on pwm_gpio succeed when its the same pin as as vdd_fan’s gpio?

There is another forum entry on the fan for the J120.
https://devtalk.nvidia.com/default/topic/1028361/jetson-tx2/auvidea-j120-imu-rev-7-carrier-board-/

The following overrides seem to result in a system that doesn’t throw errors on boot, but I haven’t seen the fan turn on either, yet.

&vdd_fan {
        /delete-property/ gpio;
};
&pwm_fan_shared_data {
        pwm_gpio = <&tegra_main_gpio TEGRA_MAIN_GPIO(J, 6) GPIO_ACTIVE_LOW>;
};