summaryrefslogtreecommitdiff
path: root/Silicon/Hisilicon/Hi1616/D05AcpiTables/MadtHi1616.aslc
blob: 169ee72430e9be800fd77f3038745e89abf99c82 (plain)
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
/** @file
*  Multiple APIC Description Table (MADT)
*
*  Copyright (c) 2012 - 2014, ARM Limited. All rights reserved.
*  Copyright (c) 2015 - 2016, Hisilicon Limited. All rights reserved.
*  Copyright (c) 2015 - 2016, Linaro Limited. All rights reserved.
*
*  This program and the accompanying materials
*
*  This program and the accompanying materials
*  are licensed and made available under the terms and conditions of the BSD License
*  which accompanies this distribution.  The full text of the license may be found at
*  http://opensource.org/licenses/bsd-license.php
*
*  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
*  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
*
*  Based on the files under ArmPlatformPkg/ArmJunoPkg/AcpiTables/
*
**/


#include <IndustryStandard/Acpi.h>
#include <Library/AcpiLib.h>
#include <Library/AcpiNextLib.h>
#include <Library/ArmLib.h>
#include <Library/PcdLib.h>
#include "Hi1616Platform.h"

// Differs from Juno, we have another affinity level beyond cluster and core
// 0x20000 is only for socket 0
#define PLATFORM_GET_MPID_TA(ClusterId, CoreId)   (0x10000 | ((ClusterId) << 8) | (CoreId))
#define PLATFORM_GET_MPID_TB(ClusterId, CoreId)   (0x30000 | ((ClusterId) << 8) | (CoreId))
#define PLATFORM_GET_MPID_TA_2(ClusterId, CoreId)   (0x50000 | ((ClusterId) << 8) | (CoreId))
#define PLATFORM_GET_MPID_TB_2(ClusterId, CoreId)   (0x70000 | ((ClusterId) << 8) | (CoreId))

//
// Multiple APIC Description Table
//
#pragma pack (1)

typedef struct {
  EFI_ACPI_6_1_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER   Header;
  EFI_ACPI_6_1_GIC_STRUCTURE                            GicInterfaces[64];
  EFI_ACPI_6_1_GIC_DISTRIBUTOR_STRUCTURE                GicDistributor;
  EFI_ACPI_6_1_GIC_ITS_STRUCTURE                      GicITS[8];
} EFI_ACPI_6_1_MULTIPLE_APIC_DESCRIPTION_TABLE;

#pragma pack ()

EFI_ACPI_6_1_MULTIPLE_APIC_DESCRIPTION_TABLE Madt = {
  {
    ARM_ACPI_HEADER (
      EFI_ACPI_6_1_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE,
      EFI_ACPI_6_1_MULTIPLE_APIC_DESCRIPTION_TABLE,
      EFI_ACPI_6_1_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION
    ),
    //
    // MADT specific fields
    //
    0, // LocalApicAddress
    0, // Flags
  },
  {
    // Format: EFI_ACPI_6_1_GICC_STRUCTURE_INIT(GicId, AcpiCpuUid, Flags, PmuIrq, GicBase, GicVBase, GicHBase,
    //                                          GsivId, GicRBase, Mpidr)
    // Note: The GIC Structure of the primary CPU must be the first entry (see note in 5.2.12.14 GICC Structure of
    //       ACPI v6.1).
    //       The cores from a same cluster are kept together. It is not an ACPI requirement but in case the OSPM uses
    //       the ACPI ARM Parking protocol, it might want to wake up the cores in the order of this table.
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        0, 0, PLATFORM_GET_MPID_TA(0, 0),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4D000000 + 0x100000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        1, 1, PLATFORM_GET_MPID_TA(0, 1),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4D000000 + 0x140000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        2, 2, PLATFORM_GET_MPID_TA(0, 2),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4D000000 + 0x180000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        3, 3, PLATFORM_GET_MPID_TA(0, 3),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4D000000 + 0x1C0000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        4, 4, PLATFORM_GET_MPID_TA(1, 0), EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4D000000 + 0x200000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        5, 5, PLATFORM_GET_MPID_TA(1, 1),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4D000000 + 0x240000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        6, 6, PLATFORM_GET_MPID_TA(1, 2),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4D000000 + 0x280000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        7, 7, PLATFORM_GET_MPID_TA(1, 3),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4D000000 + 0x2C0000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        8, 8, PLATFORM_GET_MPID_TA(2, 0),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4D000000 + 0x300000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        9, 9, PLATFORM_GET_MPID_TA(2, 1),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4D000000 + 0x340000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        10, 10, PLATFORM_GET_MPID_TA(2, 2),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4D000000 + 0x380000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        11, 11, PLATFORM_GET_MPID_TA(2, 3),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4D000000 + 0x3C0000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        12, 12, PLATFORM_GET_MPID_TA(3, 0), EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4D000000 + 0x400000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        13, 13, PLATFORM_GET_MPID_TA(3, 1),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4D000000 + 0x440000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        14, 14, PLATFORM_GET_MPID_TA(3, 2),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4D000000 + 0x480000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        15, 15, PLATFORM_GET_MPID_TA(3, 3),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4D000000 + 0x4C0000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        16, 16, PLATFORM_GET_MPID_TB(0, 0),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4D000000 + 0x20000000 + 0x100000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        17, 17, PLATFORM_GET_MPID_TB(0, 1),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4D000000 + 0x20000000 + 0x140000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        18, 18, PLATFORM_GET_MPID_TB(0, 2),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4D000000 + 0x20000000 + 0x180000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        19, 19, PLATFORM_GET_MPID_TB(0, 3),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4D000000 + 0x20000000 + 0x1C0000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        20, 20, PLATFORM_GET_MPID_TB(1, 0), EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4D000000 + 0x20000000 + 0x200000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        21, 21, PLATFORM_GET_MPID_TB(1, 1),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4D000000 + 0x20000000 + 0x240000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        22, 22, PLATFORM_GET_MPID_TB(1, 2),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4D000000  + 0x20000000 + 0x280000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        23, 23, PLATFORM_GET_MPID_TB(1, 3),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4D000000  + 0x20000000 + 0x2C0000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        24, 24, PLATFORM_GET_MPID_TB(2, 0),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4D000000  + 0x20000000 + 0x300000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        25, 25, PLATFORM_GET_MPID_TB(2, 1),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4D000000  + 0x20000000 + 0x340000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        26, 26, PLATFORM_GET_MPID_TB(2, 2),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4D000000  + 0x20000000 + 0x380000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        27, 27, PLATFORM_GET_MPID_TB(2, 3),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4D000000  + 0x20000000 + 0x3C0000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        28, 28, PLATFORM_GET_MPID_TB(3, 0), EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4D000000  + 0x20000000 + 0x400000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        29, 29, PLATFORM_GET_MPID_TB(3, 1),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4D000000  + 0x20000000 + 0x440000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        30, 30, PLATFORM_GET_MPID_TB(3, 2),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4D000000  + 0x20000000 + 0x480000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        31, 31, PLATFORM_GET_MPID_TB(3, 3),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4D000000  + 0x20000000 + 0x4C0000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        32, 32, PLATFORM_GET_MPID_TA_2(0, 0),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4004D000000 + 0x100000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        33, 33, PLATFORM_GET_MPID_TA_2(0, 1),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4004D000000 + 0x140000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        34, 34, PLATFORM_GET_MPID_TA_2(0, 2),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4004D000000 + 0x180000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        35, 35, PLATFORM_GET_MPID_TA_2(0, 3),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4004D000000 + 0x1C0000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        36, 36, PLATFORM_GET_MPID_TA_2(1, 0), EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4004D000000 + 0x200000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        37, 37, PLATFORM_GET_MPID_TA_2(1, 1),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4004D000000 + 0x240000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        38, 38, PLATFORM_GET_MPID_TA_2(1, 2),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4004D000000 + 0x280000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        39, 39, PLATFORM_GET_MPID_TA_2(1, 3),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4004D000000 + 0x2C0000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        40, 40, PLATFORM_GET_MPID_TA_2(2, 0),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4004D000000 + 0x300000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        41, 41, PLATFORM_GET_MPID_TA_2(2, 1),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4004D000000 + 0x340000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        42, 42, PLATFORM_GET_MPID_TA_2(2, 2),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4004D000000 + 0x380000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        43, 43, PLATFORM_GET_MPID_TA_2(2, 3),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4004D000000 + 0x3C0000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        44, 44, PLATFORM_GET_MPID_TA_2(3, 0), EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4004D000000 + 0x400000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        45, 45, PLATFORM_GET_MPID_TA_2(3, 1),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4004D000000 + 0x440000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        46, 46, PLATFORM_GET_MPID_TA_2(3, 2),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4004D000000 + 0x480000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        47, 47, PLATFORM_GET_MPID_TA_2(3, 3),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4004D000000 + 0x4C0000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        48, 48, PLATFORM_GET_MPID_TB_2(0, 0),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4004D000000 + 0x20000000 + 0x100000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        49, 49, PLATFORM_GET_MPID_TB_2(0, 1),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4004D000000 + 0x20000000 + 0x140000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        50, 50, PLATFORM_GET_MPID_TB_2(0, 2),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4004D000000 + 0x20000000 + 0x180000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        51, 51, PLATFORM_GET_MPID_TB_2(0, 3),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4004D000000 + 0x20000000 + 0x1C0000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        52, 52, PLATFORM_GET_MPID_TB_2(1, 0), EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4004D000000 + 0x20000000 + 0x200000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        53, 53, PLATFORM_GET_MPID_TB_2(1, 1),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4004D000000 + 0x20000000 + 0x240000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        54, 54, PLATFORM_GET_MPID_TB_2(1, 2),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4004D000000  + 0x20000000 + 0x280000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        55, 55, PLATFORM_GET_MPID_TB_2(1, 3),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4004D000000  + 0x20000000 + 0x2C0000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        56, 56, PLATFORM_GET_MPID_TB_2(2, 0),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4004D000000  + 0x20000000 + 0x300000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        57, 57, PLATFORM_GET_MPID_TB_2(2, 1),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4004D000000  + 0x20000000 + 0x340000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        58, 58, PLATFORM_GET_MPID_TB_2(2, 2),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4004D000000  + 0x20000000 + 0x380000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        59, 59, PLATFORM_GET_MPID_TB_2(2, 3),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4004D000000  + 0x20000000 + 0x3C0000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        60, 60, PLATFORM_GET_MPID_TB_2(3, 0), EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4004D000000  + 0x20000000 + 0x400000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        61, 61, PLATFORM_GET_MPID_TB_2(3, 1),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4004D000000  + 0x20000000 + 0x440000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        62, 62, PLATFORM_GET_MPID_TB_2(3, 2),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4004D000000  + 0x20000000 + 0x480000 /* GicRBase */, 0),
    EFI_ACPI_6_1_GICC_STRUCTURE_INIT(
        63, 63, PLATFORM_GET_MPID_TB_2(3, 3),  EFI_ACPI_6_1_GIC_ENABLED, 23, FixedPcdGet32 (PcdGicInterruptInterfaceBase),
        FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x20000, FixedPcdGet32 (PcdGicInterruptInterfaceBase) + 0x10000, 25, 0x4004D000000  + 0x20000000 + 0x4C0000 /* GicRBase */, 0),
  },

  EFI_ACPI_6_1_GIC_DISTRIBUTOR_INIT(0, 0x4D000000, 0, 0x4),
  {
    EFI_ACPI_6_1_GIC_ITS_INIT(0,0x4C000000), //peri a
    EFI_ACPI_6_1_GIC_ITS_INIT(1,0x6C000000), //peri b
    EFI_ACPI_6_1_GIC_ITS_INIT(2,0xC6000000), //dsa a
    EFI_ACPI_6_1_GIC_ITS_INIT(3,0x8C6000000), //dsa b
    EFI_ACPI_6_1_GIC_ITS_INIT(4,0x4004C000000), //P1 peri a
    EFI_ACPI_6_1_GIC_ITS_INIT(5,0x4006C000000), //P1 peri b
    EFI_ACPI_6_1_GIC_ITS_INIT(6,0x400C6000000), //P1 dsa a
    EFI_ACPI_6_1_GIC_ITS_INIT(7,0x408C6000000), //P1 dsa b
  }
};

//
// Reference the table being generated to prevent the optimizer from removing the
// data structure from the executable
//
VOID* CONST ReferenceAcpiTable = &Madt;