app: aboot: replace hard coded value with variable

Replace hard coded value with mmc blocksize

Change-Id: I631629050e64df059fc1d0142d3450a28928f4eb
diff --git a/app/aboot/aboot.c b/app/aboot/aboot.c
index 18733d6..e17fc53 100644
--- a/app/aboot/aboot.c
+++ b/app/aboot/aboot.c
@@ -190,6 +190,8 @@
 
 static unsigned page_size = 0;
 static unsigned page_mask = 0;
+static unsigned mmc_blocksize = 0;
+static unsigned mmc_blocksize_mask = 0;
 static char ffbm_mode_string[FFBM_MODE_BUF_SIZE];
 static bool boot_into_ffbm;
 static char *target_boot_params = NULL;
@@ -2622,7 +2624,7 @@
 			}
 
 			size = partition_get_size(index);
-			if (ROUND_TO_PAGE(sz,511) > size) {
+			if (ROUND_TO_PAGE(sz, mmc_blocksize_mask) > size) {
 				fastboot_fail("size too large");
 				return;
 			}
@@ -3668,6 +3670,8 @@
 	{
 		page_size = mmc_page_size();
 		page_mask = page_size - 1;
+		mmc_blocksize = mmc_get_device_blocksize();
+		mmc_blocksize_mask = mmc_blocksize - 1;
 	}
 	else
 	{