+#if CONFIG_IS_ENABLED(EFI_PARTITION)
+ if (strcmp(cmd, CONFIG_FASTBOOT_GPT_NAME) == 0) {
+ printf("%s: updating MBR, Primary and Backup GPT(s)\n",
+ __func__);
+ if (is_valid_gpt_buf(dev_desc, download_buffer)) {
+ printf("%s: invalid GPT - refusing to write to flash\n",
+ __func__);
+ fastboot_fail("invalid GPT partition");
+ return;
+ }
+ if (write_mbr_and_gpt_partitions(dev_desc, download_buffer)) {
+ printf("%s: writing GPT partitions failed\n", __func__);
+ fastboot_fail("writing GPT partitions failed");
+ return;
+ }
+ printf("........ success\n");
+ fastboot_okay("");
+ return;
+ }
+#endif
+
+#if CONFIG_IS_ENABLED(DOS_PARTITION)
+ if (strcmp(cmd, CONFIG_FASTBOOT_MBR_NAME) == 0) {
+ printf("%s: updating MBR\n", __func__);
+ if (is_valid_dos_buf(download_buffer)) {
+ printf("%s: invalid MBR - refusing to write to flash\n",
+ __func__);
+ fastboot_fail("invalid MBR partition");
+ return;
+ }
+ if (write_mbr_partition(dev_desc, download_buffer)) {
+ printf("%s: writing MBR partition failed\n", __func__);
+ fastboot_fail("writing MBR partition failed");
+ return;
+ }
+ printf("........ success\n");
+ fastboot_okay("");
+ return;
+ }
+#endif
+
+#ifdef CONFIG_ANDROID_BOOT_IMAGE
+ if (strncasecmp(cmd, "zimage", 6) == 0) {
+ fb_mmc_update_zimage(dev_desc, download_buffer, download_bytes);
+ return;
+ }
+#endif
+
+ if (part_get_info_by_name_or_alias(dev_desc, cmd, &info) < 0) {
+ pr_err("cannot find partition: '%s'\n", cmd);