Beispiel #1
0
AGESA_STATUS agesawrapper_amdS3Save(void)
{
	AGESA_STATUS status;
	AMD_S3SAVE_PARAMS *AmdS3SaveParamsPtr;
	AMD_INTERFACE_PARAMS AmdInterfaceParams;

	memset(&AmdInterfaceParams, 0, sizeof(AMD_INTERFACE_PARAMS));

	AmdInterfaceParams.StdHeader.ImageBasePtr = 0;
	AmdInterfaceParams.StdHeader.HeapStatus = HEAP_SYSTEM_MEM;
	AmdInterfaceParams.StdHeader.CalloutPtr = &GetBiosCallout;
	AmdInterfaceParams.AllocationMethod = PostMemDram;
	AmdInterfaceParams.AgesaFunctionName = AMD_S3_SAVE;
	AmdInterfaceParams.StdHeader.AltImageBasePtr = 0;
	AmdInterfaceParams.StdHeader.Func = 0;
	AmdCreateStruct(&AmdInterfaceParams);

	AmdS3SaveParamsPtr = (AMD_S3SAVE_PARAMS *) AmdInterfaceParams.NewStructPtr;
	AmdS3SaveParamsPtr->StdHeader = AmdInterfaceParams.StdHeader;

	status = AmdS3Save(AmdS3SaveParamsPtr);
	AGESA_EVENTLOG(status, &AmdInterfaceParams.StdHeader);
	ASSERT(status == AGESA_SUCCESS);

	OemS3Save(AmdS3SaveParamsPtr);

	AmdReleaseStruct(&AmdInterfaceParams);

	return status;
}
Beispiel #2
0
AGESA_STATUS agesawrapper_amdS3Save(void)
{
	AGESA_STATUS Status;
	AMD_S3SAVE_PARAMS *AmdS3SaveParamsPtr;
	AMD_INTERFACE_PARAMS  AmdInterfaceParams;
	S3_DATA_TYPE          S3DataType;

	LibAmdMemFill (&AmdInterfaceParams,
		       0,
		       sizeof (AMD_INTERFACE_PARAMS),
		       &(AmdInterfaceParams.StdHeader));

	AmdInterfaceParams.StdHeader.ImageBasePtr = 0;
	AmdInterfaceParams.StdHeader.HeapStatus = HEAP_SYSTEM_MEM;
	AmdInterfaceParams.StdHeader.CalloutPtr = &GetBiosCallout;
	AmdInterfaceParams.AllocationMethod = PostMemDram;
	AmdInterfaceParams.AgesaFunctionName = AMD_S3_SAVE;
	AmdInterfaceParams.StdHeader.AltImageBasePtr = 0;
	AmdInterfaceParams.StdHeader.Func = 0;

	AmdCreateStruct(&AmdInterfaceParams);
	AmdS3SaveParamsPtr = (AMD_S3SAVE_PARAMS *)AmdInterfaceParams.NewStructPtr;
	AmdS3SaveParamsPtr->StdHeader = AmdInterfaceParams.StdHeader;

	Status = AmdS3Save(AmdS3SaveParamsPtr);
	if (Status != AGESA_SUCCESS) {
		agesawrapper_amdreadeventlog(AmdInterfaceParams.StdHeader.HeapStatus);
		ASSERT(Status == AGESA_SUCCESS);
	}

	S3DataType = S3DataTypeNonVolatile;
	printk(BIOS_DEBUG, "NvStorageSize=%x, NvStorage=%x\n",
	       (unsigned int)AmdS3SaveParamsPtr->S3DataBlock.NvStorageSize,
	       (unsigned int)AmdS3SaveParamsPtr->S3DataBlock.NvStorage);

	Status = OemAgesaSaveS3Info (
		S3DataType,
		AmdS3SaveParamsPtr->S3DataBlock.NvStorageSize,
		AmdS3SaveParamsPtr->S3DataBlock.NvStorage);

	printk(BIOS_DEBUG, "VolatileStorageSize=%x, VolatileStorage=%x\n",
	       (unsigned int)AmdS3SaveParamsPtr->S3DataBlock.VolatileStorageSize,
	       (unsigned int)AmdS3SaveParamsPtr->S3DataBlock.VolatileStorage);

	if (AmdS3SaveParamsPtr->S3DataBlock.VolatileStorageSize != 0) {
		S3DataType = S3DataTypeVolatile;

		Status = OemAgesaSaveS3Info (
			S3DataType,
			AmdS3SaveParamsPtr->S3DataBlock.VolatileStorageSize,
			AmdS3SaveParamsPtr->S3DataBlock.VolatileStorage);
	}
	OemAgesaSaveMtrr();

	AmdReleaseStruct (&AmdInterfaceParams);

	return Status;
}
Beispiel #3
0
VOID
EFIAPI
AgesaS3Save (
  IN EFI_EVENT        Event,
  IN VOID             *Context
  )
/*++

Routine Description:

  Installs the Smbios image to the System Table. This function gets called
  each time the EFI_EVENT_SIGNAL_READY_TO_BOOT gets signaled

Arguments & Return Values: Standard event handling function prototype

--*/
{
  EFI_STATUS            Status;
  AMD_INTERFACE_PARAMS  AmdInterfaceParams;
  AMD_S3SAVE_PARAMS     *AmdS3SaveParamsPtr;
  AGESA_STATUS          AgesaStatus;
  S3_DATA_TYPE          S3DataType;

  //
  // Prepare for S3Save
  //
  AmdInterfaceParams.StdHeader.ImageBasePtr = 0;
  AmdInterfaceParams.StdHeader.HeapStatus = HEAP_SYSTEM_MEM;
  AmdInterfaceParams.AllocationMethod = PostMemDram;
  AmdInterfaceParams.AgesaFunctionName = AMD_S3_SAVE;

  AgesaStatus = AmdCreateStruct (&AmdInterfaceParams);
  AmdS3SaveParamsPtr = (AMD_S3SAVE_PARAMS *)AmdInterfaceParams.NewStructPtr;
  AmdS3SaveParamsPtr->StdHeader = AmdInterfaceParams.StdHeader;
  //
  // OEM hook to customize any S3 Info required
  //
  OemCustomizeS3Save (gBS, AmdS3SaveParamsPtr);

  AgesaStatus = AmdS3Save (AmdS3SaveParamsPtr);

  if (AgesaStatus !=  AGESA_SUCCESS) {
    return;
  }

  if (AmdS3SaveParamsPtr->S3DataBlock.NvStorageSize != 0) {
    S3DataType = S3DataTypeNonVolatile;

    Status = OemAgesaSaveS3Info (
      S3DataType,
      AmdS3SaveParamsPtr->S3DataBlock.NvStorageSize,
      AmdS3SaveParamsPtr->S3DataBlock.NvStorage
      );
  }

  if (AmdS3SaveParamsPtr->S3DataBlock.VolatileStorageSize != 0) {
    S3DataType = S3DataTypeVolatile;

    Status = OemAgesaSaveS3Info (
      S3DataType,
      AmdS3SaveParamsPtr->S3DataBlock.VolatileStorageSize,
      AmdS3SaveParamsPtr->S3DataBlock.VolatileStorage
      );
  }
  //
  // Close this event to avoid any alternate run
  //
  gBS->CloseEvent (Event);
}