mirror of https://github.com/acidanthera/audk.git
remove additional space from comments and pass ICC/GCC44 build
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10903 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
16d5d16832
commit
aca84419c4
|
@ -135,11 +135,11 @@ AhciOrReg (
|
||||||
/**
|
/**
|
||||||
Wait for memory set to the test value.
|
Wait for memory set to the test value.
|
||||||
|
|
||||||
@param PciIo The PCI IO protocol instance.
|
@param PciIo The PCI IO protocol instance.
|
||||||
@param Offset The memory address to test.
|
@param Offset The memory address to test.
|
||||||
@param MaskValue The mask value of memory.
|
@param MaskValue The mask value of memory.
|
||||||
@param TestValue The test value of memory.
|
@param TestValue The test value of memory.
|
||||||
@param Timeout The time out value for wait memory set.
|
@param Timeout The time out value for wait memory set.
|
||||||
|
|
||||||
@retval EFI_DEVICE_ERROR The memory is not set.
|
@retval EFI_DEVICE_ERROR The memory is not set.
|
||||||
@retval EFI_TIMEOUT The memory setting is time out.
|
@retval EFI_TIMEOUT The memory setting is time out.
|
||||||
|
@ -188,8 +188,8 @@ AhciWaitMemSet (
|
||||||
Check if the device is still on port. It also checks if the AHCI controller
|
Check if the device is still on port. It also checks if the AHCI controller
|
||||||
supports the address and data count will be transfered.
|
supports the address and data count will be transfered.
|
||||||
|
|
||||||
@param PciIo The PCI IO protocol instance.
|
@param PciIo The PCI IO protocol instance.
|
||||||
@param Port The number of port.
|
@param Port The number of port.
|
||||||
|
|
||||||
@retval EFI_SUCCESS The device is attached to port and the transfer data is
|
@retval EFI_SUCCESS The device is attached to port and the transfer data is
|
||||||
supported by AHCI controller.
|
supported by AHCI controller.
|
||||||
|
@ -347,15 +347,15 @@ AhciDisableFisReceive (
|
||||||
/**
|
/**
|
||||||
Build the command list, command table and prepare the fis receiver.
|
Build the command list, command table and prepare the fis receiver.
|
||||||
|
|
||||||
@param PciIo The PCI IO protocol instance.
|
@param PciIo The PCI IO protocol instance.
|
||||||
@param AhciRegisters The pointer to the EFI_AHCI_REGISTERS.
|
@param AhciRegisters The pointer to the EFI_AHCI_REGISTERS.
|
||||||
@param Port The number of port.
|
@param Port The number of port.
|
||||||
@param PortMultiplier The timeout value of stop.
|
@param PortMultiplier The timeout value of stop.
|
||||||
@param CommandFis The control fis will be used for the transfer.
|
@param CommandFis The control fis will be used for the transfer.
|
||||||
@param CommandList The command list will be used for the transfer.
|
@param CommandList The command list will be used for the transfer.
|
||||||
@param AtapiCommand The atapi command will be used for the transfer.
|
@param AtapiCommand The atapi command will be used for the transfer.
|
||||||
@param AtapiCommandLength The length of the atapi command.
|
@param AtapiCommandLength The length of the atapi command.
|
||||||
@param CommandSlotNumber The command slot will be used for the transfer.
|
@param CommandSlotNumber The command slot will be used for the transfer.
|
||||||
@param DataPhysicalAddr The pointer to the data buffer pci bus master address.
|
@param DataPhysicalAddr The pointer to the data buffer pci bus master address.
|
||||||
@param DataLength The data count to be transferred.
|
@param DataLength The data count to be transferred.
|
||||||
|
|
||||||
|
@ -466,7 +466,7 @@ AhciBuildCommand (
|
||||||
/**
|
/**
|
||||||
Buid a command FIS.
|
Buid a command FIS.
|
||||||
|
|
||||||
@param CmdFis A pointer to the EFI_AHCI_COMMAND_FIS data structure.
|
@param CmdFis A pointer to the EFI_AHCI_COMMAND_FIS data structure.
|
||||||
@param AtaCommandBlock A pointer to the AhciBuildCommandFis data structure.
|
@param AtaCommandBlock A pointer to the AhciBuildCommandFis data structure.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
@ -501,17 +501,17 @@ AhciBuildCommandFis (
|
||||||
CmdFis->AhciCFisSecCount = AtaCommandBlock->AtaSectorCount;
|
CmdFis->AhciCFisSecCount = AtaCommandBlock->AtaSectorCount;
|
||||||
CmdFis->AhciCFisSecCountExp = AtaCommandBlock->AtaSectorCountExp;
|
CmdFis->AhciCFisSecCountExp = AtaCommandBlock->AtaSectorCountExp;
|
||||||
|
|
||||||
CmdFis->AhciCFisDevHead = AtaCommandBlock->AtaDeviceHead | 0xE0;
|
CmdFis->AhciCFisDevHead = (UINT8) (AtaCommandBlock->AtaDeviceHead | 0xE0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Start a PIO data transfer on specific port.
|
Start a PIO data transfer on specific port.
|
||||||
|
|
||||||
@param PciIo The PCI IO protocol instance.
|
@param PciIo The PCI IO protocol instance.
|
||||||
@param AhciRegisters The pointer to the EFI_AHCI_REGISTERS.
|
@param AhciRegisters The pointer to the EFI_AHCI_REGISTERS.
|
||||||
@param Port The number of port.
|
@param Port The number of port.
|
||||||
@param PortMultiplier The timeout value of stop.
|
@param PortMultiplier The timeout value of stop.
|
||||||
@param AtapiCommand The atapi command will be used for the transfer.
|
@param AtapiCommand The atapi command will be used for the transfer.
|
||||||
@param AtapiCommandLength The length of the atapi command.
|
@param AtapiCommandLength The length of the atapi command.
|
||||||
@param Read The transfer direction.
|
@param Read The transfer direction.
|
||||||
@param AtaCommandBlock The EFI_ATA_COMMAND_BLOCK data.
|
@param AtaCommandBlock The EFI_ATA_COMMAND_BLOCK data.
|
||||||
|
@ -527,6 +527,7 @@ AhciBuildCommandFis (
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
AhciPioTransfer (
|
AhciPioTransfer (
|
||||||
IN EFI_PCI_IO_PROTOCOL *PciIo,
|
IN EFI_PCI_IO_PROTOCOL *PciIo,
|
||||||
IN EFI_AHCI_REGISTERS *AhciRegisters,
|
IN EFI_AHCI_REGISTERS *AhciRegisters,
|
||||||
|
@ -691,23 +692,23 @@ Exit:
|
||||||
/**
|
/**
|
||||||
Start a DMA data transfer on specific port
|
Start a DMA data transfer on specific port
|
||||||
|
|
||||||
@param PciIo The PCI IO protocol instance.
|
@param PciIo The PCI IO protocol instance.
|
||||||
@param AhciRegisters The pointer to the EFI_AHCI_REGISTERS.
|
@param AhciRegisters The pointer to the EFI_AHCI_REGISTERS.
|
||||||
@param Port The number of port.
|
@param Port The number of port.
|
||||||
@param PortMultiplier The timeout value of stop.
|
@param PortMultiplier The timeout value of stop.
|
||||||
@param AtapiCommand The atapi command will be used for the transfer.
|
@param AtapiCommand The atapi command will be used for the transfer.
|
||||||
@param AtapiCommandLength The length of the atapi command.
|
@param AtapiCommandLength The length of the atapi command.
|
||||||
@param Read The transfer direction.
|
@param Read The transfer direction.
|
||||||
@param AtaCommandBlock The EFI_ATA_COMMAND_BLOCK data.
|
@param AtaCommandBlock The EFI_ATA_COMMAND_BLOCK data.
|
||||||
@param AtaStatusBlock The EFI_ATA_STATUS_BLOCK data.
|
@param AtaStatusBlock The EFI_ATA_STATUS_BLOCK data.
|
||||||
@param MemoryAddr The pointer to the data buffer.
|
@param MemoryAddr The pointer to the data buffer.
|
||||||
@param DataCount The data count to be transferred.
|
@param DataCount The data count to be transferred.
|
||||||
@param Timeout The timeout value of non data transfer.
|
@param Timeout The timeout value of non data transfer.
|
||||||
|
|
||||||
@retval EFI_DEVICE_ERROR The DMA data transfer abort with error occurs.
|
@retval EFI_DEVICE_ERROR The DMA data transfer abort with error occurs.
|
||||||
@retval EFI_TIMEOUT The operation is time out.
|
@retval EFI_TIMEOUT The operation is time out.
|
||||||
@retval EFI_UNSUPPORTED The device is not ready for transfer.
|
@retval EFI_UNSUPPORTED The device is not ready for transfer.
|
||||||
@retval EFI_SUCCESS The DMA data transfer executes successfully.
|
@retval EFI_SUCCESS The DMA data transfer executes successfully.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
|
@ -860,15 +861,15 @@ Exit:
|
||||||
/**
|
/**
|
||||||
Start a non data transfer on specific port.
|
Start a non data transfer on specific port.
|
||||||
|
|
||||||
@param PciIo The PCI IO protocol instance.
|
@param PciIo The PCI IO protocol instance.
|
||||||
@param AhciRegisters The pointer to the EFI_AHCI_REGISTERS.
|
@param AhciRegisters The pointer to the EFI_AHCI_REGISTERS.
|
||||||
@param Port The number of port.
|
@param Port The number of port.
|
||||||
@param PortMultiplier The timeout value of stop.
|
@param PortMultiplier The timeout value of stop.
|
||||||
@param AtapiCommand The atapi command will be used for the transfer.
|
@param AtapiCommand The atapi command will be used for the transfer.
|
||||||
@param AtapiCommandLength The length of the atapi command.
|
@param AtapiCommandLength The length of the atapi command.
|
||||||
@param AtaCommandBlock The EFI_ATA_COMMAND_BLOCK data.
|
@param AtaCommandBlock The EFI_ATA_COMMAND_BLOCK data.
|
||||||
@param AtaStatusBlock The EFI_ATA_STATUS_BLOCK data.
|
@param AtaStatusBlock The EFI_ATA_STATUS_BLOCK data.
|
||||||
@param Timeout The timeout value of non data transfer.
|
@param Timeout The timeout value of non data transfer.
|
||||||
|
|
||||||
@retval EFI_DEVICE_ERROR The non data transfer abort with error occurs.
|
@retval EFI_DEVICE_ERROR The non data transfer abort with error occurs.
|
||||||
@retval EFI_TIMEOUT The operation is time out.
|
@retval EFI_TIMEOUT The operation is time out.
|
||||||
|
@ -1251,11 +1252,11 @@ AhciReset (
|
||||||
/**
|
/**
|
||||||
Send Buffer cmd to specific device.
|
Send Buffer cmd to specific device.
|
||||||
|
|
||||||
@param PciIo The PCI IO protocol instance.
|
@param PciIo The PCI IO protocol instance.
|
||||||
@param AhciRegisters The pointer to the EFI_AHCI_REGISTERS.
|
@param AhciRegisters The pointer to the EFI_AHCI_REGISTERS.
|
||||||
@param Port The number of port.
|
@param Port The number of port.
|
||||||
@param PortMultiplier The timeout value of stop.
|
@param PortMultiplier The timeout value of stop.
|
||||||
@param Buffer The data buffer to store IDENTIFY PACKET data.
|
@param Buffer The data buffer to store IDENTIFY PACKET data.
|
||||||
|
|
||||||
@retval EFI_DEVICE_ERROR The cmd abort with error occurs.
|
@retval EFI_DEVICE_ERROR The cmd abort with error occurs.
|
||||||
@retval EFI_TIMEOUT The operation is time out.
|
@retval EFI_TIMEOUT The operation is time out.
|
||||||
|
@ -1308,11 +1309,11 @@ AhciIdentify (
|
||||||
/**
|
/**
|
||||||
Send Buffer cmd to specific device.
|
Send Buffer cmd to specific device.
|
||||||
|
|
||||||
@param PciIo The PCI IO protocol instance.
|
@param PciIo The PCI IO protocol instance.
|
||||||
@param AhciRegisters The pointer to the EFI_AHCI_REGISTERS.
|
@param AhciRegisters The pointer to the EFI_AHCI_REGISTERS.
|
||||||
@param Port The number of port.
|
@param Port The number of port.
|
||||||
@param PortMultiplier The timeout value of stop.
|
@param PortMultiplier The timeout value of stop.
|
||||||
@param Buffer The data buffer to store IDENTIFY PACKET data.
|
@param Buffer The data buffer to store IDENTIFY PACKET data.
|
||||||
|
|
||||||
@retval EFI_DEVICE_ERROR The cmd abort with error occurs.
|
@retval EFI_DEVICE_ERROR The cmd abort with error occurs.
|
||||||
@retval EFI_TIMEOUT The operation is time out.
|
@retval EFI_TIMEOUT The operation is time out.
|
||||||
|
@ -1365,12 +1366,12 @@ AhciIdentifyPacket (
|
||||||
/**
|
/**
|
||||||
Send SET FEATURE cmd on specific device.
|
Send SET FEATURE cmd on specific device.
|
||||||
|
|
||||||
@param PciIo The PCI IO protocol instance.
|
@param PciIo The PCI IO protocol instance.
|
||||||
@param AhciRegisters The pointer to the EFI_AHCI_REGISTERS.
|
@param AhciRegisters The pointer to the EFI_AHCI_REGISTERS.
|
||||||
@param Port The number of port.
|
@param Port The number of port.
|
||||||
@param PortMultiplier The timeout value of stop.
|
@param PortMultiplier The timeout value of stop.
|
||||||
@param Feature The data to send Feature register.
|
@param Feature The data to send Feature register.
|
||||||
@param FeatureSpecificData The specific data for SET FEATURE cmd.
|
@param FeatureSpecificData The specific data for SET FEATURE cmd.
|
||||||
|
|
||||||
@retval EFI_DEVICE_ERROR The cmd abort with error occurs.
|
@retval EFI_DEVICE_ERROR The cmd abort with error occurs.
|
||||||
@retval EFI_TIMEOUT The operation is time out.
|
@retval EFI_TIMEOUT The operation is time out.
|
||||||
|
@ -1561,7 +1562,7 @@ AhciCreateTransferDescriptor (
|
||||||
// Get the number of command slots per port supported by this HBA.
|
// Get the number of command slots per port supported by this HBA.
|
||||||
//
|
//
|
||||||
MaxCommandSlotNumber = (UINT8) (((Capability & 0x1F00) >> 8) + 1);
|
MaxCommandSlotNumber = (UINT8) (((Capability & 0x1F00) >> 8) + 1);
|
||||||
Support64Bit = ((Capability & BIT31) != 0) ? TRUE : FALSE;
|
Support64Bit = (BOOLEAN) (((Capability & BIT31) != 0) ? TRUE : FALSE);
|
||||||
|
|
||||||
MaxReceiveFisSize = MaxPortNumber * sizeof (EFI_AHCI_RECEIVED_FIS);
|
MaxReceiveFisSize = MaxPortNumber * sizeof (EFI_AHCI_RECEIVED_FIS);
|
||||||
Status = PciIo->AllocateBuffer (
|
Status = PciIo->AllocateBuffer (
|
||||||
|
@ -1588,7 +1589,7 @@ AhciCreateTransferDescriptor (
|
||||||
EfiPciIoOperationBusMasterCommonBuffer,
|
EfiPciIoOperationBusMasterCommonBuffer,
|
||||||
Buffer,
|
Buffer,
|
||||||
&Bytes,
|
&Bytes,
|
||||||
&(EFI_PHYSICAL_ADDRESS)AhciRegisters->AhciRFisPciAddr,
|
(EFI_PHYSICAL_ADDRESS *) &AhciRegisters->AhciRFisPciAddr,
|
||||||
&AhciRegisters->MapRFis
|
&AhciRegisters->MapRFis
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -1600,7 +1601,7 @@ AhciCreateTransferDescriptor (
|
||||||
goto Error6;
|
goto Error6;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((!Support64Bit) && ((EFI_PHYSICAL_ADDRESS)AhciRegisters->AhciRFisPciAddr > 0x100000000UL)) {
|
if ((!Support64Bit) && ((EFI_PHYSICAL_ADDRESS)(UINTN)AhciRegisters->AhciRFisPciAddr > 0x100000000ULL)) {
|
||||||
//
|
//
|
||||||
// The AHCI HBA doesn't support 64bit addressing, so should not get a >4G pci bus master address.
|
// The AHCI HBA doesn't support 64bit addressing, so should not get a >4G pci bus master address.
|
||||||
//
|
//
|
||||||
|
@ -1642,7 +1643,7 @@ AhciCreateTransferDescriptor (
|
||||||
EfiPciIoOperationBusMasterCommonBuffer,
|
EfiPciIoOperationBusMasterCommonBuffer,
|
||||||
Buffer,
|
Buffer,
|
||||||
&Bytes,
|
&Bytes,
|
||||||
&(EFI_PHYSICAL_ADDRESS)AhciRegisters->AhciCmdListPciAddr,
|
(EFI_PHYSICAL_ADDRESS *)&AhciRegisters->AhciCmdListPciAddr,
|
||||||
&AhciRegisters->MapCmdList
|
&AhciRegisters->MapCmdList
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -1654,7 +1655,7 @@ AhciCreateTransferDescriptor (
|
||||||
goto Error4;
|
goto Error4;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((!Support64Bit) && ((EFI_PHYSICAL_ADDRESS)AhciRegisters->AhciCmdListPciAddr > 0x100000000UL)) {
|
if ((!Support64Bit) && ((EFI_PHYSICAL_ADDRESS)(UINTN)AhciRegisters->AhciCmdListPciAddr > 0x100000000ULL)) {
|
||||||
//
|
//
|
||||||
// The AHCI HBA doesn't support 64bit addressing, so should not get a >4G pci bus master address.
|
// The AHCI HBA doesn't support 64bit addressing, so should not get a >4G pci bus master address.
|
||||||
//
|
//
|
||||||
|
@ -1697,7 +1698,7 @@ AhciCreateTransferDescriptor (
|
||||||
EfiPciIoOperationBusMasterCommonBuffer,
|
EfiPciIoOperationBusMasterCommonBuffer,
|
||||||
Buffer,
|
Buffer,
|
||||||
&Bytes,
|
&Bytes,
|
||||||
&(EFI_PHYSICAL_ADDRESS)AhciRegisters->AhciCommandTablePciAddr,
|
(EFI_PHYSICAL_ADDRESS *)&AhciRegisters->AhciCommandTablePciAddr,
|
||||||
&AhciRegisters->MapCommandTable
|
&AhciRegisters->MapCommandTable
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -1709,7 +1710,7 @@ AhciCreateTransferDescriptor (
|
||||||
goto Error2;
|
goto Error2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((!Support64Bit) && ((EFI_PHYSICAL_ADDRESS)AhciRegisters->AhciCommandTablePciAddr > 0x100000000UL)) {
|
if ((!Support64Bit) && ((EFI_PHYSICAL_ADDRESS)(UINTN)AhciRegisters->AhciCommandTablePciAddr > 0x100000000ULL)) {
|
||||||
//
|
//
|
||||||
// The AHCI HBA doesn't support 64bit addressing, so should not get a >4G pci bus master address.
|
// The AHCI HBA doesn't support 64bit addressing, so should not get a >4G pci bus master address.
|
||||||
//
|
//
|
||||||
|
@ -1819,7 +1820,7 @@ AhciModeInitialization (
|
||||||
// Get the number of command slots per port supported by this HBA.
|
// Get the number of command slots per port supported by this HBA.
|
||||||
//
|
//
|
||||||
MaxCommandSlotNumber = (UINT8) (((Capability & 0x1F00) >> 8) + 1);
|
MaxCommandSlotNumber = (UINT8) (((Capability & 0x1F00) >> 8) + 1);
|
||||||
Support64Bit = ((Capability & BIT31) != 0) ? TRUE : FALSE;
|
Support64Bit = (BOOLEAN) (((Capability & BIT31) != 0) ? TRUE : FALSE);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Get the bit map of those ports exposed by this HBA.
|
// Get the bit map of those ports exposed by this HBA.
|
||||||
|
@ -1942,7 +1943,7 @@ AhciModeInitialization (
|
||||||
} else {
|
} else {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEBUG ((EFI_D_INFO, "port [%d] port mulitplier [%d] has a [%a]\n",
|
DEBUG ((EFI_D_INFO, "port [%d] port mulitplier [%d] has a [%a]\n",
|
||||||
Port, 0, DeviceType == EfiIdeCdrom ? "cdrom" : "harddisk"));
|
Port, 0, DeviceType == EfiIdeCdrom ? "cdrom" : "harddisk"));
|
||||||
|
|
||||||
|
@ -1991,7 +1992,7 @@ AhciModeInitialization (
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = AhciDeviceSetFeature (PciIo, AhciRegisters, Port, 0, 0x03, (UINT32)(*(UINT8 *)&TransferMode));
|
Status = AhciDeviceSetFeature (PciIo, AhciRegisters, Port, 0, 0x03, (UINT32)(*(UINT8 *)&TransferMode));
|
||||||
|
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
DEBUG ((EFI_D_ERROR, "Set transfer Mode Fail, Status = %r\n", Status));
|
DEBUG ((EFI_D_ERROR, "Set transfer Mode Fail, Status = %r\n", Status));
|
||||||
continue;
|
continue;
|
||||||
|
@ -2006,5 +2007,3 @@ AhciModeInitialization (
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -351,15 +351,15 @@ AhciStopCommand (
|
||||||
/**
|
/**
|
||||||
Start a non data transfer on specific port.
|
Start a non data transfer on specific port.
|
||||||
|
|
||||||
@param PciIo The PCI IO protocol instance.
|
@param PciIo The PCI IO protocol instance.
|
||||||
@param AhciRegisters The pointer to the EFI_AHCI_REGISTERS.
|
@param AhciRegisters The pointer to the EFI_AHCI_REGISTERS.
|
||||||
@param Port The number of port.
|
@param Port The number of port.
|
||||||
@param PortMultiplier The timeout value of stop.
|
@param PortMultiplier The timeout value of stop.
|
||||||
@param AtapiCommand The atapi command will be used for the transfer.
|
@param AtapiCommand The atapi command will be used for the transfer.
|
||||||
@param AtapiCommandLength The length of the atapi command.
|
@param AtapiCommandLength The length of the atapi command.
|
||||||
@param AtaCommandBlock The EFI_ATA_COMMAND_BLOCK data.
|
@param AtaCommandBlock The EFI_ATA_COMMAND_BLOCK data.
|
||||||
@param AtaStatusBlock The EFI_ATA_STATUS_BLOCK data.
|
@param AtaStatusBlock The EFI_ATA_STATUS_BLOCK data.
|
||||||
@param Timeout The timeout value of non data transfer.
|
@param Timeout The timeout value of non data transfer.
|
||||||
|
|
||||||
@retval EFI_DEVICE_ERROR The non data transfer abort with error occurs.
|
@retval EFI_DEVICE_ERROR The non data transfer abort with error occurs.
|
||||||
@retval EFI_TIMEOUT The operation is time out.
|
@retval EFI_TIMEOUT The operation is time out.
|
||||||
|
@ -384,23 +384,23 @@ AhciNonDataTransfer (
|
||||||
/**
|
/**
|
||||||
Start a DMA data transfer on specific port
|
Start a DMA data transfer on specific port
|
||||||
|
|
||||||
@param PciIo The PCI IO protocol instance.
|
@param PciIo The PCI IO protocol instance.
|
||||||
@param AhciRegisters The pointer to the EFI_AHCI_REGISTERS.
|
@param AhciRegisters The pointer to the EFI_AHCI_REGISTERS.
|
||||||
@param Port The number of port.
|
@param Port The number of port.
|
||||||
@param PortMultiplier The timeout value of stop.
|
@param PortMultiplier The timeout value of stop.
|
||||||
@param AtapiCommand The atapi command will be used for the transfer.
|
@param AtapiCommand The atapi command will be used for the transfer.
|
||||||
@param AtapiCommandLength The length of the atapi command.
|
@param AtapiCommandLength The length of the atapi command.
|
||||||
@param Read The transfer direction.
|
@param Read The transfer direction.
|
||||||
@param AtaCommandBlock The EFI_ATA_COMMAND_BLOCK data.
|
@param AtaCommandBlock The EFI_ATA_COMMAND_BLOCK data.
|
||||||
@param AtaStatusBlock The EFI_ATA_STATUS_BLOCK data.
|
@param AtaStatusBlock The EFI_ATA_STATUS_BLOCK data.
|
||||||
@param MemoryAddr The pointer to the data buffer.
|
@param MemoryAddr The pointer to the data buffer.
|
||||||
@param DataCount The data count to be transferred.
|
@param DataCount The data count to be transferred.
|
||||||
@param Timeout The timeout value of non data transfer.
|
@param Timeout The timeout value of non data transfer.
|
||||||
|
|
||||||
@retval EFI_DEVICE_ERROR The DMA data transfer abort with error occurs.
|
@retval EFI_DEVICE_ERROR The DMA data transfer abort with error occurs.
|
||||||
@retval EFI_TIMEOUT The operation is time out.
|
@retval EFI_TIMEOUT The operation is time out.
|
||||||
@retval EFI_UNSUPPORTED The device is not ready for transfer.
|
@retval EFI_UNSUPPORTED The device is not ready for transfer.
|
||||||
@retval EFI_SUCCESS The DMA data transfer executes successfully.
|
@retval EFI_SUCCESS The DMA data transfer executes successfully.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
|
@ -423,11 +423,11 @@ AhciDmaTransfer (
|
||||||
/**
|
/**
|
||||||
Start a PIO data transfer on specific port.
|
Start a PIO data transfer on specific port.
|
||||||
|
|
||||||
@param PciIo The PCI IO protocol instance.
|
@param PciIo The PCI IO protocol instance.
|
||||||
@param AhciRegisters The pointer to the EFI_AHCI_REGISTERS.
|
@param AhciRegisters The pointer to the EFI_AHCI_REGISTERS.
|
||||||
@param Port The number of port.
|
@param Port The number of port.
|
||||||
@param PortMultiplier The timeout value of stop.
|
@param PortMultiplier The timeout value of stop.
|
||||||
@param AtapiCommand The atapi command will be used for the transfer.
|
@param AtapiCommand The atapi command will be used for the transfer.
|
||||||
@param AtapiCommandLength The length of the atapi command.
|
@param AtapiCommandLength The length of the atapi command.
|
||||||
@param Read The transfer direction.
|
@param Read The transfer direction.
|
||||||
@param AtaCommandBlock The EFI_ATA_COMMAND_BLOCK data.
|
@param AtaCommandBlock The EFI_ATA_COMMAND_BLOCK data.
|
||||||
|
|
|
@ -303,23 +303,8 @@ AtaAtapiPassThruSupported (
|
||||||
PciData.Hdr.ClassCode
|
PciData.Hdr.ClassCode
|
||||||
);
|
);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
gBS->CloseProtocol (
|
|
||||||
Controller,
|
|
||||||
&gEfiPciIoProtocolGuid,
|
|
||||||
This->DriverBindingHandle,
|
|
||||||
Controller
|
|
||||||
);
|
|
||||||
return EFI_UNSUPPORTED;
|
return EFI_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
//
|
|
||||||
// Close PciIo protocol as we have gotten the PciData.
|
|
||||||
//
|
|
||||||
gBS->CloseProtocol (
|
|
||||||
Controller,
|
|
||||||
&gEfiPciIoProtocolGuid,
|
|
||||||
This->DriverBindingHandle,
|
|
||||||
Controller
|
|
||||||
);
|
|
||||||
|
|
||||||
if (IS_PCI_IDE (&PciData) || IS_PCI_SATADPA (&PciData)) {
|
if (IS_PCI_IDE (&PciData) || IS_PCI_SATADPA (&PciData)) {
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
|
@ -625,7 +610,7 @@ AtaAtapiPassThruStop (
|
||||||
);
|
);
|
||||||
PciIo->FreeBuffer (
|
PciIo->FreeBuffer (
|
||||||
PciIo,
|
PciIo,
|
||||||
EFI_SIZE_TO_PAGES (AhciRegisters->MaxCommandTableSize),
|
(UINTN) EFI_SIZE_TO_PAGES (AhciRegisters->MaxCommandTableSize),
|
||||||
AhciRegisters->AhciCommandTable
|
AhciRegisters->AhciCommandTable
|
||||||
);
|
);
|
||||||
PciIo->Unmap (
|
PciIo->Unmap (
|
||||||
|
@ -634,7 +619,7 @@ AtaAtapiPassThruStop (
|
||||||
);
|
);
|
||||||
PciIo->FreeBuffer (
|
PciIo->FreeBuffer (
|
||||||
PciIo,
|
PciIo,
|
||||||
EFI_SIZE_TO_PAGES (AhciRegisters->MaxCommandListSize),
|
(UINTN) EFI_SIZE_TO_PAGES (AhciRegisters->MaxCommandListSize),
|
||||||
AhciRegisters->AhciCmdList
|
AhciRegisters->AhciCmdList
|
||||||
);
|
);
|
||||||
PciIo->Unmap (
|
PciIo->Unmap (
|
||||||
|
@ -643,7 +628,7 @@ AtaAtapiPassThruStop (
|
||||||
);
|
);
|
||||||
PciIo->FreeBuffer (
|
PciIo->FreeBuffer (
|
||||||
PciIo,
|
PciIo,
|
||||||
EFI_SIZE_TO_PAGES (AhciRegisters->MaxReceiveFisSize),
|
(UINTN) EFI_SIZE_TO_PAGES (AhciRegisters->MaxReceiveFisSize),
|
||||||
AhciRegisters->AhciRFis
|
AhciRegisters->AhciRFis
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -960,7 +960,7 @@ GetIdeRegisterIoAddr (
|
||||||
IdeRegisters[EfiIdeSecondary].Head = (UINT16) (CommandBlockBaseAddr + 0x06);
|
IdeRegisters[EfiIdeSecondary].Head = (UINT16) (CommandBlockBaseAddr + 0x06);
|
||||||
IdeRegisters[EfiIdeSecondary].CmdOrStatus = (UINT16) (CommandBlockBaseAddr + 0x07);
|
IdeRegisters[EfiIdeSecondary].CmdOrStatus = (UINT16) (CommandBlockBaseAddr + 0x07);
|
||||||
IdeRegisters[EfiIdeSecondary].AltOrDev = ControlBlockBaseAddr;
|
IdeRegisters[EfiIdeSecondary].AltOrDev = ControlBlockBaseAddr;
|
||||||
IdeRegisters[EfiIdeSecondary].BusMasterBaseAddr = BusMasterBaseAddr + 0x8;
|
IdeRegisters[EfiIdeSecondary].BusMasterBaseAddr = (UINT16) (BusMasterBaseAddr + 0x8);
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -1411,7 +1411,7 @@ AtaUdmaInOut (
|
||||||
AllocateAnyPages,
|
AllocateAnyPages,
|
||||||
EfiBootServicesData,
|
EfiBootServicesData,
|
||||||
PageCount,
|
PageCount,
|
||||||
&PrdBaseAddr,
|
(VOID **)&PrdBaseAddr,
|
||||||
0
|
0
|
||||||
);
|
);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
|
@ -1503,9 +1503,9 @@ AtaUdmaInOut (
|
||||||
DeviceControl = 0;
|
DeviceControl = 0;
|
||||||
IdeWritePortB (PciIo, IdeRegisters->AltOrDev, DeviceControl);
|
IdeWritePortB (PciIo, IdeRegisters->AltOrDev, DeviceControl);
|
||||||
|
|
||||||
IoPortForBmic = IdeRegisters->BusMasterBaseAddr + BMIC_OFFSET;
|
IoPortForBmic = (UINT16) (IdeRegisters->BusMasterBaseAddr + BMIC_OFFSET);
|
||||||
IoPortForBmis = IdeRegisters->BusMasterBaseAddr + BMIS_OFFSET;
|
IoPortForBmis = (UINT16) (IdeRegisters->BusMasterBaseAddr + BMIS_OFFSET);
|
||||||
IoPortForBmid = IdeRegisters->BusMasterBaseAddr + BMID_OFFSET;
|
IoPortForBmid = (UINT16) (IdeRegisters->BusMasterBaseAddr + BMID_OFFSET);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Read BMIS register and clear ERROR and INTR bit
|
// Read BMIS register and clear ERROR and INTR bit
|
||||||
|
@ -1715,8 +1715,7 @@ AtaPacketReadWrite (
|
||||||
//
|
//
|
||||||
Status = DRQReady2 (PciIo, IdeRegisters, Timeout);
|
Status = DRQReady2 (PciIo, IdeRegisters, Timeout);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
CheckStatusRegister (PciIo, IdeRegisters);
|
return CheckStatusRegister (PciIo, IdeRegisters);
|
||||||
return EFI_DEVICE_ERROR;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -1890,7 +1889,7 @@ AtaPacketCommandExecute (
|
||||||
//
|
//
|
||||||
AtaCommandBlock.AtaCylinderLow = (UINT8) (ATAPI_MAX_BYTE_COUNT & 0x00ff);
|
AtaCommandBlock.AtaCylinderLow = (UINT8) (ATAPI_MAX_BYTE_COUNT & 0x00ff);
|
||||||
AtaCommandBlock.AtaCylinderHigh = (UINT8) (ATAPI_MAX_BYTE_COUNT >> 8);
|
AtaCommandBlock.AtaCylinderHigh = (UINT8) (ATAPI_MAX_BYTE_COUNT >> 8);
|
||||||
AtaCommandBlock.AtaDeviceHead = Device << 0x4;
|
AtaCommandBlock.AtaDeviceHead = (UINT8) (Device << 0x4);
|
||||||
AtaCommandBlock.AtaCommand = ATA_CMD_PACKET;
|
AtaCommandBlock.AtaCommand = ATA_CMD_PACKET;
|
||||||
|
|
||||||
IdeWritePortB (PciIo, IdeRegisters->Head, (UINT8)(0xe0 | (Device << 0x4)));
|
IdeWritePortB (PciIo, IdeRegisters->Head, (UINT8)(0xe0 | (Device << 0x4)));
|
||||||
|
@ -2247,7 +2246,7 @@ DetectAndConfigIdeDevice (
|
||||||
UINT8 LBAMidReg;
|
UINT8 LBAMidReg;
|
||||||
UINT8 LBAHighReg;
|
UINT8 LBAHighReg;
|
||||||
EFI_ATA_DEVICE_TYPE DeviceType;
|
EFI_ATA_DEVICE_TYPE DeviceType;
|
||||||
EFI_IDE_DEVICE IdeDevice;
|
UINT8 IdeDevice;
|
||||||
EFI_IDE_REGISTERS *IdeRegisters;
|
EFI_IDE_REGISTERS *IdeRegisters;
|
||||||
EFI_IDENTIFY_DATA Buffer;
|
EFI_IDENTIFY_DATA Buffer;
|
||||||
|
|
||||||
|
@ -2409,7 +2408,7 @@ DetectAndConfigIdeDevice (
|
||||||
// Init driver parameters
|
// Init driver parameters
|
||||||
//
|
//
|
||||||
DriveParameters.Sector = (UINT8) ((ATA5_IDENTIFY_DATA *)(&Buffer.AtaData))->sectors_per_track;
|
DriveParameters.Sector = (UINT8) ((ATA5_IDENTIFY_DATA *)(&Buffer.AtaData))->sectors_per_track;
|
||||||
DriveParameters.Heads = (UINT8) ((ATA5_IDENTIFY_DATA *)(&Buffer.AtaData))->heads - 1;
|
DriveParameters.Heads = (UINT8) (((ATA5_IDENTIFY_DATA *)(&Buffer.AtaData))->heads - 1);
|
||||||
DriveParameters.MultipleSector = (UINT8) ((ATA5_IDENTIFY_DATA *)(&Buffer.AtaData))->multi_sector_cmd_max_sct_cnt;
|
DriveParameters.MultipleSector = (UINT8) ((ATA5_IDENTIFY_DATA *)(&Buffer.AtaData))->multi_sector_cmd_max_sct_cnt;
|
||||||
|
|
||||||
Status = SetDriveParameters (Instance, IdeChannel, IdeDevice, &DriveParameters, NULL);
|
Status = SetDriveParameters (Instance, IdeChannel, IdeDevice, &DriveParameters, NULL);
|
||||||
|
|
Loading…
Reference in New Issue