IntelFrameworkModulePkg IdeBusDxe: Remove redundant functions
The redundant functions which are never called have been removed. They are AtaNonDataCommandInExt,IDEBusDriverConfigurationSetOptions, GetResponse,IDEBusDriverConfigurationOptionsValid and IDEBusDriverConfigurationForceDefaults. https://bugzilla.tianocore.org/show_bug.cgi?id=1063 Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: shenglei <shenglei.zhang@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
This commit is contained in:
@ -2676,124 +2676,5 @@ AtaNonDataCommandIn (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Send ATA Ext command into device with NON_DATA protocol
|
||||
|
||||
@param IdeDev Standard IDE device private data structure
|
||||
@param AtaCommand The ATA command to be sent
|
||||
@param Device The value in Device register
|
||||
@param Feature The value in Feature register
|
||||
@param SectorCount The value in SectorCount register
|
||||
@param LbaAddress The LBA address in 48-bit mode
|
||||
|
||||
@retval EFI_SUCCESS Reading succeed
|
||||
@retval EFI_ABORTED Command failed
|
||||
@retval EFI_DEVICE_ERROR Device status error.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
AtaNonDataCommandInExt (
|
||||
IN IDE_BLK_IO_DEV *IdeDev,
|
||||
IN UINT8 AtaCommand,
|
||||
IN UINT8 Device,
|
||||
IN UINT16 Feature,
|
||||
IN UINT16 SectorCount,
|
||||
IN EFI_LBA LbaAddress
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT8 StatusRegister;
|
||||
UINT8 SectorCount8;
|
||||
UINT8 Feature8;
|
||||
UINT8 LbaLow;
|
||||
UINT8 LbaMid;
|
||||
UINT8 LbaHigh;
|
||||
|
||||
Status = WaitForBSYClear (IdeDev, ATATIMEOUT);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return EFI_DEVICE_ERROR;
|
||||
}
|
||||
|
||||
//
|
||||
// Select device (bit4), set LBA mode(bit6) (use 0xe0 for compatibility)
|
||||
//
|
||||
IDEWritePortB (
|
||||
IdeDev->PciIo,
|
||||
IdeDev->IoPort->Head,
|
||||
(UINT8) ((IdeDev->Device << 4) | 0xe0)
|
||||
);
|
||||
|
||||
//
|
||||
// ATA commands for ATA device must be issued when DRDY is set
|
||||
//
|
||||
Status = DRDYReady (IdeDev, ATATIMEOUT);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return EFI_DEVICE_ERROR;
|
||||
}
|
||||
|
||||
//
|
||||
// Pass parameter into device register block
|
||||
//
|
||||
IDEWritePortB (IdeDev->PciIo, IdeDev->IoPort->Head, Device);
|
||||
|
||||
//
|
||||
// Fill the feature register, which is a two-byte FIFO. Need write twice.
|
||||
//
|
||||
Feature8 = (UINT8) (Feature >> 8);
|
||||
IDEWritePortB (IdeDev->PciIo, IdeDev->IoPort->Reg1.Feature, Feature8);
|
||||
|
||||
Feature8 = (UINT8) Feature;
|
||||
IDEWritePortB (IdeDev->PciIo, IdeDev->IoPort->Reg1.Feature, Feature8);
|
||||
|
||||
//
|
||||
// Fill the sector count register, which is a two-byte FIFO. Need write twice.
|
||||
//
|
||||
SectorCount8 = (UINT8) (SectorCount >> 8);
|
||||
IDEWritePortB (IdeDev->PciIo, IdeDev->IoPort->SectorCount, SectorCount8);
|
||||
|
||||
SectorCount8 = (UINT8) SectorCount;
|
||||
IDEWritePortB (IdeDev->PciIo, IdeDev->IoPort->SectorCount, SectorCount8);
|
||||
|
||||
//
|
||||
// Fill the start LBA registers, which are also two-byte FIFO
|
||||
//
|
||||
LbaLow = (UINT8) RShiftU64 (LbaAddress, 24);
|
||||
LbaMid = (UINT8) RShiftU64 (LbaAddress, 32);
|
||||
LbaHigh = (UINT8) RShiftU64 (LbaAddress, 40);
|
||||
IDEWritePortB (IdeDev->PciIo, IdeDev->IoPort->SectorNumber, LbaLow);
|
||||
IDEWritePortB (IdeDev->PciIo, IdeDev->IoPort->CylinderLsb, LbaMid);
|
||||
IDEWritePortB (IdeDev->PciIo, IdeDev->IoPort->CylinderMsb, LbaHigh);
|
||||
|
||||
LbaLow = (UINT8) LbaAddress;
|
||||
LbaMid = (UINT8) RShiftU64 (LbaAddress, 8);
|
||||
LbaHigh = (UINT8) RShiftU64 (LbaAddress, 16);
|
||||
IDEWritePortB (IdeDev->PciIo, IdeDev->IoPort->SectorNumber, LbaLow);
|
||||
IDEWritePortB (IdeDev->PciIo, IdeDev->IoPort->CylinderLsb, LbaMid);
|
||||
IDEWritePortB (IdeDev->PciIo, IdeDev->IoPort->CylinderMsb, LbaHigh);
|
||||
|
||||
//
|
||||
// Send command via Command Register
|
||||
//
|
||||
IDEWritePortB (IdeDev->PciIo, IdeDev->IoPort->Reg.Command, AtaCommand);
|
||||
|
||||
//
|
||||
// Wait for command completion
|
||||
//
|
||||
Status = WaitForBSYClear (IdeDev, ATATIMEOUT);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return EFI_DEVICE_ERROR;
|
||||
}
|
||||
|
||||
StatusRegister = IDEReadPortB (IdeDev->PciIo, IdeDev->IoPort->Reg.Status);
|
||||
if ((StatusRegister & ATA_STSREG_ERR) == ATA_STSREG_ERR) {
|
||||
//
|
||||
// Failed to execute command, abort operation
|
||||
//
|
||||
return EFI_ABORTED;
|
||||
}
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user