MdeModulePkg: Clean up source files

1. Do not use tab characters
2. No trailing white space in one line
3. All files must end with CRLF

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
This commit is contained in:
Liming Gao
2018-06-27 21:08:52 +08:00
parent ca79bab7af
commit d1102dba72
1010 changed files with 13588 additions and 13588 deletions

View File

@@ -1,6 +1,6 @@
/** @file
Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2014 - 2018, 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
@@ -153,10 +153,10 @@ UFS_PEIM_HC_PRIVATE_DATA gUfsHcPeimTemplate = {
EFI_STATUS
UfsPeimRequestSense (
IN UFS_PEIM_HC_PRIVATE_DATA *Private,
IN UINTN Lun,
IN UINTN Lun,
OUT VOID *DataBuffer,
OUT UINT32 *DataBufferLength
)
)
{
UFS_SCSI_REQUEST_PACKET Packet;
UINT8 Cdb[UFS_SCSI_OP_LENGTH_SIX];
@@ -201,10 +201,10 @@ UfsPeimRequestSense (
EFI_STATUS
UfsPeimTestUnitReady (
IN UFS_PEIM_HC_PRIVATE_DATA *Private,
IN UINTN Lun,
IN UINTN Lun,
OUT VOID *SenseData, OPTIONAL
OUT UINT8 *SenseDataLength
)
)
{
UFS_SCSI_REQUEST_PACKET Packet;
UINT8 Cdb[UFS_SCSI_OP_LENGTH_SIX];
@@ -254,7 +254,7 @@ UfsPeimInquiry (
OUT UINT32 *InquiryLength,
OUT VOID *SenseData, OPTIONAL
OUT UINT8 *SenseDataLength
)
)
{
UFS_SCSI_REQUEST_PACKET Packet;
UINT8 Cdb[UFS_SCSI_OP_LENGTH_SIX];
@@ -311,7 +311,7 @@ UfsPeimReadCapacity (
OUT UINT32 *DataLength,
OUT VOID *SenseData, OPTIONAL
OUT UINT8 *SenseDataLength
)
)
{
UFS_SCSI_REQUEST_PACKET Packet;
UINT8 Cdb[UFS_SCSI_OP_LENGTH_TEN];
@@ -367,7 +367,7 @@ UfsPeimReadCapacity16 (
OUT UINT32 *DataLength,
OUT VOID *SenseData, OPTIONAL
OUT UINT8 *SenseDataLength
)
)
{
UFS_SCSI_REQUEST_PACKET Packet;
UINT8 Cdb[UFS_SCSI_OP_LENGTH_SIXTEEN];
@@ -429,7 +429,7 @@ UfsPeimRead10 (
OUT UINT32 *DataLength,
OUT VOID *SenseData, OPTIONAL
OUT UINT8 *SenseDataLength
)
)
{
UFS_SCSI_REQUEST_PACKET Packet;
UINT8 Cdb[UFS_SCSI_OP_LENGTH_TEN];
@@ -491,7 +491,7 @@ UfsPeimRead16 (
OUT UINT32 *DataLength,
OUT VOID *SenseData, OPTIONAL
OUT UINT8 *SenseDataLength
)
)
{
UFS_SCSI_REQUEST_PACKET Packet;
UINT8 Cdb[UFS_SCSI_OP_LENGTH_SIXTEEN];
@@ -597,16 +597,16 @@ UfsPeimParsingSenseKeys (
/**
Gets the count of block I/O devices that one specific block driver detects.
This function is used for getting the count of block I/O devices that one
This function is used for getting the count of block I/O devices that one
specific block driver detects. To the PEI ATAPI driver, it returns the number
of all the detected ATAPI devices it detects during the enumeration process.
To the PEI legacy floppy driver, it returns the number of all the legacy
devices it finds during its enumeration process. If no device is detected,
then the function will return zero.
@param[in] PeiServices General-purpose services that are available
of all the detected ATAPI devices it detects during the enumeration process.
To the PEI legacy floppy driver, it returns the number of all the legacy
devices it finds during its enumeration process. If no device is detected,
then the function will return zero.
@param[in] PeiServices General-purpose services that are available
to every PEIM.
@param[in] This Indicates the EFI_PEI_RECOVERY_BLOCK_IO_PPI
@param[in] This Indicates the EFI_PEI_RECOVERY_BLOCK_IO_PPI
instance.
@param[out] NumberBlockDevices The number of block I/O devices discovered.
@@ -633,41 +633,41 @@ UfsBlockIoPeimGetDeviceNo (
/**
Gets a block device's media information.
This function will provide the caller with the specified block device's media
information. If the media changes, calling this function will update the media
This function will provide the caller with the specified block device's media
information. If the media changes, calling this function will update the media
information accordingly.
@param[in] PeiServices General-purpose services that are available to every
PEIM
@param[in] This Indicates the EFI_PEI_RECOVERY_BLOCK_IO_PPI instance.
@param[in] DeviceIndex Specifies the block device to which the function wants
to talk. Because the driver that implements Block I/O
PPIs will manage multiple block devices, the PPIs that
want to talk to a single device must specify the
@param[in] DeviceIndex Specifies the block device to which the function wants
to talk. Because the driver that implements Block I/O
PPIs will manage multiple block devices, the PPIs that
want to talk to a single device must specify the
device index that was assigned during the enumeration
process. This index is a number from one to
process. This index is a number from one to
NumberBlockDevices.
@param[out] MediaInfo The media information of the specified block media.
The caller is responsible for the ownership of this
@param[out] MediaInfo The media information of the specified block media.
The caller is responsible for the ownership of this
data structure.
@par Note:
The MediaInfo structure describes an enumeration of possible block device
types. This enumeration exists because no device paths are actually passed
across interfaces that describe the type or class of hardware that is publishing
@par Note:
The MediaInfo structure describes an enumeration of possible block device
types. This enumeration exists because no device paths are actually passed
across interfaces that describe the type or class of hardware that is publishing
the block I/O interface. This enumeration will allow for policy decisions
in the Recovery PEIM, such as "Try to recover from legacy floppy first,
LS-120 second, CD-ROM third." If there are multiple partitions abstracted
by a given device type, they should be reported in ascending order; this
order also applies to nested partitions, such as legacy MBR, where the
outermost partitions would have precedence in the reporting order. The
same logic applies to systems such as IDE that have precedence relationships
like "Master/Slave" or "Primary/Secondary". The master device should be
in the Recovery PEIM, such as "Try to recover from legacy floppy first,
LS-120 second, CD-ROM third." If there are multiple partitions abstracted
by a given device type, they should be reported in ascending order; this
order also applies to nested partitions, such as legacy MBR, where the
outermost partitions would have precedence in the reporting order. The
same logic applies to systems such as IDE that have precedence relationships
like "Master/Slave" or "Primary/Secondary". The master device should be
reported first, the slave second.
@retval EFI_SUCCESS Media information about the specified block device
@retval EFI_SUCCESS Media information about the specified block device
was obtained successfully.
@retval EFI_DEVICE_ERROR Cannot get the media information due to a hardware
@retval EFI_DEVICE_ERROR Cannot get the media information due to a hardware
error.
**/
@@ -687,7 +687,7 @@ UfsBlockIoPeimGetMediaInfo (
EFI_SCSI_DISK_CAPACITY_DATA Capacity;
EFI_SCSI_DISK_CAPACITY_DATA16 Capacity16;
UINTN DataLength;
BOOLEAN NeedRetry;
BOOLEAN NeedRetry;
Private = GET_UFS_PEIM_HC_PRIVATE_DATA_FROM_THIS (This);
NeedRetry = TRUE;
@@ -717,7 +717,7 @@ UfsBlockIoPeimGetMediaInfo (
if (!EFI_ERROR (Status)) {
break;
}
if (SenseDataLength == 0) {
continue;
}
@@ -763,31 +763,31 @@ UfsBlockIoPeimGetMediaInfo (
/**
Reads the requested number of blocks from the specified block device.
The function reads the requested number of blocks from the device. All the
The function reads the requested number of blocks from the device. All the
blocks are read, or an error is returned. If there is no media in the device,
the function returns EFI_NO_MEDIA.
@param[in] PeiServices General-purpose services that are available to
@param[in] PeiServices General-purpose services that are available to
every PEIM.
@param[in] This Indicates the EFI_PEI_RECOVERY_BLOCK_IO_PPI instance.
@param[in] DeviceIndex Specifies the block device to which the function wants
to talk. Because the driver that implements Block I/O
PPIs will manage multiple block devices, PPIs that
want to talk to a single device must specify the device
index that was assigned during the enumeration process.
@param[in] DeviceIndex Specifies the block device to which the function wants
to talk. Because the driver that implements Block I/O
PPIs will manage multiple block devices, PPIs that
want to talk to a single device must specify the device
index that was assigned during the enumeration process.
This index is a number from one to NumberBlockDevices.
@param[in] StartLBA The starting logical block address (LBA) to read from
on the device
@param[in] BufferSize The size of the Buffer in bytes. This number must be
a multiple of the intrinsic block size of the device.
@param[out] Buffer A pointer to the destination buffer for the data.
The caller is responsible for the ownership of the
The caller is responsible for the ownership of the
buffer.
@retval EFI_SUCCESS The data was read correctly from the device.
@retval EFI_DEVICE_ERROR The device reported an error while attempting
@retval EFI_DEVICE_ERROR The device reported an error while attempting
to perform the read operation.
@retval EFI_INVALID_PARAMETER The read request contains LBAs that are not
@retval EFI_INVALID_PARAMETER The read request contains LBAs that are not
valid, or the buffer is not properly aligned.
@retval EFI_NO_MEDIA There is no media in the device.
@retval EFI_BAD_BUFFER_SIZE The BufferSize parameter is not a multiple of
@@ -811,7 +811,7 @@ UfsBlockIoPeimReadBlocks (
UFS_PEIM_HC_PRIVATE_DATA *Private;
EFI_SCSI_SENSE_DATA SenseData;
UINT8 SenseDataLength;
BOOLEAN NeedRetry;
BOOLEAN NeedRetry;
Status = EFI_SUCCESS;
NeedRetry = TRUE;
@@ -861,7 +861,7 @@ UfsBlockIoPeimReadBlocks (
if (!EFI_ERROR (Status)) {
break;
}
if (SenseDataLength == 0) {
continue;
}
@@ -903,16 +903,16 @@ UfsBlockIoPeimReadBlocks (
/**
Gets the count of block I/O devices that one specific block driver detects.
This function is used for getting the count of block I/O devices that one
This function is used for getting the count of block I/O devices that one
specific block driver detects. To the PEI ATAPI driver, it returns the number
of all the detected ATAPI devices it detects during the enumeration process.
To the PEI legacy floppy driver, it returns the number of all the legacy
devices it finds during its enumeration process. If no device is detected,
then the function will return zero.
@param[in] PeiServices General-purpose services that are available
of all the detected ATAPI devices it detects during the enumeration process.
To the PEI legacy floppy driver, it returns the number of all the legacy
devices it finds during its enumeration process. If no device is detected,
then the function will return zero.
@param[in] PeiServices General-purpose services that are available
to every PEIM.
@param[in] This Indicates the EFI_PEI_RECOVERY_BLOCK_IO2_PPI
@param[in] This Indicates the EFI_PEI_RECOVERY_BLOCK_IO2_PPI
instance.
@param[out] NumberBlockDevices The number of block I/O devices discovered.
@@ -939,41 +939,41 @@ UfsBlockIoPeimGetDeviceNo2 (
/**
Gets a block device's media information.
This function will provide the caller with the specified block device's media
information. If the media changes, calling this function will update the media
This function will provide the caller with the specified block device's media
information. If the media changes, calling this function will update the media
information accordingly.
@param[in] PeiServices General-purpose services that are available to every
PEIM
@param[in] This Indicates the EFI_PEI_RECOVERY_BLOCK_IO2_PPI instance.
@param[in] DeviceIndex Specifies the block device to which the function wants
to talk. Because the driver that implements Block I/O
PPIs will manage multiple block devices, the PPIs that
want to talk to a single device must specify the
@param[in] DeviceIndex Specifies the block device to which the function wants
to talk. Because the driver that implements Block I/O
PPIs will manage multiple block devices, the PPIs that
want to talk to a single device must specify the
device index that was assigned during the enumeration
process. This index is a number from one to
process. This index is a number from one to
NumberBlockDevices.
@param[out] MediaInfo The media information of the specified block media.
The caller is responsible for the ownership of this
@param[out] MediaInfo The media information of the specified block media.
The caller is responsible for the ownership of this
data structure.
@par Note:
The MediaInfo structure describes an enumeration of possible block device
types. This enumeration exists because no device paths are actually passed
across interfaces that describe the type or class of hardware that is publishing
@par Note:
The MediaInfo structure describes an enumeration of possible block device
types. This enumeration exists because no device paths are actually passed
across interfaces that describe the type or class of hardware that is publishing
the block I/O interface. This enumeration will allow for policy decisions
in the Recovery PEIM, such as "Try to recover from legacy floppy first,
LS-120 second, CD-ROM third." If there are multiple partitions abstracted
by a given device type, they should be reported in ascending order; this
order also applies to nested partitions, such as legacy MBR, where the
outermost partitions would have precedence in the reporting order. The
same logic applies to systems such as IDE that have precedence relationships
like "Master/Slave" or "Primary/Secondary". The master device should be
in the Recovery PEIM, such as "Try to recover from legacy floppy first,
LS-120 second, CD-ROM third." If there are multiple partitions abstracted
by a given device type, they should be reported in ascending order; this
order also applies to nested partitions, such as legacy MBR, where the
outermost partitions would have precedence in the reporting order. The
same logic applies to systems such as IDE that have precedence relationships
like "Master/Slave" or "Primary/Secondary". The master device should be
reported first, the slave second.
@retval EFI_SUCCESS Media information about the specified block device
@retval EFI_SUCCESS Media information about the specified block device
was obtained successfully.
@retval EFI_DEVICE_ERROR Cannot get the media information due to a hardware
@retval EFI_DEVICE_ERROR Cannot get the media information due to a hardware
error.
**/
@@ -991,7 +991,7 @@ UfsBlockIoPeimGetMediaInfo2 (
EFI_PEI_BLOCK_IO_MEDIA Media;
Private = GET_UFS_PEIM_HC_PRIVATE_DATA_FROM_THIS2 (This);
Status = UfsBlockIoPeimGetMediaInfo (
PeiServices,
&Private->BlkIoPpi,
@@ -1009,31 +1009,31 @@ UfsBlockIoPeimGetMediaInfo2 (
/**
Reads the requested number of blocks from the specified block device.
The function reads the requested number of blocks from the device. All the
The function reads the requested number of blocks from the device. All the
blocks are read, or an error is returned. If there is no media in the device,
the function returns EFI_NO_MEDIA.
@param[in] PeiServices General-purpose services that are available to
@param[in] PeiServices General-purpose services that are available to
every PEIM.
@param[in] This Indicates the EFI_PEI_RECOVERY_BLOCK_IO2_PPI instance.
@param[in] DeviceIndex Specifies the block device to which the function wants
to talk. Because the driver that implements Block I/O
PPIs will manage multiple block devices, PPIs that
want to talk to a single device must specify the device
index that was assigned during the enumeration process.
@param[in] DeviceIndex Specifies the block device to which the function wants
to talk. Because the driver that implements Block I/O
PPIs will manage multiple block devices, PPIs that
want to talk to a single device must specify the device
index that was assigned during the enumeration process.
This index is a number from one to NumberBlockDevices.
@param[in] StartLBA The starting logical block address (LBA) to read from
on the device
@param[in] BufferSize The size of the Buffer in bytes. This number must be
a multiple of the intrinsic block size of the device.
@param[out] Buffer A pointer to the destination buffer for the data.
The caller is responsible for the ownership of the
The caller is responsible for the ownership of the
buffer.
@retval EFI_SUCCESS The data was read correctly from the device.
@retval EFI_DEVICE_ERROR The device reported an error while attempting
@retval EFI_DEVICE_ERROR The device reported an error while attempting
to perform the read operation.
@retval EFI_INVALID_PARAMETER The read request contains LBAs that are not
@retval EFI_INVALID_PARAMETER The read request contains LBAs that are not
valid, or the buffer is not properly aligned.
@retval EFI_NO_MEDIA There is no media in the device.
@retval EFI_BAD_BUFFER_SIZE The BufferSize parameter is not a multiple of
@@ -1052,7 +1052,7 @@ UfsBlockIoPeimReadBlocks2 (
)
{
EFI_STATUS Status;
UFS_PEIM_HC_PRIVATE_DATA *Private;
UFS_PEIM_HC_PRIVATE_DATA *Private;
Status = EFI_SUCCESS;
Private = GET_UFS_PEIM_HC_PRIVATE_DATA_FROM_THIS2 (This);
@@ -1118,7 +1118,7 @@ UfsEndOfPei (
/**
The user code starts with this function.
@param FileHandle Handle of the file being invoked.
@param PeiServices Describes the list of possible PEI Services.
@@ -1205,8 +1205,8 @@ InitializeUfsBlockIoPeim (
//
// UFS 2.0 spec Section 13.1.3.3:
// At the end of the UFS Interconnect Layer initialization on both host and device side,
// the host shall send a NOP OUT UPIU to verify that the device UTP Layer is ready.
// At the end of the UFS Interconnect Layer initialization on both host and device side,
// the host shall send a NOP OUT UPIU to verify that the device UTP Layer is ready.
//
Status = UfsExecNopCmds (Private);
if (EFI_ERROR (Status)) {
@@ -1241,7 +1241,7 @@ InitializeUfsBlockIoPeim (
DEBUG ((EFI_D_INFO, "Ufs %d Lun %d is enabled\n", Controller, Index));
}
}
PeiServicesInstallPpi (&Private->BlkIoPpiList);
PeiServicesNotifyPpi (&Private->EndOfPeiNotifyList);
Controller++;

View File

@@ -1,6 +1,6 @@
/** @file
Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2014 - 2018, 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
@@ -102,7 +102,7 @@ typedef struct {
UINT8 SenseDataLength;
} UFS_SCSI_REQUEST_PACKET;
typedef struct _UFS_PEIM_HC_PRIVATE_DATA {
typedef struct _UFS_PEIM_HC_PRIVATE_DATA {
UINT32 Signature;
EFI_HANDLE Controller;
@@ -282,16 +282,16 @@ UfsExecNopCmds (
/**
Gets the count of block I/O devices that one specific block driver detects.
This function is used for getting the count of block I/O devices that one
This function is used for getting the count of block I/O devices that one
specific block driver detects. To the PEI ATAPI driver, it returns the number
of all the detected ATAPI devices it detects during the enumeration process.
To the PEI legacy floppy driver, it returns the number of all the legacy
devices it finds during its enumeration process. If no device is detected,
then the function will return zero.
@param[in] PeiServices General-purpose services that are available
of all the detected ATAPI devices it detects during the enumeration process.
To the PEI legacy floppy driver, it returns the number of all the legacy
devices it finds during its enumeration process. If no device is detected,
then the function will return zero.
@param[in] PeiServices General-purpose services that are available
to every PEIM.
@param[in] This Indicates the EFI_PEI_RECOVERY_BLOCK_IO_PPI
@param[in] This Indicates the EFI_PEI_RECOVERY_BLOCK_IO_PPI
instance.
@param[out] NumberBlockDevices The number of block I/O devices discovered.
@@ -309,41 +309,41 @@ UfsBlockIoPeimGetDeviceNo (
/**
Gets a block device's media information.
This function will provide the caller with the specified block device's media
information. If the media changes, calling this function will update the media
This function will provide the caller with the specified block device's media
information. If the media changes, calling this function will update the media
information accordingly.
@param[in] PeiServices General-purpose services that are available to every
PEIM
@param[in] This Indicates the EFI_PEI_RECOVERY_BLOCK_IO_PPI instance.
@param[in] DeviceIndex Specifies the block device to which the function wants
to talk. Because the driver that implements Block I/O
PPIs will manage multiple block devices, the PPIs that
want to talk to a single device must specify the
@param[in] DeviceIndex Specifies the block device to which the function wants
to talk. Because the driver that implements Block I/O
PPIs will manage multiple block devices, the PPIs that
want to talk to a single device must specify the
device index that was assigned during the enumeration
process. This index is a number from one to
process. This index is a number from one to
NumberBlockDevices.
@param[out] MediaInfo The media information of the specified block media.
The caller is responsible for the ownership of this
@param[out] MediaInfo The media information of the specified block media.
The caller is responsible for the ownership of this
data structure.
@par Note:
The MediaInfo structure describes an enumeration of possible block device
types. This enumeration exists because no device paths are actually passed
across interfaces that describe the type or class of hardware that is publishing
@par Note:
The MediaInfo structure describes an enumeration of possible block device
types. This enumeration exists because no device paths are actually passed
across interfaces that describe the type or class of hardware that is publishing
the block I/O interface. This enumeration will allow for policy decisions
in the Recovery PEIM, such as "Try to recover from legacy floppy first,
LS-120 second, CD-ROM third." If there are multiple partitions abstracted
by a given device type, they should be reported in ascending order; this
order also applies to nested partitions, such as legacy MBR, where the
outermost partitions would have precedence in the reporting order. The
same logic applies to systems such as IDE that have precedence relationships
like "Master/Slave" or "Primary/Secondary". The master device should be
in the Recovery PEIM, such as "Try to recover from legacy floppy first,
LS-120 second, CD-ROM third." If there are multiple partitions abstracted
by a given device type, they should be reported in ascending order; this
order also applies to nested partitions, such as legacy MBR, where the
outermost partitions would have precedence in the reporting order. The
same logic applies to systems such as IDE that have precedence relationships
like "Master/Slave" or "Primary/Secondary". The master device should be
reported first, the slave second.
@retval EFI_SUCCESS Media information about the specified block device
@retval EFI_SUCCESS Media information about the specified block device
was obtained successfully.
@retval EFI_DEVICE_ERROR Cannot get the media information due to a hardware
@retval EFI_DEVICE_ERROR Cannot get the media information due to a hardware
error.
**/
@@ -359,31 +359,31 @@ UfsBlockIoPeimGetMediaInfo (
/**
Reads the requested number of blocks from the specified block device.
The function reads the requested number of blocks from the device. All the
The function reads the requested number of blocks from the device. All the
blocks are read, or an error is returned. If there is no media in the device,
the function returns EFI_NO_MEDIA.
@param[in] PeiServices General-purpose services that are available to
@param[in] PeiServices General-purpose services that are available to
every PEIM.
@param[in] This Indicates the EFI_PEI_RECOVERY_BLOCK_IO_PPI instance.
@param[in] DeviceIndex Specifies the block device to which the function wants
to talk. Because the driver that implements Block I/O
PPIs will manage multiple block devices, PPIs that
want to talk to a single device must specify the device
index that was assigned during the enumeration process.
@param[in] DeviceIndex Specifies the block device to which the function wants
to talk. Because the driver that implements Block I/O
PPIs will manage multiple block devices, PPIs that
want to talk to a single device must specify the device
index that was assigned during the enumeration process.
This index is a number from one to NumberBlockDevices.
@param[in] StartLBA The starting logical block address (LBA) to read from
on the device
@param[in] BufferSize The size of the Buffer in bytes. This number must be
a multiple of the intrinsic block size of the device.
@param[out] Buffer A pointer to the destination buffer for the data.
The caller is responsible for the ownership of the
The caller is responsible for the ownership of the
buffer.
@retval EFI_SUCCESS The data was read correctly from the device.
@retval EFI_DEVICE_ERROR The device reported an error while attempting
@retval EFI_DEVICE_ERROR The device reported an error while attempting
to perform the read operation.
@retval EFI_INVALID_PARAMETER The read request contains LBAs that are not
@retval EFI_INVALID_PARAMETER The read request contains LBAs that are not
valid, or the buffer is not properly aligned.
@retval EFI_NO_MEDIA There is no media in the device.
@retval EFI_BAD_BUFFER_SIZE The BufferSize parameter is not a multiple of
@@ -404,16 +404,16 @@ UfsBlockIoPeimReadBlocks (
/**
Gets the count of block I/O devices that one specific block driver detects.
This function is used for getting the count of block I/O devices that one
This function is used for getting the count of block I/O devices that one
specific block driver detects. To the PEI ATAPI driver, it returns the number
of all the detected ATAPI devices it detects during the enumeration process.
To the PEI legacy floppy driver, it returns the number of all the legacy
devices it finds during its enumeration process. If no device is detected,
then the function will return zero.
@param[in] PeiServices General-purpose services that are available
of all the detected ATAPI devices it detects during the enumeration process.
To the PEI legacy floppy driver, it returns the number of all the legacy
devices it finds during its enumeration process. If no device is detected,
then the function will return zero.
@param[in] PeiServices General-purpose services that are available
to every PEIM.
@param[in] This Indicates the EFI_PEI_RECOVERY_BLOCK_IO2_PPI
@param[in] This Indicates the EFI_PEI_RECOVERY_BLOCK_IO2_PPI
instance.
@param[out] NumberBlockDevices The number of block I/O devices discovered.
@@ -431,41 +431,41 @@ UfsBlockIoPeimGetDeviceNo2 (
/**
Gets a block device's media information.
This function will provide the caller with the specified block device's media
information. If the media changes, calling this function will update the media
This function will provide the caller with the specified block device's media
information. If the media changes, calling this function will update the media
information accordingly.
@param[in] PeiServices General-purpose services that are available to every
PEIM
@param[in] This Indicates the EFI_PEI_RECOVERY_BLOCK_IO2_PPI instance.
@param[in] DeviceIndex Specifies the block device to which the function wants
to talk. Because the driver that implements Block I/O
PPIs will manage multiple block devices, the PPIs that
want to talk to a single device must specify the
@param[in] DeviceIndex Specifies the block device to which the function wants
to talk. Because the driver that implements Block I/O
PPIs will manage multiple block devices, the PPIs that
want to talk to a single device must specify the
device index that was assigned during the enumeration
process. This index is a number from one to
process. This index is a number from one to
NumberBlockDevices.
@param[out] MediaInfo The media information of the specified block media.
The caller is responsible for the ownership of this
@param[out] MediaInfo The media information of the specified block media.
The caller is responsible for the ownership of this
data structure.
@par Note:
The MediaInfo structure describes an enumeration of possible block device
types. This enumeration exists because no device paths are actually passed
across interfaces that describe the type or class of hardware that is publishing
@par Note:
The MediaInfo structure describes an enumeration of possible block device
types. This enumeration exists because no device paths are actually passed
across interfaces that describe the type or class of hardware that is publishing
the block I/O interface. This enumeration will allow for policy decisions
in the Recovery PEIM, such as "Try to recover from legacy floppy first,
LS-120 second, CD-ROM third." If there are multiple partitions abstracted
by a given device type, they should be reported in ascending order; this
order also applies to nested partitions, such as legacy MBR, where the
outermost partitions would have precedence in the reporting order. The
same logic applies to systems such as IDE that have precedence relationships
like "Master/Slave" or "Primary/Secondary". The master device should be
in the Recovery PEIM, such as "Try to recover from legacy floppy first,
LS-120 second, CD-ROM third." If there are multiple partitions abstracted
by a given device type, they should be reported in ascending order; this
order also applies to nested partitions, such as legacy MBR, where the
outermost partitions would have precedence in the reporting order. The
same logic applies to systems such as IDE that have precedence relationships
like "Master/Slave" or "Primary/Secondary". The master device should be
reported first, the slave second.
@retval EFI_SUCCESS Media information about the specified block device
@retval EFI_SUCCESS Media information about the specified block device
was obtained successfully.
@retval EFI_DEVICE_ERROR Cannot get the media information due to a hardware
@retval EFI_DEVICE_ERROR Cannot get the media information due to a hardware
error.
**/
@@ -481,31 +481,31 @@ UfsBlockIoPeimGetMediaInfo2 (
/**
Reads the requested number of blocks from the specified block device.
The function reads the requested number of blocks from the device. All the
The function reads the requested number of blocks from the device. All the
blocks are read, or an error is returned. If there is no media in the device,
the function returns EFI_NO_MEDIA.
@param[in] PeiServices General-purpose services that are available to
@param[in] PeiServices General-purpose services that are available to
every PEIM.
@param[in] This Indicates the EFI_PEI_RECOVERY_BLOCK_IO2_PPI instance.
@param[in] DeviceIndex Specifies the block device to which the function wants
to talk. Because the driver that implements Block I/O
PPIs will manage multiple block devices, PPIs that
want to talk to a single device must specify the device
index that was assigned during the enumeration process.
@param[in] DeviceIndex Specifies the block device to which the function wants
to talk. Because the driver that implements Block I/O
PPIs will manage multiple block devices, PPIs that
want to talk to a single device must specify the device
index that was assigned during the enumeration process.
This index is a number from one to NumberBlockDevices.
@param[in] StartLBA The starting logical block address (LBA) to read from
on the device
@param[in] BufferSize The size of the Buffer in bytes. This number must be
a multiple of the intrinsic block size of the device.
@param[out] Buffer A pointer to the destination buffer for the data.
The caller is responsible for the ownership of the
The caller is responsible for the ownership of the
buffer.
@retval EFI_SUCCESS The data was read correctly from the device.
@retval EFI_DEVICE_ERROR The device reported an error while attempting
@retval EFI_DEVICE_ERROR The device reported an error while attempting
to perform the read operation.
@retval EFI_INVALID_PARAMETER The read request contains LBAs that are not
@retval EFI_INVALID_PARAMETER The read request contains LBAs that are not
valid, or the buffer is not properly aligned.
@retval EFI_NO_MEDIA There is no media in the device.
@retval EFI_BAD_BUFFER_SIZE The BufferSize parameter is not a multiple of
@@ -525,7 +525,7 @@ UfsBlockIoPeimReadBlocks2 (
/**
Initialize the memory management pool for the host controller.
@param Private The Ufs Peim driver private data.
@retval EFI_SUCCESS The memory pool is initialized.
@@ -554,7 +554,7 @@ UfsPeimFreeMemPool (
/**
Allocate some memory from the host controller's memory pool
which can be used to communicate with host controller.
@param Pool The host controller's memory pool.
@param Size Size of the memory to allocate.

View File

@@ -3,14 +3,14 @@
//
// The UfsBlockIoPei driver is used to support recovery from UFS device.
//
// Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
// Copyright (c) 2015 - 2018, 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
// http://opensource.org/licenses/bsd-license.php
//
//
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
//

View File

@@ -1,7 +1,7 @@
// /** @file
// UfsBlockIoPei Localized Strings and Content
//
// Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
// Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
//
// This program and the accompanying materials
// are licensed and made available under the terms and conditions
@@ -14,8 +14,8 @@
//
// **/
#string STR_PROPERTIES_MODULE_NAME
#language en-US
#string STR_PROPERTIES_MODULE_NAME
#language en-US
"UFS BlockIo Peim for Recovery"

View File

@@ -1,7 +1,7 @@
/** @file
Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2014 - 2018, 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
@@ -44,17 +44,17 @@ UfsPeimAllocMemBlock (
}
ZeroMem ((VOID*)(UINTN)TempPtr, sizeof(UFS_PEIM_MEM_BLOCK));
//
// each bit in the bit array represents UFS_PEIM_MEM_UNIT
// bytes of memory in the memory block.
//
ASSERT (UFS_PEIM_MEM_UNIT * 8 <= EFI_PAGE_SIZE);
Block = (UFS_PEIM_MEM_BLOCK*)(UINTN)TempPtr;
Block->BufLen = EFI_PAGES_TO_SIZE (Pages);
Block->BitsLen = Block->BufLen / (UFS_PEIM_MEM_UNIT * 8);
Status = PeiServicesAllocatePool (Block->BitsLen, &TempPtr);
if (EFI_ERROR (Status)) {
return NULL;
@@ -158,7 +158,7 @@ UfsPeimAllocMemFromBlock (
if (Available < Units) {
return NULL;
}
//
// Mark the memory as allocated
//
@@ -209,7 +209,7 @@ UfsPeimIsMemBlockEmpty (
{
UINTN Index;
for (Index = 0; Index < Block->BitsLen; Index++) {
if (Block->Bits[Index] != 0) {
return FALSE;
@@ -247,7 +247,7 @@ UfsPeimUnlinkMemBlock (
/**
Initialize the memory management pool for the host controller.
@param Private The Ufs Peim driver private data.
@retval EFI_SUCCESS The memory pool is initialized.
@@ -265,7 +265,7 @@ UfsPeimInitMemPool (
TempPtr = NULL;
Pool = NULL;
Status = PeiServicesAllocatePool (sizeof (UFS_PEIM_MEM_POOL), &TempPtr);
if (EFI_ERROR (Status)) {
return EFI_OUT_OF_RESOURCES;
@@ -287,7 +287,7 @@ UfsPeimInitMemPool (
/**
Release the memory management pool.
@param Pool The memory pool to free.
@retval EFI_DEVICE_ERROR Fail to free the memory pool.
@@ -320,7 +320,7 @@ UfsPeimFreeMemPool (
/**
Allocate some memory from the host controller's memory pool
which can be used to communicate with host controller.
@param Pool The host controller's memory pool.
@param Size Size of the memory to allocate.
@@ -377,7 +377,7 @@ UfsPeimAllocateMem (
if (NewBlock == NULL) {
return NULL;
}
//
// Add the new memory block to the pool, then allocate memory from it
//

View File

@@ -1,7 +1,7 @@
/** @file
Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2014 - 2018, 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
@@ -25,7 +25,7 @@ typedef struct _UFS_PEIM_MEM_BLOCK UFS_PEIM_MEM_BLOCK;
struct _UFS_PEIM_MEM_BLOCK {
UINT8 *Bits; // Bit array to record which unit is allocated
UINTN BitsLen;
UINTN BitsLen;
UINT8 *Buf;
UINT8 *BufHost;
UINTN BufLen; // Memory size in bytes

View File

@@ -1,6 +1,6 @@
/** @file
Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2014 - 2018, 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
@@ -108,13 +108,13 @@ DumpUicCmdExecResult (
break;
case 0x08:
DEBUG ((EFI_D_VERBOSE, "UIC configuration command fails - PEER_COMMUNICATION_FAILURE\n"));
break;
break;
case 0x09:
DEBUG ((EFI_D_VERBOSE, "UIC configuration command fails - BUSY\n"));
break;
case 0x0A:
DEBUG ((EFI_D_VERBOSE, "UIC configuration command fails - DME_FAILURE\n"));
break;
break;
default :
ASSERT (FALSE);
break;
@@ -125,7 +125,7 @@ DumpUicCmdExecResult (
break;
case 0x01:
DEBUG ((EFI_D_VERBOSE, "UIC control command fails - FAILURE\n"));
break;
break;
default :
ASSERT (FALSE);
break;
@@ -171,7 +171,7 @@ DumpQueryResponseResult (
break;
case 0xFE:
DEBUG ((EFI_D_VERBOSE, "Query Response with Invalid Opcode\n"));
break;
break;
case 0xFF:
DEBUG ((EFI_D_VERBOSE, "Query Response with General Failure\n"));
break;
@@ -243,7 +243,7 @@ UfsFillTsfOfQueryReqUpiu (
SwapLittleEndianToBigEndian ((UINT8*)&Length, sizeof (Length));
TsfBase->Length = Length;
}
if (Opcode == UtpQueryFuncOpcodeWrAttr) {
SwapLittleEndianToBigEndian ((UINT8*)&Value, sizeof (Value));
TsfBase->Value = Value;
@@ -731,7 +731,7 @@ VOID
UfsStartExecCmd (
IN UFS_PEIM_HC_PRIVATE_DATA *Private,
IN UINT8 Slot
)
)
{
UINTN UfsHcBase;
UINTN Address;
@@ -739,7 +739,7 @@ UfsStartExecCmd (
UfsHcBase = Private->UfsHcBase;
Address = UfsHcBase + UFS_HC_UTRLRSR_OFFSET;
Address = UfsHcBase + UFS_HC_UTRLRSR_OFFSET;
Data = MmioRead32 (Address);
if ((Data & UFS_HC_UTRLRSR) != UFS_HC_UTRLRSR) {
MmioWrite32 (Address, UFS_HC_UTRLRSR);
@@ -760,7 +760,7 @@ VOID
UfsStopExecCmd (
IN UFS_PEIM_HC_PRIVATE_DATA *Private,
IN UINT8 Slot
)
)
{
UINTN UfsHcBase;
UINTN Address;
@@ -768,10 +768,10 @@ UfsStopExecCmd (
UfsHcBase = Private->UfsHcBase;
Address = UfsHcBase + UFS_HC_UTRLDBR_OFFSET;
Address = UfsHcBase + UFS_HC_UTRLDBR_OFFSET;
Data = MmioRead32 (Address);
if ((Data & (BIT0 << Slot)) != 0) {
Address = UfsHcBase + UFS_HC_UTRLCLR_OFFSET;
Address = UfsHcBase + UFS_HC_UTRLCLR_OFFSET;
Data = MmioRead32 (Address);
MmioWrite32 (Address, (Data & ~(BIT0 << Slot)));
}
@@ -839,7 +839,7 @@ UfsRwDeviceDesc (
if (EFI_ERROR (Status)) {
return Status;
}
Trd = ((UTP_TRD*)Private->UtpTrlBase) + Slot;
//
// Fill transfer request descriptor to this slot.
@@ -863,8 +863,8 @@ UfsRwDeviceDesc (
//
// Wait for the completion of the transfer request.
//
Address = Private->UfsHcBase + UFS_HC_UTRLDBR_OFFSET;
//
Address = Private->UfsHcBase + UFS_HC_UTRLDBR_OFFSET;
Status = UfsWaitMemSet (Address, BIT0 << Slot, 0, Packet.Timeout);
if (EFI_ERROR (Status)) {
goto Exit;
@@ -953,7 +953,7 @@ UfsRwAttributes (
if (EFI_ERROR (Status)) {
return Status;
}
Trd = ((UTP_TRD*)Private->UtpTrlBase) + Slot;
//
// Fill transfer request descriptor to this slot.
@@ -977,8 +977,8 @@ UfsRwAttributes (
//
// Wait for the completion of the transfer request.
//
Address = Private->UfsHcBase + UFS_HC_UTRLDBR_OFFSET;
//
Address = Private->UfsHcBase + UFS_HC_UTRLDBR_OFFSET;
Status = UfsWaitMemSet (Address, BIT0 << Slot, 0, Packet.Timeout);
if (EFI_ERROR (Status)) {
goto Exit;
@@ -1091,8 +1091,8 @@ UfsRwFlags (
//
// Wait for the completion of the transfer request.
//
Address = Private->UfsHcBase + UFS_HC_UTRLDBR_OFFSET;
//
Address = Private->UfsHcBase + UFS_HC_UTRLDBR_OFFSET;
Status = UfsWaitMemSet (Address, BIT0 << Slot, 0, Packet.Timeout);
if (EFI_ERROR (Status)) {
goto Exit;
@@ -1249,8 +1249,8 @@ UfsExecNopCmds (
//
// Wait for the completion of the transfer request.
//
Address = Private->UfsHcBase + UFS_HC_UTRLDBR_OFFSET;
//
Address = Private->UfsHcBase + UFS_HC_UTRLDBR_OFFSET;
Status = UfsWaitMemSet (Address, BIT0 << Slot, 0, UFS_TIMEOUT);
if (EFI_ERROR (Status)) {
goto Exit;
@@ -1335,8 +1335,8 @@ UfsExecScsiCmds (
//
// Wait for the completion of the transfer request.
//
Address = Private->UfsHcBase + UFS_HC_UTRLDBR_OFFSET;
//
Address = Private->UfsHcBase + UFS_HC_UTRLDBR_OFFSET;
Status = UfsWaitMemSet (Address, BIT0 << Slot, 0, Packet->Timeout);
if (EFI_ERROR (Status)) {
goto Exit;
@@ -1348,7 +1348,7 @@ UfsExecScsiCmds (
Response = (UTP_RESPONSE_UPIU*)(CmdDescBase + Trd->RuO * sizeof (UINT32));
SenseDataLen = Response->SenseDataLen;
SwapLittleEndianToBigEndian ((UINT8*)&SenseDataLen, sizeof (UINT16));
if ((Packet->SenseDataLength != 0) && (Packet->SenseData != NULL)) {
CopyMem (Packet->SenseData, Response->SenseData, SenseDataLen);
Packet->SenseDataLength = (UINT8)SenseDataLen;
@@ -1458,7 +1458,7 @@ UfsExecUicCommands (
//
// UFS 2.0 spec section 5.3.1 Offset:0x20 IS.Bit10 UIC Command Completion Status (UCCS)
// This bit is set to '1' by the host controller upon completion of a UIC command.
// This bit is set to '1' by the host controller upon completion of a UIC command.
//
Address = UfsHcBase + UFS_HC_IS_OFFSET;
Data = MmioRead32 (Address);
@@ -1481,7 +1481,7 @@ UfsExecUicCommands (
//
// Check value of HCS.DP and make sure that there is a device attached to the Link.
//
Address = UfsHcBase + UFS_HC_STATUS_OFFSET;
Address = UfsHcBase + UFS_HC_STATUS_OFFSET;
Data = MmioRead32 (Address);
if ((Data & UFS_HC_HCS_DP) == 0) {
Address = UfsHcBase + UFS_HC_IS_OFFSET;
@@ -1614,11 +1614,11 @@ UfsInitTaskManagementRequestList (
EFI_PHYSICAL_ADDRESS CmdDescPhyAddr;
VOID *CmdDescMapping;
EFI_STATUS Status;
//
// Initial h/w and s/w context for future operations.
//
Address = Private->UfsHcBase + UFS_HC_CAP_OFFSET;
Address = Private->UfsHcBase + UFS_HC_CAP_OFFSET;
Data = MmioRead32 (Address);
Private->Capabilities = Data;
@@ -1642,9 +1642,9 @@ UfsInitTaskManagementRequestList (
// Program the UTP Task Management Request List Base Address and UTP Task Management
// Request List Base Address with a 64-bit address allocated at step 6.
//
Address = Private->UfsHcBase + UFS_HC_UTMRLBA_OFFSET;
Address = Private->UfsHcBase + UFS_HC_UTMRLBA_OFFSET;
MmioWrite32 (Address, (UINT32)(UINTN)CmdDescPhyAddr);
Address = Private->UfsHcBase + UFS_HC_UTMRLBAU_OFFSET;
Address = Private->UfsHcBase + UFS_HC_UTMRLBAU_OFFSET;
MmioWrite32 (Address, (UINT32)RShiftU64 ((UINT64)CmdDescPhyAddr, 32));
Private->UtpTmrlBase = (VOID*)(UINTN)CmdDescHost;
Private->Nutmrs = Nutmrs;
@@ -1654,7 +1654,7 @@ UfsInitTaskManagementRequestList (
// Enable the UTP Task Management Request List by setting the UTP Task Management
// Request List RunStop Register (UTMRLRSR) to '1'.
//
Address = Private->UfsHcBase + UFS_HC_UTMRLRSR_OFFSET;
Address = Private->UfsHcBase + UFS_HC_UTMRLRSR_OFFSET;
MmioWrite32 (Address, UFS_HC_UTMRLRSR);
return EFI_SUCCESS;
@@ -1681,11 +1681,11 @@ UfsInitTransferRequestList (
EFI_PHYSICAL_ADDRESS CmdDescPhyAddr;
VOID *CmdDescMapping;
EFI_STATUS Status;
//
// Initial h/w and s/w context for future operations.
//
Address = Private->UfsHcBase + UFS_HC_CAP_OFFSET;
Address = Private->UfsHcBase + UFS_HC_CAP_OFFSET;
Data = MmioRead32 (Address);
Private->Capabilities = Data;
@@ -1709,19 +1709,19 @@ UfsInitTransferRequestList (
// Program the UTP Transfer Request List Base Address and UTP Transfer Request List
// Base Address with a 64-bit address allocated at step 8.
//
Address = Private->UfsHcBase + UFS_HC_UTRLBA_OFFSET;
Address = Private->UfsHcBase + UFS_HC_UTRLBA_OFFSET;
MmioWrite32 (Address, (UINT32)(UINTN)CmdDescPhyAddr);
Address = Private->UfsHcBase + UFS_HC_UTRLBAU_OFFSET;
Address = Private->UfsHcBase + UFS_HC_UTRLBAU_OFFSET;
MmioWrite32 (Address, (UINT32)RShiftU64 ((UINT64)CmdDescPhyAddr, 32));
Private->UtpTrlBase = (VOID*)(UINTN)CmdDescHost;
Private->Nutrs = Nutrs;
Private->TrlMapping = CmdDescMapping;
//
// Enable the UTP Transfer Request List by setting the UTP Transfer Request List
// RunStop Register (UTRLRSR) to '1'.
//
Address = Private->UfsHcBase + UFS_HC_UTRLRSR_OFFSET;
Address = Private->UfsHcBase + UFS_HC_UTRLRSR_OFFSET;
MmioWrite32 (Address, UFS_HC_UTRLRSR);
return EFI_SUCCESS;
@@ -1803,14 +1803,14 @@ UfsControllerStop (
// Enable the UTP Task Management Request List by setting the UTP Task Management
// Request List RunStop Register (UTMRLRSR) to '1'.
//
Address = Private->UfsHcBase + UFS_HC_UTMRLRSR_OFFSET;
Address = Private->UfsHcBase + UFS_HC_UTMRLRSR_OFFSET;
MmioWrite32 (Address, 0);
//
// Enable the UTP Transfer Request List by setting the UTP Transfer Request List
// RunStop Register (UTRLRSR) to '1'.
//
Address = Private->UfsHcBase + UFS_HC_UTRLRSR_OFFSET;
Address = Private->UfsHcBase + UFS_HC_UTRLRSR_OFFSET;
MmioWrite32 (Address, 0);
//

View File

@@ -2,7 +2,7 @@
UfsPassThruDxe driver is used to produce EFI_EXT_SCSI_PASS_THRU protocol interface
for upper layer application to execute UFS-supported SCSI cmds.
Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2014 - 2018, 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
@@ -153,7 +153,7 @@ typedef struct {
// UFSHCI 2.0 Spec Section 5.2.5 Offset 18h: AHIT - Auto-Hibernate Idle Timer
//
typedef struct {
UINT32 Ahitv:10; // Auto-Hibernate Idle Timer Value
UINT32 Ahitv:10; // Auto-Hibernate Idle Timer Value
UINT32 Ts:3; // Timer scale
UINT32 Rsvd1:19;
} UFS_HC_AHIT;
@@ -165,19 +165,19 @@ typedef struct {
UINT16 Utrcs:1; // UTP Transfer Request Completion Status
UINT16 Udepri:1; // UIC DME_ENDPOINT_RESET Indication
UINT16 Ue:1; // UIC Error
UINT16 Utms:1; // UIC Test Mode Status
UINT16 Utms:1; // UIC Test Mode Status
UINT16 Upms:1; // UIC Power Mode Status
UINT16 Uhxs:1; // UIC Hibernate Exit Status
UINT16 Uhes:1; // UIC Hibernate Enter Status
UINT16 Ulls:1; // UIC Link Lost Status
UINT16 Upms:1; // UIC Power Mode Status
UINT16 Uhxs:1; // UIC Hibernate Exit Status
UINT16 Uhes:1; // UIC Hibernate Enter Status
UINT16 Ulls:1; // UIC Link Lost Status
UINT16 Ulss:1; // UIC Link Startup Status
UINT16 Utmrcs:1; // UTP Task Management Request Completion Status
UINT16 Uccs:1; // UIC Command Completion Status
UINT16 Dfes:1; // Device Fatal Error Status
UINT16 Ulss:1; // UIC Link Startup Status
UINT16 Utmrcs:1; // UTP Task Management Request Completion Status
UINT16 Uccs:1; // UIC Command Completion Status
UINT16 Dfes:1; // Device Fatal Error Status
UINT16 Utpes:1; // UTP Error Status
UINT16 Utpes:1; // UTP Error Status
UINT16 Rsvd1:3;
UINT16 Hcfes:1; // Host Controller Fatal Error Status
@@ -194,9 +194,9 @@ typedef struct {
UINT16 Uee:1; // UIC Error Enable
UINT16 Utmse:1; // UIC Test Mode Status Enable
UINT16 Upmse:1; // UIC Power Mode Status Enable
UINT16 Upmse:1; // UIC Power Mode Status Enable
UINT16 Uhxse:1; // UIC Hibernate Exit Status Enable
UINT16 Uhese:1; // UIC Hibernate Enter Status Enable
UINT16 Uhese:1; // UIC Hibernate Enter Status Enable
UINT16 Ullse:1; // UIC Link Lost Status Enable
UINT16 Ulsse:1; // UIC Link Startup Status Enable
@@ -450,22 +450,22 @@ typedef struct {
//
UINT32 Rsvd6:7;
UINT32 UcdBa:25; /* UTP Command Descriptor Base Address */
//
// DW5
//
UINT32 UcdBaU; /* UTP Command Descriptor Base Address Upper 32-bits */
//
// DW6
//
UINT16 RuL; /* Response UPIU Length */
UINT16 RuL; /* Response UPIU Length */
UINT16 RuO; /* Response UPIU Offset */
//
// DW7
//
UINT16 PrdtL; /* PRDT Length */
UINT16 PrdtL; /* PRDT Length */
UINT16 PrdtO; /* PRDT Offset */
} UTP_TRD;
@@ -475,12 +475,12 @@ typedef struct {
//
UINT32 Rsvd1:2;
UINT32 DbAddr:30; /* Data Base Address */
//
// DW1
//
UINT32 DbAddrU; /* Data Base Address Upper 32-bits */
//
// DW2
//
@@ -846,7 +846,7 @@ typedef struct {
// DW4 - DW11
//
UTP_TM_REQ_UPIU TmReq; /* Task Management Request UPIU */
//
// DW12 - DW19
//
@@ -972,7 +972,7 @@ typedef struct {
typedef enum {
UfsUtpQueryResponseSuccess = 0x00,
UfsUtpQueryResponseParamNotReadable = 0xF6,
UfsUtpQueryResponseParamNotWriteable = 0xF7,
UfsUtpQueryResponseParamNotWriteable = 0xF7,
UfsUtpQueryResponseParamAlreadyWritten = 0xF8,
UfsUtpQueryResponseInvalidLen = 0xF9,
UfsUtpQueryResponseInvalidVal = 0xFA,
@@ -1305,7 +1305,7 @@ typedef enum {
UfsFlagPurgeEn = 0x06,
UfsFlagPhyResRemoval = 0x08,
UfsFlagBusyRtc = 0x09,
UfsFlagPermDisFwUpdate = 0x0B
UfsFlagPermDisFwUpdate = 0x0B
} UFS_FLAGS_IDN;
//

View File

@@ -1,13 +1,13 @@
/** @file
Copyright (c) 2014, 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
http://opensource.org/licenses/bsd-license.php
Copyright (c) 2014 - 2018, 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "UfsPassThru.h"
@@ -32,18 +32,18 @@ GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gUfsPassThruComponent
GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mUfsPassThruDriverNameTable[] = {
{
{
"eng;en",
L"Universal Flash Storage (UFS) Pass Thru Driver"
},
{
{
NULL,
NULL
}
};
GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mUfsPassThruControllerNameTable[] = {
{
{
"eng;en",
L"Universal Flash Storage (UFS) Host Controller"
},

View File

@@ -1,6 +1,6 @@
/** @file
Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2014 - 2018, 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
@@ -18,7 +18,7 @@
//
UFS_PASS_THRU_PRIVATE_DATA gUfsPassThruTemplate = {
UFS_PASS_THRU_SIG, // Signature
NULL, // Handle
NULL, // Handle
{ // ExtScsiPassThruMode
0xFFFFFFFF,
EFI_EXT_SCSI_PASS_THRU_ATTRIBUTES_PHYSICAL | EFI_EXT_SCSI_PASS_THRU_ATTRIBUTES_LOGICAL | EFI_EXT_SCSI_PASS_THRU_ATTRIBUTES_NONBLOCKIO,
@@ -209,7 +209,7 @@ UfsPassThruPassThru (
if ((Private->Luns.BitMask & (BIT0 << Index)) == 0) {
continue;
}
if (Private->Luns.Lun[Index] == UfsLun) {
break;
}
@@ -413,7 +413,7 @@ UfsPassThruBuildDevicePath (
if ((Private->Luns.BitMask & (BIT0 << Index)) == 0) {
continue;
}
if (Private->Luns.Lun[Index] == UfsLun) {
break;
}
@@ -504,7 +504,7 @@ UfsPassThruGetTargetLun (
if ((Private->Luns.BitMask & (BIT0 << Index)) == 0) {
continue;
}
if (Private->Luns.Lun[Index] == UfsLun) {
break;
}
@@ -730,7 +730,7 @@ UfsPassThruDriverBindingSupported (
This->DriverBindingHandle,
Controller
);
return EFI_SUCCESS;
}
@@ -883,8 +883,8 @@ UfsPassThruDriverBindingStart (
//
// UFS 2.0 spec Section 13.1.3.3:
// At the end of the UFS Interconnect Layer initialization on both host and device side,
// the host shall send a NOP OUT UPIU to verify that the device UTP Layer is ready.
// At the end of the UFS Interconnect Layer initialization on both host and device side,
// the host shall send a NOP OUT UPIU to verify that the device UTP Layer is ready.
//
Status = UfsExecNopCmds (Private);
if (EFI_ERROR (Status)) {
@@ -955,7 +955,7 @@ UfsPassThruDriverBindingStart (
Error:
if (Private != NULL) {
if (Private->TmrlMapping != NULL) {
UfsHc->Unmap (UfsHc, Private->TmrlMapping);
UfsHc->Unmap (UfsHc, Private->TmrlMapping);
}
if (Private->UtpTmrlBase != NULL) {
UfsHc->FreeBuffer (UfsHc, EFI_SIZE_TO_PAGES (Private->Nutmrs * sizeof (UTP_TMRD)), Private->UtpTmrlBase);

View File

@@ -1,6 +1,6 @@
/** @file
Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2014 - 2018, 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
@@ -35,7 +35,7 @@
#define UFS_PASS_THRU_SIG SIGNATURE_32 ('U', 'F', 'S', 'P')
//
// Lun 0~7 is for 8 common luns.
// Lun 0~7 is for 8 common luns.
// Lun 8~11 is for those 4 well known luns (Refer to UFS 2.0 spec Table 10.58 for details):
// Lun 8: REPORT LUNS
// Lun 9: UFS DEVICE
@@ -59,7 +59,7 @@ typedef struct {
for(Entry = (ListHead)->ForwardLink, NextEntry = Entry->ForwardLink;\
Entry != (ListHead); Entry = NextEntry, NextEntry = Entry->ForwardLink)
typedef struct _UFS_PASS_THRU_PRIVATE_DATA {
typedef struct _UFS_PASS_THRU_PRIVATE_DATA {
UINT32 Signature;
EFI_HANDLE Handle;
EFI_EXT_SCSI_PASS_THRU_MODE ExtScsiPassThruMode;

View File

@@ -1,16 +1,16 @@
// /** @file
// The UfsPassThruDxe driver is used to provide support on accessing UFS device.
// The UfsPassThruDxe driver is used to provide support on accessing UFS device.
//
// It produces an EFI_EXT_SCSI_PASS_THRU_PROTOCOL interface for upper layer to send
// SCSI cmd to UFS device.
//
// Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
// Copyright (c) 2015 - 2018, 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
// http://opensource.org/licenses/bsd-license.php
//
//
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
//

View File

@@ -1,7 +1,7 @@
## @file
# Description file for the Universal Flash Storage (UFS) Pass Thru driver.
#
# Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2014 - 2018, 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
@@ -28,8 +28,8 @@
#
# VALID_ARCHITECTURES = IA32 X64 IPF EBC
#
# DRIVER_BINDING = gUfsPassThruDriverBinding
# COMPONENT_NAME = gUfsPassThruComponentName
# DRIVER_BINDING = gUfsPassThruDriverBinding
# COMPONENT_NAME = gUfsPassThruComponentName
#
[Sources]

View File

@@ -1,7 +1,7 @@
// /** @file
// UfsPassThruDxe Localized Strings and Content
//
// Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
// Copyright (c) 2015 - 2018, 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
@@ -13,8 +13,8 @@
//
// **/
#string STR_PROPERTIES_MODULE_NAME
#language en-US
#string STR_PROPERTIES_MODULE_NAME
#language en-US
"UFS PassThru UEFI Driver"

View File

@@ -2,7 +2,7 @@
UfsPassThruDxe driver is used to produce EFI_EXT_SCSI_PASS_THRU protocol interface
for upper layer application to execute UFS-supported SCSI cmds.
Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2014 - 2018, 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
@@ -179,13 +179,13 @@ DumpUicCmdExecResult (
break;
case 0x08:
DEBUG ((DEBUG_VERBOSE, "UIC configuration command fails - PEER_COMMUNICATION_FAILURE\n"));
break;
break;
case 0x09:
DEBUG ((DEBUG_VERBOSE, "UIC configuration command fails - BUSY\n"));
break;
case 0x0A:
DEBUG ((DEBUG_VERBOSE, "UIC configuration command fails - DME_FAILURE\n"));
break;
break;
default :
ASSERT (FALSE);
break;
@@ -196,7 +196,7 @@ DumpUicCmdExecResult (
break;
case 0x01:
DEBUG ((DEBUG_VERBOSE, "UIC control command fails - FAILURE\n"));
break;
break;
default :
ASSERT (FALSE);
break;
@@ -242,7 +242,7 @@ DumpQueryResponseResult (
break;
case 0xFE:
DEBUG ((DEBUG_VERBOSE, "Query Response with Invalid Opcode\n"));
break;
break;
case 0xFF:
DEBUG ((DEBUG_VERBOSE, "Query Response with General Failure\n"));
break;
@@ -314,7 +314,7 @@ UfsFillTsfOfQueryReqUpiu (
SwapLittleEndianToBigEndian ((UINT8*)&Length, sizeof (Length));
TsfBase->Length = Length;
}
if (Opcode == UtpQueryFuncOpcodeWrAttr) {
SwapLittleEndianToBigEndian ((UINT8*)&Value, sizeof (Value));
TsfBase->Value = Value;
@@ -790,7 +790,7 @@ EFI_STATUS
UfsStartExecCmd (
IN UFS_PASS_THRU_PRIVATE_DATA *Private,
IN UINT8 Slot
)
)
{
UINT32 Data;
EFI_STATUS Status;
@@ -826,7 +826,7 @@ EFI_STATUS
UfsStopExecCmd (
IN UFS_PASS_THRU_PRIVATE_DATA *Private,
IN UINT8 Slot
)
)
{
UINT32 Data;
EFI_STATUS Status;
@@ -940,7 +940,7 @@ UfsSendDmRequestRetry (
if (EFI_ERROR (Status)) {
return Status;
}
Trd = ((UTP_TRD*)Private->UtpTrlBase) + Slot;
//
// Fill transfer request descriptor to this slot.
@@ -1337,7 +1337,7 @@ UfsExecNopCmds (
//
// Wait for the completion of the transfer request.
//
//
Status = UfsWaitMemSet (Private, UFS_HC_UTRLDBR_OFFSET, BIT0 << Slot, 0, UFS_TIMEOUT);
if (EFI_ERROR (Status)) {
goto Exit;
@@ -1503,7 +1503,7 @@ UfsExecScsiCmds (
//
// Wait for the completion of the transfer request.
//
//
Status = UfsWaitMemSet (Private, UFS_HC_UTRLDBR_OFFSET, BIT0 << TransReq->Slot, 0, Packet->Timeout);
if (EFI_ERROR (Status)) {
goto Exit;
@@ -1516,7 +1516,7 @@ UfsExecScsiCmds (
ASSERT (Response != NULL);
SenseDataLen = Response->SenseDataLen;
SwapLittleEndianToBigEndian ((UINT8*)&SenseDataLen, sizeof (UINT16));
if ((Packet->SenseDataLength != 0) && (Packet->SenseData != NULL)) {
CopyMem (Packet->SenseData, Response->SenseData, SenseDataLen);
Packet->SenseDataLength = (UINT8)SenseDataLen;
@@ -1649,7 +1649,7 @@ UfsExecUicCommands (
//
// UFS 2.0 spec section 5.3.1 Offset:0x20 IS.Bit10 UIC Command Completion Status (UCCS)
// This bit is set to '1' by the host controller upon completion of a UIC command.
// This bit is set to '1' by the host controller upon completion of a UIC command.
//
Status = UfsWaitMemSet (Private, UFS_HC_IS_OFFSET, UFS_HC_IS_UCCS, UFS_HC_IS_UCCS, UFS_TIMEOUT);
if (EFI_ERROR (Status)) {
@@ -1907,7 +1907,7 @@ UfsInitTaskManagementRequestList (
EFI_PHYSICAL_ADDRESS CmdDescPhyAddr;
VOID *CmdDescMapping;
EFI_STATUS Status;
//
// Initial h/w and s/w context for future operations.
//
@@ -1978,7 +1978,7 @@ UfsInitTransferRequestList (
UINT8 Nutrs;
VOID *CmdDescHost;
EFI_PHYSICAL_ADDRESS CmdDescPhyAddr;
VOID *CmdDescMapping;
VOID *CmdDescMapping;
EFI_STATUS Status;
//
@@ -2019,7 +2019,7 @@ UfsInitTransferRequestList (
}
Private->UtpTrlBase = CmdDescHost;
Private->Nutrs = Nutrs;
Private->Nutrs = Nutrs;
Private->TrlMapping = CmdDescMapping;
//

View File

@@ -2,7 +2,7 @@
UfsPassThruDxe driver is used to produce EFI_EXT_SCSI_PASS_THRU protocol interface
for upper layer application to execute UFS-supported SCSI cmds.
Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2014 - 2018, 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
@@ -153,7 +153,7 @@ typedef struct {
// UFSHCI 2.0 Spec Section 5.2.5 Offset 18h: AHIT - Auto-Hibernate Idle Timer
//
typedef struct {
UINT32 Ahitv:10; // Auto-Hibernate Idle Timer Value
UINT32 Ahitv:10; // Auto-Hibernate Idle Timer Value
UINT32 Ts:3; // Timer scale
UINT32 Rsvd1:19;
} UFS_HC_AHIT;
@@ -165,19 +165,19 @@ typedef struct {
UINT16 Utrcs:1; // UTP Transfer Request Completion Status
UINT16 Udepri:1; // UIC DME_ENDPOINT_RESET Indication
UINT16 Ue:1; // UIC Error
UINT16 Utms:1; // UIC Test Mode Status
UINT16 Utms:1; // UIC Test Mode Status
UINT16 Upms:1; // UIC Power Mode Status
UINT16 Uhxs:1; // UIC Hibernate Exit Status
UINT16 Uhes:1; // UIC Hibernate Enter Status
UINT16 Ulls:1; // UIC Link Lost Status
UINT16 Upms:1; // UIC Power Mode Status
UINT16 Uhxs:1; // UIC Hibernate Exit Status
UINT16 Uhes:1; // UIC Hibernate Enter Status
UINT16 Ulls:1; // UIC Link Lost Status
UINT16 Ulss:1; // UIC Link Startup Status
UINT16 Utmrcs:1; // UTP Task Management Request Completion Status
UINT16 Uccs:1; // UIC Command Completion Status
UINT16 Dfes:1; // Device Fatal Error Status
UINT16 Ulss:1; // UIC Link Startup Status
UINT16 Utmrcs:1; // UTP Task Management Request Completion Status
UINT16 Uccs:1; // UIC Command Completion Status
UINT16 Dfes:1; // Device Fatal Error Status
UINT16 Utpes:1; // UTP Error Status
UINT16 Utpes:1; // UTP Error Status
UINT16 Rsvd1:3;
UINT16 Hcfes:1; // Host Controller Fatal Error Status
@@ -194,9 +194,9 @@ typedef struct {
UINT16 Uee:1; // UIC Error Enable
UINT16 Utmse:1; // UIC Test Mode Status Enable
UINT16 Upmse:1; // UIC Power Mode Status Enable
UINT16 Upmse:1; // UIC Power Mode Status Enable
UINT16 Uhxse:1; // UIC Hibernate Exit Status Enable
UINT16 Uhese:1; // UIC Hibernate Enter Status Enable
UINT16 Uhese:1; // UIC Hibernate Enter Status Enable
UINT16 Ullse:1; // UIC Link Lost Status Enable
UINT16 Ulsse:1; // UIC Link Startup Status Enable
@@ -450,22 +450,22 @@ typedef struct {
//
UINT32 Rsvd6:7;
UINT32 UcdBa:25; /* UTP Command Descriptor Base Address */
//
// DW5
//
UINT32 UcdBaU; /* UTP Command Descriptor Base Address Upper 32-bits */
//
// DW6
//
UINT16 RuL; /* Response UPIU Length */
UINT16 RuL; /* Response UPIU Length */
UINT16 RuO; /* Response UPIU Offset */
//
// DW7
//
UINT16 PrdtL; /* PRDT Length */
UINT16 PrdtL; /* PRDT Length */
UINT16 PrdtO; /* PRDT Offset */
} UTP_TRD;
@@ -475,12 +475,12 @@ typedef struct {
//
UINT32 Rsvd1:2;
UINT32 DbAddr:30; /* Data Base Address */
//
// DW1
//
UINT32 DbAddrU; /* Data Base Address Upper 32-bits */
//
// DW2
//
@@ -846,7 +846,7 @@ typedef struct {
// DW4 - DW11
//
UTP_TM_REQ_UPIU TmReq; /* Task Management Request UPIU */
//
// DW12 - DW19
//
@@ -972,7 +972,7 @@ typedef struct {
typedef enum {
UfsUtpQueryResponseSuccess = 0x00,
UfsUtpQueryResponseParamNotReadable = 0xF6,
UfsUtpQueryResponseParamNotWriteable = 0xF7,
UfsUtpQueryResponseParamNotWriteable = 0xF7,
UfsUtpQueryResponseParamAlreadyWritten = 0xF8,
UfsUtpQueryResponseInvalidLen = 0xF9,
UfsUtpQueryResponseInvalidVal = 0xFA,
@@ -1305,7 +1305,7 @@ typedef enum {
UfsFlagPurgeEn = 0x06,
UfsFlagPhyResRemoval = 0x08,
UfsFlagBusyRtc = 0x09,
UfsFlagPermDisFwUpdate = 0x0B
UfsFlagPermDisFwUpdate = 0x0B
} UFS_FLAGS_IDN;
//