Gtdt.aslc 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /** @file
  2. * Generic Timer Description Table (GTDT)
  3. *
  4. * Copyright (c) 2018, Linaro Limited. All rights reserved.
  5. * Copyright (c) 2012 - 2016, ARM Limited. All rights reserved.
  6. *
  7. * SPDX-License-Identifier: BSD-2-Clause-Patent
  8. *
  9. **/
  10. #include <IndustryStandard/Acpi.h>
  11. #include <Library/AcpiLib.h>
  12. #include <Library/PcdLib.h>
  13. #include "AcpiTables.h"
  14. #define RPI_GTDT_GLOBAL_FLAGS 0
  15. #define RPI_GTDT_GTIMER_FLAGS EFI_ACPI_6_3_GTDT_TIMER_FLAG_TIMER_INTERRUPT_POLARITY
  16. #pragma pack (1)
  17. typedef struct {
  18. EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE Gtdt;
  19. } EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLES;
  20. #pragma pack ()
  21. EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLES Gtdt = {
  22. {
  23. ACPI_HEADER(
  24. EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE_SIGNATURE,
  25. EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLES,
  26. EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE_REVISION
  27. ),
  28. RPI_SYSTEM_TIMER_BASE_ADDRESS, // UINT64 PhysicalAddress
  29. 0, // UINT32 Reserved
  30. FixedPcdGet32 (PcdArmArchTimerSecIntrNum), // UINT32 SecurePL1TimerGSIV
  31. RPI_GTDT_GTIMER_FLAGS, // UINT32 SecurePL1TimerFlags
  32. FixedPcdGet32 (PcdArmArchTimerIntrNum), // UINT32 NonSecurePL1TimerGSIV
  33. RPI_GTDT_GTIMER_FLAGS, // UINT32 NonSecurePL1TimerFlags
  34. FixedPcdGet32 (PcdArmArchTimerVirtIntrNum), // UINT32 VirtualTimerGSIV
  35. RPI_GTDT_GTIMER_FLAGS, // UINT32 VirtualTimerFlags
  36. FixedPcdGet32 (PcdArmArchTimerHypIntrNum), // UINT32 NonSecurePL2TimerGSIV
  37. RPI_GTDT_GTIMER_FLAGS, // UINT32 NonSecurePL2TimerFlags
  38. 0xFFFFFFFFFFFFFFFF, // UINT64 CntReadBasePhysicalAddress
  39. 0, // UINT32 PlatformTimerCount
  40. 0 // UINT32 PlatfromTimerOffset
  41. },
  42. };
  43. //
  44. // Reference the table being generated to prevent the optimizer
  45. // from removing the data structure from the executable
  46. //
  47. VOID* CONST ReferenceAcpiTable = &Gtdt;