| FORUM

FEDEVEL
Platform forum

boot command line

kbradway@divercety.com , 09-07-2016, 08:48 AM
Using Robert Nelsons how to: Latest 3.17 kernel and trying to use the boot command line.
The uboot command line is as follows:
"console=ttymxc0,115200 ip=dhcp root=/dev/mmcblk0p1 rootwait rw mmcinfo ext2load mmc 0:1 0x10800000 uImage ext2load mmc 0:1 0x12000000 imx6q-darde.dtb bootm 0x10800000 - 0x12000000"

The question is how do I translate that into a working boot command line so that I can get to a login in on runlevel 2?

I added it to CONFIG_CMDLINE with multiple renditions to no avail.
I also disabled CONFIG_CMDLINE_FROM_BOOTLOADER

Thanks
robertferanec , 09-07-2016, 09:16 AM
I do not remember exactly, but 3.17 may not be taking the command line from uBoot. When you run Kernel, have a look if the command line you are putting into the uBoot is the same as the command line reported by Kernel during booting.
kbradway@divercety.com , 09-07-2016, 09:35 AM
Yes I knew it is not booting from uBoot. Here is a clue to the issue:

The 3.10.17 kernel that boots from uBoot shows this at bootup

"console=ttymxc0,115200 ip=dhcp root=/dev/mmcblk0p1 rootwait rw root=/dev/mmcblk0p1 rootwait rw"

Looking at be printenv it shows
bootargs "console=ttymxc0,115200 ip=dhcp root=/dev/mmcblk0p1 rootwait rw mmcinfo ext2load mmc 0:1 0x10800000: uImage"
bootargs_fdt "ext2load mmc 0:1 0x12000000 imx6q-darde.dtb bootm 0x10800000 - 0x12000000"
boot_cmd "bootargs bootargs_fdt"

So I make the 3.17 kernel CONFIG_CMDLINE look like the following:

"console=ttymxc0,115200 ip=dhcp root=/dev/mmcblk0p1 rootwait rw root=/dev/mmcblk0p1 rootwait rw"

But when the kernel boots it only shows one root=xxx as in

"console=ttymxc0,115200 ip=dhcp root=/dev/mmcblk0p1 rootwait rw"

The second root= is missing.
That I am assuming is my dtb load??

So I can not seem to create the exact build line from uBoot.


robertferanec , 09-07-2016, 11:26 AM
I would try to change the CONFIG_CMDLINE "mmcblk0p1" to "mmcblk1p1" and see if the kernel boots changes too. I would also try to search for "console=ttymxc0,115200 ip=dhcp root=/dev/mmcblk0p1 rootwait rw" in the source code, maybe it is defined somewhere else.
kbradway@divercety.com , 09-08-2016, 01:38 PM
I did and no that did not help. The 2 cmd lines that are brought over from uboot: One is for the kernel and the other for the device tree. So it seems that it is dying in the dtb somehow.
That I do not understand as it is the same device tree (recompiled with the new kernel) as what I am using in the 3.10.17 kernel and it is booting to level 2 properly.
robertferanec , 09-08-2016, 05:37 PM
I am not a software guy, so I do not really know. Please, when you find out what is problem, let us know - also how you fixed that. I am interested to know as I needed this for couple of times and I didn't know how to change it.
kbradway@divercety.com , 09-09-2016, 01:08 PM
Answer: uboot env var

setenv kernel_address 0x10008000
setenv dtb_address 0x12000000


setenv bootm "$kernel_address $initrd_address $dtb_address"

or w/o initrd

setenv bootm "$kernel_address - $dtb_address"
saveenv
robertferanec , 09-09-2016, 03:00 PM
Thank you!
So, you need to boot it through bootm and specify the device tree as second parameter. That is actually the way to start the kernels with device tree.
kbradway@divercety.com , 09-12-2016, 07:20 AM
Actually, there are 3 parameters: $kernel_addr $initrd_addr $dtb_addr. They need to be in that order.
Make sure you put a "-" (dash) for each one not present on the boot command line
robertferanec , 09-13-2016, 04:35 PM
Thank you!
Use our interactive Discord forum to reply or ask new questions.
Discord invite
Discord forum link (after invitation)

Didn't find what you were looking for?