fastboot: Increasing the max allowed download size
Creating a function which will return target specific max allowed flash size.
Change-Id: I7ff7d895af1cfea773e628c1a7a6b564043a3517
diff --git a/app/aboot/aboot.c b/app/aboot/aboot.c
index 82b6dd8..e574fb4 100644
--- a/app/aboot/aboot.c
+++ b/app/aboot/aboot.c
@@ -92,6 +92,7 @@
unsigned board_machtype(void);
unsigned check_reboot_mode(void);
void *target_get_scratch_address(void);
+unsigned target_get_max_flash_size(void);
int target_is_emmc_boot(void);
void reboot_device(unsigned);
void target_battery_charging_enable(unsigned enable, unsigned disconnect);
@@ -691,6 +692,7 @@
unsigned reboot_mode = 0;
unsigned disp_init = 0;
unsigned usb_init = 0;
+ unsigned sz = 0;
/* Setup page size information for nand/emmc reads */
if (target_is_emmc_boot())
@@ -777,8 +779,8 @@
fastboot_register("reboot-bootloader", cmd_reboot_bootloader);
fastboot_publish("product", TARGET(BOARD));
fastboot_publish("kernel", "lk");
-
- fastboot_init(target_get_scratch_address(), 120 * 1024 * 1024);
+ sz = target_get_max_flash_size();
+ fastboot_init(target_get_scratch_address(), sz);
udc_start();
target_battery_charging_enable(1, 0);
}