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