summaryrefslogtreecommitdiffstats
path: root/MdePkg/Library
diff options
context:
space:
mode:
authorHao Wu <hao.a.wu@intel.com>2017-08-08 16:34:43 +0800
committerHao Wu <hao.a.wu@intel.com>2017-08-14 08:45:10 +0800
commitb92efc9fe5aebf4115e076c3ef44c82b21da4e20 (patch)
tree0fadfafac8479e6672aeabf205c908eb11b9dafa /MdePkg/Library
parent79de8c79cdef26e5578050b7f1a206745c6cff14 (diff)
downloadedk2-b92efc9fe5aebf4115e076c3ef44c82b21da4e20.tar.gz
edk2-b92efc9fe5aebf4115e076c3ef44c82b21da4e20.tar.bz2
edk2-b92efc9fe5aebf4115e076c3ef44c82b21da4e20.zip
MdeModulePkg/EmmcDxe: Make sure no extra data is erased by EraseBlocks
V3 changes: Add debug messages for new return path when successfully erase the specified blocks. Refine logic for calculating the size for writing zeros to device. V2 changes: The Trim command is not supported on all eMMC devices. For those devices that do not support such command, add codes to handle the scenario. Commit message: The current implementation of the Erase Block Protocol service EraseBlocks() uses the erase command. According to spec eMMC Electrical Standard 5.1, Section 6.6.9: The erasable unit of the eMMC is the "Erase Group"; Erase group is measured in write blocks that are the basic writable units of the Device. ... When the Erase is executed it will apply to all write blocks within an erase group. However, code logic in function EmmcEraseBlocks() does not check whether the blocks to be erased form complete erase groups. Missing such checks will lead to erasing extra data on the device. This commit will: a. If the device support the Trim command, use the Trim command to perform the erase operations for eMMC devices. According to the spec: Unlike the Erase command, the Trim function applies the erase operation to write blocks instead of erase groups. b. If the device does not support the Trim command, use the Erase command to erase the data in the erase groups. And write zeros to those blocks that cannot form a complete erase group. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
Diffstat (limited to 'MdePkg/Library')
0 files changed, 0 insertions, 0 deletions