summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcharles.park <charles.park@hardkernel.com>2017-08-07 07:37:00 +0300
committercharles.park <charles.park@hardkernel.com>2017-08-07 07:37:00 +0300
commitddaa85859cc92554c53f1ce64d9d79d00343cc5f (patch)
tree048d824adf26eabfd1be4f192994cd8c765f0ac3
parent55d76a847a48633c28a3a36931f940400fc30d5c (diff)
downloadu-boot-ddaa85859cc92554c53f1ce64d9d79d00343cc5f.tar.xz
ODROID-XU4 : erase partition error fix.
Change-Id: I508e7d877e64b7fd3b9b59d8790eb298e5291689
-rwxr-xr-xcmd/odroid_fastboot.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/cmd/odroid_fastboot.c b/cmd/odroid_fastboot.c
index e998d2800e..9a3201432b 100755
--- a/cmd/odroid_fastboot.c
+++ b/cmd/odroid_fastboot.c
@@ -93,6 +93,8 @@ static void erase_partition(struct partition_info *pinfo, unsigned int dev_no)
1024 - (blk_start & 0x3ff),
clrbuf);
printf("*** erase start block 0x%x ***\n", blk_start);
+ blk_cnt = blk_cnt - (1024 - (blk_start & 0x3FFF));
+ blk_start = (blk_start & (~0x3FFF)) + 1024;
}
if (blk_cnt & 0x3FF) {
mmc->block_dev.block_write(&mmc->block_dev,
@@ -100,6 +102,7 @@ static void erase_partition(struct partition_info *pinfo, unsigned int dev_no)
(blk_cnt & 0x3FF),
clrbuf);
printf("*** erase block length 0x%x ***\n", blk_cnt);
+ blk_cnt = blk_cnt - (blk_cnt & 0x3FFF);
}
if (blk_cnt >> 10) {
mmc->block_dev.block_erase(&mmc->block_dev, blk_start, blk_cnt);
@@ -231,6 +234,7 @@ static int flashing_data(struct partition_info *pinfo,
write_compressed_ext4((char*)addr, pinfo->blk_start, dev_no);
}
+ printf("\npartition '%s' flashed.\n\n", pinfo->name);
return 0;
}
@@ -360,12 +364,12 @@ static int rx_handler (const unsigned char *buffer, unsigned int buffer_size)
if (memcmp(cmdbuf, "erase:", 6) == 0)
{
struct partition_info pinfo;
- printf("partition '%s' erased\n", cmdbuf + 6);
+ ret = 0;
+ printf("partition '%s' erased\n", cmdbuf + 6);
if (!strncmp(cmdbuf + 6, "fat", sizeof("fat"))) {
run_command("fatformat mmc 0:1", 0);
sprintf(response, "OKAY");
- ret = 0;
goto send_tx_status;
}
if (odroid_get_partition_info(&cmdbuf[6], &pinfo))
@@ -376,9 +380,8 @@ static int rx_handler (const unsigned char *buffer, unsigned int buffer_size)
sprintf(response, "OKAY");
}
else
- sprintf(response, "FAILUnsupport partitiond");
+ sprintf(response, "FAILUnsupport or Unknown partitiond");
}
- ret = 0;
goto send_tx_status;
}