summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xboard/samsung/common/odroid_misc.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/board/samsung/common/odroid_misc.c b/board/samsung/common/odroid_misc.c
index c9f5fc9e72..2c7a10f1b8 100755
--- a/board/samsung/common/odroid_misc.c
+++ b/board/samsung/common/odroid_misc.c
@@ -374,8 +374,6 @@ static uint upload_file(const char *fname, const char *pname,
#endif
total_fsize += filesize;
}
- if (!is_split || !filesize)
- goto out;
mem_addr += filesize;
/* load memory overflow */
@@ -385,6 +383,8 @@ static uint upload_file(const char *fname, const char *pname,
upinfo->file_size = 0;
return upinfo->mem_addr;
}
+ if (!is_split || !filesize)
+ goto out;
}
out:
if (total_fsize) {
@@ -504,9 +504,7 @@ static void odroid_fw_update(unsigned int option)
"cache", upload_addr, &upinfo[PART_CACHE], false);
if (option & OPTION_ERASE_USERDATA) {
- if (option & OPTION_FILELOAD_EXT4) {
- run_command("fatformat mmc 0:3", 0);
- } else if ((option & OPTION_RESIZE_PART) == 0) {
+ if ((option & OPTION_RESIZE_PART) == 0) {
upload_addr = upload_file("userdata.img",
"userdata", upload_addr, &upinfo[PART_USERDATA], false);
}
@@ -557,6 +555,10 @@ static void odroid_fw_update(unsigned int option)
else if (option & OPTION_OLDTYPE_PART)
run_command("fdisk -c 0", 0);
+ if (option & OPTION_ERASE_USERDATA)
+ if (option & OPTION_FILELOAD_EXT4)
+ run_command("fatformat mmc 0:3", 0);
+
for (i = 0; i < PART_MAX; i++)
upload_data_write(&upinfo[i], i > PART_KERNEL ? 0 : 1);