DM368开发 -- uboot 使用
生活随笔
收集整理的這篇文章主要介紹了
DM368开发 -- uboot 使用
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
一、uboot指令
hisilicon # help? ? ? ? - alias for 'help'
base ? ?- print or set address offset
bootm ? - boot application image from memory
bootp ? - boot image via network using BOOTP/TFTP protocol
cmp ? ? - memory compare
cp ? ? ?- memory copy
crc32 ? - checksum calculation
ddr ? ? - ddr training function
fatinfo - print information about filesystem
fatload - load binary file from a dos filesystem
fatls ? - list files in a directory (default /)
getinfo - print hardware information
Go?? ? ?- start application at address 'addr'
help ? ?- print command description/usage
loadb ? - load binary file over serial line (kermit mode)
loady ? - load binary file over serial line (ymodem mode)
loop ? ?- infinite loop on address range
md ? ? ?- memory display
mii ? ? - MII utility commands
mm ? ? ?- memory modify (auto-incrementing address)
mtest ? - simple RAM read/write test
mw ? ? ?- memory write (fill)
nand ? ?- NAND sub-system
nboot ? - boot from NAND device
nm ? ? ?- memory modify (constant address)
ping ? ?- send ICMP ECHO_REQUEST to network host
printenv- print environment variables
rarpboot- boot image via network using RARP/TFTP protocol
reset ? - Perform RESET of the CPU
saveenv - save environment variables to persistent storage
setenv ?- set environment variables
sf ? ? ?- SPI flash sub-system
tftp ? ?- tftp ?- download or upload image via network using TFTP protocol
usb ? ? - USB sub-system
usbboot - boot from USB device
version - print monitor version
hisilicon #?
詳細查看各個指令用法可使用 help+指令名 來查看。舉個栗子: x210 # help erase erase start end- erase FLASH from addr 'start' to addr 'end' erase start +len- erase FLASH from addr 'start' to the end of sect w/addr 'start'+'len'-1 erase N:SF[-SL]- erase sectors SF-SL in FLASH bank # N erase bank N- erase FLASH bank # N erase all
二、uboot 環境變量
參看:U-Boot Usage 參看:uboot環境變量實現分析 bootdelay ? ?執行自動啟動的等候秒數 baudrate ? ? 串口控制臺的波特率netmask ? ? 以太網接口的掩碼
ethaddr ? ? ? 以太網卡的網卡物理地址
bootfile ? ? ? ?缺省的下載文件
bootargs ? ? 傳遞給內核的啟動參數
bootcmd ? ? 自動啟動時執行的命令
serverip ? ? ? 服務器端的ip地址
ipaddr ? ? ? ? 本地ip 地址
stdin ? ? ? ? ? 標準輸入設備
stdout ? ? ? ?標準輸出設備
stderr ? ? ? ? 標準出錯設備
三、uboot 傳參機制
參看:uboot向kernel的傳參機制——bootm與tags四、bootargs?
參看:U-Boot Usage 參看:GSG: DM365 DVEVM Additional Procedures 例如: setenv bootargs 'console=ttyS0,115200n8 ip=dhcp root=/dev/mtdblock3 rw rootfstype=yaffs2 mem=76M video=davincifb:vid0=OFF:vid1=OFF:osd0=720x576x16,4050K dm365_imp.oper_mode=0 davinci_capture.device_type=4' setenv bootcmd 'nand read 0x80700000 0x400000 0x400000;bootm 0x80700000';root=
它告訴內核使用什么設備作為根文件系統。例如,要通過NFS引導,請設置? ? root=/dev/nfs
要通過MMC / SD啟動,請執行類似操作 ? ? root=/dev/mmcblk0p2
rw
這告訴內核將根文件系統掛載為讀/寫。rootstype=
指明文件系統的類型nfsroot=
它告訴內核哪個機器和目錄用于NFS掛載,以及根文件系統的選項。 更多細節可以在 linux/Documentation/ nfsroot.txt 文件中找到。 這也必須與 root = /dev/nfs 參數一起使用。例如:? ? nfsroot=192.168.1.100:/home/workdir/filesystem,nolock?(192.168.1.100 為虛擬機 IP)
ip=
通過 NFS 安裝時,內核必須直接配置網絡接口。 這個的典型用法是:? ? ip=dhcp
例如:ip=192.168.32.128:192.168.32.122:192.168.32.1:255.255.255.0?
“ip=”后面:?
? ? 第一項(192.168.32.128)是開發板的臨時IP(注意不要和局域網內其他 IP 沖突);?
? ? 第二項(192.168.32.122)是我的 PC 的 IP;?
? ? 第三項(192.168.32.1)是開發板上網關(GW)的設置;?
? ? 第四項(255.255.255.0)是子網掩碼;
noinitrd?
當指定時,這將允許通過 /dev /initrd 訪問初始 RAM 磁盤。否則使用 initrdinit
init指定的是內核啟起來后,進入系統中運行的第一個腳本,一般init=/linuxrc, 或者init=/etc/preinit,preinit的內容一般是創建console,null設備節點,運行init程序,掛載一些文件系統等等操作。請注意,很多初學者以為init=/linuxrc 是固定寫法,其實不然,/linuxrc指的是/目錄下面的linuxrc腳本,一般是一個連接罷了。mem=
這指定了可用于Linux的內存量。console=
這告訴內核在哪里發送引導消息。 典型用法是使用第一個串行端口,115200波特,8位數據,無奇偶校驗。 例如:? ? console=ttyS0,115200n8
mtdparts
Flash分區描述,格式為 mtdparts=hi_sfc:256K(boot),3M(kernel),1M(rootfs),5M(data)? 表示有4個分區,分區0大小為256用于bootloader啟動,分區1大小為3M用于內核啟動,分區2大小為1M用于根文件系統啟動,5M為用戶數據。video=
這將告訴內核有關如何配置視頻設備的信息。 這里給出了與TI EVM具體相關的一些常見值。? ? davincifb | omap24xxfb
這具體說明要使用的framebuffer驅動程序的名稱。 (對于DaVinci零件選擇davincifb和OMAP3零件的omap24xxfb)。? ? vid[0-1]=[width x height x bpp,mem]
這指定了對應于vid0或vid1的幀緩沖區的大小,每像素的位數和內存量。 如果使用v4l2驅動程序(而不是davincifb),請將其指定為vid0 = OFF:vid1 = OFF。 如果使用davincifb驅動程序,您可以分配一個720x480 vid0窗口,每個像素16位,內存2500KB? ? vid0=720x480x16,2500K
? ? osd[0-1][width x height x bpp,mem]
這指定了對應于osd0或osd1的幀緩沖區的大小,每像素的位數和分配的內存量。 例如,您可以分配一個720x480的osd0窗口,每個像素16位,內存2500KB? ? osd0=720x480x16,2500K
? ? rotation=n (for use with omap24xxfb only)
這指定了幀緩沖區的旋轉量。 n的有效值為{0,90,180,270}。video =參數的所有值部分應該用逗號分隔。 例如,在達芬奇設備上,要使用v4l2驅動程序進行視頻窗口并設置OSD窗口,請使用:
? ? video=davincifb:vid0=OFF:vid1=OFF:osd0=720x480x16,2500K
dm365_imp.oper_mode=
這將設置IPIPE調整器的模式。 連續模式為0,單拍模式為1。davinci_capture.device_type=
這定義要使用哪個驅動程序。 使用以下設置: ? ? davinci_capture.device_type=0 for MT9T001? ? davinci_capture.device_type=1 for TVP5146
? ? davinci_capture.device_type=2 for MT9T031
? ? davinci_capture.device_type=3 for MT9P031
? ? davinci_capture.device_type=4 for TVP7002
? ? davinci_enc_mngr.ch0_output=
有效值為: ? ?COMPOSITE
? ?COMPOSITE1
? ?SVIDEO
? ?SVIDEO1
? ?COMPONENT
? ?COMPONENT1
? ?LCD
? ?LCD1
davinci_enc_mngr.ch0_mode=
達芬奇的有效值為:? ?NTSC
? ?ntsc
? ?NTSC-RGB
? ?PAL
? ?pal
? ?PAL-RGB
? ?720P-24
? ?720P-25
? ?720P-30
? ?720P-50
? ?720P-60
? ?1080I-25
? ?1080I-30
? ?1080P-25
? ?1080P-30
? ?1080P-50
? ?1080P-60
? ?480P-60
? ?576P-50
? ?640x480
? ?640x400
? ?640x350
? ?800x480
DaVinciHD(DM6467)的有效值為: ? ?NTSC
? ?NTSC-RGB
? ?PAL
? ?PAL-RGB
? ?720P-25
? ?720P-30
? ?720P-50
? ?720P-60
? ?1080I-25
? ?1080I-30
? ?1080P-24
? ?1080P-25
? ?1080P-30
? ?1080P-50
? ?1080P-60
? ?480P-60
? ?576P-50
? ?640x480
? ?640x400
? ?640x350
五、nand flash/nor flash燒寫指令
1、nand flash
例如:燒寫內核 mw.b 82000000 ff 400000 tftp 82000000 uImage nand erase 800000 400000 nand write 82000000 800000 400000nand info : ?查看nandflash芯片信息包括數據線位寬一般8或者是16等
nand erase: ?nandflash使用之前必須先擦除,遇到壞塊會標記以下是使用實例
? ? nand erase 0x00280000 0x300000? ? 作用:擦除nandflash上起始地址為0x00280000,長度為0x300000的flash空間
nand scrub: 作用和nand erase差不多,但是會將壞塊信息也擦除掉
? ? nand scrub 400000 1000000 表示從 0x400000 開始清理 64M。? ? 如果最后一個參數不傳,則表示從此地址開始清理至 nand flash 結束,比如:
? ? nand scrub 400000 表示清理從 0x400000 開始的所有 flash 空間。
nand write: ?將數據從ddr上的某個地址寫入flash中間比如
? ? nand write 0x81000000 0x00280000 0x300000? ? 作用:將DDR地址為0x81000000上的數據寫入到nandflash 地址0x00280000上,寫入長度為0x30000
nandecc ?: 在讀寫flash之前需要先設置好該flash的ecc校驗方法,否則可能導致很嚴重的錯誤,
? ? 以下是設置ecc校驗的命令:? ? nandecc hw 2設置nandflash的ecc校驗是硬件校驗具體為BCH8(4位校驗碼)
? ? nandecc hw 0設置nandflash的校驗方法是硬件校驗具體是漢明碼(1位校驗碼)
? ? nandecc sw 設置nandflash的校驗方法是軟件校驗
2、nor flash
例如:燒寫 uboot sf probe 0 mw.b 82000000 ff 100000 tftp 0x82000000 u-boot.bin sf probe 0 sf erase 0 100000 sf write 82000000 0 100000【mw.b】
mw.b表示按字節顯示,內存初始化,填充內存。把內存 0x82000000 開始的 0x10000 字節設為 0xFF。【sf probe 0】?
探測并初始化SPI FLASH;【0x82000000】
內存地址【erase】?
表示從地址0擦除了1M的文件【write】?
表示從內存地址0x82000000寫入1M文件總結
以上是生活随笔為你收集整理的DM368开发 -- uboot 使用的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: DM368开发 -- Bootloade
- 下一篇: 排序二叉树 SortBinaryTree