Modifying the L4TConfiguration dts

I am trying to add “KernelCommandLine” to my L4TConfiguration.dts to include some new default kernel bootargs. The problem is that KernelCommandLine is define as uint16 since it is unicode. If I set data = “string value”; then it appears that the individual characters are somehow transformed to unicode characters and I get a kernel command line with Asian characters in place of “string value”. If I use data = [0072 006f]; to try to force 2 unicode characters for example. I get the same result where the characters are similarly misinterpreted into 4 unicode characters of unknown progeny. What is the syntax in the device tree to pass a unicode string or at least somehow get the characters I want transferred to the kernel command line?

This is what I am using now (that isn’t working):

KernelCommandLine {
data = “root=/dev/mmcblk0p1 rauc.slot=A”;
runtime;
non-volatile;
}

The device tree has node “chosen->bootloader” (on a running system check “cat /proc/device-tree/chosen/bootloader”). This is appended to kernel boot command line. Can you add the “rauc.slot=A” there? Also, when this fails, what do you see from “cat /proc/cmdline”?

On the computer you work from, what do you see from “echo $LANG”?

Thanks for your response. On my system I have /proc/device-tree/chosen/bootargs - I do not have bootloader (this is an Orin system and uses UEFI FWIW) - and the content is:

mminit_loglevel=4 console=tty0 console=ttyTCU0,115200 firmware_class.path=/etc/firmware fbcon=map:0 net.ifnames=0 潲瑯⼽敤⽶浭扣歬瀰‱慲捵献潬㵴A

I cannot modify the contents of this ‘file’

cat /proc/cmdline yields:
mminit_loglevel=4 console=tty0 console=ttyTCU0,115200 firmware_class.path=/etc/firmware fbcon=map:0 net.ifnames=0 潲瑯⼽敤⽶浭扣歬瀰‱慲捵献潬㵴A

And echo $LANG on my work computer (where I generate the dtb) is:
en_US.UTF-8

Hi neil30,

Are you using the devkit or custom board?

Have you tried to modify “/boot/extlinux/extlinux.conf” for kernel cmdline?
Please also try with sudo permission.

Hi @KevinFFF

Thanks for your response. It is a yocto-generated kernel and file system (core-image-minimal) running on a standard NVIDIA Orin dev kit. I am logged in as root so I don’t need sudo and there is nothing at all in the /boot directory.

Sorry, we don’t support and maintain yocto project due to also not verified by us.

This question has nothing to do with yocto. The question is “What is the syntax in the device tree L4TConfiguration.dts for specifying a value for “KernelCommandLine” given that it is defined as unicode characters?”

Please try to use chosen for bootargs as following:

chosen {
    bootargs = "root=/dev/mmcblk0p1 rauc.slot=A";
};

Unfortunately, that yielded the same result. Asian characters appended to the boot arg list. The magic here is most definitely knowing the device tree syntax that allows specification of unicode characters

Is it possible that the Yocto software itself is not en_US? The possibilities are:

  • The character is preserved correctly, but being displayed with another $LANG.
  • The character is altered during conversion of dts to dtb.

We know that your software, where you are reading it, is en_US. But we don’t know if Yocto itself is 100% en_US. For example, “cat /proc/cmdline” might be altered during read or during creation.

My money is currently on the device tree compiler turning the string into a standard ASCII encoded string rather than a unicode string because every other string in the device tree is ASCII-encoded and NOT unicode. I don’t see a way to flag a unicode string to the device tree compiler. If there is some magic way to define a 16 bit word array to the device tree compiler that could be a work around too, I suppose. The few attempts I have made at that have seen the compiler break every array into 8 bit bytes that once again are mangled by the code that reads this particular device tree entry (it reads each byte and expands it to 16 bits)