Uboot startup parameter description

29.Uboot startup parameter description:

bootcmd=cp.b 0xc4200000 0x7fc0 0x200000 ; bootm

// After the countdown reaches 0, the command will be executed automatically

bootdelay=2

baudrate=38400

// Serial port baud rate, generally use 38400

ethaddr=08:00:3e:26:0a:5c

bootfile="uImage"

ethact=lan911x

serverip=10.117.192.3

// Specify the ip address of the linux server, which will be used when performing command operations such as tftp

gatewayip=10.117.192.1

// Specify the gateway address

netmask=255.255.255.0

// Specify the subnet mask

ipaddr=10.117.192.216

// Specify the ip address of the current development board

bootargs=root=/dev/mtdblock0 mem=32M

// The parameters passed to the kernel to start execution, such as whether to use ramdisk or nfs, etc.

mtdparts=armflash.1:12M@0x400000(jffs2) console=ttyAMA0,38400 macaddr=0216 rootfstype=jffs2

stdin=serial

stdout=serial

stderr=serial

verify=n

Append:

bootdelay-How many seconds after uboot starts, the command set in bootcmd will be automatically executed, that is, self-starting. If the bootcmd parameter is not configured, bootdelay will not work

 

The fs of type jffs2 runs directly on the board, and the address starts from 0xc4400000 with 4M, which is specified by root=/dev/mtdblock0 mtdparts=armflash.1:4M@0x400000(jffs2) in the bootargs parameter. macaddr=08003e260a55 This configures the mac address of the board, each board should have a different mac address

 

30. Linux Kernel common parameter examples

Ramdisk startup parameters:

setenv bootargs root=/dev/ram0 initrd=0x2800000,24M rootfstype=ext2 mem=64M console=ttyAMA0

Nfs startup parameters:

setenv bootargs root=/dev/nfs nfsroot=192.168.1.7:/opt/yz/nfs,rw ip=192.168.1.160 mem=64M console=ttyAMA0

jffs2 startup parameters:

setenv bootargs root=/dev/mtdblock0 mem=16M mtdparts=armflash.1:4M@0x400000(jffs2) macaddr=9854 rootfstype=jffs2 console=ttyAMA0

 

31. Description of ubbot startup information

U-Boot 1.1.3 (Apr 22 2008 - 10:21:13)

U-Boot code: 00800000 -> 00815850 BSS: -> 0081B184

RAM Configuration:

Bank #0: 00000000 64 MB

Flash: 16 MB

In:    serial

Out:   serial

Err:   serial

Net:   lan911x_init

lan911x

Hit any key to stop autoboot: 0

6.4.3 U-Boot environment variables
Similar to Shell, U-Boot also uses environment variables. You can view the settings of environment variables through the printenv command.
 
U-Boot> printenv
bootdelay=3
baudrate=115200
netmask=255.255.0.0
ethaddr = 12: 34: 56: 78: 90: ab
bootfile=uImage
bootargs=console=ttyS0,115200 root=/dev/ram rw initrd=0x30800000,8M
bootcmd=tftp 0x30008000 zImage;go 0x30008000
serverip=192.168.1.1
ipaddr=192.168.1.100
stdin=serial
stdout=serial
stderr=serial
 
Environment size: 337/131068 bytes
U-Boot>
 
Table 6.5 is an explanation of the meaning of commonly used environment variables. The value of these variables can be printed out through the printenv command.
Table 6.5 Explanation of U-Boot environment variables

 

Environment variable
explain
bootdelay
Define the number of seconds to wait for automatic startup
baudrate
Define the baud rate of the serial console
netmask
Define the mask of the Ethernet interface
ethaddr
Define the MAC address of the Ethernet interface
bootfile
Define the default download file
bootargs
Define the command line parameters passed to the Linux kernel
bootcmd
Define several commands to be executed during automatic startup
serverip
Define the IP address of the tftp server
ipaddr
Define the local IP address
stdin
Define the standard input device, usually a serial port
stdout
Define the standard output device, usually a serial port
stderr
Define the standard error message output device, usually a serial port

 

 
U-Boot environment variables can all have default values, or they can be modified and saved in the parameter area. The parameter area of ​​U-Boot generally has EEPROM and Flash two devices.
The command for setting environment variables is setenv, which is explained in section 6.2.2.
Give examples to illustrate the use of environment variables.
 
=>setenv serverip 192.168.1.1
=>setenv ipaddr 192.168.1.100
=>setenv rootpath "/usr/local/arm/3.3.2/rootfs"
=>setenv bootargs "root=/dev/nfs rw nfsroot=/$(serverip):/$(rootpath) ip=
/$(ipaddr) "
=>setenv kernel_addr 30000000
=>setenv nfscmd "tftp /$(kernel_addr) uImage; bootm /$(kernel_addr) "
=>run nfscmd
 
The environment variables defined above are serverip ipaddr rootpath bootargs kernel_addr. Environment variables are also used in the environment variable bootargs. Bootargs defines command line parameters, which are passed to the kernel through the bootm command. Environment variables are also used in the environment variable nfscmd, the function is to download uImage to the specified address and boot. The nfscmd script can be executed through the run command.

Guess you like

Origin blog.csdn.net/daocaokafei/article/details/114906462