Acidanthera UEFI Development Kit based on EDK II edk2-stable202311
Go to file
Hao Wu b92efc9fe5 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>
2017-08-14 08:45:10 +08:00
AppPkg edk2: Move License.txt file to root 2017-08-03 11:02:17 -07:00
ArmPkg edk2: Move License.txt file to root 2017-08-03 11:02:17 -07:00
ArmPlatformPkg edk2: Move License.txt file to root 2017-08-03 11:02:17 -07:00
ArmVirtPkg edk2: Move License.txt file to root 2017-08-03 11:02:17 -07:00
BaseTools BaseTools: Support TabSpace between section tag in DEC file 2017-08-13 12:04:42 +08:00
BeagleBoardPkg edk2: Move License.txt file to root 2017-08-03 11:02:17 -07:00
Conf EDK II: Add .gitignore 2014-10-14 16:08:15 +00:00
CorebootModulePkg edk2: Move License.txt file to root 2017-08-03 11:02:17 -07:00
CorebootPayloadPkg edk2: Move License.txt file to root 2017-08-03 11:02:17 -07:00
CryptoPkg edk2: Move License.txt file to root 2017-08-03 11:02:17 -07:00
DuetPkg DuetPkg: Fix Xcode 9 Beta treating 32-bit left shift as undefined 2017-08-11 08:44:54 +08:00
EdkCompatibilityPkg edk2: Move License.txt file to root 2017-08-03 11:02:17 -07:00
EdkShellBinPkg edk2: Move License.txt file to root 2017-08-03 11:02:17 -07:00
EdkShellPkg edk2: Move License.txt file to root 2017-08-03 11:02:17 -07:00
EmbeddedPkg EmbeddedPkg/AndroidFastboot: split android boot header 2017-08-07 17:25:57 +01:00
EmulatorPkg edk2: Move License.txt file to root 2017-08-03 11:02:17 -07:00
FatBinPkg edk2: Move License.txt file to root 2017-08-03 11:02:17 -07:00
FatPkg edk2: Move License.txt file to root 2017-08-03 11:02:17 -07:00
IntelFrameworkModulePkg IntelFrameworkModulePkg: Fix Xcode 9 Beta treating 32-bit left shift as undefined 2017-08-11 08:46:15 +08:00
IntelFrameworkPkg edk2: Move License.txt file to root 2017-08-03 11:02:17 -07:00
IntelFsp2Pkg edk2: Move License.txt file to root 2017-08-03 11:02:17 -07:00
IntelFsp2WrapperPkg edk2: Move License.txt file to root 2017-08-03 11:02:17 -07:00
IntelFspPkg edk2: Move License.txt file to root 2017-08-03 11:02:17 -07:00
IntelFspWrapperPkg edk2: Move License.txt file to root 2017-08-03 11:02:17 -07:00
IntelSiliconPkg IntelSiliconPkg: Fix VS2015 NOOPT IA32 build failure in IntelVTdDxe 2017-08-11 09:30:19 +08:00
MdeModulePkg MdeModulePkg/EmmcDxe: Make sure no extra data is erased by EraseBlocks 2017-08-14 08:45:10 +08:00
MdePkg MdePkg: Update the comments of Ip4Config2/Ip6Config Protocol 2017-08-11 12:57:43 +08:00
NetworkPkg NetworkPkg/HttpDxe: Handle the HttpVersionUnsupported in the HttpConfigData 2017-08-14 08:43:16 +08:00
Nt32Pkg edk2: Move License.txt file to root 2017-08-03 11:02:17 -07:00
Omap35xxPkg edk2: Move License.txt file to root 2017-08-03 11:02:17 -07:00
OptionRomPkg edk2: Move License.txt file to root 2017-08-03 11:02:17 -07:00
OvmfPkg OvmfPkg/AcpiPlatformDxe: short-circuit the transfer of an empty S3_CONTEXT 2017-08-08 15:10:45 +02:00
PcAtChipsetPkg edk2: Move License.txt file to root 2017-08-03 11:02:17 -07:00
PerformancePkg edk2: Move License.txt file to root 2017-08-03 11:02:17 -07:00
QuarkPlatformPkg QuarkPlatformPkg/Readme.md: Bring Readme.md up to date 2017-08-10 09:44:24 -07:00
QuarkSocPkg QuarkSocPkg/MemoryInit: Remove use of memset()/memcpy() 2017-08-10 09:44:17 -07:00
SecurityPkg edk2: Move License.txt file to root 2017-08-03 11:02:17 -07:00
ShellBinPkg edk2: Move License.txt file to root 2017-08-03 11:02:17 -07:00
ShellPkg ShellPkg/drivers: Fix GCC build failure 2017-08-11 11:19:29 +08:00
SignedCapsulePkg edk2: Move License.txt file to root 2017-08-03 11:02:17 -07:00
SourceLevelDebugPkg edk2: Move License.txt file to root 2017-08-03 11:02:17 -07:00
StdLib edk2: Move License.txt file to root 2017-08-03 11:02:17 -07:00
StdLibPrivateInternalFiles edk2: Move License.txt file to root 2017-08-03 11:02:17 -07:00
UefiCpuPkg UefiCpuPkg MtrrLib: Remove deprecated micro. 2017-08-07 15:28:14 +08:00
UnixPkg UnixPkg: Remove UnixPkg files (It is replaced by EmulatorPkg) 2013-07-29 21:09:55 +00:00
Vlv2DeviceRefCodePkg edk2: Move License.txt file to root 2017-08-03 11:02:17 -07:00
Vlv2TbltDevicePkg Vlv2TbltDevicePkg: Remove reference deprecated macro. 2017-08-07 15:28:13 +08:00
.gitignore edk2: Add .DS_Store to .gitignore for macOS 2017-05-19 15:14:34 -07:00
BuildNotes2.txt BaseTools: Updated BuildNotes URLs 2016-03-25 09:46:44 +08:00
Contributions.txt edk2: Reformat TianoCore Contribution Agreement 1.1 2017-08-03 11:02:10 -07:00
Edk2Setup.bat Edk2Setup.bat: Fix build errors from VS tools PREFIX ENV missing 2016-11-05 09:10:58 +08:00
License.txt edk2: Move License.txt file to root 2017-08-03 11:02:17 -07:00
Maintainers.txt Maintainers.txt: Change maintainer for Intel*Pkg. 2017-08-11 22:15:56 +08:00
Readme.md edk2: Add Readme.md to root of edk2 repository 2017-08-03 11:02:25 -07:00
edksetup.bat BaseTools: suppress usage instructions with rebuild options 2017-07-04 10:16:13 +08:00
edksetup.sh BaseTools/edksetup.sh: fix invalid test for current working directory 2017-08-10 12:54:58 +08:00

Readme.md

EDK II Project

A modern, feature-rich, cross-platform firmware development environment for the UEFI and PI specifications from www.uefi.org.

Contributions to the EDK II open source project are covered by the TianoCore Contribution Agreement 1.1

The majority of the content in the EDK II open source project uses a BSD 2-Clause License. The EDK II open source project contains the following components that are covered by additional licenses:

The EDK II Project is composed of packages. The maintainers for each package are listed in Maintainers.txt.

Resources