Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
Lee Leahy | b092c9e | 2016-01-01 18:09:50 -0800 | [diff] [blame] | 4 | * Copyright (C) 2014-2016 Intel Corporation |
Frans Hendriks | 8f95edc | 2018-11-06 12:04:34 +0100 | [diff] [blame] | 5 | * Copyright (C) 2018 Eltan B.V. |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License as published by |
| 9 | * the Free Software Foundation; version 2 of the License. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 15 | */ |
| 16 | |
Aaron Durbin | 932e09d | 2016-07-13 23:09:52 -0500 | [diff] [blame] | 17 | #include <arch/acpi.h> |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 18 | #include <cbmem.h> |
Patrick Rudolph | f677d17 | 2018-10-01 19:17:11 +0200 | [diff] [blame] | 19 | #include <cf9_reset.h> |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 20 | #include <console/console.h> |
Lee Leahy | 94b856e | 2015-10-15 12:07:03 -0700 | [diff] [blame] | 21 | #include <fsp/memmap.h> |
Lee Leahy | b092c9e | 2016-01-01 18:09:50 -0800 | [diff] [blame] | 22 | #include <fsp/romstage.h> |
Aaron Durbin | 789f2b6 | 2015-09-09 17:05:06 -0500 | [diff] [blame] | 23 | #include <fsp/util.h> |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 24 | #include <lib.h> /* hexdump */ |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 25 | #include <string.h> |
| 26 | #include <timestamp.h> |
Philipp Deppenwiese | fea2429 | 2017-10-17 17:02:29 +0200 | [diff] [blame] | 27 | #include <security/vboot/vboot_common.h> |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 28 | |
| 29 | void raminit(struct romstage_params *params) |
| 30 | { |
Nico Huber | 16895c5 | 2019-05-04 16:29:17 +0200 | [diff] [blame] | 31 | const bool s3wake = params->power_state->prev_sleep_state == ACPI_S3; |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 32 | const EFI_GUID bootldr_tolum_guid = FSP_BOOTLOADER_TOLUM_HOB_GUID; |
| 33 | EFI_HOB_RESOURCE_DESCRIPTOR *cbmem_root; |
| 34 | FSP_INFO_HEADER *fsp_header; |
| 35 | EFI_HOB_RESOURCE_DESCRIPTOR *fsp_memory; |
| 36 | FSP_MEMORY_INIT fsp_memory_init; |
| 37 | FSP_MEMORY_INIT_PARAMS fsp_memory_init_params; |
| 38 | const EFI_GUID fsp_reserved_guid = |
| 39 | FSP_RESERVED_MEMORY_RESOURCE_HOB_GUID; |
| 40 | void *fsp_reserved_memory_area; |
| 41 | FSP_INIT_RT_COMMON_BUFFER fsp_rt_common_buffer; |
| 42 | void *hob_list_ptr; |
| 43 | FSP_SMBIOS_MEMORY_INFO *memory_info_hob; |
| 44 | const EFI_GUID memory_info_hob_guid = FSP_SMBIOS_MEMORY_INFO_GUID; |
| 45 | MEMORY_INIT_UPD memory_init_params; |
| 46 | const EFI_GUID mrc_guid = FSP_NON_VOLATILE_STORAGE_HOB_GUID; |
| 47 | u32 *mrc_hob; |
| 48 | u32 fsp_reserved_bytes; |
| 49 | MEMORY_INIT_UPD *original_params; |
| 50 | struct pei_data *pei_ptr; |
| 51 | EFI_STATUS status; |
| 52 | VPD_DATA_REGION *vpd_ptr; |
| 53 | UPD_DATA_REGION *upd_ptr; |
| 54 | int fsp_verification_failure = 0; |
Julius Werner | cd49cce | 2019-03-05 16:53:33 -0800 | [diff] [blame] | 55 | #if CONFIG(DISPLAY_HOBS) |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 56 | unsigned long int data; |
| 57 | EFI_PEI_HOB_POINTERS hob_ptr; |
| 58 | #endif |
| 59 | |
| 60 | /* |
| 61 | * Find and copy the UPD region to the stack so the platform can modify |
| 62 | * the settings if needed. Modifications to the UPD buffer are done in |
| 63 | * the platform callback code. The platform callback code is also |
| 64 | * responsible for assigning the UpdDataRngPtr to this buffer if any |
| 65 | * updates are made. The default state is to leave the UpdDataRngPtr |
| 66 | * set to NULL. This indicates that the FSP code will use the UPD |
| 67 | * region in the FSP binary. |
| 68 | */ |
Furquan Shaikh | 585210a | 2018-10-16 11:54:37 -0700 | [diff] [blame] | 69 | post_code(POST_MEM_PREINIT_PREP_START); |
Aaron Durbin | e6af4be | 2015-09-24 12:26:31 -0500 | [diff] [blame] | 70 | fsp_header = params->chipset_context; |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 71 | vpd_ptr = (VPD_DATA_REGION *)(fsp_header->CfgRegionOffset + |
| 72 | fsp_header->ImageBase); |
| 73 | printk(BIOS_DEBUG, "VPD Data: 0x%p\n", vpd_ptr); |
| 74 | upd_ptr = (UPD_DATA_REGION *)(vpd_ptr->PcdUpdRegionOffset + |
| 75 | fsp_header->ImageBase); |
| 76 | printk(BIOS_DEBUG, "UPD Data: 0x%p\n", upd_ptr); |
| 77 | original_params = (void *)((u8 *)upd_ptr + |
| 78 | upd_ptr->MemoryInitUpdOffset); |
| 79 | memcpy(&memory_init_params, original_params, |
| 80 | sizeof(memory_init_params)); |
| 81 | |
| 82 | /* Zero fill RT Buffer data and start populating fields. */ |
| 83 | memset(&fsp_rt_common_buffer, 0, sizeof(fsp_rt_common_buffer)); |
| 84 | pei_ptr = params->pei_data; |
Nico Huber | 16895c5 | 2019-05-04 16:29:17 +0200 | [diff] [blame] | 85 | if (s3wake) { |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 86 | fsp_rt_common_buffer.BootMode = BOOT_ON_S3_RESUME; |
| 87 | } else if (pei_ptr->saved_data != NULL) { |
| 88 | fsp_rt_common_buffer.BootMode = |
| 89 | BOOT_ASSUMING_NO_CONFIGURATION_CHANGES; |
| 90 | } else { |
| 91 | fsp_rt_common_buffer.BootMode = BOOT_WITH_FULL_CONFIGURATION; |
| 92 | } |
| 93 | fsp_rt_common_buffer.UpdDataRgnPtr = &memory_init_params; |
| 94 | fsp_rt_common_buffer.BootLoaderTolumSize = cbmem_overhead_size(); |
| 95 | |
| 96 | /* Get any board specific changes */ |
| 97 | fsp_memory_init_params.NvsBufferPtr = (void *)pei_ptr->saved_data; |
| 98 | fsp_memory_init_params.RtBufferPtr = &fsp_rt_common_buffer; |
| 99 | fsp_memory_init_params.HobListPtr = &hob_list_ptr; |
| 100 | |
| 101 | /* Update the UPD data */ |
Duncan Laurie | 9dcd4f0 | 2015-08-17 18:09:14 -0700 | [diff] [blame] | 102 | soc_memory_init_params(params, &memory_init_params); |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 103 | mainboard_memory_init_params(params, &memory_init_params); |
Pratik Prajapati | b90b94d | 2015-09-11 13:51:38 -0700 | [diff] [blame] | 104 | |
Julius Werner | cd49cce | 2019-03-05 16:53:33 -0800 | [diff] [blame] | 105 | if (CONFIG(MMA)) |
Pratik Prajapati | b90b94d | 2015-09-11 13:51:38 -0700 | [diff] [blame] | 106 | setup_mma(&memory_init_params); |
| 107 | |
Furquan Shaikh | 585210a | 2018-10-16 11:54:37 -0700 | [diff] [blame] | 108 | post_code(POST_MEM_PREINIT_PREP_END); |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 109 | |
| 110 | /* Display the UPD data */ |
Julius Werner | cd49cce | 2019-03-05 16:53:33 -0800 | [diff] [blame] | 111 | if (CONFIG(DISPLAY_UPD_DATA)) |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 112 | soc_display_memory_init_params(original_params, |
| 113 | &memory_init_params); |
| 114 | |
| 115 | /* Call FspMemoryInit to initialize RAM */ |
| 116 | fsp_memory_init = (FSP_MEMORY_INIT)(fsp_header->ImageBase |
| 117 | + fsp_header->FspMemoryInitEntryOffset); |
| 118 | printk(BIOS_DEBUG, "Calling FspMemoryInit: 0x%p\n", fsp_memory_init); |
| 119 | printk(BIOS_SPEW, " 0x%p: NvsBufferPtr\n", |
| 120 | fsp_memory_init_params.NvsBufferPtr); |
| 121 | printk(BIOS_SPEW, " 0x%p: RtBufferPtr\n", |
| 122 | fsp_memory_init_params.RtBufferPtr); |
| 123 | printk(BIOS_SPEW, " 0x%p: HobListPtr\n", |
| 124 | fsp_memory_init_params.HobListPtr); |
| 125 | |
| 126 | timestamp_add_now(TS_FSP_MEMORY_INIT_START); |
Duncan Laurie | fb50983 | 2015-11-22 14:53:57 -0800 | [diff] [blame] | 127 | post_code(POST_FSP_MEMORY_INIT); |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 128 | status = fsp_memory_init(&fsp_memory_init_params); |
Frans Hendriks | 1385b7d | 2019-04-05 13:42:14 +0200 | [diff] [blame] | 129 | mainboard_after_memory_init(); |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 130 | post_code(0x37); |
| 131 | timestamp_add_now(TS_FSP_MEMORY_INIT_END); |
| 132 | |
| 133 | printk(BIOS_DEBUG, "FspMemoryInit returned 0x%08x\n", status); |
| 134 | if (status != EFI_SUCCESS) |
| 135 | die("ERROR - FspMemoryInit failed to initialize memory!\n"); |
| 136 | |
| 137 | /* Locate the FSP reserved memory area */ |
| 138 | fsp_reserved_bytes = 0; |
| 139 | fsp_memory = get_next_resource_hob(&fsp_reserved_guid, hob_list_ptr); |
| 140 | if (fsp_memory == NULL) { |
| 141 | fsp_verification_failure = 1; |
| 142 | printk(BIOS_DEBUG, |
| 143 | "7.2: FSP_RESERVED_MEMORY_RESOURCE_HOB missing!\n"); |
| 144 | } else { |
| 145 | fsp_reserved_bytes = fsp_memory->ResourceLength; |
| 146 | printk(BIOS_DEBUG, "Reserving 0x%016lx bytes for FSP\n", |
| 147 | (unsigned long int)fsp_reserved_bytes); |
| 148 | } |
| 149 | |
| 150 | /* Display SMM area */ |
Julius Werner | cd49cce | 2019-03-05 16:53:33 -0800 | [diff] [blame] | 151 | #if CONFIG(HAVE_SMI_HANDLER) |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 152 | char *smm_base; |
| 153 | size_t smm_size; |
| 154 | |
| 155 | smm_region((void **)&smm_base, &smm_size); |
| 156 | printk(BIOS_DEBUG, "0x%08x: smm_size\n", (unsigned int)smm_size); |
| 157 | printk(BIOS_DEBUG, "0x%p: smm_base\n", smm_base); |
| 158 | #endif |
| 159 | |
| 160 | /* Migrate CAR data */ |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 161 | printk(BIOS_DEBUG, "0x%p: cbmem_top\n", cbmem_top()); |
Nico Huber | 16895c5 | 2019-05-04 16:29:17 +0200 | [diff] [blame] | 162 | if (!s3wake) { |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 163 | cbmem_initialize_empty_id_size(CBMEM_ID_FSP_RESERVED_MEMORY, |
| 164 | fsp_reserved_bytes); |
| 165 | } else if (cbmem_initialize_id_size(CBMEM_ID_FSP_RESERVED_MEMORY, |
| 166 | fsp_reserved_bytes)) { |
Julius Werner | cd49cce | 2019-03-05 16:53:33 -0800 | [diff] [blame] | 167 | #if CONFIG(HAVE_ACPI_RESUME) |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 168 | printk(BIOS_DEBUG, "Failed to recover CBMEM in S3 resume.\n"); |
| 169 | /* Failed S3 resume, reset to come up cleanly */ |
Patrick Rudolph | f677d17 | 2018-10-01 19:17:11 +0200 | [diff] [blame] | 170 | /* FIXME: A "system" reset is likely enough: */ |
| 171 | full_reset(); |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 172 | #endif |
| 173 | } |
| 174 | |
| 175 | /* Save the FSP runtime parameters. */ |
Aaron Durbin | e1ecfc9 | 2015-09-16 15:18:04 -0500 | [diff] [blame] | 176 | fsp_set_runtime(fsp_header, hob_list_ptr); |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 177 | |
| 178 | /* Lookup the FSP_BOOTLOADER_TOLUM_HOB */ |
| 179 | cbmem_root = get_next_resource_hob(&bootldr_tolum_guid, hob_list_ptr); |
| 180 | if (cbmem_root == NULL) { |
| 181 | fsp_verification_failure = 1; |
| 182 | printk(BIOS_ERR, "7.4: FSP_BOOTLOADER_TOLUM_HOB missing!\n"); |
| 183 | printk(BIOS_ERR, "BootLoaderTolumSize: 0x%08x bytes\n", |
| 184 | fsp_rt_common_buffer.BootLoaderTolumSize); |
| 185 | } |
| 186 | |
| 187 | /* Locate the FSP_SMBIOS_MEMORY_INFO HOB */ |
| 188 | memory_info_hob = get_next_guid_hob(&memory_info_hob_guid, |
| 189 | hob_list_ptr); |
Lee Leahy | 216712a | 2017-03-17 11:23:32 -0700 | [diff] [blame] | 190 | if (memory_info_hob == NULL) { |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 191 | printk(BIOS_ERR, "FSP_SMBIOS_MEMORY_INFO HOB missing!\n"); |
| 192 | fsp_verification_failure = 1; |
| 193 | } else { |
| 194 | printk(BIOS_DEBUG, |
| 195 | "FSP_SMBIOS_MEMORY_INFO HOB: 0x%p\n", |
| 196 | memory_info_hob); |
| 197 | } |
| 198 | |
Julius Werner | cd49cce | 2019-03-05 16:53:33 -0800 | [diff] [blame] | 199 | #if CONFIG(DISPLAY_HOBS) |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 200 | if (hob_list_ptr == NULL) |
| 201 | die("ERROR - HOB pointer is NULL!\n"); |
| 202 | |
| 203 | /* |
| 204 | * Verify that FSP is generating the required HOBs: |
| 205 | * 7.1: FSP_BOOTLOADER_TEMP_MEMORY_HOB only produced for FSP 1.0 |
| 206 | * 7.2: FSP_RESERVED_MEMORY_RESOURCE_HOB verified above |
Frans Hendriks | 8f95edc | 2018-11-06 12:04:34 +0100 | [diff] [blame] | 207 | * 7.3: FSP_NON_VOLATILE_STORAGE_HOB only produced when |
| 208 | * new NVS data is generated, verified below |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 209 | * 7.4: FSP_BOOTLOADER_TOLUM_HOB verified above |
| 210 | * 7.5: EFI_PEI_GRAPHICS_INFO_HOB produced by SiliconInit |
| 211 | * FSP_SMBIOS_MEMORY_INFO HOB verified above |
| 212 | */ |
Lee Leahy | 216712a | 2017-03-17 11:23:32 -0700 | [diff] [blame] | 213 | if (cbmem_root != NULL) { |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 214 | printk(BIOS_DEBUG, |
| 215 | "7.4: FSP_BOOTLOADER_TOLUM_HOB: 0x%p\n", |
| 216 | cbmem_root); |
| 217 | data = cbmem_root->PhysicalStart; |
| 218 | printk(BIOS_DEBUG, " 0x%016lx: PhysicalStart\n", data); |
| 219 | data = cbmem_root->ResourceLength; |
| 220 | printk(BIOS_DEBUG, " 0x%016lx: ResourceLength\n", data); |
| 221 | } |
| 222 | hob_ptr.Raw = get_next_guid_hob(&mrc_guid, hob_list_ptr); |
Lee Leahy | 216712a | 2017-03-17 11:23:32 -0700 | [diff] [blame] | 223 | if (hob_ptr.Raw == NULL) { |
Frans Hendriks | 8f95edc | 2018-11-06 12:04:34 +0100 | [diff] [blame] | 224 | if (params->pei_data->saved_data == NULL) { |
| 225 | printk(BIOS_ERR, "7.3: FSP_NON_VOLATILE_STORAGE_HOB missing!\n"); |
| 226 | fsp_verification_failure = 1; |
| 227 | } |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 228 | } else { |
| 229 | printk(BIOS_DEBUG, |
| 230 | "7.3: FSP_NON_VOLATILE_STORAGE_HOB: 0x%p\n", |
| 231 | hob_ptr.Raw); |
| 232 | } |
| 233 | if (fsp_memory != NULL) { |
| 234 | printk(BIOS_DEBUG, |
| 235 | "7.2: FSP_RESERVED_MEMORY_RESOURCE_HOB: 0x%p\n", |
| 236 | fsp_memory); |
| 237 | data = fsp_memory->PhysicalStart; |
| 238 | printk(BIOS_DEBUG, " 0x%016lx: PhysicalStart\n", data); |
| 239 | data = fsp_memory->ResourceLength; |
| 240 | printk(BIOS_DEBUG, " 0x%016lx: ResourceLength\n", data); |
| 241 | } |
| 242 | |
| 243 | /* Verify all the HOBs are present */ |
| 244 | if (fsp_verification_failure) |
| 245 | printk(BIOS_DEBUG, |
| 246 | "ERROR - Missing one or more required FSP HOBs!\n"); |
| 247 | |
| 248 | /* Display the HOBs */ |
| 249 | print_hob_type_structure(0, hob_list_ptr); |
| 250 | #endif |
| 251 | |
| 252 | /* Get the address of the CBMEM region for the FSP reserved memory */ |
| 253 | fsp_reserved_memory_area = cbmem_find(CBMEM_ID_FSP_RESERVED_MEMORY); |
| 254 | printk(BIOS_DEBUG, "0x%p: fsp_reserved_memory_area\n", |
| 255 | fsp_reserved_memory_area); |
| 256 | |
| 257 | /* Verify the order of CBMEM root and FSP memory */ |
| 258 | if ((fsp_memory != NULL) && (cbmem_root != NULL) && |
| 259 | (cbmem_root->PhysicalStart <= fsp_memory->PhysicalStart)) { |
| 260 | fsp_verification_failure = 1; |
| 261 | printk(BIOS_DEBUG, |
| 262 | "ERROR - FSP reserved memory above CBMEM root!\n"); |
| 263 | } |
| 264 | |
| 265 | /* Verify that the FSP memory was properly reserved */ |
| 266 | if ((fsp_memory != NULL) && ((fsp_reserved_memory_area == NULL) || |
| 267 | (fsp_memory->PhysicalStart != |
| 268 | (unsigned int)fsp_reserved_memory_area))) { |
| 269 | fsp_verification_failure = 1; |
| 270 | printk(BIOS_DEBUG, "ERROR - Reserving FSP memory area!\n"); |
Julius Werner | cd49cce | 2019-03-05 16:53:33 -0800 | [diff] [blame] | 271 | #if CONFIG(HAVE_SMI_HANDLER) |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 272 | if (cbmem_root != NULL) { |
| 273 | size_t delta_bytes = (unsigned int)smm_base |
| 274 | - cbmem_root->PhysicalStart |
| 275 | - cbmem_root->ResourceLength; |
| 276 | printk(BIOS_DEBUG, |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 277 | "0x%08x: Chipset reserved bytes reported by FSP\n", |
| 278 | (unsigned int)delta_bytes); |
| 279 | die("Please verify the chipset reserved size\n"); |
| 280 | } |
| 281 | #endif |
| 282 | } |
| 283 | |
| 284 | /* Verify the FSP 1.1 HOB interface */ |
| 285 | if (fsp_verification_failure) |
Martin Roth | e18e642 | 2017-06-03 20:03:18 -0600 | [diff] [blame] | 286 | die("ERROR - coreboot's requirements not met by FSP binary!\n"); |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 287 | |
| 288 | /* Display the memory configuration */ |
| 289 | report_memory_config(); |
| 290 | |
| 291 | /* Locate the memory configuration data to speed up the next reboot */ |
| 292 | mrc_hob = get_next_guid_hob(&mrc_guid, hob_list_ptr); |
| 293 | if (mrc_hob == NULL) |
| 294 | printk(BIOS_DEBUG, |
| 295 | "Memory Configuration Data Hob not present\n"); |
Furquan Shaikh | 0325dc6 | 2016-07-25 13:02:36 -0700 | [diff] [blame] | 296 | else if (!vboot_recovery_mode_enabled()) { |
haridhar | 07e9e6f | 2015-12-18 10:50:46 +0530 | [diff] [blame] | 297 | /* Do not save MRC data in recovery path */ |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 298 | pei_ptr->data_to_save = GET_GUID_HOB_DATA(mrc_hob); |
| 299 | pei_ptr->data_to_save_size = ALIGN( |
| 300 | ((u32)GET_HOB_LENGTH(mrc_hob)), 16); |
| 301 | } |
| 302 | } |
| 303 | |
| 304 | /* Initialize the UPD parameters for MemoryInit */ |
Aaron Durbin | 6403167 | 2018-04-21 14:45:32 -0600 | [diff] [blame] | 305 | __weak void mainboard_memory_init_params( |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 306 | struct romstage_params *params, |
| 307 | MEMORY_INIT_UPD *upd_ptr) |
| 308 | { |
| 309 | printk(BIOS_DEBUG, "WEAK: %s/%s called\n", __FILE__, __func__); |
| 310 | } |
| 311 | |
| 312 | /* Display the UPD parameters for MemoryInit */ |
Aaron Durbin | 6403167 | 2018-04-21 14:45:32 -0600 | [diff] [blame] | 313 | __weak void soc_display_memory_init_params( |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 314 | const MEMORY_INIT_UPD *old, MEMORY_INIT_UPD *new) |
| 315 | { |
| 316 | printk(BIOS_SPEW, "UPD values for MemoryInit:\n"); |
| 317 | hexdump32(BIOS_SPEW, new, sizeof(*new)); |
| 318 | } |
| 319 | |
| 320 | /* Initialize the UPD parameters for MemoryInit */ |
Aaron Durbin | 6403167 | 2018-04-21 14:45:32 -0600 | [diff] [blame] | 321 | __weak void soc_memory_init_params( |
Duncan Laurie | 9dcd4f0 | 2015-08-17 18:09:14 -0700 | [diff] [blame] | 322 | struct romstage_params *params, |
| 323 | MEMORY_INIT_UPD *upd) |
Lee Leahy | 0946ec3 | 2015-04-20 15:24:54 -0700 | [diff] [blame] | 324 | { |
| 325 | printk(BIOS_DEBUG, "WEAK: %s/%s called\n", __FILE__, __func__); |
| 326 | } |
Frans Hendriks | 1385b7d | 2019-04-05 13:42:14 +0200 | [diff] [blame] | 327 | |
| 328 | /* Initialize the SoC after MemoryInit */ |
| 329 | __weak void mainboard_after_memory_init(void) |
| 330 | { |
| 331 | printk(BIOS_DEBUG, "WEAK: %s/%s called\n", __FILE__, __func__); |
| 332 | } |