hc
2024-05-10 23fa18eaa71266feff7ba8d83022d9e1cc83c65a
u-boot/common/fb_mmc.c
....@@ -31,6 +31,15 @@
3131 #define CONFIG_FASTBOOT_MBR_NAME "mbr"
3232 #endif
3333
34
+#ifndef CONFIG_FASTBOOT_IDBLOCK_NAME
35
+#define CONFIG_FASTBOOT_IDBLOCK_NAME "idblock"
36
+#endif
37
+
38
+#define CONFIG_FASTBOOT_MMC_BLOCK_SIZE 512
39
+#define CONFIG_FASTBOOT_IDBLOCK_SECTOR 64
40
+/* idblock sector:64 ~ 64 + 5 * 1024(512K for each MiniloadAll.bin) */
41
+#define CONFIG_FASTBOOT_IDBLOCK_SECTOR_SIZE 5184
42
+
3443 #define BOOT_PARTITION_NAME "boot"
3544 #define FASTBOOT_MAX_BLK_WRITE 16384
3645 static ulong timer;
....@@ -363,6 +372,14 @@
363372 }
364373 #endif
365374
375
+ if (strcmp(cmd, CONFIG_FASTBOOT_IDBLOCK_NAME) == 0) {
376
+ printf("%s: updating IDBLOCK\n", __func__);
377
+ info.blksz = CONFIG_FASTBOOT_MMC_BLOCK_SIZE;
378
+ info.start = CONFIG_FASTBOOT_IDBLOCK_SECTOR;
379
+ info.size = CONFIG_FASTBOOT_IDBLOCK_SECTOR_SIZE;
380
+ goto download;
381
+ }
382
+
366383 #ifdef CONFIG_ANDROID_BOOT_IMAGE
367384 if (strncasecmp(cmd, "zimage", 6) == 0) {
368385 fb_mmc_update_zimage(dev_desc, download_buffer, download_bytes, response);
....@@ -376,6 +393,7 @@
376393 return;
377394 }
378395
396
+download:
379397 if (is_sparse_image(download_buffer)) {
380398 struct fb_mmc_sparse sparse_priv;
381399 struct sparse_storage sparse;