MMC: Change erase to use Secure Trim

In the past, MMC erase used a combination of Secure Erase for
erasing multiples of the erase group size and writing ones to
"erase" the write blocks that were not a multiple of the erase
group size.  The following changes were made to this:

    1) Secure Trim will be used for all erases as it can be used
    on write-block sized chunks instead of only on erase-group
    sized chunks.

    2) Large erases will be split into multiple Secure Trims
    keeping the amount to be erased to no more than
    CONFIG_SYS_MMC_MAX_ERASE_COUNT erase groups.  The default for
    CONFIG_SYS_MMC_MAX_ERASE_COUNT is 8192.  Assuming an erase
    group size of 1024 write blocks, and a write block size of
    512, the default maximum amount to be erased at one time is
    4GB.  This is to keep the timeouts from becoming ridiculously
    large and so we can keep the user informed of the progress.

    3) Improved error reporting to understand more detail than
    "mmc erase failed".

    4) Made the erase block functions consistent with the other
    block functions now that they didn't need to handle writing
    ones versus erasing.

Change-Id: Iea5efe75892480f885b1ba49d93c79f891380faf
Signed-off-by: Scott Anderson <saa@android.com>
2 files changed