The fastboot protocol is a mechanism for communicating with bootloaders over USB. It is designed to be very straightforward to implement, to allow it to be used across a wide range of devices and from hosts running Linux, Windows, or OSX.然後剩下的就是 protocol 內容的說明....
由於是bootloader 的 protocol,所以通常拿來作 system image 的 update 用。 以 freescale imx51 為例:
開機後,按下 ENTER 中斷 uboot 開機,進入 command console,輸入 fastboot,進入 fastboot 模式。
PC 端接上 usb,輸入 fastboot devices ,會顯示出目前連線的fastboot 裝置。
PC 端輸入 fastboot help,會顯示 fastboot command。
有關 燒錄 image : bootloader, kernel, ramdisk, system,command 是
fast flash partition file
partition 是 uboot 預先定義的,以 emmc 為 boot 裝置時,partition 的切割是:static int fastboot_init_mmc_sata_ptable(void)
{
....
/* MBR */
strcpy(ptable[PTN_MBR_INDEX].name, "mbr");
ptable[PTN_MBR_INDEX].start = ANDROID_MBR_OFFSET / dev_desc->blksz;
ptable[PTN_MBR_INDEX].length = ANDROID_MBR_SIZE / dev_desc->blksz;
/* Bootloader */
strcpy(ptable[PTN_BOOTLOADER_INDEX].name, "bootloader");
ptable[PTN_BOOTLOADER_INDEX].start =
ANDROID_BOOTLOADER_OFFSET / dev_desc->blksz;
ptable[PTN_BOOTLOADER_INDEX].length =
ANDROID_BOOTLOADER_SIZE / dev_desc->blksz;
/* kernel */
strcpy(ptable[PTN_KERNEL_INDEX].name, "kernel");
ptable[PTN_KERNEL_INDEX].start =
ANDROID_KERNEL_OFFSET / dev_desc->blksz;
ptable[PTN_KERNEL_INDEX].length =
ANDROID_KERNEL_SIZE / dev_desc->blksz;
/* uramdisk */
strcpy(ptable[PTN_URAMDISK_INDEX].name, "uramdisk");
ptable[PTN_URAMDISK_INDEX].start =
ANDROID_URAMDISK_OFFSET / dev_desc->blksz;
ptable[PTN_URAMDISK_INDEX].length =
ANDROID_URAMDISK_SIZE / dev_desc->blksz;
/* system partition */
strcpy(ptable[PTN_SYSTEM_INDEX].name, "system");
if (get_partition_info(dev_desc,
CONFIG_ANDROID_SYSTEM_PARTITION_MMC, &info))
printf("Bad partition index:%d\n",
CONFIG_ANDROID_SYSTEM_PARTITION_MMC);
else {
ptable[PTN_SYSTEM_INDEX].start = info.start;
ptable[PTN_SYSTEM_INDEX].length = info.size;
}
/* recovery partition */
strcpy(ptable[PTN_RECOVERY_INDEX].name, "recovery");
if (get_partition_info(dev_desc,
CONFIG_ANDROID_RECOVERY_PARTITION_MMC, &info))
printf("Bad partition index:%d\n",
CONFIG_ANDROID_RECOVERY_PARTITION_MMC);
else {
ptable[PTN_RECOVERY_INDEX].start = info.start;
ptable[PTN_RECOVERY_INDEX].length = info.size;
}
for (i = 0; i <= PTN_RECOVERY_INDEX; i++)
fastboot_flash_add_ptn(&ptable[i]);
也就是...
- bootlaoder
- kernel
- uramdisk
- system
- recovery
其中 system, recovery 是讀取 emmc 的 parition table 得到的。
所以 eMMC 要預先partition 好..
這樣,燒路的動作就是
fastboot flash kernel uImage
和
fastboot flash uramdisk uramdisk.img
還有
fastboot flash system system.img
燒完之後可以直接下 reboot command:
fastboot reboot
沒有留言:
張貼留言