• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: Help converting a command  (Read 3431 times)
eric.frederich
Newbie
*

Karma: 0
Posts: 9


View Profile
« on: July 28, 2009, 05:15:24 AM »

So if my NAND were flashed with this uImage I just built I would be able to boot it with this....

Code:
Marvell>> setenv bootcmd nand read 0x01000000 0x00100000 0x00400000\;setenv bootargs $(console) root=/dev/sda1 rootdelay=5\; bootm 0x01000000
Marvell>> saveenv
Saving Environment to NAND...
Erasing Nand...Writing to Nand... done
Marvell>> reset

I don't want to flash my NAND right now.  So how can I boot that same uImage from the first partition of a USB drive (ext2)?
I called the file gentoo_uImage and it is right there in the root directory.

I don't really understand that bootcmd command.  Why are there 3 addresses?  I just have one uImage file.  Is the first address the destination and the next two the start and end of the source?  Are there equivalent ext2load commands?

Logged

yotam
Global Moderator
Newbie
*****

Karma: 1
Posts: 10


View Profile
« Reply #1 on: July 28, 2009, 05:57:06 AM »

Hi,
The nand read/write has 3 parameters:
DRAM address to read into or write from.
NAND internal offset.
Length of operation
All parameters are in hexadecimal and in byte.

Please use help nand in u-boot to see all options for nand.
Thanks,
Yotam
Logged

eric.frederich
Newbie
*

Karma: 0
Posts: 9


View Profile
« Reply #2 on: July 28, 2009, 02:26:19 PM »

Hi,
The nand read/write has 3 parameters:
DRAM address to read into or write from.
NAND internal offset.
Length of operation
All parameters are in hexadecimal and in byte.

Please use help nand in u-boot to see all options for nand.
Thanks,
Yotam


So are there equivalent ext2load commands?  Help on ext2load doesn't say much about reading from an offset of a file.
Logged

restamp
Global Moderator
Sr. Member
*****

Karma: 4
Posts: 273


View Profile
« Reply #3 on: July 28, 2009, 03:03:31 PM »

Ext2load takes 4 args:

ext2load <iface> <dev[:part]> <memaddr> <filename>

Note: I've only been successful accessing the first partition on a device.  Also, the filename must start with a slash.

Examples:

Code:
ext2load mmc 0 0x800000 /boot/uImage

Code:
ext2load usb 0:1 0x800000 /uImage

Also note ext2ls:

Code:
ext2ls mmc 0:1 /boot
Logged

eric.frederich
Newbie
*

Karma: 0
Posts: 9


View Profile
« Reply #4 on: July 28, 2009, 09:20:39 PM »

Again, you haven't told me anything I didn't already know.
I need help converting that specific set of commands

The original message on here had those commands.
It had me loading 0x00100000 to 0x00400000 from NAND into 0x01000000
How would I load those same offsets from a file called gentoo-uImage on USB?
Logged

tinker
Newbie
*

Karma: 2
Posts: 43


View Profile
« Reply #5 on: July 29, 2009, 12:28:29 AM »

This is what I use to boot from a HDD in an external USB enclosure.

Code:
setenv bootcmd 'usb start; ext2load usb 0:1 0x8000000 /boot/uImage; bootm 0x8000000; reset'
setenv bootargs 'console=ttyS0,115200 root=/dev/sda5 rootdelay=10 rw'

For reference my HDD  is partitioned as follows :

Disk /dev/sda: 40.0 GB, 40007761920 bytes
64 heads, 32 sectors/track, 38154 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          32       32752   83  Linux
/dev/sda2              33       38154    39036928    5  Extended
/dev/sda5              33       37432    38297584   83  Linux
/dev/sda6           37433       38154      739312   82  Linux swap / Solaris


Partition sizes are in MB

sda1 is formatted ext2
sda5 is formatted ext3
Logged

kilowatt
Global Moderator
Full Member
*****

Karma: 3
Posts: 106


View Profile
« Reply #6 on: July 29, 2009, 08:07:20 AM »

With usb you don't need the read location or size since you are specifying a file and the file system will supply these.  you just specify the destination address in ram where you will then bootm from.
Logged

tinker
Newbie
*

Karma: 2
Posts: 43


View Profile
« Reply #7 on: July 29, 2009, 08:40:21 AM »

kilowatt, are you saying the information at http://plugcomputer.org/plugwiki/index.php/U-Boot_Quick_Reference is incorrect ?
Logged

kilowatt
Global Moderator
Full Member
*****

Karma: 3
Posts: 106


View Profile
« Reply #8 on: July 29, 2009, 09:06:08 AM »

Quote
usb start
ext2load usb 0:1 0x8000000 /boot/uImage.sheeva.20090319
bootm 0x8000000

No, it is correct.  0:1 specifies usb device:partition.  0x8000000 is the write address to memory for the image (you later bootm from this same address since it is were you wrote the kernel with ext2load).  /boot/uImage.sheeva.20090319 is the image name with full path  (the ext2 file system on the disk provides the actual disk read address and size of this file for reading).

The NAND doesn't have a partition table (this is why we have to pass it to the kernel by including the mtdparts in the bootargs section of the uboot  bootcmd we use)  We must also tell uboot the starting address to use for reading the kernel from flash and the length to read.  The kernel image is usually written raw to the second partition of the flash.  Again there are no real partitions, we decide how we want to divide it and then we must pass this information to uboot and to the kernel.  Most of us are using the 1st 1MB of flash for uBoot, then the next 4MB of flash for kernel Image, and the rest for the root file system.  Once you have picked the partition you intend to use you must be consistant with the information you pass to uBoot and the kernel.  The reason some of the documentation uses different numbers is because some people divide their flash differently.  You must adjust the commands to match the partitioning you are using.
« Last Edit: July 29, 2009, 09:33:41 AM by kilowatt » Logged

tinker
Newbie
*

Karma: 2
Posts: 43


View Profile
« Reply #9 on: July 29, 2009, 09:13:51 AM »

kilowatt why do you have two ext2load lines?  In my example I use only one and it works fine in reality.
Logged

kilowatt
Global Moderator
Full Member
*****

Karma: 3
Posts: 106


View Profile
« Reply #10 on: July 29, 2009, 09:19:33 AM »

sorry that was a cut and past error (fixed it)

Mark
Logged

Pages: [1]
Print
Jump to: