• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: u-boot Example Settings To Easily Switch Between TFTP/NFS and NAND  (Read 10364 times)
mteel
Newbie
*

Karma: 0
Posts: 10


View Profile
« on: April 11, 2009, 08:51:29 AM »

Here are my u-boot variables of interest for switching between TFTP/NFS booting and NAND booting:

Code:
    serverip=10.0.0.159
    gatewayip=10.0.0.1
    netmask=255.255.255.0
    bootargs_end=:::DB88FXX81:eth0:none
    ipaddr=10.0.0.42
    console=console=ttyS0,115200 mtdparts=nand_mtd:0x00100000@0x00000000(uboot),0x00500000@0x00100000(uImage),0x1fa00000@0x00600000(rootfs)
    boottftp=tftpboot 0x2000000 uImage.sheeva.20090319
    bootnand=nand read.e 0x2000000 0x00100000 0x00500000
    bootargs_nand=root=/dev/mtdblock2 rw
    bootargs_nfs=root=/dev/nfs rw nfsroot=10.0.0.159:/tftpboot/root-ubuntu
    bootcmd=run bootnand;setenv bootargs $(console) $(bootargs_nand) ip=$(ipaddr):$(serverip)$(bootargs_end);bootm 0x2000000
    bootcmd_nand=run bootnand;setenv bootargs $(console) $(bootargs_nand) ip=$(ipaddr):$(serverip)$(bootargs_end);bootm 0x2000000
    bootcmd_nfs=run boottftp;setenv bootargs $(console) $(bootargs_nfs) ip=$(ipaddr):$(serverip)$(bootargs_end);bootm 0x2000000

The bootcmd_nand and bootcmd_nfs are just storage. Copy the desired boot type to the bootcmd variable and use "saveenv" to save it.
In the example, it is booting from nand flash.
Logged

moshiach
Guest
« Reply #1 on: April 11, 2009, 07:53:43 PM »

Pretty much the same thing I wrote here

Glad I'm not the only one switching back and forth Smiley
Logged

finkployd
Newbie
*

Karma: 0
Posts: 4


View Profile
« Reply #2 on: April 14, 2009, 11:34:39 AM »

@mteel : thanks for your post, I've taken your settings, modified and expanded slightly to add booting from SD.  Perhaps someone will find it of use:

Code:
set console 'console=ttyS0,115200 mtdparts=nand_mtd:0x00100000@0x00000000(uBoot)ro,0x00400000@0x00100000(uImage),0x1fb00000@0x00500000(rootfs)'

set boottftp 'tftpboot 0x2000000 $(image_name)'
set bootargs_nfs 'root=/dev/nfs rw'
set boot_nfs 'run boottftp;setenv bootargs $(console) $(bootargs_nfs) nfsroot=$(serverip):$(rootpath) ip=$(ipaddr):$(serverip)$(bootargs_end);bootm 0x2000000'

set bootnand 'nand read.e 0x2000000 0x00100000 0x00500000'
set bootargs_nand 'root=/dev/mtdblock2 rw'
set boot_nand 'run bootnand;setenv bootargs $(console) $(bootargs_nand) ip=$(ipaddr):$(serverip)$(bootargs_end);bootm 0x2000000'

set bootargs_sd 'root=/dev/mmcblk0p1 rw'
set boot_sd 'run bootnand;setenv bootargs $(console) $(bootargs_sd) ip=$(ipaddr):$(serverip)$(bootargs_end);bootm 0x2000000'

set bootcmd 'run boot_sd;'

mtdparts are configured for a 4mb uImage size (and loading rootfs @ 5mb), using this one may need to adjust the numbers to match their environment.

Logged

exdec
Newbie
*

Karma: 0
Posts: 6


View Profile
« Reply #3 on: April 27, 2009, 05:45:23 PM »

I've been trying to  boot the kernel from flash but use nfs for the filesystem without success. I can use flash for both, or use tftp/nfs, but if I boot the kernel from flash it cant seem to read the root filesystem from nfs. Any ideas?

thanks
Logged

rshitrit
Global Moderator
Newbie
*****

Karma: 0
Posts: 14


View Profile
« Reply #4 on: April 28, 2009, 05:13:54 AM »

u probably missed something on the u-boot env.
pls send a dump of the u-boot env and the boot log..
Logged

Skywalker
Newbie
*

Karma: 0
Posts: 19


View Profile
« Reply #5 on: May 09, 2009, 02:13:21 AM »

Ok guys,
again: I am a newbie, who wants to learn. I have setup a tftp server,and I have setup an NFS server (do I really need both ?).
I suspect I need to put this uImage.sheeva.040309 somewhere, and I have to expand ubuntu-9.04.tar.gz to another directory. Which directory should this be ? I suspect I should find these directories back in your u-boot variables somewhere. This is a link I am missing in the settings of finkployd.
If I understood it well: the uImage will be loaded in DRAM and run form there (I suspect this one will need to be on the TFTP server), and the file system (expanded from ubuntu-9.04.tar.gz) will be accessed from the NFS server.

Please someone clarify, and post your server directories and your full Uboot variables settings. It would help me a lot.

Kind regards,

Luke
Logged

Pages: [1]
Print
Jump to: