public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] Mips, U-Boot and ramdisk
@ 2009-06-22 14:55 Robert Hodaszi
  2009-06-23  9:25 ` Detlev Zundel
  2009-06-23  9:54 ` Matthew Lear
  0 siblings, 2 replies; 6+ messages in thread
From: Robert Hodaszi @ 2009-06-22 14:55 UTC (permalink / raw)
  To: u-boot

Hello,

Can anybody help me? I'm working on this for a few days...

I'm working on a custom developed board, with Au1200, and I'd like to 
use the U-Boot as bootloader. I ported the U-Boot to my board, made a 
Linux kernel image, and a ramdisk image.

To try out the configuration, I burn the U-Boot image into the flash (it 
works well), and after I start the board, it download the kernel image 
and the ramdisk image through TFTP. I'm using the following two commands:

tftp 81000000 uImage
tftp 81FFFFC0 uRamdisk

I set the bootargs variable to: root=\dev\ram (I used: set bootargs 
root=/dev/ram)
But when I'm trying to start the Linux with the

bootm 81000000 81FFFFC0

the Linux can't find the ramdisk. It write out:

Initrd not found or empty - disabling initrd

But when I set its address into the bootargs (so the bootargs: 
root=/dev/ram rd_start=0x82000000 rd_size=0x191160), it works well; it 
successfully find the image, and can mount it.

How does the U-Boot pass the ramdisk information? It sets some kind of 
environment variables in the bootm.c. But it doesn't work for me. Why? 
(I could use the bootargs solution in this case, but I'm afraid, it 
can't pass other arguments too, like ethernet address, etc.)

Thanks in advance!

Best regards,
Robert Hodaszi

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] Mips, U-Boot and ramdisk
  2009-06-22 14:55 [U-Boot] Mips, U-Boot and ramdisk Robert Hodaszi
@ 2009-06-23  9:25 ` Detlev Zundel
  2009-06-23 10:14   ` Robert Hodaszi
  2009-06-23  9:54 ` Matthew Lear
  1 sibling, 1 reply; 6+ messages in thread
From: Detlev Zundel @ 2009-06-23  9:25 UTC (permalink / raw)
  To: u-boot

Hi Robert,

> Can anybody help me? I'm working on this for a few days...
>
> I'm working on a custom developed board, with Au1200, and I'd like to 
> use the U-Boot as bootloader. I ported the U-Boot to my board, made a 
> Linux kernel image, and a ramdisk image.
>
> To try out the configuration, I burn the U-Boot image into the flash (it 
> works well), and after I start the board, it download the kernel image 
> and the ramdisk image through TFTP. I'm using the following two commands:
>
> tftp 81000000 uImage
> tftp 81FFFFC0 uRamdisk
>
> I set the bootargs variable to: root=\dev\ram (I used: set bootargs 
> root=/dev/ram)

root=/dev/ram is definitely correct.  It was MS-DOS a while ago, which
switched the '/'s to '\'s on stealing the hierarchical file system
concept from Unix ;)

> But when I'm trying to start the Linux with the
>
> bootm 81000000 81FFFFC0
>
> the Linux can't find the ramdisk. It write out:
>
> Initrd not found or empty - disabling initrd
>
> But when I set its address into the bootargs (so the bootargs: 
> root=/dev/ram rd_start=0x82000000 rd_size=0x191160), it works well; it 
> successfully find the image, and can mount it.
>
> How does the U-Boot pass the ramdisk information? 

This is highly specific to the architecture.  Looking into MIPS code, it
an environment like datastructure is built and passes that to the kernel
(lib_mips/bootm.c).

> It sets some kind of environment variables in the bootm.c. 

Right, that's what I see also.

> But it doesn't work for me. Why?

I can't help you here, the best thing would be to debug this.  Maybe the
MIPS kernel changed the way the environment is passed?  

Cheers
  Detlev

-- 
We have a live-manual.  It's called emacs-devel at gnu.org.
You can stick to just reading it, but you can skip to a specific chapter
by simply sending an email asking for it ;-)
                                    -- Stefan Monnier
--
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 at denx.de

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] Mips, U-Boot and ramdisk
  2009-06-22 14:55 [U-Boot] Mips, U-Boot and ramdisk Robert Hodaszi
  2009-06-23  9:25 ` Detlev Zundel
@ 2009-06-23  9:54 ` Matthew Lear
  2009-06-23 10:38   ` Robert Hodaszi
  1 sibling, 1 reply; 6+ messages in thread
From: Matthew Lear @ 2009-06-23  9:54 UTC (permalink / raw)
  To: u-boot

Hi Robert.
> I set the bootargs variable to: root=\dev\ram (I used: set bootargs 
> root=/dev/ram)
> But when I'm trying to start the Linux with the
> 
> bootm 81000000 81FFFFC0
> 
> the Linux can't find the ramdisk. It write out:
> 
> Initrd not found or empty - disabling initrd

Do you see U-Boot detecting and loading the ram disk image once you invoke your
bootm command above? eg:

## Loading RAMDisk Image at 00500000 ...
   Image Name:   uboot ext2 ramdisk rootfs
   Created:      2009-06-15  14:39:13 UTC
   Image Type:   M68K Linux RAMDisk Image (gzip compressed)
   Data Size:    5219290 Bytes =  5 MB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
   Loading Ramdisk to 4fa79000, end 4ff733da ... OK

I believe that for U-Boot to pass the ram disk image information to the kernel,
it needs to be able to detect the ram disk image in the first place. You can use
U-Boot's mkimage utility to add a header onto your ram disk image.

> But when I set its address into the bootargs (so the bootargs: 
> root=/dev/ram rd_start=0x82000000 rd_size=0x191160), it works well; it 
> successfully find the image, and can mount it.

This is because you're explicitly telling the kernel where to find the ram disk
image in memory. Take a look at drivers/block/brd.c in the kernel src.

> How does the U-Boot pass the ramdisk information? It sets some kind of 
> environment variables in the bootm.c. But it doesn't work for me. Why? 
> (I could use the bootargs solution in this case, but I'm afraid, it 
> can't pass other arguments too, like ethernet address, etc.)

This is arch specific in U-Boot but I'd also check that your MIPS kernel has
support for a) correctly parsing the U-Boot environment provided to it and b)
providing the required data to other parts of the kernel for utilisation of the
ram disk, eg initrd_start / initrd_end as an example.

If you're struggling to pass other args to the kernel then it sounds like there
is more of a fundamental issue somewhere, though. Maybe just double check
Documentation/kernel-parameters.txt to make sure you're passing syntax in a form
that the kernel will recognise?

Hope that helps.

Cheers,
--  Matt

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] Mips, U-Boot and ramdisk
  2009-06-23  9:25 ` Detlev Zundel
@ 2009-06-23 10:14   ` Robert Hodaszi
  0 siblings, 0 replies; 6+ messages in thread
From: Robert Hodaszi @ 2009-06-23 10:14 UTC (permalink / raw)
  To: u-boot

Hi Detlev,

Thanks for the answer!
> Hi Robert,
>
> root=/dev/ram is definitely correct.  It was MS-DOS a while ago, which
> switched the '/'s to '\'s on stealing the hierarchical file system
> concept from Unix ;)
>   
Sorry! Yes I used '/'. I just missed it.
>
> This is highly specific to the architecture.  Looking into MIPS code, it
> an environment like datastructure is built and passes that to the kernel
> (lib_mips/bootm.c).
>   
I thought... But I didn't find any description about this.
> I can't help you here, the best thing would be to debug this.  Maybe the
> MIPS kernel changed the way the environment is passed?  
>
> Cheers
>   Detlev
>
>   
I'm trying, but it's not so easy to debug the Au1200 with the BDI3000. 
If I want to single step the code, I should set the "Enable single step 
mode" flag in the processor's debug CP0 register, and clear when I'm 
using breakpoints, and other goodies... :)

Best regards,
Robert Hodaszi

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] Mips, U-Boot and ramdisk
  2009-06-23  9:54 ` Matthew Lear
@ 2009-06-23 10:38   ` Robert Hodaszi
  2009-06-23 12:45     ` Robert Hodaszi
  0 siblings, 1 reply; 6+ messages in thread
From: Robert Hodaszi @ 2009-06-23 10:38 UTC (permalink / raw)
  To: u-boot

Hi Matthew,

> Hi Robert.
>   
> Do you see U-Boot detecting and loading the ram disk image once you invoke your
> bootm command above? eg:
>
> ## Loading RAMDisk Image at 00500000 ...
>    Image Name:   uboot ext2 ramdisk rootfs
>    Created:      2009-06-15  14:39:13 UTC
>    Image Type:   M68K Linux RAMDisk Image (gzip compressed)
>    Data Size:    5219290 Bytes =  5 MB
>    Load Address: 00000000
>    Entry Point:  00000000
>    Verifying Checksum ... OK
>    Loading Ramdisk to 4fa79000, end 4ff733da ... OK
>
> I believe that for U-Boot to pass the ram disk image information to the kernel,
> it needs to be able to detect the ram disk image in the first place. You can use
> U-Boot's mkimage utility to add a header onto your ram disk image.
>   
I used the mkimage, the U-Boot successfully recognized the ramdisk 
image, and it set the ramdisk_start and ramdisk_end variables (I turned 
on the debug feature). See the followings:

*  kernel: cmdline image address = 0x81000000
## Booting kernel from Legacy Image at 81000000 ...
   Image Name:   Linux-2.6.30-dirty
   Created:      2009-06-23  10:11:33 UTC
   Image Type:   MIPS Linux Kernel Image (gzip compressed)
   Data Size:    1589415 Bytes =  1.5 MB
   Load Address: 80100000
   Entry Point:  80104530
   Verifying Checksum ... OK
   kernel data at 0x81000040, len = 0x001840a7 (1589415)
*  ramdisk: cmdline image address = 0x81ffffc0
## Loading init Ramdisk from Legacy Image at 81ffffc0 ...
   Image Name:   Simple Embedded Linux Framework
   Created:      2007-01-21  18:52:48 UTC
   Image Type:   MIPS Linux RAMDisk Image (gzip compressed)
   Data Size:    1642848 Bytes =  1.6 MB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
   ramdisk start = 0x82000000, ramdisk end = 0x82191160
   Uncompressing Kernel Image ... OK
   kernel loaded at 0x80100000, end = 0x8044a200
## Transferring control to Linux (at address 80104530) ...
## Giving linux memsize in bytes, 134217728
> This is because you're explicitly telling the kernel where to find the ram disk
> image in memory. Take a look at drivers/block/brd.c in the kernel src.
>   
As I saw, the arch/mips/kernel/setup.c (rd_start_early and 
rd_size_early) set these informations.
> This is arch specific in U-Boot but I'd also check that your MIPS kernel has
> support for a) correctly parsing the U-Boot environment provided to it and b)
> providing the required data to other parts of the kernel for utilisation of the
> ram disk, eg initrd_start / initrd_end as an example.
>
> If you're struggling to pass other args to the kernel then it sounds like there
> is more of a fundamental issue somewhere, though. Maybe just double check
> Documentation/kernel-parameters.txt to make sure you're passing syntax in a form
> that the kernel will recognise?
>
> Hope that helps.
>
> Cheers,
> --  Matt
>   
I don't know yet, if it can or can't pass other arguments. I check only 
that one so far. But the command line parameters work well, I tried the 
kgdb, the ramdisk, etc. It's only a problem with this environment 
variable. But I'm just debugging...

Best regards,
Robert Hodaszi

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] Mips, U-Boot and ramdisk
  2009-06-23 10:38   ` Robert Hodaszi
@ 2009-06-23 12:45     ` Robert Hodaszi
  0 siblings, 0 replies; 6+ messages in thread
From: Robert Hodaszi @ 2009-06-23 12:45 UTC (permalink / raw)
  To: u-boot


>> This is arch specific in U-Boot but I'd also check that your MIPS kernel has
>> support for a) correctly parsing the U-Boot environment provided to it and b)
>> providing the required data to other parts of the kernel for utilisation of the
>> ram disk, eg initrd_start / initrd_end as an example.
>>
>> If you're struggling to pass other args to the kernel then it sounds like there
>> is more of a fundamental issue somewhere, though. Maybe just double check
>> Documentation/kernel-parameters.txt to make sure you're passing syntax in a form
>> that the kernel will recognise?
>>
>> Hope that helps.
>>
>> Cheers,
>> --  Matt
>>   
>>     
> I don't know yet, if it can or can't pass other arguments. I check only 
> that one so far. But the command line parameters work well, I tried the 
> kgdb, the ramdisk, etc. It's only a problem with this environment 
> variable. But I'm just debugging...
>
>
>   
I checked, and it seems, that the kernel doesn't check anywhere nor the 
initrd_start and initrd_size, nor the flash_start and flash_size 
environment parameters, but checks the memsize and ethaddr parameters. 
At least I couldn't find it. Is it true, or I'm blind? Did anybody use 
this U-Boot feature?

Best regards,
Robert Hodaszi

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-06-23 12:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-22 14:55 [U-Boot] Mips, U-Boot and ramdisk Robert Hodaszi
2009-06-23  9:25 ` Detlev Zundel
2009-06-23 10:14   ` Robert Hodaszi
2009-06-23  9:54 ` Matthew Lear
2009-06-23 10:38   ` Robert Hodaszi
2009-06-23 12:45     ` Robert Hodaszi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox