Konstantin Porotchkin | fa61ef6 | 2016-12-08 12:22:28 +0200 | [diff] [blame] | 1 | BUBT (Burn ATF) command |
| 2 | -------------------------- |
| 3 | Bubt command is used to burn a new ATF image to flash device. |
| 4 | |
| 5 | The bubt command gets the following parameters: ATF file name, destination device and source device. |
| 6 | bubt [file-name] [destination [source]] |
| 7 | - file-name Image file name to burn. default = flash-image.bin |
Pali Rohár | c8f5009 | 2023-01-22 01:25:12 +0100 | [diff] [blame] | 8 | - destination Flash to burn to [spi, nand, mmc, sata]. default = active flash |
Pali Rohár | 4bf91e2 | 2023-01-21 23:29:36 +0100 | [diff] [blame] | 9 | - source Source to load image from [tftp, usb, mmc, sata]. default = tftp |
Konstantin Porotchkin | fa61ef6 | 2016-12-08 12:22:28 +0200 | [diff] [blame] | 10 | |
| 11 | Examples: |
| 12 | bubt - Burn flash-image.bin from tftp to active flash |
| 13 | bubt latest-spi.bin nand - Burn latest-spi.bin from tftp to NAND flash |
| 14 | |
| 15 | Notes: |
| 16 | - For the TFTP interface set serverip and ipaddr. |
Pali Rohár | fc10a92 | 2023-01-21 22:58:28 +0100 | [diff] [blame] | 17 | - To burn image to SD/eMMC device, the target is defined by HW partition. |
Konstantin Porotchkin | fa61ef6 | 2016-12-08 12:22:28 +0200 | [diff] [blame] | 18 | |
| 19 | Bubt command details (burn image step by-step) |
| 20 | ---------------------------------------------- |
| 21 | This section describes bubt command flow: |
| 22 | |
| 23 | 1. Fetch the requested ATF image from an available interface (USB/SD/SATA/XDB, etc.) |
| 24 | into the DRAM, and place it at <load_address> |
| 25 | Example: when using the FAT file system on USB flash device: |
| 26 | # usb reset |
| 27 | # fatls usb 0 (see files in device) |
| 28 | # fatload usb 0 <load_address> <file_name> |
| 29 | |
| 30 | 2. Erase the target device: |
| 31 | - NAND: # nand erase 0 100000 |
| 32 | - SPI: # sf probe 0 |
| 33 | # sf erase 0 100000 |
| 34 | - SD/eMMC: # mmc dev <dev_id> <boot_partition> |
| 35 | |
| 36 | Notes: |
| 37 | - The eMMC has 2 boot partitions (BOOT0 and BOOT1) and a user data partition (DATA). |
| 38 | The boot partitions are numbered as partition 1 and 2 in MMC driver. |
| 39 | Number 0 is used for user data partition and should not be utilized for storing |
| 40 | boot images and U-Boot environment in RAW mode since it will break file system |
| 41 | structures usually located here. |
Pali Rohár | fc10a92 | 2023-01-21 22:58:28 +0100 | [diff] [blame] | 42 | |
| 43 | Currently configured boot partition can be printed by command: |
| 44 | # mmc partconf 0 |
| 45 | (search for BOOT_PARTITION_ACCESS output, number 7 is user data) |
| 46 | |
| 47 | Change it to BOOT0: |
| 48 | # mmc partconf 0 0 1 1 |
| 49 | |
| 50 | Change it to BOOT1: |
| 51 | # mmc partconf 0 0 2 2 |
| 52 | |
| 53 | Change it to user data: |
| 54 | # mmc partconf 0 0 7 0 |
| 55 | |
Konstantin Porotchkin | fa61ef6 | 2016-12-08 12:22:28 +0200 | [diff] [blame] | 56 | - The partition number is ignored if the target device is SD card. |
| 57 | - The boot image offset starts at block 0 for eMMC and block 1 for SD devices. |
| 58 | The block 0 on SD devices is left for MBR storage. |
| 59 | |
| 60 | 3. Write the ATF image: |
| 61 | - NAND: # nand write <load_address> 0 <ATF Size> |
| 62 | - SPI: # sf write <load_address> 0 <ATF Size> |
| 63 | - SD/eMMC: # mmc write <load_address> [0|1] <ATF Size>/<block_size> |