Parse input tree error after inclusion of pinmux gpio file for TX2
Hello, We get an error on line: TEGRA_GPIO(B, 5) when including the generated gpio file from the excell pinmux file. [code]#include <dt-bindings/gpio/tegra-gpio.h> / { gpio@2200000 { gpio-init-names = "default"; gpio-init-0 = <&gpio_default>; gpio_default: default { gpio-input = < TEGRA_GPIO(B, 5) TEGRA_GPIO(C, 0) TEGRA_GPIO(J, 5) TEGRA_GPIO(M, 5) TEGRA_GPIO(I, 4) TEGRA_GPIO(I, 6) TEGRA_GPIO(I, 7) TEGRA_GPIO(FF, 1) TEGRA_GPIO(FF, 2) TEGRA_GPIO(FF, 3) TEGRA_GPIO(FF, 4) [/code] Thank you in advance, Tanguy
Hello,

We get an error on line: TEGRA_GPIO(B, 5) when including the generated gpio file from the excell pinmux file.

#include <dt-bindings/gpio/tegra-gpio.h>

/ {
gpio@2200000 {
gpio-init-names = "default";
gpio-init-0 = <&gpio_default>;

gpio_default: default {
gpio-input = <
TEGRA_GPIO(B, 5)
TEGRA_GPIO(C, 0)
TEGRA_GPIO(J, 5)
TEGRA_GPIO(M, 5)
TEGRA_GPIO(I, 4)
TEGRA_GPIO(I, 6)
TEGRA_GPIO(I, 7)
TEGRA_GPIO(FF, 1)
TEGRA_GPIO(FF, 2)
TEGRA_GPIO(FF, 3)
TEGRA_GPIO(FF, 4)


Thank you in advance,

Tanguy

#1
Posted 01/10/2018 02:21 PM   
The gpio dtsi file is certainly not at the correct place.
The gpio dtsi file is certainly not at the correct place.

#2
Posted 01/10/2018 02:38 PM   
In which folder should the pinmux generated .dtsi file go?
In which folder should the pinmux generated .dtsi file go?

#3
Posted 01/10/2018 02:41 PM   
hello Ketchup, suppose you're following the steps in the [TX2 Configuring Pinmux GPIO and PAD] chapter, right? could you share the steps and what's the failure you met to us. thanks
hello Ketchup,

suppose you're following the steps in the [TX2 Configuring Pinmux GPIO and PAD] chapter, right?
could you share the steps and what's the failure you met to us.
thanks

#4
Posted 01/11/2018 02:22 AM   
Hi JerryChang, I am indeed following the [TX2 Configuring Pinmux GPIO and PAD] chapter. For the moment, we are not flashing the TX2 as we did not clone it yet. We want to test our compiled bootloader, linux and dtb by tftpboot them on the TX2. So, we are not using the .cfg files yet, we only need a .dtb of our custom board. When I include generated .dtsi files in a copy of tegra186-quill-p3310-1000-c03-00-base.dts, I get a parse error at: [code]#include <dt-bindings/gpio/tegra-gpio.h> / {[/code] When I copy/paste pinmux dtsi code in node pinmux@2430000, it compiles, but not when I add gpio dtsi code in gpio@2200000. Can you help?
Hi JerryChang,

I am indeed following the [TX2 Configuring Pinmux GPIO and PAD] chapter.
For the moment, we are not flashing the TX2 as we did not clone it yet.
We want to test our compiled bootloader, linux and dtb by tftpboot them on the TX2.

So, we are not using the .cfg files yet, we only need a .dtb of our custom board.

When I include generated .dtsi files in a copy of tegra186-quill-p3310-1000-c03-00-base.dts, I get a parse error at:

#include <dt-bindings/gpio/tegra-gpio.h>

/ {


When I copy/paste pinmux dtsi code in node pinmux@2430000, it compiles, but not when I add gpio dtsi code in gpio@2200000.

Can you help?

#5
Posted 01/11/2018 10:17 AM   
hello Ketchup, you need to use the .cfg files for your customize pinmux settings. thanks
hello Ketchup,

you need to use the .cfg files for your customize pinmux settings.
thanks

#6
Posted 01/12/2018 06:43 AM   
What if I don't want to flash as explained and use my own dtb like here: https://elinux.org/Jetson/TX2_DTB thanks
What if I don't want to flash as explained and use my own dtb like here: https://elinux.org/Jetson/TX2_DTB


thanks

#7
Posted 01/12/2018 11:07 AM   
As explained here https://devtalk.nvidia.com/default/topic/1022822/?comment=5204511, I want to build my DTB's with my generated .dtsi files. Please help.
As explained here https://devtalk.nvidia.com/default/topic/1022822/?comment=5204511, I want to build my DTB's with my generated .dtsi files.

Please help.

#8
Posted 01/12/2018 04:04 PM   
Is it the creation of a dtb file from dtsi which you are asking about? Or are you asking about installing without flashing? If it is about creating a dtb file from dtsi, then you have to edit the dtsi within the kernel source, and while configured to match your running system, run "make dtbs". I do not know which of the many generated dtb files your dtsi will result in modification, but a dtsi is just a header/include file to device trees in the same way that a C ".h" header file is included in multiple source files...the output file is not necessarily a 1-to-1 correspondence...the change of a dtsi may change multiple dtb files, or under some configurations might not change any. Because the destination of most device tree changes for a TX2 running L4T R28.1 is mmcblk0p15 odds are the particular kernel build target result you are interested in is "arch/arm64/boot/dts/tegra186-quill-p3310-1000-c03-00-base.dtb".
Is it the creation of a dtb file from dtsi which you are asking about? Or are you asking about installing without flashing?

If it is about creating a dtb file from dtsi, then you have to edit the dtsi within the kernel source, and while configured to match your running system, run "make dtbs". I do not know which of the many generated dtb files your dtsi will result in modification, but a dtsi is just a header/include file to device trees in the same way that a C ".h" header file is included in multiple source files...the output file is not necessarily a 1-to-1 correspondence...the change of a dtsi may change multiple dtb files, or under some configurations might not change any.

Because the destination of most device tree changes for a TX2 running L4T R28.1 is mmcblk0p15 odds are the particular kernel build target result you are interested in is "arch/arm64/boot/dts/tegra186-quill-p3310-1000-c03-00-base.dtb".

#9
Posted 01/12/2018 05:51 PM   
Hi linuxdev, It is indeed about creating our custom tegra186-quill-p3310-1000-c03-00-base.dtb but using the generetaed .dtsi files from the excell pinmux sheet. The nv4lt documentation says copy files to linux, where in the kernel source should these .dtsi files be copied and where to include them?
Hi linuxdev,

It is indeed about creating our custom tegra186-quill-p3310-1000-c03-00-base.dtb but using the generetaed .dtsi files from the excell pinmux sheet.

The nv4lt documentation says copy files to linux, where in the kernel source should these .dtsi files be copied and where to include them?

#10
Posted 01/12/2018 06:03 PM   
I don't know which files are listed, but do you see the "source_sync.sh" script in the "Linux_for_Tegra/" subdirectory of the driver package? This is also part of the JetPack install (which is a front end for the driver package), and is probably the preferred way to get the kernel source since it also brings in some related files. Example: [code]./source_sync.sh -u tegra-l4t-r28.1[/code] This produces a "sources/" subdirectory. If you cd to that location you can run this command and see a complete list of every dtsi file: [code]find . -name '*.dtsi'[/code] A more sane list of files starting with "tegra186-quill": [code]find . -name 'tegra186-quill*.dtsi'[/code] So a question which might be useful here is "which dtsi files do you have"?
I don't know which files are listed, but do you see the "source_sync.sh" script in the "Linux_for_Tegra/" subdirectory of the driver package? This is also part of the JetPack install (which is a front end for the driver package), and is probably the preferred way to get the kernel source since it also brings in some related files. Example:
./source_sync.sh -u tegra-l4t-r28.1


This produces a "sources/" subdirectory. If you cd to that location you can run this command and see a complete list of every dtsi file:
find . -name '*.dtsi'


A more sane list of files starting with "tegra186-quill":
find . -name 'tegra186-quill*.dtsi'


So a question which might be useful here is "which dtsi files do you have"?

#11
Posted 01/12/2018 06:42 PM   
I have all sources and quill dtsi files, thanks. I have the generated .dtsi files: tegra18x-<custom-name>-gpio-default.dtsi tegra18x-<custom-name>-padvoltage-default.dtsi tegra18x-<custom-name>-pinmux.dtsi
I have all sources and quill dtsi files, thanks.

I have the generated .dtsi files:

tegra18x-<custom-name>-gpio-default.dtsi
tegra18x-<custom-name>-padvoltage-default.dtsi
tegra18x-<custom-name>-pinmux.dtsi

#12
Posted 01/12/2018 07:19 PM   
Does find show these within the source_sync.sh tree? If so, then I'd back up the originals and copy yours in in place of the originals. Then configure for kernel build matching your existing system and CONFIG_LOCALVERSION (the suffix of "uname -r"). Just to guarantee proper configuration I'd then make the Image target, although this isn't strictly needed...I consider it a sanity check even if I don't need it. Then make the dtbs target, and the dtb file should become available. This is what gets put into mmcblk0p15 (the partition with label "kernel-dtb"). Once you have this there are a couple of ways to put this in place. The default instructions are typically say to build the dtb file and copy "kernel/arch/arm64/boot/dts/tegra186-quill-p3310-1000-c03-00-base.dtb" to overwrite the "Linux_for_Tegra/kernel/dtb/" version (I suggest backing up the original), then put it in place with: [code]sudo ./flash.sh -r -k kernel-dtb jetson-tx2 mmcblk0p1[/code] So long as the file is not larger than the partition (and there are a lot of additions which would be required before this would ever happen) this is equivalent to using dd to write to that partition. Extra NULL bytes won't hurt. [b][u]Alternative to flash.sh for dtb install:[/u][/b] An example of doing this with dd is to first check the size of that partition and make a backup: [code]dd if=/dev/mmcblk0p15 of=original_kernel-dtb.bin bs=512 ls -l original_kernel-dtb.bin # ...verify the size is evenly divisible by 512, the block size...[/code] On R28.1 of a TX2 it should be [b]524288[/b] bytes. Strictly speaking, you probably don't need to extend the smaller ".dtb" file, but it must fit within this original partition size. Just to be thorough I'm going to pad with NULL bytes until I get that size: [code]cp /where/ever/it/is/tegra186-quill-p3310-1000-c03-00-base.dtb modified_kernel-dtb.bin truncate --size=524288 modified_kernel-dtb.bin ls -l modified_kernel-dtb.bin # ...original and modified should now be the same size... dd if=modified_kernel-dtb.bin of=/dev/mmcblk0p15 bs=512[/code] After reboot the changes should be visible in "/proc/device-tree/". Do be careful and verify the dtb file you now have is truly the modification you want. One tool is to take that original partttion, convert it to a dts, and compare to the one you are about to flash: [code]dtc -I dtb -O dts -o original_kernel-dtb.dts original_kernel-dtb.bin # compare original and modified[/code]
Does find show these within the source_sync.sh tree? If so, then I'd back up the originals and copy yours in in place of the originals. Then configure for kernel build matching your existing system and CONFIG_LOCALVERSION (the suffix of "uname -r"). Just to guarantee proper configuration I'd then make the Image target, although this isn't strictly needed...I consider it a sanity check even if I don't need it. Then make the dtbs target, and the dtb file should become available. This is what gets put into mmcblk0p15 (the partition with label "kernel-dtb").

Once you have this there are a couple of ways to put this in place. The default instructions are typically say to build the dtb file and copy "kernel/arch/arm64/boot/dts/tegra186-quill-p3310-1000-c03-00-base.dtb" to overwrite the "Linux_for_Tegra/kernel/dtb/" version (I suggest backing up the original), then put it in place with:
sudo ./flash.sh -r -k kernel-dtb jetson-tx2 mmcblk0p1


So long as the file is not larger than the partition (and there are a lot of additions which would be required before this would ever happen) this is equivalent to using dd to write to that partition. Extra NULL bytes won't hurt.

Alternative to flash.sh for dtb install:

An example of doing this with dd is to first check the size of that partition and make a backup:
dd if=/dev/mmcblk0p15 of=original_kernel-dtb.bin bs=512
ls -l original_kernel-dtb.bin
# ...verify the size is evenly divisible by 512, the block size...


On R28.1 of a TX2 it should be 524288 bytes. Strictly speaking, you probably don't need to extend the smaller ".dtb" file, but it must fit within this original partition size. Just to be thorough I'm going to pad with NULL bytes until I get that size:
cp /where/ever/it/is/tegra186-quill-p3310-1000-c03-00-base.dtb modified_kernel-dtb.bin
truncate --size=524288 modified_kernel-dtb.bin
ls -l modified_kernel-dtb.bin
# ...original and modified should now be the same size...
dd if=modified_kernel-dtb.bin of=/dev/mmcblk0p15 bs=512


After reboot the changes should be visible in "/proc/device-tree/". Do be careful and verify the dtb file you now have is truly the modification you want.

One tool is to take that original partttion, convert it to a dts, and compare to the one you are about to flash:
dtc -I dtb -O dts -o original_kernel-dtb.dts original_kernel-dtb.bin
# compare original and modified

#13
Posted 01/12/2018 09:15 PM   
Thanks linuxdev, What we don't know is where to include those .dtsi in the kernel source: tegra18x-<custom-name>-gpio-default.dtsi tegra18x-<custom-name>-padvoltage-default.dtsi tegra18x-<custom-name>-pinmux.dtsi We get tree parse errors when we include them at the beginning of file tegra186-quill-p3310-1000-c03-00-base.dts. Thanks for pointing us out where to include those headers.
Thanks linuxdev,

What we don't know is where to include those .dtsi in the kernel source:

tegra18x-<custom-name>-gpio-default.dtsi
tegra18x-<custom-name>-padvoltage-default.dtsi
tegra18x-<custom-name>-pinmux.dtsi

We get tree parse errors when we include them at the beginning of file tegra186-quill-p3310-1000-c03-00-base.dts.

Thanks for pointing us out where to include those headers.

#14
Posted 01/14/2018 11:01 AM   
I don't know if the forum will work attaching a spreadsheet, but if possible, click on the "paper clip" icon which shows up when you hover the mouse over the quote icon in the upper right of an existing post...then attach the spreadsheet you used. It might be easier if people can just look at it if the forum software allows the attachment.
I don't know if the forum will work attaching a spreadsheet, but if possible, click on the "paper clip" icon which shows up when you hover the mouse over the quote icon in the upper right of an existing post...then attach the spreadsheet you used. It might be easier if people can just look at it if the forum software allows the attachment.

#15
Posted 01/14/2018 03:14 PM   
Scroll To Top

Add Reply