/*----------------------------------------------------------------------------------------*/ VOID STATIC PcieClkPmEnableOnDevice ( IN PCI_ADDR Device, IN AMD_CONFIG_PARAMS *StdHeader ) { UINT8 MaxFunc; UINT8 CurrentFunc; AGESA_STATUS AgesaStatus; AgesaStatus = AGESA_UNSUPPORTED; if (PcieClkPmCheckDeviceCapability (Device, StdHeader)) { MaxFunc = GnbLibPciIsMultiFunctionDevice (Device.AddressValue, StdHeader) ? 7 : 0; for (CurrentFunc = 0; CurrentFunc <= MaxFunc; CurrentFunc++) { Device.Address.Function = CurrentFunc; if (GnbLibPciIsDevicePresent (Device.AddressValue, StdHeader)) { AgesaStatus = AgesaGnbOemCallout (StdHeader, AGESA_GNB_PCIE_CLK_REQ, &Device); if (AgesaStatus == AGESA_SUCCESS) { IDS_HDT_CONSOLE (GNB_TRACE, " Enable Clock Power Managment for Device = %d:%d:%d\n", Device.Address.Bus, Device.Address.Device, Device.Address.Function ); PcieClkPmEnableOnFunction (Device, StdHeader); } } } } }
/*----------------------------------------------------------------------------------------*/ STATIC BOOLEAN PcieClkPmCheckDeviceCapability ( IN PCI_ADDR Device, IN AMD_CONFIG_PARAMS *StdHeader ) { UINT8 MaxFunc; UINT8 CurrentFunc; UINT8 PcieCapPtr; UINT32 Value; MaxFunc = GnbLibPciIsMultiFunctionDevice (Device.AddressValue, StdHeader) ? 7 : 0; for (CurrentFunc = 0; CurrentFunc <= MaxFunc; CurrentFunc++) { Device.Address.Function = CurrentFunc; if (GnbLibPciIsDevicePresent (Device.AddressValue, StdHeader)) { PcieCapPtr = GnbLibFindPciCapability (Device.AddressValue, PCIE_CAP_ID, StdHeader); if (PcieCapPtr == 0) { return FALSE; } GnbLibPciRead ( Device.AddressValue | (PcieCapPtr + PCIE_LINK_CAP_REGISTER), AccessWidth32, &Value, StdHeader ); if ((Value & BIT18) == 0) { return FALSE; } } } return TRUE; }
STATIC VOID excel950_fun5 ( IN PCI_ADDR Device, IN PCIE_ASPM_TYPE Aspm, IN AMD_CONFIG_PARAMS *StdHeader ) { UINT8 MaxFunc; UINT8 CurrentFunc; MaxFunc = GnbLibPciIsMultiFunctionDevice (Device.AddressValue, StdHeader) ? 7 : 0; for (CurrentFunc = 0; CurrentFunc <= MaxFunc; CurrentFunc++) { Device.Address.Function = CurrentFunc; if (GnbLibPciIsDevicePresent (Device.AddressValue, StdHeader)) { excel950_fun4 (Device, Aspm, StdHeader); } } }
/*----------------------------------------------------------------------------------------*/ VOID PcieProgramCommClkCfgOnDevice ( IN PCI_ADDR Device, IN AMD_CONFIG_PARAMS *StdHeader ) { UINT8 MaxFunc; UINT8 CurrentFunc; MaxFunc = GnbLibPciIsMultiFunctionDevice (Device.AddressValue, StdHeader) ? 7 : 0; for (CurrentFunc = 0; CurrentFunc <= MaxFunc; CurrentFunc++) { Device.Address.Function = CurrentFunc; if (GnbLibPciIsDevicePresent (Device.AddressValue, StdHeader)) { PcieProgramCommClkCfgOnFunction (Device, StdHeader); } } }
/*----------------------------------------------------------------------------------------*/ STATIC VOID PcieClkPmEnableOnDevice ( IN PCI_ADDR Device, IN AMD_CONFIG_PARAMS *StdHeader ) { UINT8 MaxFunc; UINT8 CurrentFunc; if (PcieClkPmCheckDeviceCapability (Device, StdHeader)) { MaxFunc = GnbLibPciIsMultiFunctionDevice (Device.AddressValue, StdHeader) ? 7 : 0; for (CurrentFunc = 0; CurrentFunc <= MaxFunc; CurrentFunc++) { Device.Address.Function = CurrentFunc; if (GnbLibPciIsDevicePresent (Device.AddressValue, StdHeader)) { IDS_HDT_CONSOLE (GNB_TRACE, " Enable Clock Power Managment for Device = %d:%d:%d\n", Device.Address.Bus, Device.Address.Device, Device.Address.Function ); PcieClkPmEnableOnFunction (Device, StdHeader); } } } }