2 Copyright (c) 2019-2020, Intel Corporation. All rights reserved.<BR>
4 Redistribution and use in source and binary forms, with or without modification,
5 are permitted provided that the following conditions are met:
7 * Redistributions of source code must retain the above copyright notice, this
8 list of conditions and the following disclaimer.
9 * Redistributions in binary form must reproduce the above copyright notice, this
10 list of conditions and the following disclaimer in the documentation and/or
11 other materials provided with the distribution.
12 * Neither the name of Intel Corporation nor the names of its contributors may
13 be used to endorse or promote products derived from this software without
14 specific prior written permission.
16 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
20 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
26 THE POSSIBILITY OF SUCH DAMAGE.
31 #ifndef _MEMORY_MAP_GUID_H_
32 #define _MEMORY_MAP_GUID_H_
34 #define FSP_SYSTEM_MEMORYMAP_HOB_GUID { \
35 0x15, 0x00, 0x87, 0xf8, 0x94, 0x69, 0x98, 0x4b, 0x95, 0xa2, \
36 0xbd, 0x56, 0xda, 0x91, 0xc0, 0x7f \
39 #define MEMTYPE_1LM_MASK (1 << 0)
40 #define MEMTYPE_2LM_MASK (1 << 1)
41 #define MEMTYPE_VOLATILE_MASK (MEMTYPE_1LM_MASK | MEMTYPE_2LM_MASK)
43 #define MAX_FPGA_REMOTE_SAD_RULES 2 // Maximum FPGA sockets exists on ICX platform
45 #define MAX_SAD_RULES 24
46 #define MAX_DRAM_CLUSTERS 1
47 #define MAX_IMC_PER_SOCKET 2
48 #define MAX_SRAT_MEM_ENTRIES_PER_IMC 8
49 #define MAX_ACPI_MEMORY_AFFINITY_COUNT ( \
50 MAX_SOCKET * MAX_IMC_PER_SOCKET * MAX_SRAT_MEM_ENTRIES_PER_IMC \
53 /* ACPI SRAT Memory Flags */
54 #define SRAT_ACPI_MEMORY_ENABLED (1 << 0)
55 #define SRAT_ACPI_MEMORY_HOT_REMOVE_SUPPORTED (1 << 1)
56 #define SRAT_ACPI_MEMORY_NONVOLATILE (1 << 2)
58 #define MEM_TYPE_RESERVED (1 << 8)
59 #define MEM_ADDR_64MB_SHIFT_BITS 26
61 #define NGN_MAX_SERIALNUMBER_STRLEN 4
62 #define NGN_MAX_PARTNUMBER_STRLEN 20
63 #define NGN_FW_VER_LEN 4
65 // System Memory Map HOB information
70 typedef struct SystemMemoryMapElement
{
71 // Type of this memory element; Bit0: 1LM Bit1: 2LM Bit2: PMEM Bit3: PMEM-cache
72 // Bit4: BLK Window Bit5: CSR/Mailbox/Ctrl region
74 // Node ID of the HA Owning the memory
76 // Socket Id of socket that has his memory - ONLY IN NUMA
78 // Socket interleave bitmap, if more that on socket then ImcInterBitmap and ChInterBitmap are identical in all sockets
80 // IMC interleave bitmap for this memory
82 // Bit map to denote which channels are interleaved per IMC eg: 111b - Ch 2,1 & 0 are interleaved;
83 // 011b denotes Ch1 & 0 are interleaved
84 UINT8 ChInterBitmap
[MAX_IMC
];
85 // Base Address of the element in 64MB chunks
87 // Size of this memory element in 64MB chunks
89 } SYSTEM_MEMORY_MAP_ELEMENT
;
91 typedef struct DimmDevice
{
103 UINT16 SPDMMfgId
; // Module Mfg Id from SPD
107 UINT8 serialNumber
[NGN_MAX_SERIALNUMBER_STRLEN
]; // Serial Number
108 UINT8 PartNumber
[NGN_MAX_PARTNUMBER_STRLEN
]; // Part Number
109 UINT8 FirmwareVersionStr
[NGN_FW_VER_LEN
]; // Used to update the SMBIOS TYPE 17
111 UINT16 SubsystemVendorID
;
112 UINT16 SubsystemDeviceID
;
114 UINT8 DimmSku
; // Dimm SKU info
119 UINT16 SPDRegVen
; // Register Vendor ID in SPD
120 } MEMMAP_DIMM_DEVICE_INFO_STRUCT
;
122 struct ChannelDevice
{
124 MEMMAP_DIMM_DEVICE_INFO_STRUCT DimmInfo
[MAX_IMC
];
127 typedef struct socket
{
128 UINT8 reserved1
[1114];
129 struct ChannelDevice ChannelInfo
[MAX_CH
];
132 /* NOTE - Reserved sizes need to be calibrated if any of the above #define values change */
133 typedef struct SystemMemoryMapHob
{
136 UINT32 lowMemBase
; // Mem base in 64MB units for below 4GB mem.
137 UINT32 lowMemSize
; // Mem size in 64MB units for below 4GB mem.
138 UINT32 highMemBase
; // Mem base in 64MB units for above 4GB mem.
139 UINT32 highMemSize
; // Mem size in 64MB units for above 4GB mem.
140 UINT32 memSize
; // Total physical memory size
141 UINT16 memFreq
; // Mem Frequency
148 UINT8 numberEntries
; // Number of Memory Map Elements
149 SYSTEM_MEMORY_MAP_ELEMENT Element
[(MAX_SOCKET
* MAX_DRAM_CLUSTERS
* MAX_SAD_RULES
) + MAX_FPGA_REMOTE_SAD_RULES
];
150 UINT8 reserved4
[2216];
151 MEMMAP_SOCKET Socket
[MAX_SOCKET
];
152 UINT8 reserved5
[1603];
154 UINT16 BiosFisVersion
; // Firmware Interface Specification version currently supported by BIOS
158 UINT32 MmiohBase
; // MMIOH base in 64MB granularity
162 } SYSTEM_MEMORY_MAP_HOB
;