$Revision: 1.19 $
#
# Copyright 2004-2006 by Freescale, Incorporated. All rights reserved.
#
# Description: Sets all U-Boot environment variables.
# NB: 1) This file may be sent to the serial port using text file
# send from hyperterminal. The main caveats are:
# a) this file must only have DOS line terminations
# () you may use d2u/u2d programs to convert all
# line termination. (即: 用linux下的dos2unix/unix2dos命令进行换行符转换)
# b) use 20 millisecond delay after a newline and a 1
# millisecond character delay in the hyperterminal ASCII
# Setup. (即: 超级终端 文件->属性->设置::ASCII 码设置行延迟20ms, 字符延迟1ms,点击"发送"->"发送文本文件"选择此文本发送
# or, 2) Use TeraTerm setup using the following menu item.
# Setup -> Serial Port...
# Port: Com#
# Baud rate: 115200
# Data: 8 bit
# Parity: none
# Stop: 1 bit
# Flow control: none
# Transmit delay
# 1 Msec/char, 10 msec/line
# and send using menu item "File -> Send file..."
# or, 3) Use kermit in Linux. Kermit is part of the ckermit
# package in most distros.
# a) Convert this file to UNIX linefeeds before customizing
# the settings in your UNIX-based editor:
# dos2unix MPC8349ITX\ set-uboot-env.txt
# b) Your ~/.kermrc file should include the following
# settings. "line" is set to the COM port you're using
# (/dev/ttyS0 for COM1).
# set line /dev/ttyS0
# set speed 115200
# set carrier-watch off
# set handshake none
# set flow-control none
# set transmit echo on
# set transmit pause 20
# set transmit timeout 1
# set transmit prompt 62
# c) Get your u-boot prompt on COM1 with "sudo kermit -c",
# then jump out to kermit command line with "CTRL-\ c"
# and issue this command:
# transmit "MPC8349ITX set-uboot-env.txt"
#
# Here is an example of what you do to boot:
#=> run setenv1
#=> run tftpramboot
#
#*----------------------------------------------------------------------------*/
#
#setenv baudrate 115200 ## 波特率
#setenv stdin serial ## 标准输入
#setenv stdout serial
#setenv stderr serial
setenv consoledev ttyS0
setenv loads_echo 1 ## 回显
setenv loadaddr 200000 ## 下载到ram中地址
setenv loadkernaddr 1000000 ## tftp下载内核到ram地址
setenv loadramdaddr 1200000 ## tftp下载根文件系统到ram中的地址
setenv kernaddr fe810000 ## flash中内核起始地址
setenv ramdiskaddr fe9a0000 ## flash中ramdisk文件系统起始地址
setenv ramdisksize 65000 ## flash中文件系统大小
setenv netdev eth0 ## 网卡eth0 为vsc8201
setenv netmask 255.255.255.0
setenv serverip 59.64.155.122 ## nfs server或tftp server ip地址
setenv gatewayip 59.64.155.1 ## 网关
setenv ipaddr 59.64.155.244 ## 板子netdev(eth0: vsc8201)的ip地址
setenv bootdrive sda1 ## 启动设备设置
setenv tftp_path 'bootln' ## tftp server 服务根目录下的目录或软连接
setenv rootpath '/home/liuby/rootfsln' ## NFS server 服务目录或软连接
setenv lanphyinit 'cp.b fef50000 40000 20000; go 40004' ## 驱动MPC8349itx交换芯片vsc7385
#
setenv bootcmd 'run flashramboot' ## 默认启动命令: 从flash中启动
setenv bootdelay '3' ## 启动前延迟3秒
setenv setargs 'run lanphyinit;setenv bootfile \$tftp_path/uImage;setenv ramdiskfile \$tftp_path/rootfs.ext2.gz.uboot;setenv hostname PowerQUICC' ## 启动文件名
setenv setramargs 'setenv bootargs root=/dev/ram ramdisk_size=$ramdisksize rw ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:$netdev:off console=$consoledev,$baudrate
$othbootargs' ## ram 启动参数设置,注意ip 参数设置顺序
setenv setnfsargs 'setenv bootargs root=/dev/nfs rw nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:$netdev:off console=$consoledev,$baudrate
$othbootargs' ## NFS 启动参数设置,注意ip 参数设置顺序(采用NFS挂载根文件系统,可读写。指定NFS服务器和目录,指定相应的ip信息,主机名、网络接口名,内核将采用此网络配置信息并不再试图网络协商配置(IP autoconfiguration is off)
setenv sethdargs 'setenv bootargs root=/dev/$bootdrive rw ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:$netdev:off console=$consoledev,$baudrate $othbootargs'
## 硬盘启动参数设置
setenv tftpramboot 'run setargs;run setramargs;tftp $loadkernaddr $bootfile;tftp $loadramdaddr $ramdiskfile;bootm $loadkernaddr $loadramdaddr' ## tftp 下载内核和文件系
统到ram中,然后从ram中启动
setenv tftpnfsboot 'run setargs;run setnfsargs;tftp $loadkernaddr $bootfile;bootm $loadkernaddr' ## 从tftp server下载内核, nfs分区挂载根文件系统
setenv tftphdboot 'run setargs;run sethdargs;tftp $loadkernaddr $bootfile;bootm $loadkernaddr' ## tftp 下载内核,硬盘存储加载文件系统
setenv flashramboot 'run setargs;run setramargs;bootm $kernaddr $ramdiskaddr' ## 从flash中启动内核和加载文件系统
setenv flashnfsboot 'run setargs;run setnfsargs;bootm $kernaddr' ## 从flash中启动内核, nfs分区挂载根文件系统
setenv flashhdboot 'run setargs;run sethdargs;bootm $kernaddr' ## 从flash中启动内核, 硬盘存储启动根文件系统
setenv cframboot 'run setargs;run setramargs;fatload ide 0:1 $loadkernaddr uImage;fatload ide 0:1 $loadramdaddr rootfs.ext2.gz.uboot;bootm $loadkernaddr $loadramdaddr'
## cf卡中存储内核和文件系统镜像,将其加载到ram中,启动
setenv cfnfsboot 'run setargs;run setnfsargs;fatload ide 0:1 $loadkernaddr uImage;bootm $loadkernaddr' ## 从cf卡中加载内核到ram,NFS作根文件系统
#
setenv setenv1 'setenv rootpath /home/liuby/rootfs;setenv ipaddr 59.64.155.244;setenv ethaddr 08:00:3e:03:01:10;setenv eth1addr 08:00:3e:03:01:11;setenv eth2addr
08:00:3e:03:01:12' ## 设置部分启动环境(NFS 服务根目录, 网卡eth0 IP地址, 网卡MAC地址)
setenv setenv2 'setenv rootpath /home/liuby/root2;setenv ipaddr 59.64.155.111;setenv ethaddr 08:00:3e:03:02:10;setenv eth1addr 08:00:3e:03:02:11;setenv eth2addr
08:00:3e:03:02:12'
#
saveenv ## 保存环境变量