mmc-erase: Changing the erase functionality
Reverting back to the old erase code of writing 0 to the first block
of the partition, as CMD 35, CMD 36 CMD 38 round down the start
address of the block to be erased to a 2MB aligned address which in
turn erases other partitions erroneously.
Change-Id: I4a239bc73269a8cf1cb128c82947db33a970a6bc
CRs-Fixed: 326149
diff --git a/app/aboot/aboot.c b/app/aboot/aboot.c
index 9f796c0..19d51a8 100644
--- a/app/aboot/aboot.c
+++ b/app/aboot/aboot.c
@@ -842,19 +842,20 @@
void cmd_erase_mmc(const char *arg, void *data, unsigned sz)
{
unsigned long long ptn = 0;
+ unsigned int out[512] = {0};
int index = INVALID_PTN;
- unsigned long long size;
index = partition_get_index(arg);
ptn = partition_get_offset(index);
- size = partition_get_size(index);
if(ptn == 0) {
fastboot_fail("Partition table doesn't exist\n");
return;
}
- if (mmc_erase_card(ptn, size)) {
- fastboot_fail("Failed to erase partition\n");
+ /* Simple inefficient version of erase. Just writing
+ 0 in first block */
+ if (mmc_write(ptn , 512, (unsigned int *)out)) {
+ fastboot_fail("failed to erase partition");
return;
}
fastboot_okay("");