How to set cbootargs


I need to change the kernel boot parameters on the X2 to disable the UARTA console output.

In U-boot, using setenv and saveenv on cbootargs does not work.
It gets overwritten after one boot.

Changing {cbootargs} to the actual content of {cbootargs} in boot/extlinux.conf, results in inability the boot.

Can someone advise on what’s overwriting cbootargs and how to change it?

Changing an environment variable in U-Boot does normally go away after one boot…but have you tried to use “saveenv” after the change? The change should persist with saveenv.

Running “saveenv” does not help.
Other parameters are successfully saved (for example, bootdelay), but not cbootargs.

Some of the CBOOTARGS content is from the device tree. If this is the original source of the settings, then you’d need to set it in the device tree. Some of this is set in a partition which is loaded prior to the Linux kernel taking over, but other parts might be elsewhere and loaded prior to even U-Boot…so I can’t tell you exactly which device tree file to change (and this changes dependign on which L4T release you are using…you might want to say if you are using L4T R28.1, R28.2, so on).

One suggestion is to look at a log of flashing and to reverse compile every device tree image used during the flash…and then find which of those trees involve whatever setting you want to change. In all likelihood you’ll only need to change the partition with label “kernel-dtb”, so I’d start with that…perhaps nothing more will need update. In R28.2 there seem to have been some changes to how the binaries are put together (it used to be just the dtb file followed by NULL byte padding to fit the partition…there may now be some sort of leading signature, so reverse compile would require cutting out those leading bytes first before using dtc). More details on what needs to change might help.

I too have no cbootargs after I rebuilt and flashed the latest U-Boot (from my TX2 Development Board. I require the following:-

cbootargs=root=/dev/mmcblk0p1 rw rootwait console=ttyS0,115200n8 console=tty0 OS=l4t fbcon=map:0 net.ifnames=0 memtype=0 video=tegrafb no_console_suspend=1 earlycon=uart8250,mmio32,0x03100000 nvdumper_reserved=0x2772e0000 gpt tegra_fbmem2=0x140000@0x969ee000 lut_mem2=0x2008@0x969eb000 tegraid= tegra_keep_boot_clocks maxcpus=6 boot.slot_suffix= boot.ratchetvalues=0.2.1 androidboot.serialno=0422518026482 bl_prof_dataptr=0x10000@0x277040000 sdhci_tegra.en_boot_part_access=1

I can add this manually using 'set cbootargs’and save it using ‘saveenv’, but I want this to be present after flashing without needing a manual process.

Where do I need to put these settings in the build? The u-boot version from NVidia already has this.

The device tree has an entry called “chosen”. This is where you would add this in more recent releases. The result is that it goes into a binary partition and gets read before the file system is mounted. Check on the device tree flash instructions for the particular release you are using. Having this in device tree should make it the default.

Caution: Not all flash operations preserve the root file system (rootfs). If you have something valuable, and are not sure about what you are doing, then clone first.

1 Like

I have discovered the problem here.
The version of uBoot in Jetpack 3.3 for TX2 contains custom code which has not been included in the latest uBoot source on Namely a function called
int set_cbootargs(void)
which is called from
int cboot_init_late(void)
and which saves the bootargs passed in the DTB to the uBoot environment.

These functions are present in the file cboot_board.c in Jetpack 3.3 uBoot but are not there in the latest uBoot source.
In the latest soource there is a file called nvtboot_board.c which contains a function called
int tegra_soc_board_init_late(void)
but this function does not save the bootargs from the DTB.

Am I wrong to expect this code to be included in the latest uBoot source release?

This might not be what you want, but the source from NVIDIA is available via the “” script. This is part of the driver package (which creates the “Linux_for_Tegra/” subdirectory…if you’ve flashed with JetPack then you will already have this).

An example for R28.2.1:

./ -u tegra-l4t-r28.2.1

I can’t say if this is in a newer U-Boot distributed by something else, don’t know. Seems unlikely.