Best practice - how to build DTBs

All,

to enable Thor to work with 100 GbE I already got a link to the corresponding information…
Enable 25 GbE on QSFP Port

However, one of the necessary steps was:

  1. Update the kernel device tree by patching Linux_for_Tegra/kernel/dtb/tegra264-p4071-0000+p3834-0008-nv.dtb
    (that was done, easily…)

  2. Build the DTB and replace it in the following paths:

    Linux_for_Tegra/kernel/dtb/tegra264-p4071-0000+p3834-0008-nv.dtb
    Linux_for_Tegra/rootfs/boot/tegra264-p4071-0000+p3834-0008-nv.dtb
    Linux_for_Tegra/bootloader/tegra264-p4071-0000+p3834-0008-nv.dtb

I tried to create the corresponding dtbs, using my Ubuntu VMware and the corresponding sdkmanager environment; also it is required to sync with git, creating your own development environment for ‘just updating’ the network speed.

After all, I struggled with all those steps, always ending up in additional error messages, as inludes are missing or need to be renamed or it seems even makefiles need updates :-(

–> As I’m probably not the only one to build a new kernel, DTB files, root file system:

Is there any best practises showing ‘easy steps’, also with the corresponding difference between SDKmanager directory structure and thor git-sources, e.g. when to copy which files between those sources and where to?

Any help would be highly apprectiated!
(I have basic Linux know.how, but am not a full time software developer, sorry)

Thx.!
Claus

Hi @c_thiede,

I hope you are doing well.

One important recommendation is to use a machine with Native Ubuntu. Using VM for flashing Jetson devices may cause many issues due to the instability of the USB connection. It may randomly disconnect during flashing or the board may not even get recognized.

You can follow the next steps to set up your Linux_for_Tegra build directory to apply the changes you need.

  1. Download JetPack 7 sources from NVIDIA’s official page: JetPack 7 sources. From the drivers tab download: Driver package (BSP) and Sample root Filesystem. The files downloaded are called:
  • Jetson_Linux_R38.2.1_aarch64.tbz2
  • Tegra_Linux_Sample-Root-Filesystem_R38.2.1_aarch64.tbz2
  1. Create build directory and copy the downloaded files there:
mkdir build
cd build
cp /path/to/Jetson_Linux_R38.2.1_aarch64.tbz2 .
cp /path/to/Tegra_Linux_Sample-Root-Filesystem_R38.2.1_aarch64.tbz2 .
  1. Extract the sources:
tar -vjxf Jetson_Linux_R38.2.1_aarch64.tbz2 
sudo tar -C Linux_for_Tegra/rootfs/ -vxjf Tegra_Linux_Sample-Root-Filesystem_R38.2.1_aarch64.tbz2 

This will create the Linux_for_Tegra directory.

  1. Get the kernel sources.
cd Linux_for_Tegra/source
./source_sync.sh -k -t jetson_38.2

Note: jetson_38.2 is the release tag for JetPack 7. You can find this release tag in the release notes for JetPack 7. (Release notes JetPack 7)

  1. Return to Linux_for_Tegra directory and apply binaries.
cd ../
sudo ./apply_binaries.sh
  1. Now you are all set for making the changes to Enable 25 GbE on QSFP port

Let me know if this helps! Feel free to reach out for further support.

Best regards,
Nico
Embedded Software Engineer at ProventusNova

which dtc

If you don’t have it then

sudo apt install device-tree-compiler


Decompile file
dtc -I dtb -O dts -o original_file.dts original_file.dtb
mv original_file.dtb original_file.dtb.bak

Make changes to dts

Recompile
dtc -I dts -O dtb -o original_file.dtb original_file.dts

dtc --help
Usage: dtc [options] <input file>

Options: -[qI:O:o:V:d:R:S:p:a:fb:i:H:sW:E:@AThv]
  -q, --quiet                
	Quiet: -q suppress warnings, -qq errors, -qqq all
  -I, --in-format <arg>      
	Input formats are:
		dts - device tree source text
		dtb - device tree blob
		fs  - /proc/device-tree style directory
  -o, --out <arg>            
	Output file
  -O, --out-format <arg>     
	Output formats are:
		dts - device tree source text
		dtb - device tree blob
		yaml - device tree encoded as YAML
		asm - assembler source
  -V, --out-version <arg>    
	Blob version to produce, defaults to 17 (for dtb and asm output)
  -d, --out-dependency <arg> 
	Output dependency file
  -R, --reserve <arg>        
	Make space for <number> reserve map entries (for dtb and asm output)
  -S, --space <arg>          
	Make the blob at least <bytes> long (extra space)
  -p, --pad <arg>            
	Add padding to the blob of <bytes> long (extra space)
  -a, --align <arg>          
	Make the blob align to the <bytes> (extra space)
  -b, --boot-cpu <arg>       
	Set the physical boot cpu
  -f, --force                
	Try to produce output even if the input tree has errors
  -i, --include <arg>        
	Add a path to search for include files
  -s, --sort                 
	Sort nodes and properties before outputting (useful for comparing trees)
  -H, --phandle <arg>        
	Valid phandle formats are:
		legacy - "linux,phandle" properties only
		epapr  - "phandle" properties only
		both   - Both "linux,phandle" and "phandle" properties
  -W, --warning <arg>        
	Enable/disable warnings (prefix with "no-")
  -E, --error <arg>          
	Enable/disable errors (prefix with "no-")
  -@, --symbols              
	Enable generation of symbols
  -A, --auto-alias           
	Enable auto-alias of labels
  -T, --annotate             
	Annotate output .dts with input source file and line (-T -T for more details)
  -h, --help                 
	Print this help and exit
  -v, --version              
	Print version and exit

Hi Nico, whitesscott,

many thanks to both of you!!!

This was extremely helpful and really assisted me in solving the task — there were a few minor points left, but I was able to handle those myself.
I managed to flash the Thor; however, there is still the issue that after boot, the console remains dark.
(I already applied the Console-patch with

  • SOC Display Hand-Off Mode: Auto

  • SOC Display Hand-Off Method: efifb

but it didn’t help too much: at least I could see some more output over the screen,
but no login screen/ Ubuntu Logo etc.)

Because of this, the final setup steps are not executed, and I end up without a user / login.
Is there any additional option I could try?
Thanks in advance!
Claus

Hi @c_thiede,

You can try creating a user before flashing the board with the l4t_create_default_user.sh script.

From the Linux_for_Tegra directory, run:

sudo ./tools/l4t_create_default_user.sh -u <username> -p <password> -n <hostname>

For example:

sudo ./tools/l4t_create_default_user.sh -u nvidia -p nvidia -n nvidia

Where:

  • -u is the username.
  • -p is the password.
  • -n is the hostname.

Best regards,
Nico
Embedded Software Engineer at ProventusNova

Hi Nico,
again, thank you so much!

That was exactly the answer I needed.
(the only hint I would give to others is, that the order when you start that script is important:
it is not only before flashing, but also before the ‘final’ recompile; otherwise it won’t be taken under consideration…)

So, finally I managed to implement my changes to 100 GbE and also bring Thor up and running :-)!

Besides this next topics are:

  • Console screen still is dark after reboot; is there any option I’ll need to implement into the kernel,
    to have that x-window visible after a reboot?

  • I also found out, that now I have 4 25 GbE Ports available.
    However, documentation doesn’t show, that if you use a 100 GbE cable and not
    100 GbE → 4
    25 GbE, that you’ll need another configuration than the one documented.
    The 4 * 25GbE Ports will need to show up as one 100 GbE Port for any “100 GbE” switch connected.
    ChatGPT gave recommendations for the individual additional values, such as

    mgbe0: ethernet@a808a10000 {
       status = “okay”;
       nvidia,mac-addr-idx    = <0x1>;
    
       nvidia,uphy-gbe-mode   = <0x8>;
       nvidia,use-gbe-bond    = <0x1>;
       nvidia,port-lanes      = <0x0 0x1 0x2 0x3>;
    
       nvidia,max-platform-mtu  = <0x2328>;   /* 9000 dez = 0x2328 \*/
       nvidia,pcs-rx-eq-sw-ovrd = <0x1>;
       nvidia,pps_op_ctrl       = <0x8>;
       nvidia,if-name           = “mgbe0_0”;
    
      fixed-link {
              full-duplex;
              speed = <25000>;  /* Hex optional */
      };```
    
    

};

with MGBE 1–3 only nvidia,uphy-gbe-mode = <8>;, no use-gbe-bond / port-lanes.

I hope, this will work …