2011년 6월 10일 금요일

List of booting SD card for BeagleBoard-xM rev A.

# ls -al
합계 41897
drwx------ 2 daysleep daysleep      512 1970-01-01 09:00 .
drwxr-xr-x 4 root     root         4096 2011-06-10 01:38 ..
-rw-r--r-- 1 daysleep daysleep    24296 2010-08-20 20:54 MLO
-rw-r--r-- 1 daysleep daysleep      376 2010-08-20 20:54 md5sum.txt
-rw-r--r-- 1 daysleep daysleep 19960110 2010-08-20 20:54 ramdisk.gz
-rw-r--r-- 1 daysleep daysleep 19509297 2010-08-20 20:54 ramfs.img
-rw-r--r-- 1 daysleep daysleep   210360 2010-08-20 20:54 u-boot.bin
-rw-r--r-- 1 daysleep daysleep  3190568 2010-08-20 20:54 uImage
-rw-r--r-- 1 daysleep daysleep      755 2010-08-20 20:54 user.scr

============================ user.scr ===============================
....(This is appeared as broken characters) ...
mmc init
setenv dvimode 1024x768MR-16@60
setenv vram 16M omapfb.vram=0:8M,1:4M,2:4M
setenv console tty0 console=ttyS2,115200n8
if test "${beaglerev}" = "AxBx"; then
setenv rdaddr 0x81000000
setenv optargs mem=80M@0x80000000 musb_hdrc.fifomode=5
elif test "${beaglerev}" = "Cx"; then
setenv rdaddr 0x88000000
setenv ramroot /dev/ram0 rw ramdisk_size=131072 initrd=${rdaddr},128M
setenv optargs mem=80M@0x80000000 mem=128M@0x88000000 musb_hdrc.fifomode=5
else
setenv rdaddr 0x88000000
setenv ramroot /dev/ram0 rw ramdisk_size=131072 initrd=${rdaddr},128M
setenv optargs mem=80M@0x80000000 mem=384M@0x88000000
fi
run loadramdisk
led 0 off
run loaduimage
led 1 on
run ramboot
========================= End of user.scr ============================

========================= printenv in u-boot  ========================
bootcmd=if mmc init ${mmcdev}; then if userbutton; then setenv bootscr user.scr;
if run loadbootscript; then run bootscript; fi; if run loaduimage; then if run l
oadramdisk; then run ramboot; fi; run mmcboot; fi; fi; if run loadbootscript; th
en run bootscript; fi; setenv bootscr user.scr;if run loadbootscript; then run b
ootscript; fi; if run loaduimage; then run mmcboot; fi; fi; run nandboot;

bootdelay=3

baudrate=115200

loadaddr=0x80200000

rdaddr=0x81000000

usbtty=cdc_acm

console=ttyS2,115200n8

optargs=

bootscr=boot.scr

camera=lbcm3m1

vram=12M

dvimode=640x480MR-16@60

defaultdisplay=dvi

mmcdev=1

mmcroot=/dev/mmcblk0p2 rw

mmcrootfstype=ext3 rootwait

nandroot=/dev/mtdblock4 rw

nandrootfstype=jffs2

ramroot=/dev/ram0 rw ramdisk_size=65536 initrd=0x81000000,64M

ramrootfstype=ext2

mmcargs=setenv bootargs console=${console} ${optargs} mpurate=${mpurate} buddy=$
{buddy} camera=${camera} vram=${vram} omapfb.mode=dvi:${dvimode} omapdss.def_dis
p=${defaultdisplay} root=${mmcroot} rootfstype=${mmcrootfstype}

nandargs=setenv bootargs console=${console} ${optargs} mpurate=${mpurate} buddy=
${buddy} camera=${camera} vram=${vram} omapfb.mode=dvi:${dvimode} omapdss.def_di
sp=${defaultdisplay} root=${nandroot} rootfstype=${nandrootfstype}

loadbootscript=fatload mmc ${mmcdev} ${loadaddr} ${bootscr}
ramargs=setenv bootargs console=${console} ${optargs} mpurate=${mpurate} buddy=$
{buddy} camera=${camera} vram=${vram} omapfb.mode=dvi:${dvimode} omapdss.def_dis
p=${defaultdisplay} root=${ramroot} rootfstype=${ramrootfstype}

loadramdisk=fatload mmc ${mmcdev} ${rdaddr} ramdisk.gz

bootscript=echo Running bootscript from mmc ...; source ${loadaddr}

loaduimage=fatload mmc ${mmcdev} ${loadaddr} uImage

mmcboot=echo Booting from mmc ...; run mmcargs; bootm ${loadaddr}

nandboot=echo Booting from nand ...; run nandargs; nand read ${loadaddr} 280000
400000; bootm ${loadaddr}

ramboot=echo Booting from ramdisk ...; run ramargs; bootm ${loadaddr}

buddy=none

beaglerev=xMA

mpurate=1000

dieid#=766600011ff00000015739eb0802400e

Environment size: 2013/131068 bytes
=============== End of printenv in u-boot  ========================

u-boot는 자동 부팅시 맨처음 실행하는 환경변수가 bootcmd인 것으로 생각된다. bootcmd를 좀 더 알기 쉽게 풀어 보면 다음과 같다.

====================== bootcmd ======================

if mmc init ${mmcdev};
    then if userbutton;
        then setenv bootscr user.scr;
        if run loadbootscript; then run bootscript; fi;
        if run loaduimage;
            then if run loadramdisk; then run ramboot; fi;
            run mmcboot;
        fi;
    fi;
    if run loadbootscript; then run bootscript; fi;
    setenv bootscr user.scr;
    if run loadbootscript; then run bootscript; fi;
    if run loaduimage; then run mmcboot; fi;
fi;
run nandboot;
================ End of bootcmd ======================

여기서, 빨간색 부분은 부팅시 사용자 버튼이 눌려 졌을때 사용되는 부분이기 때문에 나머지 부분을 먼저 살펴보자. bootcmd에서 사용되어지는 환경변수들을 우선 살펴보자.

loadbootscript ....


댓글 없음:

댓글 쓰기