1 /* SPDX-License-Identifier: GPL-2.0-or-later */
4 #include <console/console.h>
5 #include <device/pci.h>
6 #include <device/pci_ids.h>
7 #include <hob_iiouds.h>
8 #include <intelblocks/cpulib.h>
9 #include <intelblocks/pcr.h>
10 #include <soc/iomap.h>
12 #include <soc/pci_devs.h>
13 #include <soc/pcr_ids.h>
14 #include <soc/soc_util.h>
19 * +-------------------------+ TOLM
20 * | System Management Mode |
23 * +-------------------------+ SMM base (aligned)
25 * | Chipset Reserved Memory |
27 * +-------------------------+ top_of_ram (aligned)
31 * +-------------------------+
33 * | FSP Reserved Memory |
35 * +-------------------------+
37 * | Various CBMEM Entries |
39 * +-------------------------+ top_of_stack (8 byte aligned)
41 * | stack (CBMEM Entry) |
43 * +-------------------------+
46 const struct SystemMemoryMapHob
*get_system_memory_map(void)
49 const uint8_t mem_hob_guid
[16] = FSP_SYSTEM_MEMORYMAP_HOB_GUID
;
50 const struct SystemMemoryMapHob
*memmap_addr
;
52 memmap_addr
= fsp_find_extension_hob_by_guid(mem_hob_guid
, &hob_size
);
53 assert(memmap_addr
&& hob_size
!= 0);
58 bool is_pcie_iio_stack_res(const STACK_RES
*res
)
60 return res
->BusBase
< res
->BusLimit
;
63 bool is_ubox_stack_res(const STACK_RES
*res
)
66 * Unlike on later platforms there's no separate "UBOX" stack.
68 * The UBOX devices can always be found on the first bus on the stack IIO0 (CSTACK).
69 * This bus is also referred to as uncore bus 0 or B(30).
70 * It has at a fixed address the UBOX:
75 * The PCU devices can always be on the first bus of the stack IIO1 (PSTACK).
76 * This bus is also referred to as uncore bus 1 or B(31).
77 * It has at a fixed address the PCU:
78 * B(31):30.0 8086:2080
79 * B(31):30.1 8086:2081
80 * B(31):30.2 8086:2082
86 bool is_memtype_reserved(uint16_t mem_type
)
88 return !!(mem_type
& MEM_TYPE_RESERVED
);
91 bool is_memtype_non_volatile(uint16_t mem_type
)
93 return !(mem_type
& MEMTYPE_VOLATILE_MASK
);
96 bool is_memtype_processor_attached(uint16_t mem_type
)
101 uint8_t get_cxl_node_count(void)
106 bool get_mmio_high_base_size(resource_t
*base
, resource_t
*size
)