cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass kernel parameter from uboot ?

hochul yoo
Associate III

I want to pass the some parameters to kernel command line. 

drm.edid_firmware=edid/1280x800.bin

I tried to use "bootargs" environment of uboot. 

env set bootargs "drm.edid_firmware=edid/1280x800.bin"

But, Not working as I expect. 

I couldn't find my parameter in kernel command line.

below is dmesg log.

Kernel command line: root=PARTUUID=491f6117-415d-4f53-88c9-6e0de54deac6 rootwait rw  console=ttySTM0,115200

below is /proc/cmdline log. 

root@stm32mp15:~# cat /proc/cmdline
root=PARTUUID=491f6117-415d-4f53-88c9-6e0de54deac6 rootwait rw  console=ttySTM0,115200

How to pass the kernel command line parameters on uboot?

thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Kevin HUBER
ST Employee

Hello @hochul yoo​ ,

In the ST environment, the U-boot got the kernel bootargs from an extlinux.conf. This information can be found in the wiki: https://wiki.st.com/stm32mpu/wiki/U-Boot_overview#Generic_Distro_configuration

You can see the name of this file during the boot of your board, in the U-Boot traces:

mmc0 is current device
Scanning mmc 0:8...
Found /mmc0_extlinux/stm32mp157f-dk2_extlinux.conf
Retrieving file: /mmc0_extlinux/stm32mp157f-dk2_extlinux.conf

In this file, the several boot modes are listed and you can see the kernel bootargs associated to these configurations:

root@stm32mp1:/# cat ./boot/mmc0_extlinux/stm32mp157f-dk2_extlinux.conf
# Generic Distro Configuration file generated by OpenEmbedded
menu title Select the boot mode
MENU BACKGROUND /splash_portrait.bmp
TIMEOUT 20
DEFAULT OpenSTLinux
LABEL OpenSTLinux
        KERNEL /uImage
        FDTDIR /
        INITRD /st-image-resize-initrd
        APPEND root=PARTUUID=e91c4e10-16e6-4c0e-bd0e-77becf4a3582 rootwait rw   console=${console},${baudrate}
LABEL stm32mp157f-dk2-a7-examples
        KERNEL /uImage
        FDT /stm32mp157f-dk2-a7-examples.dtb
        INITRD /st-image-resize-initrd
        APPEND root=PARTUUID=e91c4e10-16e6-4c0e-bd0e-77becf4a3582 rootwait rw   console=${console},${baudrate}
LABEL stm32mp157f-dk2-m4-examples
        KERNEL /uImage
        FDT /stm32mp157f-dk2-m4-examples.dtb
        INITRD /st-image-resize-initrd
        APPEND root=PARTUUID=e91c4e10-16e6-4c0e-bd0e-77becf4a3582 rootwait rw   console=${console},${baudrate}

Modify the bootargs

To modify this file, you can edit it once you are in the linux by doing an edit with "vi".

Or you can follow this page that explains several way to edit the extlinux.conf: https://wiki.st.com/stm32mpu/wiki/How_to_use_the_kernel_dynamic_debug#Debug_messages_during_boot_process

Hope it helps,

Best Regards,

Kevin

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

View solution in original post

4 REPLIES 4
Kevin HUBER
ST Employee

Hello @hochul yoo​ ,

In the ST environment, the U-boot got the kernel bootargs from an extlinux.conf. This information can be found in the wiki: https://wiki.st.com/stm32mpu/wiki/U-Boot_overview#Generic_Distro_configuration

You can see the name of this file during the boot of your board, in the U-Boot traces:

mmc0 is current device
Scanning mmc 0:8...
Found /mmc0_extlinux/stm32mp157f-dk2_extlinux.conf
Retrieving file: /mmc0_extlinux/stm32mp157f-dk2_extlinux.conf

In this file, the several boot modes are listed and you can see the kernel bootargs associated to these configurations:

root@stm32mp1:/# cat ./boot/mmc0_extlinux/stm32mp157f-dk2_extlinux.conf
# Generic Distro Configuration file generated by OpenEmbedded
menu title Select the boot mode
MENU BACKGROUND /splash_portrait.bmp
TIMEOUT 20
DEFAULT OpenSTLinux
LABEL OpenSTLinux
        KERNEL /uImage
        FDTDIR /
        INITRD /st-image-resize-initrd
        APPEND root=PARTUUID=e91c4e10-16e6-4c0e-bd0e-77becf4a3582 rootwait rw   console=${console},${baudrate}
LABEL stm32mp157f-dk2-a7-examples
        KERNEL /uImage
        FDT /stm32mp157f-dk2-a7-examples.dtb
        INITRD /st-image-resize-initrd
        APPEND root=PARTUUID=e91c4e10-16e6-4c0e-bd0e-77becf4a3582 rootwait rw   console=${console},${baudrate}
LABEL stm32mp157f-dk2-m4-examples
        KERNEL /uImage
        FDT /stm32mp157f-dk2-m4-examples.dtb
        INITRD /st-image-resize-initrd
        APPEND root=PARTUUID=e91c4e10-16e6-4c0e-bd0e-77becf4a3582 rootwait rw   console=${console},${baudrate}

Modify the bootargs

To modify this file, you can edit it once you are in the linux by doing an edit with "vi".

Or you can follow this page that explains several way to edit the extlinux.conf: https://wiki.st.com/stm32mpu/wiki/How_to_use_the_kernel_dynamic_debug#Debug_messages_during_boot_process

Hope it helps,

Best Regards,

Kevin

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
Kevin HUBER
ST Employee

Hello @hochul yoo​ ,

I just saw that you already solved your problem in another topic: https://community.st.com/s/question/0D53W00001pumzNSAQ/the-way-of-specify-an-edid-data-to-display-dual-screen-

Anyway, this question will maybe help someone else in the community.

Feel free to set my previous message as Best Answer.

Best Regards,

Kevin

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

Thanks for your answer.

I have one more question !!!

I modified it by myself with the vi editor now, but

When I build my own distribution package, I want to add this kernel parameter by default.

What part of the wiki can I refer to?

Hello again @hochul yoo​ ,

You can have a look at this question: https://community.st.com/s/question/0D53W000014zXu5SAE/change-uboot-kernel-command-line

The file that generates the extlinux.conf is "openembedded-core/meta/classes/uboot-extlinux-config.bbclass"

The variable UBOOT_EXTLINUX_KERNEL_ARGS contains the bootargs. But it is recommended to not modify this variable here, but modify the one from the machine configuration located in line 17 of the file:

./meta-st/meta-st-stm32mp/conf/machine/include/st-machine-extlinux-config-stm32mp.inc

meta-st/meta-st-stm32mp/conf/machine/include/st-machine-extlinux-config-stm32mp.inc:17:UBOOT_EXTLINUX_KERNEL_ARGS ?= "rootwait rw"

Hope it helps you,

Best Regards,

Kevin

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.