MdeModulePkg/Sd: add Erase Block support on sd/emmc device

It's done by producing EFI_ERASE_BLOCK_PROTOCOL protocol instance.

Cc: Hao Wu <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
This commit is contained in:
Feng Tian
2016-05-03 14:07:38 +08:00
parent 140cc8000f
commit 275d51369a
10 changed files with 978 additions and 6 deletions

View File

@@ -4,7 +4,7 @@
This file defines common data structures, macro definitions and some module
internal function header files.
Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -24,6 +24,7 @@
#include <Protocol/SdMmcPassThru.h>
#include <Protocol/BlockIo.h>
#include <Protocol/BlockIo2.h>
#include <Protocol/EraseBlock.h>
#include <Protocol/DevicePath.h>
@@ -53,6 +54,9 @@ extern EFI_COMPONENT_NAME2_PROTOCOL gSdDxeComponentName2;
#define SD_DEVICE_DATA_FROM_BLKIO2(a) \
CR(a, SD_DEVICE, BlockIo2, SD_DEVICE_SIGNATURE)
#define SD_DEVICE_DATA_FROM_ERASEBLK(a) \
CR(a, SD_DEVICE, EraseBlock, SD_DEVICE_SIGNATURE)
//
// Take 2.5 seconds as generic time out value, 1 microsecond as unit.
//
@@ -95,6 +99,7 @@ struct _SD_DEVICE {
EFI_BLOCK_IO_PROTOCOL BlockIo;
EFI_BLOCK_IO2_PROTOCOL BlockIo2;
EFI_BLOCK_IO_MEDIA BlockMedia;
EFI_ERASE_BLOCK_PROTOCOL EraseBlock;
LIST_ENTRY Queue;