/**\r
Wait for memory set to the test value.\r
\r
- @param PciIo The PCI IO protocol instance.\r
- @param Offset The memory address to test.\r
- @param MaskValue The mask value of memory.\r
- @param TestValue The test value of memory.\r
- @param Timeout The time out value for wait memory set.\r
+ @param PciIo The PCI IO protocol instance.\r
+ @param Offset The memory address to test.\r
+ @param MaskValue The mask value of memory.\r
+ @param TestValue The test value of memory.\r
+ @param Timeout The time out value for wait memory set.\r
\r
@retval EFI_DEVICE_ERROR The memory is not set.\r
@retval EFI_TIMEOUT The memory setting is time out.\r
Check if the device is still on port. It also checks if the AHCI controller \r
supports the address and data count will be transfered.\r
\r
- @param PciIo The PCI IO protocol instance.\r
- @param Port The number of port.\r
+ @param PciIo The PCI IO protocol instance.\r
+ @param Port The number of port.\r
\r
@retval EFI_SUCCESS The device is attached to port and the transfer data is \r
supported by AHCI controller.\r
/**\r
Build the command list, command table and prepare the fis receiver.\r
\r
- @param PciIo The PCI IO protocol instance.\r
+ @param PciIo The PCI IO protocol instance.\r
@param AhciRegisters The pointer to the EFI_AHCI_REGISTERS.\r
- @param Port The number of port.\r
- @param PortMultiplier The timeout value of stop.\r
- @param CommandFis The control fis will be used for the transfer.\r
- @param CommandList The command list will be used for the transfer.\r
- @param AtapiCommand The atapi command will be used for the transfer.\r
- @param AtapiCommandLength The length of the atapi command.\r
- @param CommandSlotNumber The command slot will be used for the transfer.\r
+ @param Port The number of port.\r
+ @param PortMultiplier The timeout value of stop.\r
+ @param CommandFis The control fis will be used for the transfer.\r
+ @param CommandList The command list will be used for the transfer.\r
+ @param AtapiCommand The atapi command will be used for the transfer.\r
+ @param AtapiCommandLength The length of the atapi command.\r
+ @param CommandSlotNumber The command slot will be used for the transfer.\r
@param DataPhysicalAddr The pointer to the data buffer pci bus master address.\r
@param DataLength The data count to be transferred.\r
\r
/**\r
Buid a command FIS.\r
\r
- @param CmdFis A pointer to the EFI_AHCI_COMMAND_FIS data structure.\r
+ @param CmdFis A pointer to the EFI_AHCI_COMMAND_FIS data structure.\r
@param AtaCommandBlock A pointer to the AhciBuildCommandFis data structure.\r
\r
**/\r
CmdFis->AhciCFisSecCount = AtaCommandBlock->AtaSectorCount;\r
CmdFis->AhciCFisSecCountExp = AtaCommandBlock->AtaSectorCountExp;\r
\r
- CmdFis->AhciCFisDevHead = AtaCommandBlock->AtaDeviceHead | 0xE0;\r
+ CmdFis->AhciCFisDevHead = (UINT8) (AtaCommandBlock->AtaDeviceHead | 0xE0);\r
}\r
\r
/**\r
Start a PIO data transfer on specific port.\r
\r
- @param PciIo The PCI IO protocol instance.\r
+ @param PciIo The PCI IO protocol instance.\r
@param AhciRegisters The pointer to the EFI_AHCI_REGISTERS.\r
- @param Port The number of port.\r
- @param PortMultiplier The timeout value of stop.\r
- @param AtapiCommand The atapi command will be used for the transfer.\r
+ @param Port The number of port.\r
+ @param PortMultiplier The timeout value of stop.\r
+ @param AtapiCommand The atapi command will be used for the transfer.\r
@param AtapiCommandLength The length of the atapi command.\r
@param Read The transfer direction.\r
@param AtaCommandBlock The EFI_ATA_COMMAND_BLOCK data.\r
\r
**/\r
EFI_STATUS\r
+EFIAPI\r
AhciPioTransfer (\r
IN EFI_PCI_IO_PROTOCOL *PciIo,\r
IN EFI_AHCI_REGISTERS *AhciRegisters,\r
/**\r
Start a DMA data transfer on specific port\r
\r
- @param PciIo The PCI IO protocol instance.\r
- @param AhciRegisters The pointer to the EFI_AHCI_REGISTERS.\r
- @param Port The number of port.\r
+ @param PciIo The PCI IO protocol instance.\r
+ @param AhciRegisters The pointer to the EFI_AHCI_REGISTERS.\r
+ @param Port The number of port.\r
@param PortMultiplier The timeout value of stop.\r
@param AtapiCommand The atapi command will be used for the transfer.\r
- @param AtapiCommandLength The length of the atapi command.\r
- @param Read The transfer direction.\r
- @param AtaCommandBlock The EFI_ATA_COMMAND_BLOCK data.\r
- @param AtaStatusBlock The EFI_ATA_STATUS_BLOCK data.\r
- @param MemoryAddr The pointer to the data buffer.\r
- @param DataCount The data count to be transferred.\r
- @param Timeout The timeout value of non data transfer.\r
-\r
- @retval EFI_DEVICE_ERROR The DMA data transfer abort with error occurs.\r
- @retval EFI_TIMEOUT The operation is time out.\r
- @retval EFI_UNSUPPORTED The device is not ready for transfer.\r
- @retval EFI_SUCCESS The DMA data transfer executes successfully.\r
+ @param AtapiCommandLength The length of the atapi command.\r
+ @param Read The transfer direction.\r
+ @param AtaCommandBlock The EFI_ATA_COMMAND_BLOCK data.\r
+ @param AtaStatusBlock The EFI_ATA_STATUS_BLOCK data.\r
+ @param MemoryAddr The pointer to the data buffer.\r
+ @param DataCount The data count to be transferred.\r
+ @param Timeout The timeout value of non data transfer.\r
+\r
+ @retval EFI_DEVICE_ERROR The DMA data transfer abort with error occurs.\r
+ @retval EFI_TIMEOUT The operation is time out.\r
+ @retval EFI_UNSUPPORTED The device is not ready for transfer.\r
+ @retval EFI_SUCCESS The DMA data transfer executes successfully.\r
\r
**/\r
EFI_STATUS\r
/**\r
Start a non data transfer on specific port.\r
\r
- @param PciIo The PCI IO protocol instance.\r
- @param AhciRegisters The pointer to the EFI_AHCI_REGISTERS.\r
- @param Port The number of port.\r
+ @param PciIo The PCI IO protocol instance.\r
+ @param AhciRegisters The pointer to the EFI_AHCI_REGISTERS.\r
+ @param Port The number of port.\r
@param PortMultiplier The timeout value of stop.\r
- @param AtapiCommand The atapi command will be used for the transfer.\r
- @param AtapiCommandLength The length of the atapi command.\r
- @param AtaCommandBlock The EFI_ATA_COMMAND_BLOCK data.\r
- @param AtaStatusBlock The EFI_ATA_STATUS_BLOCK data.\r
- @param Timeout The timeout value of non data transfer.\r
+ @param AtapiCommand The atapi command will be used for the transfer.\r
+ @param AtapiCommandLength The length of the atapi command.\r
+ @param AtaCommandBlock The EFI_ATA_COMMAND_BLOCK data.\r
+ @param AtaStatusBlock The EFI_ATA_STATUS_BLOCK data.\r
+ @param Timeout The timeout value of non data transfer.\r
\r
@retval EFI_DEVICE_ERROR The non data transfer abort with error occurs.\r
@retval EFI_TIMEOUT The operation is time out.\r
/**\r
Send Buffer cmd to specific device.\r
\r
- @param PciIo The PCI IO protocol instance.\r
- @param AhciRegisters The pointer to the EFI_AHCI_REGISTERS.\r
- @param Port The number of port.\r
+ @param PciIo The PCI IO protocol instance.\r
+ @param AhciRegisters The pointer to the EFI_AHCI_REGISTERS.\r
+ @param Port The number of port.\r
@param PortMultiplier The timeout value of stop.\r
- @param Buffer The data buffer to store IDENTIFY PACKET data.\r
+ @param Buffer The data buffer to store IDENTIFY PACKET data.\r
\r
@retval EFI_DEVICE_ERROR The cmd abort with error occurs.\r
@retval EFI_TIMEOUT The operation is time out.\r
/**\r
Send Buffer cmd to specific device.\r
\r
- @param PciIo The PCI IO protocol instance.\r
- @param AhciRegisters The pointer to the EFI_AHCI_REGISTERS.\r
- @param Port The number of port.\r
+ @param PciIo The PCI IO protocol instance.\r
+ @param AhciRegisters The pointer to the EFI_AHCI_REGISTERS.\r
+ @param Port The number of port.\r
@param PortMultiplier The timeout value of stop.\r
- @param Buffer The data buffer to store IDENTIFY PACKET data.\r
+ @param Buffer The data buffer to store IDENTIFY PACKET data.\r
\r
@retval EFI_DEVICE_ERROR The cmd abort with error occurs.\r
@retval EFI_TIMEOUT The operation is time out.\r
/**\r
Send SET FEATURE cmd on specific device.\r
\r
- @param PciIo The PCI IO protocol instance.\r
- @param AhciRegisters The pointer to the EFI_AHCI_REGISTERS.\r
- @param Port The number of port.\r
+ @param PciIo The PCI IO protocol instance.\r
+ @param AhciRegisters The pointer to the EFI_AHCI_REGISTERS.\r
+ @param Port The number of port.\r
@param PortMultiplier The timeout value of stop.\r
- @param Feature The data to send Feature register.\r
- @param FeatureSpecificData The specific data for SET FEATURE cmd.\r
+ @param Feature The data to send Feature register.\r
+ @param FeatureSpecificData The specific data for SET FEATURE cmd.\r
\r
@retval EFI_DEVICE_ERROR The cmd abort with error occurs.\r
@retval EFI_TIMEOUT The operation is time out.\r
// Get the number of command slots per port supported by this HBA.\r
//\r
MaxCommandSlotNumber = (UINT8) (((Capability & 0x1F00) >> 8) + 1);\r
- Support64Bit = ((Capability & BIT31) != 0) ? TRUE : FALSE;\r
+ Support64Bit = (BOOLEAN) (((Capability & BIT31) != 0) ? TRUE : FALSE);\r
\r
MaxReceiveFisSize = MaxPortNumber * sizeof (EFI_AHCI_RECEIVED_FIS);\r
Status = PciIo->AllocateBuffer (\r
EfiPciIoOperationBusMasterCommonBuffer,\r
Buffer,\r
&Bytes,\r
- &(EFI_PHYSICAL_ADDRESS)AhciRegisters->AhciRFisPciAddr,\r
+ (EFI_PHYSICAL_ADDRESS *) &AhciRegisters->AhciRFisPciAddr,\r
&AhciRegisters->MapRFis\r
);\r
\r
goto Error6;\r
}\r
\r
- if ((!Support64Bit) && ((EFI_PHYSICAL_ADDRESS)AhciRegisters->AhciRFisPciAddr > 0x100000000UL)) {\r
+ if ((!Support64Bit) && ((EFI_PHYSICAL_ADDRESS)(UINTN)AhciRegisters->AhciRFisPciAddr > 0x100000000ULL)) {\r
//\r
// The AHCI HBA doesn't support 64bit addressing, so should not get a >4G pci bus master address.\r
//\r
EfiPciIoOperationBusMasterCommonBuffer,\r
Buffer,\r
&Bytes,\r
- &(EFI_PHYSICAL_ADDRESS)AhciRegisters->AhciCmdListPciAddr,\r
+ (EFI_PHYSICAL_ADDRESS *)&AhciRegisters->AhciCmdListPciAddr,\r
&AhciRegisters->MapCmdList\r
);\r
\r
goto Error4;\r
}\r
\r
- if ((!Support64Bit) && ((EFI_PHYSICAL_ADDRESS)AhciRegisters->AhciCmdListPciAddr > 0x100000000UL)) {\r
+ if ((!Support64Bit) && ((EFI_PHYSICAL_ADDRESS)(UINTN)AhciRegisters->AhciCmdListPciAddr > 0x100000000ULL)) {\r
//\r
// The AHCI HBA doesn't support 64bit addressing, so should not get a >4G pci bus master address.\r
//\r
EfiPciIoOperationBusMasterCommonBuffer,\r
Buffer,\r
&Bytes,\r
- &(EFI_PHYSICAL_ADDRESS)AhciRegisters->AhciCommandTablePciAddr,\r
+ (EFI_PHYSICAL_ADDRESS *)&AhciRegisters->AhciCommandTablePciAddr,\r
&AhciRegisters->MapCommandTable\r
);\r
\r
goto Error2;\r
}\r
\r
- if ((!Support64Bit) && ((EFI_PHYSICAL_ADDRESS)AhciRegisters->AhciCommandTablePciAddr > 0x100000000UL)) {\r
+ if ((!Support64Bit) && ((EFI_PHYSICAL_ADDRESS)(UINTN)AhciRegisters->AhciCommandTablePciAddr > 0x100000000ULL)) {\r
//\r
// The AHCI HBA doesn't support 64bit addressing, so should not get a >4G pci bus master address.\r
//\r
// Get the number of command slots per port supported by this HBA.\r
//\r
MaxCommandSlotNumber = (UINT8) (((Capability & 0x1F00) >> 8) + 1);\r
- Support64Bit = ((Capability & BIT31) != 0) ? TRUE : FALSE;\r
+ Support64Bit = (BOOLEAN) (((Capability & BIT31) != 0) ? TRUE : FALSE);\r
\r
//\r
// Get the bit map of those ports exposed by this HBA.\r
} else {\r
continue;\r
}\r
- \r
+\r
DEBUG ((EFI_D_INFO, "port [%d] port mulitplier [%d] has a [%a]\n", \r
Port, 0, DeviceType == EfiIdeCdrom ? "cdrom" : "harddisk"));\r
\r
}\r
\r
Status = AhciDeviceSetFeature (PciIo, AhciRegisters, Port, 0, 0x03, (UINT32)(*(UINT8 *)&TransferMode));\r
- \r
+\r
if (EFI_ERROR (Status)) {\r
DEBUG ((EFI_D_ERROR, "Set transfer Mode Fail, Status = %r\n", Status));\r
continue;\r
return EFI_SUCCESS;\r
}\r
\r
-\r
-\r