AcpiPlatform.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. /** @file
  2. This is an implementation of the ACPI platform driver. Requirements for
  3. this driver are defined in the Tiano ACPI External Product Specification,
  4. revision 0.3.6.
  5. Copyright (c) 2013-2015 Intel Corporation.
  6. SPDX-License-Identifier: BSD-2-Clause-Patent
  7. **/
  8. #ifndef _ACPI_PLATFORM_H_
  9. #define _ACPI_PLATFORM_H_
  10. //
  11. // Statements that include other header files
  12. //
  13. #include <PiDxe.h>
  14. #include <IntelQNCDxe.h>
  15. #include <Platform.h>
  16. #include <PlatformBoards.h>
  17. #include <Ioh.h>
  18. #include <QNCCommonDefinitions.h>
  19. #include <Protocol/GlobalNvsArea.h>
  20. #include <Protocol/MpService.h>
  21. #include <Protocol/AcpiSystemDescriptionTable.h>
  22. #include <Protocol/FirmwareVolume2.h>
  23. #include <Library/UefiDriverEntryPoint.h>
  24. #include <Library/UefiBootServicesTableLib.h>
  25. #include <Library/UefiRuntimeServicesTableLib.h>
  26. #include <Library/DebugLib.h>
  27. #include <Library/BaseMemoryLib.h>
  28. #include <Library/IoLib.h>
  29. #include <Library/PcdLib.h>
  30. #include <Library/UefiLib.h>
  31. #include <Library/DxeServicesLib.h>
  32. #include <Library/DevicePathLib.h>
  33. #include <Library/MemoryAllocationLib.h>
  34. #include <Library/QNCAccessLib.h>
  35. #include <Library/PlatformHelperLib.h>
  36. #include <IndustryStandard/Acpi.h>
  37. #include <IndustryStandard/HighPrecisionEventTimerTable.h>
  38. #include <IndustryStandard/MemoryMappedConfigurationSpaceAccessTable.h>
  39. #include "Madt.h"
  40. #include "AcpiPciUpdate.h"
  41. #pragma pack(1)
  42. typedef struct {
  43. UINT8 StartByte;
  44. UINT32 NameStr;
  45. UINT8 OpCode;
  46. UINT16 Size; // Hardcode to 16bit width because the table we use is fixed size
  47. UINT8 NumEntries;
  48. } EFI_ACPI_NAME_COMMAND;
  49. typedef struct {
  50. UINT8 PackageOp;
  51. UINT8 PkgLeadByte;
  52. UINT8 NumEntries;
  53. UINT8 DwordPrefix0;
  54. UINT32 CoreFreq;
  55. UINT8 DwordPrefix1;
  56. UINT32 Power;
  57. UINT8 DwordPrefix2;
  58. UINT32 TransLatency;
  59. UINT8 DwordPrefix3;
  60. UINT32 BMLatency;
  61. UINT8 DwordPrefix4;
  62. UINT32 Control;
  63. UINT8 DwordPrefix5;
  64. UINT32 Status;
  65. } EFI_PSS_PACKAGE;
  66. #pragma pack()
  67. #define AML_NAME_OP 0x08
  68. #define AML_METHOD_OP 0x14
  69. #define AML_OPREGION_OP 0x80
  70. #define AML_PACKAGE_OP 0x12 // Package operator.
  71. //
  72. // ACPI table information used to initialize tables.
  73. //
  74. #define EFI_ACPI_OEM_ID "INTEL "
  75. #define EFI_ACPI_OEM_TABLE_ID 0x2020204F4E414954ULL // "TIANO "
  76. #define EFI_ACPI_OEM_REVISION 0x00000002
  77. #define EFI_ACPI_CREATOR_ID 0x5446534D // "MSFT"
  78. #define EFI_ACPI_CREATOR_REVISION 0x01000013
  79. #define ACPI_COMPATIBLE_1_0 0
  80. #define ACPI_COMPATIBLE_2_0 1
  81. #define ACPI_COMPATIBLE_3_0 2
  82. //
  83. // Private Driver Data
  84. //
  85. //
  86. // Define Union of IO APIC & Local APIC structure;
  87. //
  88. typedef union {
  89. EFI_ACPI_2_0_PROCESSOR_LOCAL_APIC_STRUCTURE AcpiLocalApic;
  90. EFI_ACPI_2_0_IO_APIC_STRUCTURE AcpiIoApic;
  91. struct {
  92. UINT8 Type;
  93. UINT8 Length;
  94. } AcpiApicCommon;
  95. } ACPI_APIC_STRUCTURE_PTR;
  96. #endif