Angel Pons | 8a3453f | 2020-04-02 23:48:19 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 2 | |
Furquan Shaikh | 76cedd2 | 2020-05-02 10:24:23 -0700 | [diff] [blame] | 3 | #include <acpi/acpi.h> |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 4 | #include <cbmem.h> |
Patrick Rudolph | f677d17 | 2018-10-01 19:17:11 +0200 | [diff] [blame] | 5 | #include <cf9_reset.h> |
Elyes HAOUAS | 2195f7a | 2019-06-21 07:20:12 +0200 | [diff] [blame] | 6 | #include <commonlib/helpers.h> |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 7 | #include <console/console.h> |
Kyösti Mälkki | b2a5f0b | 2019-08-04 19:54:32 +0300 | [diff] [blame] | 8 | #include <cpu/x86/smm.h> |
Lee Leahy | b092c9e | 2016-01-01 18:09:50 -0800 | [diff] [blame] | 9 | #include <fsp/romstage.h> |
Aaron Durbin | 789f2b6 | 2015-09-09 17:05:06 -0500 | [diff] [blame] | 10 | #include <fsp/util.h> |
Elyes HAOUAS | 3b3d085 | 2021-02-01 10:09:40 +0100 | [diff] [blame] | 11 | #include <lib.h> |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 12 | #include <string.h> |
| 13 | #include <timestamp.h> |
| 14 | |
| 15 | void raminit(struct romstage_params *params) |
| 16 | { |
Nico Huber | 16895c5 | 2019-05-04 16:29:17 +0200 | [diff] [blame] | 17 | const bool s3wake = params->power_state->prev_sleep_state == ACPI_S3; |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 18 | const EFI_GUID bootldr_tolum_guid = FSP_BOOTLOADER_TOLUM_HOB_GUID; |
| 19 | EFI_HOB_RESOURCE_DESCRIPTOR *cbmem_root; |
| 20 | FSP_INFO_HEADER *fsp_header; |
| 21 | EFI_HOB_RESOURCE_DESCRIPTOR *fsp_memory; |
| 22 | FSP_MEMORY_INIT fsp_memory_init; |
| 23 | FSP_MEMORY_INIT_PARAMS fsp_memory_init_params; |
| 24 | const EFI_GUID fsp_reserved_guid = |
| 25 | FSP_RESERVED_MEMORY_RESOURCE_HOB_GUID; |
| 26 | void *fsp_reserved_memory_area; |
| 27 | FSP_INIT_RT_COMMON_BUFFER fsp_rt_common_buffer; |
| 28 | void *hob_list_ptr; |
| 29 | FSP_SMBIOS_MEMORY_INFO *memory_info_hob; |
| 30 | const EFI_GUID memory_info_hob_guid = FSP_SMBIOS_MEMORY_INFO_GUID; |
| 31 | MEMORY_INIT_UPD memory_init_params; |
| 32 | const EFI_GUID mrc_guid = FSP_NON_VOLATILE_STORAGE_HOB_GUID; |
| 33 | u32 *mrc_hob; |
| 34 | u32 fsp_reserved_bytes; |
| 35 | MEMORY_INIT_UPD *original_params; |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 36 | EFI_STATUS status; |
| 37 | VPD_DATA_REGION *vpd_ptr; |
| 38 | UPD_DATA_REGION *upd_ptr; |
| 39 | int fsp_verification_failure = 0; |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 40 | EFI_PEI_HOB_POINTERS hob_ptr; |
Kyösti Mälkki | 14222d8 | 2019-08-05 15:10:18 +0300 | [diff] [blame] | 41 | uintptr_t smm_base; |
Kyösti Mälkki | b490562 | 2019-07-12 08:02:35 +0300 | [diff] [blame] | 42 | size_t smm_size; |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 43 | |
| 44 | /* |
| 45 | * Find and copy the UPD region to the stack so the platform can modify |
| 46 | * the settings if needed. Modifications to the UPD buffer are done in |
| 47 | * the platform callback code. The platform callback code is also |
| 48 | * responsible for assigning the UpdDataRngPtr to this buffer if any |
| 49 | * updates are made. The default state is to leave the UpdDataRngPtr |
| 50 | * set to NULL. This indicates that the FSP code will use the UPD |
| 51 | * region in the FSP binary. |
| 52 | */ |
lilacious | 40cb3fe | 2023-06-21 23:24:14 +0200 | [diff] [blame] | 53 | post_code(POSTCODE_MEM_PREINIT_PREP_START); |
Aaron Durbin | e6af4be | 2015-09-24 12:26:31 -0500 | [diff] [blame] | 54 | fsp_header = params->chipset_context; |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 55 | vpd_ptr = (VPD_DATA_REGION *)(fsp_header->CfgRegionOffset + |
| 56 | fsp_header->ImageBase); |
Julius Werner | 540a980 | 2019-12-09 13:03:29 -0800 | [diff] [blame] | 57 | printk(BIOS_DEBUG, "VPD Data: %p\n", vpd_ptr); |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 58 | upd_ptr = (UPD_DATA_REGION *)(vpd_ptr->PcdUpdRegionOffset + |
| 59 | fsp_header->ImageBase); |
Julius Werner | 540a980 | 2019-12-09 13:03:29 -0800 | [diff] [blame] | 60 | printk(BIOS_DEBUG, "UPD Data: %p\n", upd_ptr); |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 61 | original_params = (void *)((u8 *)upd_ptr + |
| 62 | upd_ptr->MemoryInitUpdOffset); |
| 63 | memcpy(&memory_init_params, original_params, |
| 64 | sizeof(memory_init_params)); |
| 65 | |
| 66 | /* Zero fill RT Buffer data and start populating fields. */ |
| 67 | memset(&fsp_rt_common_buffer, 0, sizeof(fsp_rt_common_buffer)); |
Nico Huber | 16895c5 | 2019-05-04 16:29:17 +0200 | [diff] [blame] | 68 | if (s3wake) { |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 69 | fsp_rt_common_buffer.BootMode = BOOT_ON_S3_RESUME; |
Nico Huber | 66318aa | 2019-05-04 16:59:20 +0200 | [diff] [blame] | 70 | } else if (params->saved_data != NULL) { |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 71 | fsp_rt_common_buffer.BootMode = |
| 72 | BOOT_ASSUMING_NO_CONFIGURATION_CHANGES; |
| 73 | } else { |
| 74 | fsp_rt_common_buffer.BootMode = BOOT_WITH_FULL_CONFIGURATION; |
| 75 | } |
| 76 | fsp_rt_common_buffer.UpdDataRgnPtr = &memory_init_params; |
| 77 | fsp_rt_common_buffer.BootLoaderTolumSize = cbmem_overhead_size(); |
| 78 | |
| 79 | /* Get any board specific changes */ |
Nico Huber | 66318aa | 2019-05-04 16:59:20 +0200 | [diff] [blame] | 80 | fsp_memory_init_params.NvsBufferPtr = (void *)params->saved_data; |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 81 | fsp_memory_init_params.RtBufferPtr = &fsp_rt_common_buffer; |
| 82 | fsp_memory_init_params.HobListPtr = &hob_list_ptr; |
| 83 | |
| 84 | /* Update the UPD data */ |
Duncan Laurie | 9dcd4f0 | 2015-08-17 18:09:14 -0700 | [diff] [blame] | 85 | soc_memory_init_params(params, &memory_init_params); |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 86 | mainboard_memory_init_params(params, &memory_init_params); |
Pratik Prajapati | b90b94d | 2015-09-11 13:51:38 -0700 | [diff] [blame] | 87 | |
Julius Werner | cd49cce | 2019-03-05 16:53:33 -0800 | [diff] [blame] | 88 | if (CONFIG(MMA)) |
Pratik Prajapati | b90b94d | 2015-09-11 13:51:38 -0700 | [diff] [blame] | 89 | setup_mma(&memory_init_params); |
| 90 | |
lilacious | 40cb3fe | 2023-06-21 23:24:14 +0200 | [diff] [blame] | 91 | post_code(POSTCODE_MEM_PREINIT_PREP_END); |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 92 | |
| 93 | /* Display the UPD data */ |
Julius Werner | cd49cce | 2019-03-05 16:53:33 -0800 | [diff] [blame] | 94 | if (CONFIG(DISPLAY_UPD_DATA)) |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 95 | soc_display_memory_init_params(original_params, |
| 96 | &memory_init_params); |
| 97 | |
| 98 | /* Call FspMemoryInit to initialize RAM */ |
| 99 | fsp_memory_init = (FSP_MEMORY_INIT)(fsp_header->ImageBase |
| 100 | + fsp_header->FspMemoryInitEntryOffset); |
Julius Werner | 540a980 | 2019-12-09 13:03:29 -0800 | [diff] [blame] | 101 | printk(BIOS_DEBUG, "Calling FspMemoryInit: %p\n", fsp_memory_init); |
| 102 | printk(BIOS_SPEW, " %p: NvsBufferPtr\n", |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 103 | fsp_memory_init_params.NvsBufferPtr); |
Julius Werner | 540a980 | 2019-12-09 13:03:29 -0800 | [diff] [blame] | 104 | printk(BIOS_SPEW, " %p: RtBufferPtr\n", |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 105 | fsp_memory_init_params.RtBufferPtr); |
Julius Werner | 540a980 | 2019-12-09 13:03:29 -0800 | [diff] [blame] | 106 | printk(BIOS_SPEW, " %p: HobListPtr\n", |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 107 | fsp_memory_init_params.HobListPtr); |
| 108 | |
| 109 | timestamp_add_now(TS_FSP_MEMORY_INIT_START); |
lilacious | 40cb3fe | 2023-06-21 23:24:14 +0200 | [diff] [blame] | 110 | post_code(POSTCODE_FSP_MEMORY_INIT); |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 111 | status = fsp_memory_init(&fsp_memory_init_params); |
Frans Hendriks | 1385b7d | 2019-04-05 13:42:14 +0200 | [diff] [blame] | 112 | mainboard_after_memory_init(); |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 113 | post_code(0x37); |
| 114 | timestamp_add_now(TS_FSP_MEMORY_INIT_END); |
| 115 | |
| 116 | printk(BIOS_DEBUG, "FspMemoryInit returned 0x%08x\n", status); |
| 117 | if (status != EFI_SUCCESS) |
lilacious | 40cb3fe | 2023-06-21 23:24:14 +0200 | [diff] [blame] | 118 | die_with_post_code(POSTCODE_RAM_FAILURE, |
Keith Short | 2430263 | 2019-05-16 14:08:31 -0600 | [diff] [blame] | 119 | "ERROR - FspMemoryInit failed to initialize memory!\n"); |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 120 | |
| 121 | /* Locate the FSP reserved memory area */ |
| 122 | fsp_reserved_bytes = 0; |
Arthur Heymans | ca74d7e | 2022-03-30 14:41:16 +0200 | [diff] [blame] | 123 | fsp_memory = get_resource_hob(&fsp_reserved_guid, hob_list_ptr); |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 124 | if (fsp_memory == NULL) { |
| 125 | fsp_verification_failure = 1; |
Frans Hendriks | 509f469 | 2019-06-28 14:11:41 +0200 | [diff] [blame] | 126 | printk(BIOS_ERR, |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 127 | "7.2: FSP_RESERVED_MEMORY_RESOURCE_HOB missing!\n"); |
| 128 | } else { |
| 129 | fsp_reserved_bytes = fsp_memory->ResourceLength; |
| 130 | printk(BIOS_DEBUG, "Reserving 0x%016lx bytes for FSP\n", |
| 131 | (unsigned long int)fsp_reserved_bytes); |
| 132 | } |
| 133 | |
| 134 | /* Display SMM area */ |
Kyösti Mälkki | b490562 | 2019-07-12 08:02:35 +0300 | [diff] [blame] | 135 | if (CONFIG(HAVE_SMI_HANDLER)) { |
Kyösti Mälkki | 14222d8 | 2019-08-05 15:10:18 +0300 | [diff] [blame] | 136 | smm_region(&smm_base, &smm_size); |
Kyösti Mälkki | b490562 | 2019-07-12 08:02:35 +0300 | [diff] [blame] | 137 | printk(BIOS_DEBUG, "0x%08x: smm_size\n", (unsigned int)smm_size); |
Kyösti Mälkki | 14222d8 | 2019-08-05 15:10:18 +0300 | [diff] [blame] | 138 | printk(BIOS_DEBUG, "0x%08x: smm_base\n", (unsigned int)smm_base); |
Kyösti Mälkki | b490562 | 2019-07-12 08:02:35 +0300 | [diff] [blame] | 139 | } |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 140 | |
| 141 | /* Migrate CAR data */ |
Julius Werner | 540a980 | 2019-12-09 13:03:29 -0800 | [diff] [blame] | 142 | printk(BIOS_DEBUG, "%p: cbmem_top\n", cbmem_top()); |
Nico Huber | 16895c5 | 2019-05-04 16:29:17 +0200 | [diff] [blame] | 143 | if (!s3wake) { |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 144 | cbmem_initialize_empty_id_size(CBMEM_ID_FSP_RESERVED_MEMORY, |
| 145 | fsp_reserved_bytes); |
| 146 | } else if (cbmem_initialize_id_size(CBMEM_ID_FSP_RESERVED_MEMORY, |
| 147 | fsp_reserved_bytes)) { |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 148 | printk(BIOS_DEBUG, "Failed to recover CBMEM in S3 resume.\n"); |
| 149 | /* Failed S3 resume, reset to come up cleanly */ |
Patrick Rudolph | f677d17 | 2018-10-01 19:17:11 +0200 | [diff] [blame] | 150 | /* FIXME: A "system" reset is likely enough: */ |
| 151 | full_reset(); |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 152 | } |
| 153 | |
| 154 | /* Save the FSP runtime parameters. */ |
Aaron Durbin | e1ecfc9 | 2015-09-16 15:18:04 -0500 | [diff] [blame] | 155 | fsp_set_runtime(fsp_header, hob_list_ptr); |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 156 | |
| 157 | /* Lookup the FSP_BOOTLOADER_TOLUM_HOB */ |
Arthur Heymans | ca74d7e | 2022-03-30 14:41:16 +0200 | [diff] [blame] | 158 | cbmem_root = get_resource_hob(&bootldr_tolum_guid, hob_list_ptr); |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 159 | if (cbmem_root == NULL) { |
| 160 | fsp_verification_failure = 1; |
| 161 | printk(BIOS_ERR, "7.4: FSP_BOOTLOADER_TOLUM_HOB missing!\n"); |
| 162 | printk(BIOS_ERR, "BootLoaderTolumSize: 0x%08x bytes\n", |
| 163 | fsp_rt_common_buffer.BootLoaderTolumSize); |
| 164 | } |
| 165 | |
| 166 | /* Locate the FSP_SMBIOS_MEMORY_INFO HOB */ |
Arthur Heymans | ca74d7e | 2022-03-30 14:41:16 +0200 | [diff] [blame] | 167 | memory_info_hob = get_guid_hob(&memory_info_hob_guid, |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 168 | hob_list_ptr); |
Lee Leahy | 216712a | 2017-03-17 11:23:32 -0700 | [diff] [blame] | 169 | if (memory_info_hob == NULL) { |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 170 | printk(BIOS_ERR, "FSP_SMBIOS_MEMORY_INFO HOB missing!\n"); |
| 171 | fsp_verification_failure = 1; |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 172 | } |
| 173 | |
Frans Hendriks | 509f469 | 2019-06-28 14:11:41 +0200 | [diff] [blame] | 174 | if (hob_list_ptr == NULL) |
lilacious | 40cb3fe | 2023-06-21 23:24:14 +0200 | [diff] [blame] | 175 | die_with_post_code(POSTCODE_RAM_FAILURE, |
Frans Hendriks | 509f469 | 2019-06-28 14:11:41 +0200 | [diff] [blame] | 176 | "ERROR - HOB pointer is NULL!\n"); |
| 177 | |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 178 | /* |
| 179 | * Verify that FSP is generating the required HOBs: |
| 180 | * 7.1: FSP_BOOTLOADER_TEMP_MEMORY_HOB only produced for FSP 1.0 |
| 181 | * 7.2: FSP_RESERVED_MEMORY_RESOURCE_HOB verified above |
Frans Hendriks | 8f95edc | 2018-11-06 12:04:34 +0100 | [diff] [blame] | 182 | * 7.3: FSP_NON_VOLATILE_STORAGE_HOB only produced when |
Frans Hendriks | 509f469 | 2019-06-28 14:11:41 +0200 | [diff] [blame] | 183 | * new NVS data is generated, verified below |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 184 | * 7.4: FSP_BOOTLOADER_TOLUM_HOB verified above |
| 185 | * 7.5: EFI_PEI_GRAPHICS_INFO_HOB produced by SiliconInit |
| 186 | * FSP_SMBIOS_MEMORY_INFO HOB verified above |
| 187 | */ |
Arthur Heymans | ca74d7e | 2022-03-30 14:41:16 +0200 | [diff] [blame] | 188 | hob_ptr.Raw = get_guid_hob(&mrc_guid, hob_list_ptr); |
Frans Hendriks | 509f469 | 2019-06-28 14:11:41 +0200 | [diff] [blame] | 189 | if ((hob_ptr.Raw == NULL) && (params->saved_data == NULL)) { |
| 190 | printk(BIOS_ERR, "7.3: FSP_NON_VOLATILE_STORAGE_HOB missing!\n"); |
| 191 | fsp_verification_failure = 1; |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 192 | } |
| 193 | |
| 194 | /* Verify all the HOBs are present */ |
| 195 | if (fsp_verification_failure) |
Elyes HAOUAS | 22ad8f2 | 2022-02-04 19:44:16 +0100 | [diff] [blame] | 196 | printk(BIOS_ERR, "Missing one or more required FSP HOBs!\n"); |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 197 | |
| 198 | /* Display the HOBs */ |
Frans Hendriks | 509f469 | 2019-06-28 14:11:41 +0200 | [diff] [blame] | 199 | if (CONFIG(DISPLAY_HOBS)) |
Keith Short | bb41aba | 2019-05-16 14:07:43 -0600 | [diff] [blame] | 200 | print_hob_type_structure(0, hob_list_ptr); |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 201 | |
| 202 | /* Get the address of the CBMEM region for the FSP reserved memory */ |
| 203 | fsp_reserved_memory_area = cbmem_find(CBMEM_ID_FSP_RESERVED_MEMORY); |
Julius Werner | 540a980 | 2019-12-09 13:03:29 -0800 | [diff] [blame] | 204 | printk(BIOS_DEBUG, "%p: fsp_reserved_memory_area\n", |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 205 | fsp_reserved_memory_area); |
| 206 | |
| 207 | /* Verify the order of CBMEM root and FSP memory */ |
| 208 | if ((fsp_memory != NULL) && (cbmem_root != NULL) && |
| 209 | (cbmem_root->PhysicalStart <= fsp_memory->PhysicalStart)) { |
| 210 | fsp_verification_failure = 1; |
Elyes HAOUAS | 22ad8f2 | 2022-02-04 19:44:16 +0100 | [diff] [blame] | 211 | printk(BIOS_ERR, "FSP reserved memory above CBMEM root!\n"); |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 212 | } |
| 213 | |
| 214 | /* Verify that the FSP memory was properly reserved */ |
| 215 | if ((fsp_memory != NULL) && ((fsp_reserved_memory_area == NULL) || |
| 216 | (fsp_memory->PhysicalStart != |
| 217 | (unsigned int)fsp_reserved_memory_area))) { |
| 218 | fsp_verification_failure = 1; |
Elyes HAOUAS | 22ad8f2 | 2022-02-04 19:44:16 +0100 | [diff] [blame] | 219 | printk(BIOS_ERR, "Reserving FSP memory area!\n"); |
Kyösti Mälkki | b490562 | 2019-07-12 08:02:35 +0300 | [diff] [blame] | 220 | |
| 221 | if (CONFIG(HAVE_SMI_HANDLER) && cbmem_root != NULL) { |
Kyösti Mälkki | 14222d8 | 2019-08-05 15:10:18 +0300 | [diff] [blame] | 222 | size_t delta_bytes = smm_base |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 223 | - cbmem_root->PhysicalStart |
| 224 | - cbmem_root->ResourceLength; |
Frans Hendriks | 509f469 | 2019-06-28 14:11:41 +0200 | [diff] [blame] | 225 | printk(BIOS_ERR, |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 226 | "0x%08x: Chipset reserved bytes reported by FSP\n", |
| 227 | (unsigned int)delta_bytes); |
lilacious | 40cb3fe | 2023-06-21 23:24:14 +0200 | [diff] [blame] | 228 | die_with_post_code(POSTCODE_INVALID_VENDOR_BINARY, |
Keith Short | bb41aba | 2019-05-16 14:07:43 -0600 | [diff] [blame] | 229 | "Please verify the chipset reserved size\n"); |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 230 | } |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 231 | } |
| 232 | |
| 233 | /* Verify the FSP 1.1 HOB interface */ |
| 234 | if (fsp_verification_failure) |
lilacious | 40cb3fe | 2023-06-21 23:24:14 +0200 | [diff] [blame] | 235 | die_with_post_code(POSTCODE_INVALID_VENDOR_BINARY, |
Keith Short | bb41aba | 2019-05-16 14:07:43 -0600 | [diff] [blame] | 236 | "ERROR - coreboot's requirements not met by FSP binary!\n"); |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 237 | |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 238 | /* Locate the memory configuration data to speed up the next reboot */ |
Arthur Heymans | ca74d7e | 2022-03-30 14:41:16 +0200 | [diff] [blame] | 239 | mrc_hob = get_guid_hob(&mrc_guid, hob_list_ptr); |
Julius Werner | 29fbfcc | 2020-03-02 15:54:43 -0800 | [diff] [blame] | 240 | if (mrc_hob == NULL) { |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 241 | printk(BIOS_DEBUG, |
| 242 | "Memory Configuration Data Hob not present\n"); |
Julius Werner | 29fbfcc | 2020-03-02 15:54:43 -0800 | [diff] [blame] | 243 | } else { |
Nico Huber | 66318aa | 2019-05-04 16:59:20 +0200 | [diff] [blame] | 244 | params->data_to_save = GET_GUID_HOB_DATA(mrc_hob); |
Felix Held | 51ff9e8 | 2019-06-20 14:49:16 +0200 | [diff] [blame] | 245 | params->data_to_save_size = ALIGN_UP( |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 246 | ((u32)GET_HOB_LENGTH(mrc_hob)), 16); |
| 247 | } |
| 248 | } |
| 249 | |
Frans Hendriks | 1385b7d | 2019-04-05 13:42:14 +0200 | [diff] [blame] | 250 | /* Initialize the SoC after MemoryInit */ |
| 251 | __weak void mainboard_after_memory_init(void) |
| 252 | { |
| 253 | printk(BIOS_DEBUG, "WEAK: %s/%s called\n", __FILE__, __func__); |
| 254 | } |