[UP] change update interval.
[arrow.git] / viki / uboot / uboot_with_dfu.viki
blob4dfdbea63b968477ccdf2acc65fe0ca068cdea86
1 ref:http://wiki.openmoko.org/wiki/Dfu-util/zh_cn
2 Dfu-util/zh cn
3 From Openmoko
4 Jump to: navigation, search
5 Contents
6 [hide]
8     * 1 目的
9     * 2 源代码
10     * 3 参考文档
11           o 3.1 Command-line options
12                 + 3.1.1 --help
13                 + 3.1.2 --list
14                 + 3.1.3 --device
15                 + 3.1.4 --transfer-size
16                 + 3.1.5 --download
17                 + 3.1.6 --upload
18     * 4 Phrasebook
19           o 4.1 Flashing the kernel
20           o 4.2 Flashing the bootloader
21           o 4.3 Copying a kernel into RAM
23 目的
25 dfu-util 是一个实现主机端USB DFU(通用串行总线 设备固件升级)协议的程序。
27 在 Openmoko 项目中,我们使用这个程序来与我们的特别增强型boot loader u-boot 通信,这个boot loader实现了DFU的设备侧功能。
29 通过使用 dfu-util 和你的 Neo1973,你能做到:
31     * transfer and flash partitions to NAND Flash, such as
32           o The Linux kernel
33           o 根文件系统分区
34           o The splash screen partition
35           o u-boot 环境
36           o Last, but not least: The u-boot bootloader itself. 
37     * 向 Neo1973 的 RAM 传输任何东西
38           o this can be used for fast development cycles of low-level code such as kernels without flashing them 
39     * read out the current NAND partitions
40           o this is an easy and efficient way of doing full backups of your phone 
42 源代码
44 dfu-util 的源代码可以从 http://svn.openmoko.org/trunk/src/host/dfu-util/ 下载。
46 Binary packages will be made available as part of the regular Openmoko builds
47 参考文档
48 Command-line options
49 --help
51 dfu-util - (C) 2007 by Openmoko Inc.
52 This program is Free Software and has ABSOLUTELY NO WARRANTY
54 Usage: dfu-util [options] ...
55   -h --help                     Print this help message
56   -V --version                  Print the version number
57   -l --list                     List the currently attached DFU capable USB devices
58   -d --device vendor:product    Specify Vendor/Product ID of DFU device
59   -c --cfg config_nr            Specify the Configuration of DFU device
60   -i --intf intf_nr             Specify the DFU Interface number
61   -a --alt alt_nr               Specify the Altseting of the DFU Interface
62   -t --transfer-size            Specify the number of bytes per USB Transfer
63   -U --upload file              Read firmware from device into <file>
64   -D --download file            Write firmware from <file> into device
65   -R --reset                    Issue USB Reset signalling once we're finished
67 --list
69 Using the --list option, you can list the available DFU capable devices, their configuration, interface and altsettings. Below is an example for a current Neo1973 phone in u-boot Runtime Mode
71 # ./dfu-util --list
72 dfu-util - (C) 2007 by Openmoko Inc.
73 This program is Free Software and has ABSOLUTELY NO WARRANTY
75 Found DFU Runtime: [0x1457:0x5119] devnum=0, cfg=0, intf=2, alt=0, name="USB Device Firmware Upgrade"
77 Below is an example for a current Neo1973 phone in u-boot DFU Mode
79 # ./dfu-util --list
80 dfu-util - (C) 2007 by Openmoko Inc.
81 This program is Free Software and has ABSOLUTELY NO WARRANTY
83 Found DFU: [0x1457:0x5119] devnum=16, cfg=0, intf=0, alt=0, name="RAM 0x32000000"
84 Found DFU: [0x1457:0x5119] devnum=16, cfg=0, intf=0, alt=1, name="u-boot"
85 Found DFU: [0x1457:0x5119] devnum=16, cfg=0, intf=0, alt=2, name="u-boot_env"
86 Found DFU: [0x1457:0x5119] devnum=16, cfg=0, intf=0, alt=3, name="kernel"
87 Found DFU: [0x1457:0x5119] devnum=16, cfg=0, intf=0, alt=4, name="splash"
88 Found DFU: [0x1457:0x5119] devnum=16, cfg=0, intf=0, alt=5, name="rootfs"
90 This shows you six interfaces, all in configuration 0 and interface 0, with altsetting 0...4. The name is currently not yet defined, but will be added to one of the upcoming u-boot releases. The mapping on the Neo1973 is as follows:
92     * 0: RAM
93     * 1: 'u-boot' partition
94     * 2: 'u-boot_env' partition
95     * 3: 'kernel' partition
96     * 4: 'splash' partition
97     * 5: 'rootfs' partition 
99 --device
101 You can specify the USB Vendor and Product ID of the device you want to program:
103 dfu-util --device 0x1457:0x5119
105 If you only have one standards-compliant DFU device attached to your PC, this is optional. However, as soon as you have multiple DFU devices, dfu-util will detect this and abort, asking you to specify which device it shall use.
106 --transfer-size
108 Specifies the size of each individual USB transfer. If you don't use it, the maximum possible size for your combination of host operating system and USB device is chosen (for optimal performance).
109 --download
111 download the given file into the device.
112 --upload
114 upload from the DFU device into the given file[name].
115         NOTE: Upload support is currently broken
116 Phrasebook
118 There's no full-fledged manual yet. Instead, some examples:
119 Flashing the kernel
121 dfu-util -a 3 -R -D /path/to/uImage
123 Flashing the bootloader
125 dfu-util -a 1 -R -D /path/to/u-boot.bin
127 Copying a kernel into RAM
129 dfu-util -a 0 -R -D /path/to/uImage
131 Once this has finished, the kernel will be available at the default load address of 0x32000000 in Neo1973 RAM.