hc
2024-03-22 f63cd4c03ea42695d5f9b0e1798edd196923aae6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/** @file
 
  Multiple APIC Description Table (MADT)
 
  Copyright (c) 2017, Linaro Ltd. All rights reserved.<BR>
  Copyright (C) 2018, Marvell International Ltd. and its affiliates.<BR>
 
  SPDX-License-Identifier: BSD-2-Clause-Patent
 
**/
 
#include <Library/AcpiLib.h>
 
#include "AcpiHeader.h"
 
// active low, level triggered
#define GTDT_GTIMER_FLAGS  EFI_ACPI_6_0_GTDT_TIMER_FLAG_ALWAYS_ON_CAPABILITY
 
// active high, level triggered
#define GTDT_WDG_FLAGS     0x0
 
#pragma pack(1)
typedef struct {
  EFI_ACPI_6_0_GENERIC_TIMER_DESCRIPTION_TABLE        Header;
  EFI_ACPI_6_0_GTDT_SBSA_GENERIC_WATCHDOG_STRUCTURE   SbsaWatchdog;
} ACPI_6_0_GTDT_STRUCTURE;
#pragma pack()
 
ACPI_6_0_GTDT_STRUCTURE Gtdt = {
  {
    __ACPI_HEADER (EFI_ACPI_6_0_GENERIC_TIMER_DESCRIPTION_TABLE_SIGNATURE,
                   ACPI_6_0_GTDT_STRUCTURE,
                   EFI_ACPI_6_0_GENERIC_TIMER_DESCRIPTION_TABLE_REVISION),
    0xFFFFFFFFFFFFFFFF,                             // UINT64  PhysicalAddress
    0,                                              // UINT32  Reserved
    FixedPcdGet32 (PcdArmArchTimerSecIntrNum),      // UINT32  SecureEL1TimerGSIV
    GTDT_GTIMER_FLAGS,                              // UINT32  SecureEL1TimerFlags
    FixedPcdGet32 (PcdArmArchTimerIntrNum),         // UINT32  NonSecureEL1TimerGSIV
    GTDT_GTIMER_FLAGS,                              // UINT32  NonSecureEL1TimerFlags
    FixedPcdGet32 (PcdArmArchTimerVirtIntrNum),     // UINT32  VirtualTimerGSIV
    GTDT_GTIMER_FLAGS,                              // UINT32  VirtualTimerFlags
    FixedPcdGet32 (PcdArmArchTimerHypIntrNum),      // UINT32  NonSecureEL2TimerGSIV
    GTDT_GTIMER_FLAGS,                              // UINT32  NonSecureEL2TimerFlags
    0xFFFFFFFFFFFFFFFF,                             // UINT64  CntReadBaseAddress
    0x1,                                            // UINT32  PlatformTimerCount
    sizeof (Gtdt.Header)                            // UINT32  PlatformTimerOffset
  }, {
    EFI_ACPI_6_0_GTDT_SBSA_GENERIC_WATCHDOG,        // UINT8   Type
    sizeof (Gtdt.SbsaWatchdog),                     // UINT16  Length
    0x0,                                            // UINT8   Reserved
    FixedPcdGet64 (PcdGenericWatchdogRefreshBase),  // UINT64  RefreshFramePhysicalAddress
    FixedPcdGet64 (PcdGenericWatchdogControlBase),  // UINT64  WatchdogControlFramePhysicalAddress
    FixedPcdGet32 (PcdGenericWatchdogEl2IntrNum),   // UINT32  WatchdogTimerGSIV
    GTDT_WDG_FLAGS                                  // UINT32  WatchdogTimerFlags
  },
};
 
VOID CONST * CONST ReferenceAcpiTable = &Gtdt;