How to cut the FAN device and ina3221 for device tree

hi,on my customed tx2 carry board, there is not a FAN device and ina3221, when the board power on, the uart logs “FAN: coudln’t get the regulator” and “ina3221x 0-0042: ina3221 reset failure status: 0xffffff87” and also “ina3221x 0-0043: ina3221 reset failure status: 0xffffff87”,how to modify the device tree to adapte or cut the device related ?
i used jetpack4.4(L4T 32.4.3)

hello zsjalive,

please check below device tree for TX2’s power monitor for reference.
for example,

hi,i have compiled my dtb file so the date info is new, i used “sudo ./ -r -k kernel-dtb jetson-tx2 mmcblk0p1” to flash dtb , after power on, how to confirm the board used my customed dtb or not ? is the date info inclued in dmesg, or any other ways?thanks

hello zsjalive,

the quickest way is checking from kernel messages,
for example, $ dmesg | grep DTS.

if the device tree change works as expect.
you may see the path of your device tree file, it should be the path of your host machine where you’d compiled it.

my message is
[ 0.164209] DTS File Name: /dvs/git/dirty/git-master_linux/kernel/kernel-4.9/arch/arm64/boot/dts/…/…/…/…/…/…/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-c03-00-base.dts
[ 0.429734] DTS File Name: /dvs/git/dirty/git-master_linux/kernel/kernel-4.9/arch/arm64/boot/dts/…/…/…/…/…/…/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-c03-00-base.dts

it means my dtb doesn’t work?

hello zsjalive,

yes, those were default device tree binaries coming from build machine.
had you replace your own customize device tree with $OUT/Linux_for_Tegra/kernel/dtb/tegra186-quill-p3310-1000-c03-00-base.dtb before execute the flashing commands?

  1. I download L4T source ,2、i compiled the kernel source and dtb ,“make ARCH=arm64 O=TEGRA_KERNEL_OUT CROSS_COMPILE={CROSS_COMPILE} -j4 dtbs”,3.i confirm the dtb file in “kernel/output/arch/arm64/boot/dts” is updated , the date of files is new. 4. i copy the dtb files to “JetPack_4.4_Linux_JETSON_TX2/Linux_for_Tegra/kernel/dtb”, 5. go to dir “Linux_for_Tegra”, flash the dtb files using “sudo ./ -r -k kernel-dtb jetson-tx2 mmcblk0p1”. any step wrong ?

hello zsjalive,

those steps looks correct, could you please also share the flashing messages for reference,

hi ,i have uploaded flash dtb log .flashDTBlog.txt (18.6 KB)

hello zsjalive,

it seems kernel-dtb has update correctly, you may also check the /boot/extlinux/extlinux.conf configuration file.
the default extlinux.conf file has no FDT entry. if there is no FDT entry, the kernel-dtb binary is loaded from the kernel-dtb partition.

so this is the key, but there is another problem conflict, 1、i enabled spi on J21 header on TX2 board, it generates another dtb file named “tegra186-quill-p3310-1000-c03-00-base-user-custom.dtb” under path /boot on board, and extlinux.conf upated (i have uploaed), when powered on , it autos select user-comstomed dtb file. 2、when i used defalut extlinux.conf(not enabled spi), the dtb file i compiled woeks , i used " $ dmesg | grep DTS .", the date of dtb file is new. but i can not use spi .
so how to reslove the conflict.

hello zsjalive,

you should merge those device tree modification of SPI, then generate another device tree blob.
you may disassembler the dtb file into text file to review the device tree content.
for example, $ dtc -I dtb -O dts -o output.txt tegra186-quill-p3310-1000-c03-00-base-user-custom.dtb

1、i converted user-custom.dtb(enable spi) to dts file ,convert default dtb to dts file.
2、 compare two dts file, then merge.
3、convert dts file to dtb file
4、flash dtb file.
but spi test failed.
i have to pic (log from uart J21

)uploaded .

hello zsjalive,

did you remove the FDT entry from extlinux.conf file, to ensure loading the device tree binary from the kernel-dtb partition.

hello zsjalive,

the FDT entry,
please delete that line for making device tree binary loads from the kernel-dtb partition.