Chinaunix首页 | 论坛 | 博客
  • 博客访问: 549544
  • 博文数量: 116
  • 博客积分: 2063
  • 博客等级: 大尉
  • 技术积分: 1174
  • 用 户 组: 普通用户
  • 注册时间: 2007-10-26 16:44
个人简介

none

文章分类

全部博文(116)

文章存档

2023年(2)

2020年(3)

2019年(4)

2018年(7)

2017年(6)

2016年(17)

2015年(13)

2014年(19)

2013年(6)

2012年(13)

2011年(5)

2010年(11)

2008年(10)

分类: LINUX

2016-10-12 17:09:30

U-Boot > usb
usb - USB sub-system
 
Usage:
usb start - start (scan) USB controller
usb reset - reset (rescan) USB controller
usb stop [f] - stop USB [f]=force stop
usb tree - show USB device tree
usb info [dev] - show available USB devices
usb storage - show details of USB storage devices
usb dev [dev] - show or set current USB storage device
usb part [dev] - print partition table of one or all USB storage devices
usb read addr blk# cnt - read `cnt' blocks starting at block `blk#'
to memory address `addr'
usb write addr blk# cnt - write `cnt' blocks starting at block `blk#'
from memory address `addr'

////////////////////////From  http://blog.chinaunix.net/uid-22117117-id-2881169.html //////////////////////////
这种方法比较简单,就是利用uboot自带命令usbboot来实现启动,也算是最粗糙的一种。

1.在配置文件中添加一系列有关USB的支持。
uboot编译启动后输入
usb start
usbboot 0x30800000 0:1
这里的0是usb设备0,1是第一分区
当然,这里肯定会失败,因为usb storage中还没有必须的内核文件呢。

2.usbboot是从指定分区的起始位置拷贝内核文件到指定的地址。
因为没有找到合适的拷贝工具,于是使用uboot自带的usb命令进行复制。
先把内核拷贝到内存,再从内存拷贝到usb storage。
tftp 0x30800000 uImage_n35
usb write 0x30800000 0x1f80 0x1000
这里要注意的一点是起始block和blknum都应该是16进制,如果觉得麻烦,可以把do_usbboot中获取参数的simple_stroul改为10进制。

内核文件准备完毕后,最终的启动命令为:
usb start; usbboot 0x30800000 0:1; bootm 0x30800000 //因为usbboot会自动识别分区起始位置的内核头,内核头中指明了内核大小。
////////////////////////From  http://blog.chinaunix.net/uid-22117117-id-2881169.html //////////////////////////

====================Device Start Log=======================================
hisilicon #
hisilicon # tftp 0x82000000 uImage.hi3531NVR
No such device: 0:2 No such device: 0:2 MAC: 00-00-45-1D-2A-39 TFTP from server 192.168.200.138; our IP address is 192.168.200.221 Download Filename 'uImage.hi3531NVR'.
Download to address: 0x82000000 Downloading: #################################################
done
Bytes transferred = 3713652 (38aa74 hex)
hisilicon #
hisilicon # usb start
(Re)start USB... USB:   scanning bus for devices... 2 USB Device(s) found
       scanning bus for storage devices... usb_stor_get_info->1406,blksz:512 1 Storage Device(s) found
hisilicon #
hisilicon # usb write 0x82000000 0 0x1D00 ####### Here 3713652/512=7254=0x1C56<=0x1D00 USB write: device 0 block # 0, count 7424 ... ..................................................
................................................................................................
................................................................................................
................................................................................................
................................. 7424 blocks write: OK
hisilicon #
hisilicon # setenv bootcmd 'usb start;usb  read 0x82000000 0 0x1D00;bootm 0x82000000';save;reset
Saving Environment to NAND...
Erasing Nand...
Erasing at 0xe0000 -- 100% complete.
Writing to Nand... done
resetting ...



U-Boot 2010.06.HISI.1.0.A.0_SVN.1876_3531.NVR (Jun 09 2016 - 03:36:36) NAND:  Special Nand id table Version 1.35 Nand ID: 0xAD 0xF1 0x00 0x1D 0xAD 0xF1 0x00 0x1D Nand(Hardware): Block:128KB Page:2KB Chip:128MB*1 OOB:64B ECC:1bit 128 MiB
AIC3101 Reg86=0x3b set_HISI_register Done

NAND read: device 0 offset 0xe00000, size 0x200000 2097152 bytes read: OK
decode at addr 0x85000000 jpeg!
dev 0 set background color!
dev 2 set background color!
dev 0 opened!
graphic layer 0 opened from addr 0x85000000 dev 2 opened!
graphic layer 2 opened from addr 0x85000000 In:    serial Out:   serial Err:   serial
Hit any key to stop autoboot: 0 (Re)start USB... USB:   scanning bus for devices... 2 USB Device(s) found
       scanning bus for storage devices... usb_stor_get_info->1406,blksz:512 1 Storage Device(s) found

USB read: device 0 block # 0, count 7424 ... ..................................................
...............................................................................................
...............................................................................................
...............................................................................................
.................................... 7424 blocks read: OK
## Booting kernel from Legacy Image at 82000000 ...
   Image Name:   Linux-3.0.8 Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size: 3713588 Bytes = 3.5 MiB
   Load Address: 80008000 Entry Point: 80008000 Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
[ 0.000000] Linux version 3.0.8 (root@localhost.localdomain)
(gcc version 4.4.1 (Hisilicon_v100(gcc4.4-290+uclibc_0.9.30.2+eabi+linuxpthread)) )
#Hi3531_1.0.A.0_SVN_1945 SMP Thu Jul 21 08:50:25 CST 2016
阅读(4581) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~