app: aboot: Remove ifdef for SDHCI support in cmd_erase
In some UFS vendor parts unmap command doesn't zero out the unmapped
blocks. Hence the data is still preserved after a reboot. This change
removes the dependency for ufs and emmc definitions for cmd_erase to
co-exist in the same build.
Change-Id: Ifb4a425f4269b177b849ac4fe7d75de81490bf05
diff --git a/app/aboot/aboot.c b/app/aboot/aboot.c
index 0d3cd76..91a8c06 100644
--- a/app/aboot/aboot.c
+++ b/app/aboot/aboot.c
@@ -1904,24 +1904,25 @@
lun = partition_get_lun(index);
mmc_set_lun(lun);
-#if MMC_SDHCI_SUPPORT
- if (mmc_erase_card(ptn, size)) {
- fastboot_fail("failed to erase partition\n");
- return;
- }
-#else
- BUF_DMA_ALIGN(out, DEFAULT_ERASE_SIZE);
- size = partition_get_size(index);
- if (size > DEFAULT_ERASE_SIZE)
- size = DEFAULT_ERASE_SIZE;
+ if (platform_boot_dev_isemmc())
+ {
+ if (mmc_erase_card(ptn, size)) {
+ fastboot_fail("failed to erase partition\n");
+ return;
+ }
+ } else {
+ BUF_DMA_ALIGN(out, DEFAULT_ERASE_SIZE);
+ size = partition_get_size(index);
+ if (size > DEFAULT_ERASE_SIZE)
+ size = DEFAULT_ERASE_SIZE;
- /* Simple inefficient version of erase. Just writing
- 0 in first several blocks */
- if (mmc_write(ptn , size, (unsigned int *)out)) {
- fastboot_fail("failed to erase partition");
- return;
+ /* Simple inefficient version of erase. Just writing
+ 0 in first several blocks */
+ if (mmc_write(ptn , size, (unsigned int *)out)) {
+ fastboot_fail("failed to erase partition");
+ return;
+ }
}
-#endif
fastboot_okay("");
}