How to share data between u-boot and kernel using bootargs

Hi Toradex Team,

I am using the apalis Im6 evaluation board, where I would like to set few bytes of data to environment variables and use that in kernel userspace.
Generally for other platforms I used bootargs variable to set some data in u-boot and that used to be stored in /proc/cmdline file in linux userspace. But this seems to be not working in apalis evaluation board.
I also found a file /etc/u-boot-initial-env which literally has all the u-boot args, however if I update some content to console uboot env variable and save that variable in u-boot shell and booted the kernel, still I don’t see the variable has the updated content.

Would request toradex team to help me on this issue. Here I would like to share 64 bytes of data from u-boot to kernel.

Thanks,
venkatesh

Hi @venkateshg,

Thanks for posting on Toradex Community!

Regarding your query you can use defargs. Check below exmaple setting custom var to hello and reading from /proc/cmdline.

Apalis iMX6 # editenv defargs
edit: enable_wait_mode=off vmalloc=400M custom=hello
root@apalis-imx6-04860229:~# cat /proc/cmdline 
enable_wait_mode=off vmalloc=400M custom=hello root=PARTUUID=e9ed4cf7-02 ro rootwait fec_mac=00:14:2d:4a:29:45 consoleblank=0 M

Best Regards
Ritesh Kumar