Kyösti Mälkki | 28c4d2f | 2016-11-25 11:21:02 +0200 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2011-2012 Advanced Micro Devices, Inc. |
| 5 | * Copyright (C) 2016 Kyösti Mälkki |
| 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. |
| 15 | */ |
| 16 | |
| 17 | #include <stdint.h> |
| 18 | #include <string.h> |
Kyösti Mälkki | 28c4d2f | 2016-11-25 11:21:02 +0200 | [diff] [blame] | 19 | #include <arch/acpi.h> |
Elyes HAOUAS | d2b9ec1 | 2018-10-27 09:41:02 +0200 | [diff] [blame] | 20 | #include <arch/cpu.h> |
Kyösti Mälkki | 28c4d2f | 2016-11-25 11:21:02 +0200 | [diff] [blame] | 21 | #include <bootstate.h> |
Kyösti Mälkki | dbd6495 | 2017-07-16 16:08:58 +0300 | [diff] [blame] | 22 | #include <cbfs.h> |
Kyösti Mälkki | 43f6d9d | 2019-03-14 14:59:31 +0200 | [diff] [blame] | 23 | #include <cbmem.h> |
| 24 | #include <timestamp.h> |
| 25 | |
Kyösti Mälkki | 28c4d2f | 2016-11-25 11:21:02 +0200 | [diff] [blame] | 26 | #include <northbridge/amd/agesa/state_machine.h> |
| 27 | #include <northbridge/amd/agesa/agesa_helper.h> |
| 28 | #include <northbridge/amd/agesa/BiosCallOuts.h> |
Elyes HAOUAS | 19f5ba8 | 2018-10-14 14:52:06 +0200 | [diff] [blame] | 29 | #include <amdlib.h> |
Kyösti Mälkki | c6918f9 | 2018-06-11 08:52:22 +0300 | [diff] [blame] | 30 | |
Elyes HAOUAS | 19f5ba8 | 2018-10-14 14:52:06 +0200 | [diff] [blame] | 31 | #include <AMD.h> |
Kyösti Mälkki | 28c4d2f | 2016-11-25 11:21:02 +0200 | [diff] [blame] | 32 | |
Julius Werner | cd49cce | 2019-03-05 16:53:33 -0800 | [diff] [blame] | 33 | #if CONFIG(CPU_AMD_AGESA_OPENSOURCE) |
Kyösti Mälkki | dbd6495 | 2017-07-16 16:08:58 +0300 | [diff] [blame] | 34 | #include "Dispatcher.h" |
| 35 | #endif |
Kyösti Mälkki | 28c4d2f | 2016-11-25 11:21:02 +0200 | [diff] [blame] | 36 | |
| 37 | #if ENV_ROMSTAGE |
| 38 | #include <PlatformMemoryConfiguration.h> |
| 39 | CONST PSO_ENTRY ROMDATA DefaultPlatformMemoryConfiguration[] = {PSO_END}; |
| 40 | #endif |
| 41 | |
Kyösti Mälkki | dbd6495 | 2017-07-16 16:08:58 +0300 | [diff] [blame] | 42 | static void agesa_locate_image(AMD_CONFIG_PARAMS *StdHeader) |
| 43 | { |
Julius Werner | cd49cce | 2019-03-05 16:53:33 -0800 | [diff] [blame] | 44 | #if CONFIG(CPU_AMD_AGESA_BINARY_PI) |
Kyösti Mälkki | dbd6495 | 2017-07-16 16:08:58 +0300 | [diff] [blame] | 45 | const char ModuleIdentifier[] = AGESA_ID; |
| 46 | const void *agesa, *image; |
| 47 | size_t file_size; |
| 48 | |
| 49 | agesa = cbfs_boot_map_with_leak((const char *)CONFIG_AGESA_CBFS_NAME, |
| 50 | CBFS_TYPE_RAW, &file_size); |
| 51 | if (agesa == NULL) |
| 52 | return; |
| 53 | |
| 54 | image = LibAmdLocateImage(agesa, agesa + file_size, 4096, |
| 55 | ModuleIdentifier); |
Elyes HAOUAS | b0b0c8c | 2018-07-08 12:33:47 +0200 | [diff] [blame] | 56 | StdHeader->ImageBasePtr = (void *) image; |
Kyösti Mälkki | dbd6495 | 2017-07-16 16:08:58 +0300 | [diff] [blame] | 57 | #endif |
| 58 | } |
| 59 | |
Kyösti Mälkki | 28c4d2f | 2016-11-25 11:21:02 +0200 | [diff] [blame] | 60 | void agesa_set_interface(struct sysinfo *cb) |
| 61 | { |
| 62 | memset(&cb->StdHeader, 0, sizeof(AMD_CONFIG_PARAMS)); |
| 63 | |
| 64 | cb->StdHeader.CalloutPtr = GetBiosCallout; |
Kyösti Mälkki | dbd6495 | 2017-07-16 16:08:58 +0300 | [diff] [blame] | 65 | |
Julius Werner | cd49cce | 2019-03-05 16:53:33 -0800 | [diff] [blame] | 66 | if (CONFIG(CPU_AMD_AGESA_BINARY_PI)) { |
Kyösti Mälkki | dbd6495 | 2017-07-16 16:08:58 +0300 | [diff] [blame] | 67 | agesa_locate_image(&cb->StdHeader); |
| 68 | AMD_IMAGE_HEADER *image = |
Elyes HAOUAS | b0b0c8c | 2018-07-08 12:33:47 +0200 | [diff] [blame] | 69 | (void *)(uintptr_t)cb->StdHeader.ImageBasePtr; |
Kyösti Mälkki | dbd6495 | 2017-07-16 16:08:58 +0300 | [diff] [blame] | 70 | ASSERT(image); |
| 71 | AMD_MODULE_HEADER *module = |
Elyes HAOUAS | b0b0c8c | 2018-07-08 12:33:47 +0200 | [diff] [blame] | 72 | (void *)(uintptr_t)image->ModuleInfoOffset; |
Kyösti Mälkki | dbd6495 | 2017-07-16 16:08:58 +0300 | [diff] [blame] | 73 | ASSERT(module && module->ModuleDispatcher); |
| 74 | } |
Kyösti Mälkki | 28c4d2f | 2016-11-25 11:21:02 +0200 | [diff] [blame] | 75 | } |
| 76 | |
| 77 | AGESA_STATUS module_dispatch(AGESA_STRUCT_NAME func, |
| 78 | AMD_CONFIG_PARAMS *StdHeader) |
| 79 | { |
Kyösti Mälkki | dbd6495 | 2017-07-16 16:08:58 +0300 | [diff] [blame] | 80 | MODULE_ENTRY dispatcher; |
| 81 | |
Julius Werner | cd49cce | 2019-03-05 16:53:33 -0800 | [diff] [blame] | 82 | #if CONFIG(CPU_AMD_AGESA_OPENSOURCE) |
Kyösti Mälkki | dbd6495 | 2017-07-16 16:08:58 +0300 | [diff] [blame] | 83 | dispatcher = AmdAgesaDispatcher; |
| 84 | #endif |
Julius Werner | cd49cce | 2019-03-05 16:53:33 -0800 | [diff] [blame] | 85 | #if CONFIG(CPU_AMD_AGESA_BINARY_PI) |
Elyes HAOUAS | b0b0c8c | 2018-07-08 12:33:47 +0200 | [diff] [blame] | 86 | AMD_IMAGE_HEADER *image = (void *)(uintptr_t)StdHeader->ImageBasePtr; |
| 87 | AMD_MODULE_HEADER *module = (void *)(uintptr_t)image->ModuleInfoOffset; |
Kyösti Mälkki | dbd6495 | 2017-07-16 16:08:58 +0300 | [diff] [blame] | 88 | dispatcher = module->ModuleDispatcher; |
| 89 | #endif |
Kyösti Mälkki | 28c4d2f | 2016-11-25 11:21:02 +0200 | [diff] [blame] | 90 | |
| 91 | StdHeader->Func = func; |
| 92 | return dispatcher(StdHeader); |
| 93 | } |
| 94 | |
| 95 | static AGESA_STATUS amd_create_struct(AMD_INTERFACE_PARAMS *aip, |
| 96 | AGESA_STRUCT_NAME func, void *buf, size_t len) |
| 97 | { |
| 98 | aip->AgesaFunctionName = func; |
| 99 | aip->AllocationMethod = 0; |
| 100 | aip->NewStructPtr = buf; |
| 101 | aip->NewStructSize = len; |
| 102 | if (buf != NULL && len != 0) |
| 103 | aip->AllocationMethod = ByHost; |
| 104 | |
| 105 | return module_dispatch(AMD_CREATE_STRUCT, &aip->StdHeader); |
| 106 | } |
| 107 | |
| 108 | static AGESA_STATUS amd_release_struct(AMD_INTERFACE_PARAMS *aip) |
| 109 | { |
| 110 | /* Cannot release AMD_LATE_PARAMS until ACPI tables are done. */ |
| 111 | if (aip->AgesaFunctionName == AMD_INIT_LATE) |
| 112 | return AGESA_SUCCESS; |
| 113 | |
| 114 | return module_dispatch(AMD_RELEASE_STRUCT, &aip->StdHeader); |
| 115 | } |
| 116 | |
| 117 | /* By design, for each valid AGESA_STRUCT_NAME, AMD_CONFIG_PARAMS |
| 118 | * can be evaluated to apply correct typecast based on Func field. |
| 119 | */ |
| 120 | |
Kyösti Mälkki | a18f58b | 2017-07-25 11:34:43 +0300 | [diff] [blame] | 121 | static AGESA_STATUS romstage_dispatch(struct sysinfo *cb, |
Kyösti Mälkki | 28c4d2f | 2016-11-25 11:21:02 +0200 | [diff] [blame] | 122 | AGESA_STRUCT_NAME func, AMD_CONFIG_PARAMS *StdHeader) |
| 123 | { |
| 124 | AGESA_STATUS status = AGESA_UNSUPPORTED; |
| 125 | |
| 126 | switch (func) |
| 127 | { |
Kyösti Mälkki | 28c4d2f | 2016-11-25 11:21:02 +0200 | [diff] [blame] | 128 | case AMD_INIT_RESET: |
| 129 | { |
| 130 | AMD_RESET_PARAMS *param = (void *)StdHeader; |
| 131 | platform_BeforeInitReset(cb, param); |
| 132 | board_BeforeInitReset(cb, param); |
| 133 | status = module_dispatch(func, StdHeader); |
| 134 | break; |
| 135 | } |
| 136 | |
| 137 | case AMD_INIT_EARLY: |
| 138 | { |
| 139 | AMD_EARLY_PARAMS *param = (void *)StdHeader; |
| 140 | platform_BeforeInitEarly(cb, param); |
| 141 | board_BeforeInitEarly(cb, param); |
| 142 | status = module_dispatch(func, StdHeader); |
| 143 | break; |
| 144 | } |
| 145 | |
| 146 | case AMD_INIT_POST: |
| 147 | { |
| 148 | AMD_POST_PARAMS *param = (void *)StdHeader; |
| 149 | platform_BeforeInitPost(cb, param); |
| 150 | board_BeforeInitPost(cb, param); |
| 151 | status = module_dispatch(func, StdHeader); |
Kyösti Mälkki | 43f6d9d | 2019-03-14 14:59:31 +0200 | [diff] [blame] | 152 | |
| 153 | /* FIXME: Detect if TSC frequency really |
| 154 | * changed during raminit? */ |
| 155 | timestamp_rescale_table(1, 4); |
| 156 | |
Kyösti Mälkki | 28c4d2f | 2016-11-25 11:21:02 +0200 | [diff] [blame] | 157 | platform_AfterInitPost(cb, param); |
| 158 | break; |
| 159 | } |
| 160 | |
| 161 | case AMD_INIT_RESUME: |
| 162 | { |
| 163 | AMD_RESUME_PARAMS *param = (void *)StdHeader; |
| 164 | platform_BeforeInitResume(cb, param); |
| 165 | status = module_dispatch(func, StdHeader); |
Kyösti Mälkki | 43f6d9d | 2019-03-14 14:59:31 +0200 | [diff] [blame] | 166 | |
| 167 | /* FIXME: Detect if TSC frequency really |
| 168 | * changed during raminit? */ |
| 169 | timestamp_rescale_table(1, 4); |
| 170 | |
Kyösti Mälkki | 28c4d2f | 2016-11-25 11:21:02 +0200 | [diff] [blame] | 171 | platform_AfterInitResume(cb, param); |
| 172 | break; |
| 173 | } |
| 174 | |
Kyösti Mälkki | a18f58b | 2017-07-25 11:34:43 +0300 | [diff] [blame] | 175 | default: |
| 176 | { |
| 177 | break; |
| 178 | } |
| 179 | |
| 180 | } |
| 181 | return status; |
| 182 | } |
| 183 | |
| 184 | static AGESA_STATUS ramstage_dispatch(struct sysinfo *cb, |
| 185 | AGESA_STRUCT_NAME func, AMD_CONFIG_PARAMS *StdHeader) |
| 186 | { |
| 187 | AGESA_STATUS status = AGESA_UNSUPPORTED; |
| 188 | |
| 189 | switch (func) |
| 190 | { |
Kyösti Mälkki | 28c4d2f | 2016-11-25 11:21:02 +0200 | [diff] [blame] | 191 | case AMD_INIT_ENV: |
| 192 | { |
| 193 | AMD_ENV_PARAMS *param = (void *)StdHeader; |
| 194 | platform_BeforeInitEnv(cb, param); |
| 195 | board_BeforeInitEnv(cb, param); |
| 196 | status = module_dispatch(func, StdHeader); |
| 197 | platform_AfterInitEnv(cb, param); |
| 198 | break; |
| 199 | } |
| 200 | |
| 201 | case AMD_S3LATE_RESTORE: |
| 202 | { |
| 203 | AMD_S3LATE_PARAMS *param = (void *)StdHeader; |
| 204 | platform_BeforeS3LateRestore(cb, param); |
| 205 | status = module_dispatch(func, StdHeader); |
| 206 | platform_AfterS3LateRestore(cb, param); |
| 207 | break; |
| 208 | } |
Kyösti Mälkki | 21e609c | 2017-03-09 20:08:15 +0200 | [diff] [blame] | 209 | |
Kyösti Mälkki | 28c4d2f | 2016-11-25 11:21:02 +0200 | [diff] [blame] | 210 | case AMD_INIT_MID: |
| 211 | { |
| 212 | AMD_MID_PARAMS *param = (void *)StdHeader; |
| 213 | platform_BeforeInitMid(cb, param); |
| 214 | board_BeforeInitMid(cb, param); |
| 215 | status = module_dispatch(func, StdHeader); |
| 216 | break; |
| 217 | } |
| 218 | |
| 219 | case AMD_S3_SAVE: |
| 220 | { |
| 221 | AMD_S3SAVE_PARAMS *param = (void *)StdHeader; |
| 222 | status = module_dispatch(func, StdHeader); |
| 223 | platform_AfterS3Save(cb, param); |
| 224 | break; |
| 225 | } |
Kyösti Mälkki | a18f58b | 2017-07-25 11:34:43 +0300 | [diff] [blame] | 226 | |
Kyösti Mälkki | 28c4d2f | 2016-11-25 11:21:02 +0200 | [diff] [blame] | 227 | case AMD_INIT_LATE: |
| 228 | { |
| 229 | AMD_LATE_PARAMS *param = (void *)StdHeader; |
| 230 | status = module_dispatch(func, StdHeader); |
| 231 | platform_AfterInitLate(cb, param); |
| 232 | completion_InitLate(cb, param); |
| 233 | break; |
| 234 | } |
Kyösti Mälkki | a18f58b | 2017-07-25 11:34:43 +0300 | [diff] [blame] | 235 | |
Kyösti Mälkki | 28c4d2f | 2016-11-25 11:21:02 +0200 | [diff] [blame] | 236 | default: |
| 237 | { |
| 238 | break; |
| 239 | } |
| 240 | |
| 241 | } |
| 242 | return status; |
| 243 | } |
| 244 | |
Kyösti Mälkki | 28c4d2f | 2016-11-25 11:21:02 +0200 | [diff] [blame] | 245 | int agesa_execute_state(struct sysinfo *cb, AGESA_STRUCT_NAME func) |
| 246 | { |
| 247 | AMD_INTERFACE_PARAMS aip; |
| 248 | union { |
| 249 | AMD_RESET_PARAMS reset; |
Kyösti Mälkki | 21e609c | 2017-03-09 20:08:15 +0200 | [diff] [blame] | 250 | AMD_S3LATE_PARAMS s3late; |
Kyösti Mälkki | 28c4d2f | 2016-11-25 11:21:02 +0200 | [diff] [blame] | 251 | } agesa_params; |
| 252 | void *buf = NULL; |
| 253 | size_t len = 0; |
Kyösti Mälkki | 28c4d2f | 2016-11-25 11:21:02 +0200 | [diff] [blame] | 254 | |
| 255 | AGESA_STATUS status, final; |
| 256 | |
| 257 | struct agesa_state task; |
| 258 | memset(&task, 0, sizeof(task)); |
Kyösti Mälkki | d1d4f93 | 2017-09-24 08:21:00 +0300 | [diff] [blame] | 259 | agesa_state_on_entry(&task, func); |
Kyösti Mälkki | 28c4d2f | 2016-11-25 11:21:02 +0200 | [diff] [blame] | 260 | |
| 261 | aip.StdHeader = cb->StdHeader; |
| 262 | |
| 263 | /* For these calls, heap is not available. */ |
Kyösti Mälkki | 21e609c | 2017-03-09 20:08:15 +0200 | [diff] [blame] | 264 | if (func == AMD_INIT_RESET || func == AMD_S3LATE_RESTORE) { |
Kyösti Mälkki | 28c4d2f | 2016-11-25 11:21:02 +0200 | [diff] [blame] | 265 | buf = (void *) &agesa_params; |
| 266 | len = sizeof(agesa_params); |
| 267 | memcpy(buf, &cb->StdHeader, sizeof(cb->StdHeader)); |
| 268 | } |
| 269 | |
| 270 | status = amd_create_struct(&aip, func, buf, len); |
| 271 | ASSERT(status == AGESA_SUCCESS); |
| 272 | |
| 273 | /* Must call the function buffer was allocated for.*/ |
| 274 | AMD_CONFIG_PARAMS *StdHeader = aip.NewStructPtr; |
Jacob Garber | 176670e | 2019-06-04 15:13:46 -0600 | [diff] [blame^] | 275 | ASSERT(StdHeader != NULL && StdHeader->Func == func); |
Kyösti Mälkki | 28c4d2f | 2016-11-25 11:21:02 +0200 | [diff] [blame] | 276 | |
Kyösti Mälkki | 43f6d9d | 2019-03-14 14:59:31 +0200 | [diff] [blame] | 277 | if (CONFIG(AGESA_EXTRA_TIMESTAMPS) && task.ts_entry_id) |
| 278 | timestamp_add_now(task.ts_entry_id); |
| 279 | |
Kyösti Mälkki | a18f58b | 2017-07-25 11:34:43 +0300 | [diff] [blame] | 280 | if (ENV_ROMSTAGE) |
| 281 | final = romstage_dispatch(cb, func, StdHeader); |
| 282 | |
| 283 | if (ENV_RAMSTAGE) |
| 284 | final = ramstage_dispatch(cb, func, StdHeader); |
Kyösti Mälkki | 28c4d2f | 2016-11-25 11:21:02 +0200 | [diff] [blame] | 285 | |
Kyösti Mälkki | 43f6d9d | 2019-03-14 14:59:31 +0200 | [diff] [blame] | 286 | if (CONFIG(AGESA_EXTRA_TIMESTAMPS) && task.ts_exit_id) |
| 287 | timestamp_add_now(task.ts_exit_id); |
| 288 | |
Kyösti Mälkki | d1d4f93 | 2017-09-24 08:21:00 +0300 | [diff] [blame] | 289 | agesawrapper_trace(final, StdHeader, task.function_name); |
Kyösti Mälkki | 28c4d2f | 2016-11-25 11:21:02 +0200 | [diff] [blame] | 290 | ASSERT(final < AGESA_FATAL); |
| 291 | |
| 292 | status = amd_release_struct(&aip); |
| 293 | ASSERT(status == AGESA_SUCCESS); |
| 294 | |
Kyösti Mälkki | d1d4f93 | 2017-09-24 08:21:00 +0300 | [diff] [blame] | 295 | agesa_state_on_exit(&task, &aip.StdHeader); |
Kyösti Mälkki | 28c4d2f | 2016-11-25 11:21:02 +0200 | [diff] [blame] | 296 | |
| 297 | return (final < AGESA_FATAL) ? 0 : -1; |
| 298 | } |
| 299 | |
| 300 | #if ENV_RAMSTAGE |
| 301 | |
| 302 | static void amd_bs_ramstage_init(void *arg) |
| 303 | { |
| 304 | struct sysinfo *cb = arg; |
| 305 | |
| 306 | agesa_set_interface(cb); |
Kyösti Mälkki | 21e609c | 2017-03-09 20:08:15 +0200 | [diff] [blame] | 307 | |
| 308 | if (!acpi_is_wakeup_s3()) |
| 309 | agesa_execute_state(cb, AMD_INIT_ENV); |
| 310 | else { |
Kyösti Mälkki | 21e609c | 2017-03-09 20:08:15 +0200 | [diff] [blame] | 311 | agesa_execute_state(cb, AMD_S3LATE_RESTORE); |
Kyösti Mälkki | 38aff1a | 2017-07-26 00:57:30 +0300 | [diff] [blame] | 312 | fchs3earlyrestore(&cb->StdHeader); |
Kyösti Mälkki | 21e609c | 2017-03-09 20:08:15 +0200 | [diff] [blame] | 313 | } |
Kyösti Mälkki | 28c4d2f | 2016-11-25 11:21:02 +0200 | [diff] [blame] | 314 | } |
| 315 | |
| 316 | void sb_After_Pci_Restore_Init(void); |
| 317 | |
| 318 | static void amd_bs_dev_enable(void *arg) |
| 319 | { |
| 320 | struct sysinfo *cb = arg; |
| 321 | |
| 322 | if (!acpi_is_wakeup_s3()) |
| 323 | agesa_execute_state(cb, AMD_INIT_MID); |
| 324 | |
| 325 | /* FIXME */ |
Julius Werner | cd49cce | 2019-03-05 16:53:33 -0800 | [diff] [blame] | 326 | if (CONFIG(AMD_SB_CIMX) && acpi_is_wakeup_s3()) |
Kyösti Mälkki | 28c4d2f | 2016-11-25 11:21:02 +0200 | [diff] [blame] | 327 | sb_After_Pci_Restore_Init(); |
| 328 | } |
| 329 | |
| 330 | static void amd_bs_post_device(void *arg) |
| 331 | { |
| 332 | struct sysinfo *cb = arg; |
| 333 | |
Kyösti Mälkki | 38aff1a | 2017-07-26 00:57:30 +0300 | [diff] [blame] | 334 | if (acpi_is_wakeup_s3()) { |
| 335 | fchs3laterestore(&cb->StdHeader); |
Kyösti Mälkki | 28c4d2f | 2016-11-25 11:21:02 +0200 | [diff] [blame] | 336 | return; |
Kyösti Mälkki | 38aff1a | 2017-07-26 00:57:30 +0300 | [diff] [blame] | 337 | } |
Kyösti Mälkki | 28c4d2f | 2016-11-25 11:21:02 +0200 | [diff] [blame] | 338 | |
| 339 | agesa_execute_state(cb, AMD_INIT_LATE); |
| 340 | |
| 341 | if (!acpi_s3_resume_allowed()) |
| 342 | return; |
| 343 | |
| 344 | agesa_execute_state(cb, AMD_S3_SAVE); |
| 345 | } |
| 346 | |
| 347 | static struct sysinfo state_machine; |
| 348 | |
| 349 | BOOT_STATE_INIT_ENTRY(BS_PRE_DEVICE, BS_ON_ENTRY, amd_bs_ramstage_init, |
| 350 | &state_machine); |
| 351 | |
| 352 | BOOT_STATE_INIT_ENTRY(BS_DEV_ENABLE, BS_ON_ENTRY, amd_bs_dev_enable, |
| 353 | &state_machine); |
| 354 | |
| 355 | BOOT_STATE_INIT_ENTRY(BS_POST_DEVICE, BS_ON_EXIT, amd_bs_post_device, |
| 356 | &state_machine); |
| 357 | |
| 358 | #endif /* ENV_RAMSTAGE */ |
| 359 | |
| 360 | /* Empty stubs for cases board does not need to override anything. */ |
Aaron Durbin | 6403167 | 2018-04-21 14:45:32 -0600 | [diff] [blame] | 361 | void __weak |
Kyösti Mälkki | 28c4d2f | 2016-11-25 11:21:02 +0200 | [diff] [blame] | 362 | board_BeforeInitReset(struct sysinfo *cb, AMD_RESET_PARAMS *Reset) { } |
Aaron Durbin | 6403167 | 2018-04-21 14:45:32 -0600 | [diff] [blame] | 363 | void __weak |
Kyösti Mälkki | 28c4d2f | 2016-11-25 11:21:02 +0200 | [diff] [blame] | 364 | board_BeforeInitEarly(struct sysinfo *cb, AMD_EARLY_PARAMS *Early) { } |
Aaron Durbin | 6403167 | 2018-04-21 14:45:32 -0600 | [diff] [blame] | 365 | void __weak |
Kyösti Mälkki | 28c4d2f | 2016-11-25 11:21:02 +0200 | [diff] [blame] | 366 | board_BeforeInitPost(struct sysinfo *cb, AMD_POST_PARAMS *Post) { } |
Aaron Durbin | 6403167 | 2018-04-21 14:45:32 -0600 | [diff] [blame] | 367 | void __weak |
Kyösti Mälkki | 28c4d2f | 2016-11-25 11:21:02 +0200 | [diff] [blame] | 368 | board_BeforeInitEnv(struct sysinfo *cb, AMD_ENV_PARAMS *Env) { } |
Aaron Durbin | 6403167 | 2018-04-21 14:45:32 -0600 | [diff] [blame] | 369 | void __weak |
Kyösti Mälkki | 28c4d2f | 2016-11-25 11:21:02 +0200 | [diff] [blame] | 370 | board_BeforeInitMid(struct sysinfo *cb, AMD_MID_PARAMS *Mid) { } |
Kyösti Mälkki | 38aff1a | 2017-07-26 00:57:30 +0300 | [diff] [blame] | 371 | |
Aaron Durbin | 6403167 | 2018-04-21 14:45:32 -0600 | [diff] [blame] | 372 | AGESA_STATUS __weak |
Kyösti Mälkki | 38aff1a | 2017-07-26 00:57:30 +0300 | [diff] [blame] | 373 | fchs3earlyrestore(AMD_CONFIG_PARAMS *StdHeader) |
| 374 | { |
| 375 | return AGESA_SUCCESS; |
| 376 | } |
| 377 | |
Aaron Durbin | 6403167 | 2018-04-21 14:45:32 -0600 | [diff] [blame] | 378 | AGESA_STATUS __weak |
Kyösti Mälkki | 38aff1a | 2017-07-26 00:57:30 +0300 | [diff] [blame] | 379 | fchs3laterestore(AMD_CONFIG_PARAMS *StdHeader) |
| 380 | { |
| 381 | return AGESA_SUCCESS; |
| 382 | } |