개발 관련/U-Boot

U-Boot(uBoot) 설정

우진샘 2011. 11. 22. 14:25
반응형

U-Boot(uBoot) 설정하기 

1. 설정보기 (print)

> print
bootdelay=2
baudrate=38400
bootfile=""
rootfs_size=0xc00000
kernel_size=0x200000
loadcmd_pe0=run loadcmd_flash
loadcmd_pe1=run loadcmd_tftp
loadcmd_tftp=dhcp;tftp 0xb8000000 uImage;tftp 0xbe000000 rootfs.img.gz
loadcmd_flash=sf probe 0;sf read 0xb8000000 0x80000 ${kernel_size};sf read 0xbe0
00000 300000 ${rootfs_size}
set_ba=set bootargs mem=256M console=ttyS0,38400n8 root=/dev/ram rw ramdisk_size
=32768000 initrd=0xbe000000,${rootfs_size} a2a.enable=1
set_ba_pe1=set bootargs mem=256M console=ttyS0,38400n8 root=/dev/ram rw ramdisk_
size=32768000 initrd=0xbe000000,${rootfs_size} s7gmac.macaddr=${ethaddr} a2a.ena
ble=1
copy_to_pe1=cp.b 0xb8000000 0x78000000 ${kernel_size};cp.b 0xbe000000 0x7e000000
 ${rootfs_size};sig
copy_from_pe1=waitsig;cp.b 0x78000000 0xb8000000 ${kernel_size};cp.b 0x7e000000
0xbe000000 ${rootfs_size};sig
boot_flash_pe0=run loadcmd_pe0;run copy_to_pe1;run set_ba;bootm 0xb8000000
boot_flash_pe1=waitsig;run set_ba_pe1;bootm 0xb8000000
boot_tftp_pe0=run copy_from_pe1;run set_ba; bootm 0xb8000000
boot_tftp_pe1=run loadcmd_pe1;sig;run set_ba_pe1;waitsig;bootm 0xb8000000
bootcmd=run boot_flash_pe0
bootcmd_pe1=run boot_flash_pe1
ipaddr=172.16.4.125
netmask=255.255.255.0
gatewayip=172.16.4.1
serverip=172.16.4.100
ethaddr=00:OF:45:00:07:49
autostart=no
stdin=serial
stdout=serial
stderr=serial
INFO1=kernel offset 0x80000 in flash, rootfs offset 0x300000 in flash
erase_env=sf probe 0; sf erase 0x40000 0x10000
INFO2=env offset 0x40000 in flash, use "run erase_env" to erase
verify=n
autoload=n 


2. 설정하기 (setenv)
> setenv ipaddr 172.16.4.125
> print
ipaddr=172.16.4.125
netmask=255.255.255.0
gatewayip=172.16.4.1


* 여기서 홑따옴표(')를 사용하여 두 개 이상의 명령어를 동시에 입력할 수 있다.
* 세미콜론(;)은 명령어 라인을 분리하는 기호이다.
> setenv loadcmd_tftp 'dhcp;tftp 0xb8000000 uImage;tftp 0xbe000000 rootfs.img.gz'


* 값 없이 변수명만 적으면 해당 환경변수가 삭제된다.
> setenv ipaddr
> print
netmask=255.255.255.0
gatewayip=172.16.4.1


3. 저장하기 (saveenv)
> saveenv


4. 네트워크 설정 (ipaddr, gatewayip, netmask, serverip, ethaddr)
> setenv ipaddr 172.16.4.126
> setenv gatewayip 172.16.4.1
> setenv netmask 255.255.255.0
> setenv serverip 172.16.4.100
> setenv ethaddr 00:00:f8:12:34:56

> ping 172.16.4.100   # ping 으로 네트워크 연결 확인
반응형