From b7c51c9cf4864df6aabb99a1ae843becd577237c Mon Sep 17 00:00:00 2001 From: raywu Date: Fri, 15 Jun 2018 00:00:50 +0800 Subject: init. 1AQQW051 --- Board/EM/IdeBusBoard/IdeBusBoard.c | 664 +++++++++++++++++++++++++++++++++++ Board/EM/IdeBusBoard/IdeBusBoard.cif | 11 + 2 files changed, 675 insertions(+) create mode 100644 Board/EM/IdeBusBoard/IdeBusBoard.c create mode 100644 Board/EM/IdeBusBoard/IdeBusBoard.cif (limited to 'Board/EM/IdeBusBoard') diff --git a/Board/EM/IdeBusBoard/IdeBusBoard.c b/Board/EM/IdeBusBoard/IdeBusBoard.c new file mode 100644 index 0000000..b21bc57 --- /dev/null +++ b/Board/EM/IdeBusBoard/IdeBusBoard.c @@ -0,0 +1,664 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2010, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//************************************************************************* +// $Header: /Alaska/BIN/Core/Modules/IdeBus/IdeBusBoard.c 2 9/27/11 2:50a Rajeshms $ +// +// $Revision: 2 $ +// +// $Date: 9/27/11 2:50a $ +//************************************************************************* +// Revision History +// ---------------- +// $Log: /Alaska/BIN/Core/Modules/IdeBus/IdeBusBoard.c $ +// +// 2 9/27/11 2:50a Rajeshms +// [TAG] EIP69295 +// [Category] Improvement +// [Description] The Timeout values used by IDE and AHCI drivers are +// made as SDL tokens, so that the timeout values can be varied. +// [Files] IdeBusBoard.c, CORE_DXE.sdl, AhciSmm.h, AhciBus.h, IDESMM.h, +// Ata.c, Atapi.c, IdeBus.c, IdeBus.h, IdeBusMaster.c, IdeBusBoard.h +// +// 1 8/25/10 5:37a Rameshr +// New Feature: EIP 37748 +// Description: Move all the IDEBus Source driver SDL token into IdeBus +// Bin Driver. +// FilesModified: Ata.c, Atapi.c, idebus.c, IdeBus.h, +// IdebuscomponentName.c, IdeBusmaster.c IdeBusSrc.mak IdebusSrc.sdl +// IdeHpa.c, IdePowerManagement.c +// +// +// +//************************************************************************* +// +// +// Name: IdeBusBoard.c +// +// Description: Installs PlatformIdeProtocol Interface and Initializes it. +// +// +//************************************************************************* + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +EFI_GUID PlatformIdeProtocolGuid = PLATFORM_IDE_PROTOCOL_GUID; + +PLATFORM_IDE_PROTOCOL PlatformIdeProtocol= { + +// +//---------------------------------------------------------------------------- +// Name: Revision +// +// Description: Variable contains the Revision of PLATFORM_IDE_PROTOCOL. +// +// Notes: UINT8 +// +//---------------------------------------------------------------------------- +// +PLATFORM_IDE_PROTOCOL_REVISION, + +// +//---------------------------------------------------------------------------- +// Name: MasterSlaveEnumeration +// +// Description: Variable to replace MASTER_SLAVE_ENUMERATION token. +// +// Notes: BOOLEAN +// +//---------------------------------------------------------------------------- +// +#ifdef MASTER_SLAVE_ENUMERATION + MASTER_SLAVE_ENUMERATION +#else + 0 +#endif + , +// +//---------------------------------------------------------------------------- +// Name: IdeBusMasterSupport +// +// Description: Variable to replace IDEBUSMASTER_SUPPORT token. +// +// Notes: BOOLEAN +// +//---------------------------------------------------------------------------- +// + +#ifdef IDEBUSMASTER_SUPPORT + IDEBUSMASTER_SUPPORT +#else + 0 +#endif + , + +// +//---------------------------------------------------------------------------- +// Name: AtapiBusMasterSupport +// +// Description: Variable to replace ATAPI_BUSMASTER_SUPPORT token. +// +// Notes: BOOLEAN +// +//---------------------------------------------------------------------------- +// + +#ifdef ATAPI_BUSMASTER_SUPPORT + ATAPI_BUSMASTER_SUPPORT +#else + 0 +#endif + , + +// +//---------------------------------------------------------------------------- +// Name: AcousticManagementSupport +// +// Description: Variable to replace ACOUSTIC_MANAGEMENT_SUPPORT token. +// +// Notes: BOOLEAN +// +//---------------------------------------------------------------------------- +// + +#ifdef ACOUSTIC_MANAGEMENT_SUPPORT + ACOUSTIC_MANAGEMENT_SUPPORT +#else + 0 +#endif + , + +// +//---------------------------------------------------------------------------- +// Name: IdePowerManagementSupport +// +// Description: Variable to replace IDE_POWER_MANAGEMENT_SUPPORT token. +// +// Notes: BOOLEAN +// +//---------------------------------------------------------------------------- +// + +#ifdef IDE_POWER_MANAGEMENT_SUPPORT + IDE_POWER_MANAGEMENT_SUPPORT +#else + 0 +#endif + , + +// +//---------------------------------------------------------------------------- +// Name: StandbyTimeout +// +// Description: Variable to replace STANDBY_TIMEOUT token. +// +// Notes: INT16 +// +//---------------------------------------------------------------------------- +// + +#ifdef STANDBY_TIMEOUT + STANDBY_TIMEOUT +#else + 0 +#endif + , + +// +//---------------------------------------------------------------------------- +// Name: AdvPowerManagementSupport +// +// Description: Variable to replace ADVANCED_POWER_MANAGEMENT_SUPPORT token. +// +// Notes: BOOLEAN +// +//---------------------------------------------------------------------------- +// + +#ifdef ADVANCED_POWER_MANAGEMENT_SUPPORT + ADVANCED_POWER_MANAGEMENT_SUPPORT +#else + 0 +#endif + , + +// +//---------------------------------------------------------------------------- +// Name: AdvPowerManagementLevel +// +// Description: Variable to replace ADVANCED_POWER_MANAGEMENT_LEVEL token. +// +// Notes: UINT8 +// +//---------------------------------------------------------------------------- +// + +#ifdef ADVANCED_POWER_MANAGEMENT_LEVEL + ADVANCED_POWER_MANAGEMENT_LEVEL +#else + 0 +#endif + , + +// +//---------------------------------------------------------------------------- +// Name: PowerupInStandbySupport +// +// Description: Variable to replace POWERUP_IN_STANDBY_SUPPORT token. +// +// Notes: BOOLEAN +// +//---------------------------------------------------------------------------- +// + +#ifdef POWERUP_IN_STANDBY_SUPPORT + POWERUP_IN_STANDBY_SUPPORT +#else + 0 +#endif + , + +// +//---------------------------------------------------------------------------- +// Name: PowerupInStandbyMode +// +// Description: Variable to replace POWERUP_IN_STANDBY_MODE token. +// +// Notes: BOOLEAN +// +//---------------------------------------------------------------------------- +// + +#ifdef POWERUP_IN_STANDBY_MODE + POWERUP_IN_STANDBY_MODE +#else + 0 +#endif + , + +// +//---------------------------------------------------------------------------- +// Name: IdePwrManagementInterfaceSupport +// +// Description: Variable to replace IDE_POWER_MANAGEMENT_INTERFACE_SUPPORT token. +// +// Notes: BOOLEAN +// +//---------------------------------------------------------------------------- +// + +#ifdef IDE_POWER_MANAGEMENT_INTERFACE_SUPPORT + IDE_POWER_MANAGEMENT_INTERFACE_SUPPORT +#else + 0 +#endif + , + +// +//---------------------------------------------------------------------------- +// Name: HostProtectedAreaSupport +// +// Description: Variable to replace HOST_PROTECTED_AREA_SUPPORT token. +// +// Notes: BOOLEAN +// +//---------------------------------------------------------------------------- +// + +#ifdef HOST_PROTECTED_AREA_SUPPORT + HOST_PROTECTED_AREA_SUPPORT +#else + 0 +#endif + , + +// +//---------------------------------------------------------------------------- +// Name: IdeHPSupport +// +// Description: Variable to replace IDE_HP_SUPPORT token. +// +// Notes: BOOLEAN +// +//---------------------------------------------------------------------------- +// + +#ifdef IDE_HP_SUPPORT + IDE_HP_SUPPORT +#else + 0 +#endif + , + +// +//---------------------------------------------------------------------------- +// Name: EfiIdeProtocol +// +// Description: Variable to replace EFI_IDE_PROTOCOL token. +// +// Notes: BOOLEAN +// +//---------------------------------------------------------------------------- +// + +#ifdef EFI_IDE_PROTOCOL + EFI_IDE_PROTOCOL +#else + 0 +#endif + , + +// +//---------------------------------------------------------------------------- +// Name: AhciCompatibleMode +// +// Description: Variable to replace AHCI_COMPATIBLE_MODE token. +// +// Notes: BOOLEAN +// +//---------------------------------------------------------------------------- +// + +#ifdef AHCI_COMPATIBLE_MODE + AHCI_COMPATIBLE_MODE +#else + 0 +#endif + , +// +//---------------------------------------------------------------------------- +// Name: SBIdeSupport +// +// Description: Variable to replace SBIDE_SUPPORT token. +// +// Notes: const BOOLEAN +// +//---------------------------------------------------------------------------- +// + +#ifdef SBIDE_SUPPORT + SBIDE_SUPPORT +#else + 0 +#endif + , + +// +//---------------------------------------------------------------------------- +// Name: HddPowerLossInS3 +// +// Description: Variable to replace HDD_POWER_LOSS_IN_S3 token. +// +// Notes: const BOOLEAN +// +//---------------------------------------------------------------------------- +// + +#ifdef HDD_POWER_LOSS_IN_S3 + HDD_POWER_LOSS_IN_S3 +#else + 0 +#endif + , + +// +//---------------------------------------------------------------------------- +// Name: DiPMSupport +// +// Description: Variable to replace DiPM_SUPPORT token. +// +// Notes: BOOLEAN +// +//---------------------------------------------------------------------------- +// + +#ifdef DiPM_SUPPORT + DiPM_SUPPORT +#else + 0 +#endif + , + +// +//---------------------------------------------------------------------------- +// Name: DisableSoftSetPrev +// +// Description: Variable to replace DISABLE_SOFT_SET_PREV token. +// +// Notes: BOOLEAN +// +//---------------------------------------------------------------------------- +// + +#ifdef DISABLE_SOFT_SET_PREV + DISABLE_SOFT_SET_PREV +#else + 0 +#endif + , + +// +//---------------------------------------------------------------------------- +// Name: ForceHddPasswordPrompt +// +// Description: Variable to replace FORCE_HDD_PASSWORD_PROMPT token. +// +// Notes: BOOLEAN +// +//---------------------------------------------------------------------------- +// + +#ifdef FORCE_HDD_PASSWORD_PROMPT + FORCE_HDD_PASSWORD_PROMPT +#else + 0 +#endif + , + +// +//---------------------------------------------------------------------------- +// Name: gIdeControllerProtocolGuid +// +// Description: Variable contains Ide Controller Protocol GUID. +// +// Notes: const EFI_GUID +// +//---------------------------------------------------------------------------- +// + +#if defined EFI_IDE_PROTOCOL && EFI_IDE_PROTOCOL == 1 + EFI_IDE_CONTROLLER_INIT_PROTOCOL_GUID +#else + IDE_CONTROLLER_PROTOCOL_GUID +#endif + , + +// +//---------------------------------------------------------------------------- +// Name: gComponentNameProtocolGuid +// +// Description: Variable contains Component Name Protocol GUID. +// +// Notes: const EFI_GUID +// +//---------------------------------------------------------------------------- +// + +#ifdef EFI_COMPONENT_NAME2_PROTOCOL_GUID + EFI_COMPONENT_NAME2_PROTOCOL_GUID +#else + EFI_COMPONENT_NAME_PROTOCOL_GUID +#endif + , + +// +//---------------------------------------------------------------------------- +// Name: S3BusyClearTimeout +// +// Description: Variable to replace S3_BUSY_CLEAR_TIMEOUT token. +// +// Notes: const EFI_GUID +// +//---------------------------------------------------------------------------- +// + +#ifdef S3_BUSY_CLEAR_TIMEOUT + S3_BUSY_CLEAR_TIMEOUT +#else + 10000 +#endif + , + +// +//---------------------------------------------------------------------------- +// Name: DmaAtaCompleteCommandTimeout +// +// Description: Variable to replace DMA_ATA_COMMAND_COMPLETE_TIMEOUT token. +// +// Notes: const EFI_GUID +// +//---------------------------------------------------------------------------- +// + +#ifdef DMA_ATA_COMMAND_COMPLETE_TIMEOUT + DMA_ATA_COMMAND_COMPLETE_TIMEOUT +#else + 5000 +#endif + , + +// +//---------------------------------------------------------------------------- +// Name: DmaAtaPiCompleteCommandTimeout +// +// Description: Variable to replace DMA_ATAPI_COMMAND_COMPLETE_TIMEOUT token. +// +// Notes: const EFI_GUID +// +//---------------------------------------------------------------------------- +// + +#ifdef DMA_ATAPI_COMMAND_COMPLETE_TIMEOUT + DMA_ATAPI_COMMAND_COMPLETE_TIMEOUT +#else + 16000 +#endif + , + +// +//---------------------------------------------------------------------------- +// Name: AtaPiResetCommandTimeout +// +// Description: Variable to replace ATAPI_RESET_COMMAND_TIMEOUT token. +// +// Notes: const EFI_GUID +// +//---------------------------------------------------------------------------- +// + +#ifdef ATAPI_RESET_COMMAND_TIMEOUT + ATAPI_RESET_COMMAND_TIMEOUT +#else + 5000 +#endif + , + +// +//---------------------------------------------------------------------------- +// Name: AtaPiBusyClearTimeout +// +// Description: Variable to replace ATAPI_BUSY_CLEAR_TIMEOUT token. +// +// Notes: const EFI_GUID +// +//---------------------------------------------------------------------------- +// + +#ifdef ATAPI_BUSY_CLEAR_TIMEOUT + ATAPI_BUSY_CLEAR_TIMEOUT +#else + 16000 +#endif + , + +// +//---------------------------------------------------------------------------- +// Name: PoweonBusyClearTimeout +// +// Description: Variable to replace DMA_ATA_COMMAND_COMPLETE_TIMEOUT token. +// +// Notes: const EFI_GUID +// +//---------------------------------------------------------------------------- +// + +#ifdef POWERON_BUSY_CLEAR_TIMEOUT + POWERON_BUSY_CLEAR_TIMEOUT +#else + 10000 +#endif +}; + +// +//--------------------------------------------------------------------------- +// +// Procedure: IdeBusBoardEntryPoint +// +// Description: Installs PlatformIdeProtocol Interface +// +// Input: +// IN EFI_HANDLE ImageHandle, +// IN EFI_SYSTEM_TABLE *SystemTable +// +// Output: +// EFI_STATUS +// +// Modified: +// +// Referrals: InitAmiLib, InstallProtocolInterface +// +// Notes: +// Here is the control flow of this function: +// 1. Initialize Ami Lib. +// 2. Install PlatformIdeProtocol. +// 3. Return EFI_SUCCESS. +//--------------------------------------------------------------------------- +// + +EFI_STATUS +IdeBusBoardEntryPoint ( +IN EFI_HANDLE ImageHandle, +IN EFI_SYSTEM_TABLE *SystemTable ) +{ + EFI_STATUS Status; + InitAmiLib(ImageHandle,SystemTable); + Status = pBS->InstallProtocolInterface(\ + &ImageHandle,\ + &PlatformIdeProtocolGuid,\ + EFI_NATIVE_INTERFACE,\ + &PlatformIdeProtocol\ + ); + return Status; +} + +#ifndef EFI_COMPONENT_NAME2_PROTOCOL_GUID //old Core Support +//************************************************************************* +// +// +// Name: LanguageCodesEqual +// +// Description: +// BOOLEAN LanguageCodesEqual(CONST CHAR8* LangCode1, CONST CHAR8* LangCode2) +// compares two language codes and returns TRUE if they are equal. +// +// Input: +// CONST CHAR8* LangCode1 - first language code +// CONST CHAR8* LangCode2 - second language code +// +// Output: +// BOOLEAN TRUE - the language codes are equal +// FALSE - the language codes are not equal +// +// +//************************************************************************* +BOOLEAN LanguageCodesEqual( + CONST CHAR8* LangCode1, CONST CHAR8* LangCode2 +){ + return LangCode1[0]==LangCode2[0] + && LangCode1[1]==LangCode2[1] + && LangCode1[2]==LangCode2[2]; +} +#endif +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1985-2010, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* diff --git a/Board/EM/IdeBusBoard/IdeBusBoard.cif b/Board/EM/IdeBusBoard/IdeBusBoard.cif new file mode 100644 index 0000000..141029e --- /dev/null +++ b/Board/EM/IdeBusBoard/IdeBusBoard.cif @@ -0,0 +1,11 @@ + + name = "IdeBusBoard" + category = ModulePart + LocalRoot = "Board\EM\IdeBusBoard\" + RefName = "IdeBusBoard" +[files] +"IdeBusBoard.c" +[parts] +"IdeBusBoardProtocol" +"IdeBusBoardProtocol" + -- cgit v1.2.3