• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2016 Hisilicon Limited
3 *
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the BSD License which accompanies
6 * this distribution, and is available at
7 * http://opensource.org/licenses/bsd-license.php
8 *
9 */
10
11#include <IndustryStandard/Acpi.h>
12#include "Hi1616Platform.h"
13
14#define MCFG_VERSION  0x1
15
16#pragma pack(1)
17typedef struct
18{
19   UINT64 ullBaseAddress;
20   UINT16 usSegGroupNum;
21   UINT8  ucStartBusNum;
22   UINT8  ucEndBusNum;
23   UINT32 Reserved2;
24}EFI_MCFG_CONFIG_STRUCTURE;
25
26typedef struct
27{
28   EFI_ACPI_DESCRIPTION_HEADER Header;
29   UINT64 Reserved1;
30}EFI_MCFG_TABLE_CONFIG;
31
32typedef struct
33{
34   EFI_MCFG_TABLE_CONFIG Acpi_Table_Mcfg;
35   EFI_MCFG_CONFIG_STRUCTURE Config_Structure[8];
36}EFI_PCI_EXPRESS_MEMORY_MAPPED_CONFIGURATION_SPACE_TABLE;
37#pragma pack()
38
39EFI_PCI_EXPRESS_MEMORY_MAPPED_CONFIGURATION_SPACE_TABLE Mcfg=
40{
41  {
42      {
43        EFI_ACPI_6_0_PCI_EXPRESS_MEMORY_MAPPED_CONFIGURATION_SPACE_BASE_ADDRESS_DESCRIPTION_TABLE_SIGNATURE,
44        sizeof (EFI_PCI_EXPRESS_MEMORY_MAPPED_CONFIGURATION_SPACE_TABLE),
45        MCFG_VERSION,
46        0x00,                                                     // Checksum will be updated at runtime
47        {EFI_ACPI_ARM_OEM_ID},
48        EFI_ACPI_ARM_OEM_TABLE_ID,
49        EFI_ACPI_ARM_OEM_REVISION,
50        EFI_ACPI_ARM_CREATOR_ID,
51        EFI_ACPI_ARM_CREATOR_REVISION
52      },
53      0x0000000000000000,                                 //Reserved
54  },
55  {
56    //1p NA PCIe2
57    {
58      0xa0000000,                                         //Base Address
59      0x2,                                                //Segment Group Number
60      0x80,                                               //Start Bus Number
61      0x87,                                               //End Bus Number
62      0x00000000,                                         //Reserved
63    },
64    //1p NB PCIe0
65    {
66      0x8a0000000,                                        //Base Address
67      0x4,                                                //Segment Group Number
68      0x88,                                               //Start Bus Number
69      0x8f,                                               //End Bus Number
70      0x00000000,                                         //Reserved
71    },
72    //1p NB PCIe1
73    {
74      0x8b0000000,                                        //Base Address
75      0x5,                                                //Segment Group Number
76      0x0,                                                //Start Bus Number
77      0x7,                                                //End Bus Number
78      0x00000000,                                         //Reserved
79    },
80    //1p NB PCIe2
81    {
82      0x8a0000000,                                        //Base Address
83      0x6,                                                //Segment Group Number
84      0xc0,                                               //Start Bus Number
85      0xc7,                                               //End Bus Number
86      0x00000000,                                         //Reserved
87    },
88    //1p NB PCIe3
89    {
90      0x8b0000000,                                        //Base Address
91      0x7,                                                //Segment Group Number
92      0x90,                                               //Start Bus Number
93      0x97,                                               //End Bus Number
94      0x00000000,                                         //Reserved
95    },
96    //2P NA PCIe2
97    {
98      0x64000000000,                                      //Base Address
99      0xa,                                                //Segment Group Number
100      0x10,                                               //Start Bus Number
101      0x1f,                                               //End Bus Number
102      0x00000000,                                         //Reserved
103    },
104    //2P NB PCIe0
105    {
106      0x74000000000,                                      //Base Address
107      0xc,                                                //Segment Group Number
108      0x20,                                               //Start Bus Number
109      0x2f,                                               //End Bus Number
110      0x00000000,                                         //Reserved
111    },
112    //2P NB PCIe1
113    {
114      0x78000000000,                                      //Base Address
115      0xd,                                                //Segment Group Number
116      0x30,                                               //Start Bus Number
117      0x3f,                                               //End Bus Number
118      0x00000000,                                         //Reserved
119    },
120  }
121};
122
123//
124// Reference the table being generated to prevent the optimizer from removing the
125// data structure from the executable
126//
127VOID* CONST ReferenceAcpiTable = &Mcfg;
128