[U-Boot-Users] Doubt regarding bootm in Uboot

Hi all,
I want to know how to transfer the control from Uboot to Linux Kernel. I am using MPC5200B powerpc and ICECUBE board.
Where exactly the Linux Kernel should be loaded?
In cmd_bootm.c file,
U_BOOT_CMD(
bootm, CFG_MAXARGS, 1, do_bootm,
"bootm - boot application image from memory\n",
"[addr [arg ...]]\n - boot application image stored in memory\n"
"\tpassing arguments 'arg ...'; when booting a Linux kernel,\n"
"\t'arg' can be the address of an initrd image\n"
#ifdef CONFIG_OF_FLAT_TREE
"\tWhen booting a Linux kernel which requires a flat device-tree\n"
"\ta third argument is required which is the address of the of the\n"
"\tdevice-tree blob. To boot that kernel without an initrd image,\n"
"\tuse a '-' for the second argument. If you do not pass a third\n"
"\ta bd_info struct will be passed instead\n"
#endif
);
What do these lines signify?
For what U_BOOT_CMD is used? I have read the source code fully.
Please get me some idea.
Regards,
Yasotha Balan R
DISCLAIMER: -----------------------------------------------------------------------------------------------------------------------
The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect.
-----------------------------------------------------------------------------------------------------------------------

On 8/5/07, Yasothabalan Ramaswamy-TLS,Chennai yasothabalanr@hcl.in wrote:
Hi all,
I want to know how to transfer the control from Uboot to Linux Kernel. I am using MPC5200B powerpc and ICECUBE board.
Where exactly the Linux Kernel should be loaded?
Wherever you want to load it. u-boot will relocate it to the correct location after uncompressing the kernel uImage file.
In cmd_bootm.c file,
<snip>
What do these lines signify?
There are 2 different directories in the Linux kernel source tree which can be used to build a powerpc kernel; arch/ppc and arch/powerpc. arch/ppc is obsolete and slowly all board support in arch/ppc is moving over to arch/powerpc (support for mpc5200 is currently in both trees).
BTW, for new designs, you should be using arch/powerpc (by setting ARCH=powerpc in the environment when building the kernel)
One significant difference between arch/ppc and arch/powerpc is how the bootloader communicates with the kernel for embedded platforms. In arch/ppc, u-boot passes data via a static structure which has no standard format as is prone to breakage. In arch/powerpc, the bootloader instead passes a device tree blob which does have a standard format, and is much less prone to breakage.
So, when booting your Linux kernel that was built with ARCH=powerpc, you should pass three parameters to the bootm command. 1. address of the kernel 2. address of the (or '-' if you don't have one) 3. address of the device tree
You can generate a device tree blob (.dtb file) by compiling the dts file for your board with the device tree compiler (dtc). The Lite5200B device tree is in the kernel source tree in the directory arch/powerpc/boot/dts.
Side note: you're email client is sending mail in HTML, not plain ASCII text. Etiquette on this list is for ASCII email only.
Cheers, g.

Thanks Grant.
After loading Uboot, we will get Uboot command.
I will copy the kernel image to tftpboot directory. And I will pass the command,
run tftp_nfs
to boot the kernel.
My question is after Uboot gets loaded, the control has to be transferred directly to the kernel, without waiting in the UBOOT prompt.
So now after Uboot gets loaded, kernel should be loaded directly, where I have to modify in the Uboot code for this could be done.
Note my question is how to transfer control directly to kernel from Uboot. I should not get Uboot prompt, directly I should get the kernel prompt.
Thanks, Yaso.
-----Original Message----- From: glikely@secretlab.ca [mailto:glikely@secretlab.ca] On Behalf Of Grant Likely Sent: Monday, August 06, 2007 11:03 AM To: Yasothabalan Ramaswamy-TLS,Chennai Cc: u-boot-users@lists.sourceforge.net Subject: Re: [U-Boot-Users] Doubt regarding bootm in Uboot
On 8/5/07, Yasothabalan Ramaswamy-TLS,Chennai yasothabalanr@hcl.in wrote:
Hi all,
I want to know how to transfer the control from Uboot to Linux Kernel.
I am using MPC5200B powerpc and ICECUBE board.
Where exactly the Linux Kernel should be loaded?
Wherever you want to load it. u-boot will relocate it to the correct location after uncompressing the kernel uImage file.
In cmd_bootm.c file,
<snip>
What do these lines signify?
There are 2 different directories in the Linux kernel source tree which can be used to build a powerpc kernel; arch/ppc and arch/powerpc. arch/ppc is obsolete and slowly all board support in arch/ppc is moving over to arch/powerpc (support for mpc5200 is currently in both trees).
BTW, for new designs, you should be using arch/powerpc (by setting ARCH=powerpc in the environment when building the kernel)
One significant difference between arch/ppc and arch/powerpc is how the bootloader communicates with the kernel for embedded platforms. In arch/ppc, u-boot passes data via a static structure which has no standard format as is prone to breakage. In arch/powerpc, the bootloader instead passes a device tree blob which does have a standard format, and is much less prone to breakage.
So, when booting your Linux kernel that was built with ARCH=powerpc, you should pass three parameters to the bootm command. 1. address of the kernel 2. address of the (or '-' if you don't have one) 3. address of the device tree
You can generate a device tree blob (.dtb file) by compiling the dts file for your board with the device tree compiler (dtc). The Lite5200B device tree is in the kernel source tree in the directory arch/powerpc/boot/dts.
Side note: you're email client is sending mail in HTML, not plain ASCII text. Etiquette on this list is for ASCII email only.
Cheers, g.

In message CE54F2377C0FB8439A290BF5A88BF13D058234A5@CHN-HCLT-EVS01.HCLT.CORP.HCL.IN you wrote:
My question is after Uboot gets loaded, the control has to be transferred directly to the kernel, without waiting in the UBOOT prompt.
OK.
So now after Uboot gets loaded, kernel should be loaded directly, where I have to modify in the Uboot code for this could be done.
You don't have to modify anything. Just adjust the environment variable settings as needed (bootdelay).
PLEASE READ THE MANUAL and the DOCUMENTATION in doc/
Note my question is how to transfer control directly to kernel from Uboot. I should not get Uboot prompt, directly I should get the kernel prompt.
From kernel to U-Boot? That's done by a reset.
Best regards,
Wolfgang Denk

Hello, U-Boot is already running in my board. I configured the Flash, SDRAM, SRAM, FEC (ethernet) and console. Apparently all is working and I can trace the code just before the call in order to transfer the control to Linux, that is: (* kernel) (kbd, initrd_start, initrd_end, cmd_start, cmd_end); There it is supposed the U-Boot finishes its operation and then the Liinux kernel takes the control, but it hangs. I did the Linux image with entry address and load address 0x0. U-Boot can check the Multi-image correctly. So I don't know where the problem is. I think the problem is in the Linux image, not in U-Boot, I can not assure it. I can't trace the Linux booting because it hans at the beginning, even the console is not initialized.
Could anybody help me?
One question more, I wouldn't have to configure the memories again, I mean, Linux doesn't participate in the configuration of the memories because U-Boot has already done, right?
Thanks,
Raúl Moreno

Hi Raul,
U-Boot is already running in my board. I configured the Flash, SDRAM, SRAM, FEC (ethernet) and console. Apparently all is working and I can trace the code just before the call in order to transfer the control to Linux, that is: (* kernel) (kbd, initrd_start, initrd_end, cmd_start, cmd_end);
Congrats.
There it is supposed the U-Boot finishes its operation and then the Liinux kernel takes the control, but it hangs.
Are you sure it hangs or is it just that you don't see any output? Are you sure you are passing a correct console parameter to Linux? Search the archives, many people (including myself) already considered a perfectly working Linux kernel to be dead just because they did not see any console output...
I did the Linux image with entry address and load address 0x0. U-Boot can check the Multi-image correctly. So I don't know where the problem is. I think the problem is in the Linux image, not in U-Boot, I can not assure it. I can't trace the Linux booting because it hans at the beginning, even the console is not initialized.
Hook up a debugger if at all possible.
One question more, I wouldn't have to configure the memories again, I mean, Linux doesn't participate in the configuration of the memories because U-Boot has already done, right?
If the parameter passing between U-Boot and the kernel works, then yes, this is correct.
By the way, what kernel version on what arch are you trying to boot?
Cheers Detlev

Hi Detlev,
you were right. I can't debug, but I followed the code writing in a memory buffer and it doesn't hang, but the output display is not working.
I understand now that the problem is in the Linux kernel (version 2.6.15, for U-boot I am using 1.1.6) because the command "bdinfo" shows me the parameters and all is OK. I thought I would need to initialize the console because U-Boot has already done. I know my problem is now out of the reach of this mailing-list, but anyway, I would appreciate if you could tell me where and when I should initialize the console in the Linux kernel (in my case I am using a MPC866 and the console is on the SCM1).
Thanks,
Raúl Moreno
Detlev Zundel dzu@denx.de Detlev Zundel 08/08/2007 18:54
Para: raul.moreno@telvent.abengoa.com
cc: u-boot-users@lists.sourceforge.net
Asunto: Re: [U-Boot-Users] Linux hangs just at the beginning
Hi Raul,
U-Boot is already running in my board. I configured the Flash, SDRAM,
SRAM,
FEC (ethernet) and console. Apparently all is working and I can trace the code just before the call in order to transfer the control to Linux, that is: (* kernel) (kbd, initrd_start, initrd_end, cmd_start, cmd_end);
Congrats.
There it is supposed the U-Boot finishes its operation and then the
Liinux
kernel takes the control, but it hangs.
Are you sure it hangs or is it just that you don't see any output? Are you sure you are passing a correct console parameter to Linux? Search the archives, many people (including myself) already considered a perfectly working Linux kernel to be dead just because they did not see any console output...
I did the Linux image with entry address and load address 0x0. U-Boot can check the Multi-image correctly. So I don't know where the problem is. I think the problem is in the Linux image, not in U-Boot, I can not assure it. I can't trace the Linux booting because it hans at the beginning, even
the
console is not initialized.
Hook up a debugger if at all possible.
One question more, I wouldn't have to configure the memories again, I mean, Linux doesn't participate in the configuration of the memories because U-Boot has already done, right?
If the parameter passing between U-Boot and the kernel works, then yes, this is correct.
By the way, what kernel version on what arch are you trying to boot?
Cheers Detlev
-- "Win32 sucks so hard it could pull matter out of a Black Hole." -- Pohl Longsine -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu@denx.de

Dear Raúl,
in message OFC666EFF8.F4A30E4D-ONC1257332.00268D39-C1257332.002880CD@abengoa.com you wrote:
I know my problem is now out of the reach of this mailing-list, but anyway, I would appreciate if you could tell me where and when I should initialize the console in the Linux kernel (in my case I am using a MPC866 and the console is on the SCM1).
Did you try consulting the FAQ at http://www.denx.de/wiki/DULG/Faq ?
Best regards,
Wolfgang Denk

Hi Raul,
I understand now that the problem is in the Linux kernel (version 2.6.15, for U-boot I am using 1.1.6) because the command "bdinfo" shows me the parameters and all is OK.
And you are sure that your kernel sees the same info? "bdinfo" shows you the U-Boot side of the story. One *very good* reason of moving to flat device trees is not being bitten by non-matching C header files.
I thought I would need to initialize the console because U-Boot has already done. I know my problem is now out of the reach of this mailing-list, but anyway, I would appreciate if you could tell me where and when I should initialize the console in the Linux kernel (in my case I am using a MPC866 and the console is on the SCM1).
When your kernel correctly supports the SMC1, it is only a question of using "console=ttyCPM1,${baudrate}" (maybe adjust the 1 regarding actual SMC/SCC support in your kernel).
Cheers Detlev

In message fa686aa40708052232w52f693d9o2a92ecdab67b3833@mail.gmail.com you wrote:
Wherever you want to load it. u-boot will relocate it to the correct location after uncompressing the kernel uImage file.
Strictly speaking, U-boot *copies* the kernel to the correct address ("relocate" has a somewhat different meaning); also, it does so *while* uncompressing it, not after.
So, when booting your Linux kernel that was built with ARCH=powerpc, you should pass three parameters to the bootm command.
- address of the kernel
- address of the (or '-' if you don't have one)
... address of the initial ramdisk image (or ...
- address of the device tree
Best regards,
Wolfgang Denk
participants (5)
-
Detlev Zundel
-
Grant Likely
-
raul.moreno@telvent.abengoa.com
-
Wolfgang Denk
-
Yasothabalan Ramaswamy-TLS,Chennai