Esempio n. 1
0
/**
 *  Enable Application Power Management (APM)
 *
 * @param[in]    EntryPoint         Timepoint designator.
 * @param[in]    PlatformConfig     Contains the runtime modifiable feature input data.
 * @param[in]    StdHeader          Config Handle for library, services.
 *
 * @retval       AGESA_SUCCESS      Always succeeds.
 *
 */
AGESA_STATUS
InitializeApmFeature (
  IN       UINT64                 EntryPoint,
  IN       PLATFORM_CONFIGURATION *PlatformConfig,
  IN       AMD_CONFIG_PARAMS      *StdHeader
  )
{
  APM_FAMILY_SERVICES *FamilyServices;

  IDS_HDT_CONSOLE (CPU_TRACE, "    APM mode is enabled\n");

  GetFeatureServicesOfCurrentCore (&ApmFamilyServiceTable, (CONST VOID **)&FamilyServices, StdHeader);

  if ((EntryPoint & CPU_FEAT_AFTER_POST_MTRR_SYNC) != 0) {
    FamilyServices->ProgramApmWeights (FamilyServices, StdHeader);
  } else if ((EntryPoint & CPU_FEAT_AFTER_RESUME_MTRR_SYNC) != 0) {
    if (!CheckPspPlatformSecureEnable ()) {
      FamilyServices->ProgramApmWeights (FamilyServices, StdHeader);
    }
  } else {
  FamilyServices->EnableApm (FamilyServices, StdHeader);
  }

  return AGESA_SUCCESS;
}
Esempio n. 2
0
/**
 *  Should Application Power Management (APM) be enabled
 *
 * @param[in]    PlatformConfig     Contains the runtime modifiable feature input data.
 * @param[in]    StdHeader          Config Handle for library, services.
 *
 * @retval       TRUE               APM is supported.
 * @retval       FALSE              APM cannot be enabled.
 *
 */
BOOLEAN
STATIC
IsApmFeatureEnabled (
  IN       PLATFORM_CONFIGURATION *PlatformConfig,
  IN       AMD_CONFIG_PARAMS      *StdHeader
  )
{
  UINT32              Socket;
  BOOLEAN             IsEnabled;
  APM_FAMILY_SERVICES *FamilyServices;

  IsEnabled = FALSE;

  for (Socket = 0; Socket < GetPlatformNumberOfSockets (); Socket++) {
    if (IsProcessorPresent (Socket, StdHeader)) {
      GetFeatureServicesOfSocket (&ApmFamilyServiceTable, Socket, (CONST VOID **)&FamilyServices, StdHeader);
      if (FamilyServices != NULL) {
        if (FamilyServices->IsApmSupported (FamilyServices, PlatformConfig, Socket, StdHeader)) {
          IsEnabled = TRUE;
          break;
        }
      }
    }
  }
  return IsEnabled;
}
Esempio n. 3
0
/**
 *  AP task to enable APM
 *
 * @param[in]    StdHeader          Config Handle for library, services.
 *
 */
VOID
EnableApmOnSocket (
  IN       AMD_CONFIG_PARAMS *StdHeader
  )
{
  APM_FAMILY_SERVICES *FamilyServices;

  GetFeatureServicesOfCurrentCore (&ApmFamilyServiceTable, (CONST VOID **)&FamilyServices, StdHeader);
  FamilyServices->EnableApmOnSocket (FamilyServices,
                                     StdHeader);
}
Esempio n. 4
0
/**
 *  Should Application Power Management (APM) be enabled
 *
 * @param[in]    PlatformConfig     Contains the runtime modifiable feature input data.
 * @param[in]    StdHeader          Config Handle for library, services.
 *
 * @retval       TRUE               APM is supported.
 * @retval       FALSE              APM cannot be enabled.
 *
 */
BOOLEAN
IsApmFeatureEnabled (
  IN       PLATFORM_CONFIGURATION *PlatformConfig,
  IN       AMD_CONFIG_PARAMS      *StdHeader
  )
{
  BOOLEAN             IsEnabled;
  APM_FAMILY_SERVICES *FamilyServices;

  IsEnabled = FALSE;

  GetFeatureServicesOfCurrentCore (&ApmFamilyServiceTable, (CONST VOID **)&FamilyServices, StdHeader);
  if (FamilyServices != NULL) {
    if (FamilyServices->IsApmSupported (FamilyServices, PlatformConfig, StdHeader)) {
      IsEnabled = TRUE;
    }
  }

  return IsEnabled;
}