xref: /OK3568_Linux_fs/u-boot/doc/mvebu/cmd/bubt.txt (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunBUBT (Burn ATF) command
2*4882a593Smuzhiyun--------------------------
3*4882a593SmuzhiyunBubt command is used to burn a new ATF image to flash device.
4*4882a593Smuzhiyun
5*4882a593SmuzhiyunThe bubt command gets the following parameters: ATF file name, destination device and source device.
6*4882a593Smuzhiyunbubt [file-name] [destination [source]]
7*4882a593Smuzhiyun	- file-name		Image file name to burn. default = flash-image.bin
8*4882a593Smuzhiyun	- destination		Flash to burn to [spi, nand, mmc]. default = active flash
9*4882a593Smuzhiyun	- source		Source to load image from [tftp, usb]. default = tftp
10*4882a593Smuzhiyun
11*4882a593SmuzhiyunExamples:
12*4882a593Smuzhiyun	bubt				- Burn flash-image.bin from tftp to active flash
13*4882a593Smuzhiyun	bubt latest-spi.bin nand	- Burn latest-spi.bin from tftp to NAND flash
14*4882a593Smuzhiyun
15*4882a593SmuzhiyunNotes:
16*4882a593Smuzhiyun- For the TFTP interface set serverip and ipaddr.
17*4882a593Smuzhiyun- To burn image to SD/eMMC device, the target is defined
18*4882a593Smuzhiyun  by parameters CONFIG_SYS_MMC_ENV_DEV and CONFIG_SYS_MMC_ENV_PART.
19*4882a593Smuzhiyun
20*4882a593SmuzhiyunBubt command details (burn image step by-step)
21*4882a593Smuzhiyun----------------------------------------------
22*4882a593SmuzhiyunThis section describes bubt command flow:
23*4882a593Smuzhiyun
24*4882a593Smuzhiyun1. Fetch the requested ATF image from an available interface (USB/SD/SATA/XDB, etc.)
25*4882a593Smuzhiyun   into the DRAM, and place it at <load_address>
26*4882a593Smuzhiyun   Example: when using the FAT file system on USB flash device:
27*4882a593Smuzhiyun   # usb reset
28*4882a593Smuzhiyun   # fatls usb 0 (see files in device)
29*4882a593Smuzhiyun   # fatload usb 0 <load_address> <file_name>
30*4882a593Smuzhiyun
31*4882a593Smuzhiyun2. Erase the target device:
32*4882a593Smuzhiyun	- NAND:		# nand erase 0 100000
33*4882a593Smuzhiyun	- SPI:		# sf probe 0
34*4882a593Smuzhiyun			# sf erase 0 100000
35*4882a593Smuzhiyun	- SD/eMMC:	# mmc dev <dev_id> <boot_partition>
36*4882a593Smuzhiyun
37*4882a593SmuzhiyunNotes:
38*4882a593Smuzhiyun- The eMMC has 2 boot partitions (BOOT0 and BOOT1) and a user data partition (DATA).
39*4882a593Smuzhiyun  The boot partitions are numbered as partition 1 and 2 in MMC driver.
40*4882a593Smuzhiyun  Number 0 is used for user data partition and should not be utilized for storing
41*4882a593Smuzhiyun  boot images and U-Boot environment in RAW mode since it will break file system
42*4882a593Smuzhiyun  structures usually located here.
43*4882a593Smuzhiyun  The default boot partition is BOOT0. It is selected by the following parameter:
44*4882a593Smuzhiyun  CONFIG_SYS_MMC_ENV_PART=1
45*4882a593Smuzhiyun  Valid values for this parameter are 1 for BOOT0 and 2 for BOOT1.
46*4882a593Smuzhiyun  Please never use partition number 0 here!
47*4882a593Smuzhiyun  The eMMC has 2 boot partitions (BOOT0 and BOOT1) and a user data partition (DATA).
48*4882a593Smuzhiyun  The boot partitions are numbered as partition 1 and 2 in MMC driver.
49*4882a593Smuzhiyun  Number 0 is used for user data partition and should not be utilized for storing
50*4882a593Smuzhiyun  boot images and U-Boot environment in RAW mode since it will break file system
51*4882a593Smuzhiyun  structures usually located here.
52*4882a593Smuzhiyun  The default boot partition is BOOT0. It is selected by the following parameter:
53*4882a593Smuzhiyun  CONFIG_SYS_MMC_ENV_PART=1
54*4882a593Smuzhiyun  Valid values for this parameter are 1 for BOOT0 and 2 for BOOT1.
55*4882a593Smuzhiyun  Please never use partition number 0 here!
56*4882a593Smuzhiyun- The partition number is ignored if the target device is SD card.
57*4882a593Smuzhiyun- The boot image offset starts at block 0 for eMMC and block 1 for SD devices.
58*4882a593Smuzhiyun  The block 0 on SD devices is left for MBR storage.
59*4882a593Smuzhiyun
60*4882a593Smuzhiyun3. Write the ATF image:
61*4882a593Smuzhiyun	- NAND:		# nand write <load_address> 0 <ATF Size>
62*4882a593Smuzhiyun	- SPI:		# sf write <load_address> 0 <ATF Size>
63*4882a593Smuzhiyun	- SD/eMMC:	# mmc write <load_address> [0|1] <ATF Size>/<block_size>
64*4882a593Smuzhiyun
65