Uboot基本命令

Basic Command Tests

U-Boot provides a set of commands to operate the resources, such as RAM, FLASH, serial port, and ethernet, on the board before the kernel is executed. The below tests attempt to ensure that all the features of U-Boot are working.

    • test countdown time period
      • It calculates the intermediate time between the 3rd and 2nd second when countdown in rebooting. Then the result is compared with 1 second. If the difference is less than 0.1, the case passes, otherwise it fails.
    • version command
      • Input the version command at the U-Boot prompt. If it can display the U-Boot version, it passes, otherwise it fails.
    • echo
      • Input echo command followed by one sentence. If the output is the same as the sentence entered, the case passes, otherwise it fails.
    • help date
      • Input this command to see if the help information is shown correctly. If the output is like “[MMDDhhmm]”, the case passes, otherwise it fails.
    • date
      • Set one specific date using this command, and see if U-Boot accepts it correctly. If the print date is the intended date, the test passes, otherwise it fails.
    • date set and time set after U-Boot reset
      • Sleep 60 seconds, reset U-Boot and print the date and time information again to see if the previous setting is still effective and is displayed properly . If true, the case pass, otherwise it fails.
    • help
      • To see if the help information is right by issuing the help command. If the usage message for each command is displayed, then the case passes, else it fails.
    • flinfo
      • To check the flash bank and sector information. If what it prints goes with the value in the U-Boot config file which is, bank 1 and sector 67, the case passes, otherwise it fails.
    • mw
      • Memory write test. Use the mw.l command to write a long value to one memory address, and check it with md.w (memory display) command to see if the mw command writes as expected.
    • nm
      • Memory modify at constant address. First, write a value to one address by mw.b, then issue nm.w command to change the value 80 times. When finished, interrupt the command and check the value using md. If the result is expected the case passes, otherwise it fails.
    • mm
      • Memory modify by auto-incrementing. Input the mm.w command with one address, change that value, and hit enter to change the next value in the following address. It is cycled by 32 times. In the end, check with the md command to see if the result is right.
    • reset
      • Reset U-Boot 200 times to see if U-Boot can continuously reset the board successfully. If it resets properly every time, the test passes, otherwise it fails.
    • saveenv and printenv
      • First set the U-Boot environment variables with set command, then execute the command of saveenv, reset and printenv in sequence for 10 times. If it correctly saves and prints the environment variables, the test passes, otherwise it fails.
    • ping
      • Ping the host machine 10 times to see if this command functions properly. If all 10 pings are successful, the case passes, otherwise it fails.
    • autoscr
      • Tftp download one test image file, run autoscr to see if it can execute and print the right message. If so, the case passes, otherwise it fails.
    • base
      • Use this command to check if the base address is set as it is in the U-Boot config file. If they are the same, the case passes, otherwise it fails.
    • bdinfo
      • Use this command to check if the board memory start address and its size, flash start and size, Ethernet address, ipaddr, and baudrate in U-Boot matches the config file. If it is the same, the case passes, otherwise it fails.
    • iminfo
      • Use this command to check if the information of the kernel gunzip-compressed image can be recognized correctly in U-Boot. It includes the image name, the created date, its type, the size, its address and entry point, and checksum. If all information is right, the case passes, otherwise it fails.
    • bootelf
      • Tftp download one dxe kernel image, use this command to see if it can be booted up successfully. If so, the case passes, otherwise it fails.
    • cmp
      • Firstly tftp download one test file, copy it to one random SDRAM address, then use this command to compare if the destination file is the same as the source file. Secondly use mm.b to change the last byte of the file, compare again to see if the printed message says there is a difference and one less bytes are still the same. If so, cmp case passes, otherwise it fails.
    • run
      • Input this command to see if it can make a U-Boot command execute. Try an invalid U-Boot command to see if it reports an error message. If so, the case passes, else it fails.
    • mtest
      • Simple RAM test. To issue this command at a random RAM address to see if it quickly repeats writing and reading information. If so, it passes.
    • protect on and protect off
      • First, use this command to protect on the whole flash bank, then try cp.b command to see if it still can be written to. If not, protect on works. Secondly, protect off the whole bank, erase one random flash address area, copy a file to that address, and use cmp.b command to compare if the destination file is the same as the source file. If true, protect off case passes.
    • cp RAM-to-RAM, aligned
      • First, use mw.b to write to two aligned RAM addresses with 0xFF 4 times respectively. Secondly tftp one test file to an aligned RAM address, and copy this file to the address that is 4 bytes behind the first aligned address. Compare the two files to see if they are the same. Finally check again the two aligned addresses if the old value still remains. If so, the case passes, else fails.
    • cp RAM-to-RAM,unaligned
      • First, use mw.b to write to two unaligned RAM addresses with 0xFF 4 times respectively. Secondly tftp one test file to an unaligned RAM address, and copy this file to the address that is 4 bytes behind the first unaligned address. Compare the two files to see if they are the same. Finally check again the two unaligned addresses if the old value still remains. If so, the case passes, else fails.
    • cp RAM-to-flash, aligned
      • First, erase one flash area that is started from an aligned address, cp.b one testfile from the tftp_boot RAM aligned address to one segment of the erased flash that is started from an aligned address. Then compare the two areas to see if they are the same. Finally check two aligned flash address that is before and after this segment to see if these addresses are not modified. If so, the case passes, otherwise it fails.
    • cp RAM-to-flash, unaligned
      • First, erase one flash area that is started from an aligned address, cp.b one testfile from the tftp_boot RAM unaligned address to one segment of the erased flash that is started from an unaligned address. Then compare the two areas to see if they are the same. Finally check two unaligned flash address that is before and after this segment to see if their addresses are not modified. If so, the case passes, otherwise it fails.
    • cp flash-to-flash, aligned
      • First, erase one flash area that is started from an aligned address, and select one segment that is started from an aligned address to cp.b one testfile from RAM. Then erase another flash area with aligned start address, copy from the previous area to it. When finished, compare the two areas to see if they are the same. Finally check two aligned flash addresses that is before and after the latter flash address to see if their values are not been modified by the copy. If that is the case, the test passes, otherwise it fails.
    • cp flash-to-flash, unaligned
      • First, erase one flash area, from which select one segment that is started from an unaligned address to cp.b one testfile from RAM . And then erase another flash area, copy from the previous area to the second flash area that is also started with an unaligned address. When finished, compare the two areas to see if they are the same. Finally check two unaligned flash addresses that is before and after the latter flash address to see if their values are not been modified by the copy. If that is the case, the test passes, otherwise it fails.
    • cp flash-to-RAM,aligned
      • First, erase one flash area that is started from an aligned address, cp.b one testfile to it from RAM. And then mw.b write to two aligned RAM addresses with 0xff 4 times respectively which is before and after the intended to copy RAM address. Secondly Copy from the previous flash area started with aligned address to the selected RAM address. When finished, compare the two areas to see if they are same. Finally check again the two RAM aligned addresses to see if their values are unchanged. If that is the case, the test passes, otherwise it fails.
    • cp flash-to-RAM, unaligned
      • First, erase one flash area, from which select one segment that is started from an unaligned address to cp.b one testfile to from RAM address. And then mw.b write to two unaligned RAM addresses with 0xFF 4 times respectively which is before and after the intended to copy RAM address. Secondly Copy from the previous flash area to the selected RAM address that is also started with an unaligned address. When finished, compare the two areas to see if they are same. Finally check again the two RAM unaligned addresses to see if their values are not changed. If that is the case, the test passes, otherwise it fails.
    • tftp and tftp check for error
      • Tftp download uImage file 20 times, and check if for an error, such as invalid RARP, tftp timeout etc,during this process. If all download successfully, the tftp test passes, otherwise tftp fails. And If no tftp error is detected, the check for error case is also passed.
    • boot known-good uImage from flash
      • Download a uImage via tftp, and copy it to flash. Set the bootcmd parameter to make it boot from the flash address. Reset the board to see if the kernel really boots from the flash area and boots successfully. If so, the case passes, otherwise it fails.
    • Big-size linux image boot test with caches on
      • Having icache and dcache on, tftp download big-size(for BF533 about 35M,for BF537 about 15M) linux DXE image to see if it can boot up successfully.
    • go
      • Tftp download a small binary file add.bin to one SDRAM address 0×1000000, run this file at U-Boot prompt by issuing go command. It does an add operation and store the result value to another address. Read it out by md.b command to see if it is the expected value. If true, it proves the add.bin has been correctly executed,and the case passes. Otherwise it fails.
    • bootm
      • Tftp download one uImage kernel to a SDRAM address, use this command to see if it can be booted up successfully. If so, the case passes, otherwise it fails.
    • tftp download at speed 10 duplex half when ping flood
      • Tftp download a big linux kernel (>=20M) with the ethernet card configured at speed 10 duplex half when ping flood to see if the tftp process can still pass. The configuration is done by ethtool tool on host in the commandline: ethtool -s ethX speed 10 duplex half.
    • tftp download at speed 10 duplex full when ping flood
      • Tftp download a big linux kernel (>=20M) with the ethernet card configured at speed 10 duplex full when ping flood to see if the tftp process can still pass. The configuration is done by ethtool tool on host in the commandline: ethtool -s ethX speed 10 duplex full.
    • tftp download at speed 100 duplex half when ping flood
      • Tftp download a big linux kernel (>=20M) with the ethernet card configured at speed 100 duplex half when ping flood to see if the tftp process can still pass. The configuration is done by ethtool tool on host in the commandline: ethtool -s ethX speed 100 duplex half.
    • tftp download at speed 100 duplex full when ping flood
      • Tftp download a big linux kernel (>=20M) with the ethernet card configured at speed 100 duplex full when ping flood to see if the tftp process can still pass. The configuration is done by ethtool tool on host in the commandline: ethtool -s ethX speed 100 duplex full.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值