Aaron Durbin | 3d0071b | 2013-01-18 14:32:50 -0600 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2012 ChromeOS Authors |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; version 2 of the License. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
Aaron Durbin | 3d0071b | 2013-01-18 14:32:50 -0600 | [diff] [blame] | 14 | */ |
| 15 | |
| 16 | #include <stdint.h> |
Aaron Durbin | 7492ec1 | 2013-02-08 22:18:04 -0600 | [diff] [blame] | 17 | #include <string.h> |
Aaron Durbin | bd74a4b | 2015-03-06 23:17:33 -0600 | [diff] [blame] | 18 | #include <cbfs.h> |
Aaron Durbin | 3d0071b | 2013-01-18 14:32:50 -0600 | [diff] [blame] | 19 | #include <console/console.h> |
Aaron Durbin | a267161 | 2013-02-06 21:41:01 -0600 | [diff] [blame] | 20 | #include <arch/cpu.h> |
| 21 | #include <cpu/x86/bist.h> |
| 22 | #include <cpu/x86/msr.h> |
Aaron Durbin | 38d9423 | 2013-02-07 00:03:33 -0600 | [diff] [blame] | 23 | #include <cpu/x86/mtrr.h> |
Patrick Georgi | bd79c5e | 2014-11-28 22:35:36 +0100 | [diff] [blame] | 24 | #include <halt.h> |
Aaron Durbin | a267161 | 2013-02-06 21:41:01 -0600 | [diff] [blame] | 25 | #include <lib.h> |
| 26 | #include <timestamp.h> |
Kyösti Mälkki | a969ed3 | 2016-06-15 06:08:15 +0300 | [diff] [blame] | 27 | #include <arch/acpi.h> |
Aaron Durbin | a267161 | 2013-02-06 21:41:01 -0600 | [diff] [blame] | 28 | #include <arch/io.h> |
Aaron Durbin | 7492ec1 | 2013-02-08 22:18:04 -0600 | [diff] [blame] | 29 | #include <arch/stages.h> |
Aaron Durbin | a267161 | 2013-02-06 21:41:01 -0600 | [diff] [blame] | 30 | #include <device/pci_def.h> |
| 31 | #include <cpu/x86/lapic.h> |
Kyösti Mälkki | 465eff6 | 2016-06-15 06:07:55 +0300 | [diff] [blame] | 32 | #include <cbmem.h> |
Aaron Durbin | bf396ff | 2013-02-11 21:50:35 -0600 | [diff] [blame] | 33 | #include <romstage_handoff.h> |
Aaron Durbin | b86113f | 2013-02-19 08:59:16 -0600 | [diff] [blame] | 34 | #include <reset.h> |
Aaron Durbin | a267161 | 2013-02-06 21:41:01 -0600 | [diff] [blame] | 35 | #include <vendorcode/google/chromeos/chromeos.h> |
Duncan Laurie | 7cced0d | 2013-06-04 10:03:34 -0700 | [diff] [blame] | 36 | #if CONFIG_EC_GOOGLE_CHROMEEC |
| 37 | #include <ec/google/chromeec/ec.h> |
| 38 | #endif |
Aaron Durbin | a267161 | 2013-02-06 21:41:01 -0600 | [diff] [blame] | 39 | #include "haswell.h" |
| 40 | #include "northbridge/intel/haswell/haswell.h" |
| 41 | #include "northbridge/intel/haswell/raminit.h" |
| 42 | #include "southbridge/intel/lynxpoint/pch.h" |
| 43 | #include "southbridge/intel/lynxpoint/me.h" |
Vladimir Serbinenko | 0e90dae | 2015-05-18 10:29:06 +0200 | [diff] [blame] | 44 | #include <tpm.h> |
Aaron Durbin | a267161 | 2013-02-06 21:41:01 -0600 | [diff] [blame] | 45 | |
Aaron Durbin | b86113f | 2013-02-19 08:59:16 -0600 | [diff] [blame] | 46 | static inline void reset_system(void) |
| 47 | { |
| 48 | hard_reset(); |
Patrick Georgi | bd79c5e | 2014-11-28 22:35:36 +0100 | [diff] [blame] | 49 | halt(); |
Aaron Durbin | b86113f | 2013-02-19 08:59:16 -0600 | [diff] [blame] | 50 | } |
| 51 | |
Aaron Durbin | 38d9423 | 2013-02-07 00:03:33 -0600 | [diff] [blame] | 52 | /* The cache-as-ram assembly file calls romstage_main() after setting up |
| 53 | * cache-as-ram. romstage_main() will then call the mainboards's |
| 54 | * mainboard_romstage_entry() function. That function then calls |
| 55 | * romstage_common() below. The reason for the back and forth is to provide |
| 56 | * common entry point from cache-as-ram while still allowing for code sharing. |
| 57 | * Because we can't use global variables the stack is used for allocations -- |
| 58 | * thus the need to call back and forth. */ |
Aaron Durbin | 3d0071b | 2013-01-18 14:32:50 -0600 | [diff] [blame] | 59 | |
Aaron Durbin | 38d9423 | 2013-02-07 00:03:33 -0600 | [diff] [blame] | 60 | |
| 61 | static inline u32 *stack_push(u32 *stack, u32 value) |
| 62 | { |
| 63 | stack = &stack[-1]; |
| 64 | *stack = value; |
| 65 | return stack; |
| 66 | } |
| 67 | |
Aaron Durbin | c0cbd6e | 2013-03-13 13:51:20 -0500 | [diff] [blame] | 68 | /* Romstage needs quite a bit of stack for decompressing images since the lzma |
| 69 | * lib keeps its state on the stack during romstage. */ |
| 70 | #define ROMSTAGE_RAM_STACK_SIZE 0x5000 |
Aaron Durbin | e2d9e5b | 2013-02-08 17:38:35 -0600 | [diff] [blame] | 71 | static unsigned long choose_top_of_stack(void) |
| 72 | { |
| 73 | unsigned long stack_top; |
Kyösti Mälkki | ae98e83 | 2014-11-28 11:24:19 +0200 | [diff] [blame] | 74 | |
Aaron Durbin | c0cbd6e | 2013-03-13 13:51:20 -0500 | [diff] [blame] | 75 | /* cbmem_add() does a find() before add(). */ |
| 76 | stack_top = (unsigned long)cbmem_add(CBMEM_ID_ROMSTAGE_RAM_STACK, |
| 77 | ROMSTAGE_RAM_STACK_SIZE); |
| 78 | stack_top += ROMSTAGE_RAM_STACK_SIZE; |
Aaron Durbin | e2d9e5b | 2013-02-08 17:38:35 -0600 | [diff] [blame] | 79 | return stack_top; |
| 80 | } |
| 81 | |
Aaron Durbin | 38d9423 | 2013-02-07 00:03:33 -0600 | [diff] [blame] | 82 | /* setup_romstage_stack_after_car() determines the stack to use after |
| 83 | * cache-as-ram is torn down as well as the MTRR settings to use. */ |
| 84 | static void *setup_romstage_stack_after_car(void) |
| 85 | { |
| 86 | unsigned long top_of_stack; |
| 87 | int num_mtrrs; |
| 88 | u32 *slot; |
| 89 | u32 mtrr_mask_upper; |
Aaron Durbin | 67481ddc | 2013-02-15 15:08:37 -0600 | [diff] [blame] | 90 | u32 top_of_ram; |
Aaron Durbin | 38d9423 | 2013-02-07 00:03:33 -0600 | [diff] [blame] | 91 | |
| 92 | /* Top of stack needs to be aligned to a 4-byte boundary. */ |
Aaron Durbin | e2d9e5b | 2013-02-08 17:38:35 -0600 | [diff] [blame] | 93 | top_of_stack = choose_top_of_stack() & ~3; |
Aaron Durbin | 38d9423 | 2013-02-07 00:03:33 -0600 | [diff] [blame] | 94 | slot = (void *)top_of_stack; |
| 95 | num_mtrrs = 0; |
| 96 | |
| 97 | /* The upper bits of the MTRR mask need to set according to the number |
| 98 | * of physical address bits. */ |
| 99 | mtrr_mask_upper = (1 << ((cpuid_eax(0x80000008) & 0xff) - 32)) - 1; |
| 100 | |
Paul Menzel | 4fe9813 | 2014-01-25 15:55:28 +0100 | [diff] [blame] | 101 | /* The order for each MTRR is value then base with upper 32-bits of |
Aaron Durbin | 38d9423 | 2013-02-07 00:03:33 -0600 | [diff] [blame] | 102 | * each value coming before the lower 32-bits. The reasoning for |
| 103 | * this ordering is to create a stack layout like the following: |
| 104 | * +0: Number of MTRRs |
Paul Menzel | 4fe9813 | 2014-01-25 15:55:28 +0100 | [diff] [blame] | 105 | * +4: MTRR base 0 31:0 |
| 106 | * +8: MTRR base 0 63:32 |
| 107 | * +12: MTRR mask 0 31:0 |
| 108 | * +16: MTRR mask 0 63:32 |
| 109 | * +20: MTRR base 1 31:0 |
| 110 | * +24: MTRR base 1 63:32 |
| 111 | * +28: MTRR mask 1 31:0 |
| 112 | * +32: MTRR mask 1 63:32 |
Aaron Durbin | 38d9423 | 2013-02-07 00:03:33 -0600 | [diff] [blame] | 113 | */ |
| 114 | |
| 115 | /* Cache the ROM as WP just below 4GiB. */ |
| 116 | slot = stack_push(slot, mtrr_mask_upper); /* upper mask */ |
Alexandru Gagniuc | 86091f9 | 2015-09-30 20:23:09 -0700 | [diff] [blame] | 117 | slot = stack_push(slot, ~(CACHE_ROM_SIZE - 1) | MTRR_PHYS_MASK_VALID); |
Aaron Durbin | 38d9423 | 2013-02-07 00:03:33 -0600 | [diff] [blame] | 118 | slot = stack_push(slot, 0); /* upper base */ |
Kyösti Mälkki | 107f72e | 2014-01-06 11:06:26 +0200 | [diff] [blame] | 119 | slot = stack_push(slot, ~(CACHE_ROM_SIZE - 1) | MTRR_TYPE_WRPROT); |
Aaron Durbin | 38d9423 | 2013-02-07 00:03:33 -0600 | [diff] [blame] | 120 | num_mtrrs++; |
| 121 | |
Kyösti Mälkki | 65cc526 | 2016-06-19 20:38:41 +0300 | [diff] [blame] | 122 | /* Cache RAM as WB from 0 -> CACHE_TMP_RAMTOP. */ |
Aaron Durbin | 38d9423 | 2013-02-07 00:03:33 -0600 | [diff] [blame] | 123 | slot = stack_push(slot, mtrr_mask_upper); /* upper mask */ |
Kyösti Mälkki | 65cc526 | 2016-06-19 20:38:41 +0300 | [diff] [blame] | 124 | slot = stack_push(slot, ~(CACHE_TMP_RAMTOP - 1) | MTRR_PHYS_MASK_VALID); |
Aaron Durbin | 38d9423 | 2013-02-07 00:03:33 -0600 | [diff] [blame] | 125 | slot = stack_push(slot, 0); /* upper base */ |
| 126 | slot = stack_push(slot, 0 | MTRR_TYPE_WRBACK); |
| 127 | num_mtrrs++; |
| 128 | |
Kyösti Mälkki | f1e3c76 | 2014-12-22 12:28:07 +0200 | [diff] [blame] | 129 | top_of_ram = (uint32_t)cbmem_top(); |
Aaron Durbin | 38d9423 | 2013-02-07 00:03:33 -0600 | [diff] [blame] | 130 | /* Cache 8MiB below the top of ram. On haswell systems the top of |
| 131 | * ram under 4GiB is the start of the TSEG region. It is required to |
| 132 | * be 8MiB aligned. Set this area as cacheable so it can be used later |
| 133 | * for ramstage before setting up the entire RAM as cacheable. */ |
| 134 | slot = stack_push(slot, mtrr_mask_upper); /* upper mask */ |
Alexandru Gagniuc | 86091f9 | 2015-09-30 20:23:09 -0700 | [diff] [blame] | 135 | slot = stack_push(slot, ~((8 << 20) - 1) | MTRR_PHYS_MASK_VALID); |
Aaron Durbin | 38d9423 | 2013-02-07 00:03:33 -0600 | [diff] [blame] | 136 | slot = stack_push(slot, 0); /* upper base */ |
Aaron Durbin | 67481ddc | 2013-02-15 15:08:37 -0600 | [diff] [blame] | 137 | slot = stack_push(slot, (top_of_ram - (8 << 20)) | MTRR_TYPE_WRBACK); |
| 138 | num_mtrrs++; |
| 139 | |
| 140 | /* Cache 8MiB at the top of ram. Top of ram on haswell systems |
| 141 | * is where the TSEG region resides. However, it is not restricted |
| 142 | * to SMM mode until SMM has been relocated. By setting the region |
| 143 | * to cacheable it provides faster access when relocating the SMM |
| 144 | * handler as well as using the TSEG region for other purposes. */ |
| 145 | slot = stack_push(slot, mtrr_mask_upper); /* upper mask */ |
Alexandru Gagniuc | 86091f9 | 2015-09-30 20:23:09 -0700 | [diff] [blame] | 146 | slot = stack_push(slot, ~((8 << 20) - 1) | MTRR_PHYS_MASK_VALID); |
Aaron Durbin | 67481ddc | 2013-02-15 15:08:37 -0600 | [diff] [blame] | 147 | slot = stack_push(slot, 0); /* upper base */ |
| 148 | slot = stack_push(slot, top_of_ram | MTRR_TYPE_WRBACK); |
Aaron Durbin | 38d9423 | 2013-02-07 00:03:33 -0600 | [diff] [blame] | 149 | num_mtrrs++; |
| 150 | |
Paul Menzel | 4fe9813 | 2014-01-25 15:55:28 +0100 | [diff] [blame] | 151 | /* Save the number of MTRRs to setup. Return the stack location |
Aaron Durbin | 38d9423 | 2013-02-07 00:03:33 -0600 | [diff] [blame] | 152 | * pointing to the number of MTRRs. */ |
| 153 | slot = stack_push(slot, num_mtrrs); |
| 154 | |
| 155 | return slot; |
| 156 | } |
| 157 | |
Aaron Durbin | 39ecc65 | 2013-05-02 09:42:13 -0500 | [diff] [blame] | 158 | void * asmlinkage romstage_main(unsigned long bist) |
Aaron Durbin | 3d0071b | 2013-01-18 14:32:50 -0600 | [diff] [blame] | 159 | { |
| 160 | int i; |
Aaron Durbin | 38d9423 | 2013-02-07 00:03:33 -0600 | [diff] [blame] | 161 | void *romstage_stack_after_car; |
Aaron Durbin | 3d0071b | 2013-01-18 14:32:50 -0600 | [diff] [blame] | 162 | const int num_guards = 4; |
| 163 | const u32 stack_guard = 0xdeadbeef; |
| 164 | u32 *stack_base = (void *)(CONFIG_DCACHE_RAM_BASE + |
| 165 | CONFIG_DCACHE_RAM_SIZE - |
| 166 | CONFIG_DCACHE_RAM_ROMSTAGE_STACK_SIZE); |
| 167 | |
| 168 | printk(BIOS_DEBUG, "Setting up stack guards.\n"); |
| 169 | for (i = 0; i < num_guards; i++) |
| 170 | stack_base[i] = stack_guard; |
| 171 | |
Aaron Durbin | a267161 | 2013-02-06 21:41:01 -0600 | [diff] [blame] | 172 | mainboard_romstage_entry(bist); |
Aaron Durbin | 3d0071b | 2013-01-18 14:32:50 -0600 | [diff] [blame] | 173 | |
| 174 | /* Check the stack. */ |
| 175 | for (i = 0; i < num_guards; i++) { |
| 176 | if (stack_base[i] == stack_guard) |
| 177 | continue; |
| 178 | printk(BIOS_DEBUG, "Smashed stack detected in romstage!\n"); |
| 179 | } |
| 180 | |
Aaron Durbin | 38d9423 | 2013-02-07 00:03:33 -0600 | [diff] [blame] | 181 | /* Get the stack to use after cache-as-ram is torn down. */ |
| 182 | romstage_stack_after_car = setup_romstage_stack_after_car(); |
| 183 | |
Aaron Durbin | 38d9423 | 2013-02-07 00:03:33 -0600 | [diff] [blame] | 184 | return romstage_stack_after_car; |
Aaron Durbin | 3d0071b | 2013-01-18 14:32:50 -0600 | [diff] [blame] | 185 | } |
Aaron Durbin | a267161 | 2013-02-06 21:41:01 -0600 | [diff] [blame] | 186 | |
| 187 | void romstage_common(const struct romstage_params *params) |
| 188 | { |
Aaron Durbin | bf396ff | 2013-02-11 21:50:35 -0600 | [diff] [blame] | 189 | int boot_mode; |
Aaron Durbin | a267161 | 2013-02-06 21:41:01 -0600 | [diff] [blame] | 190 | int wake_from_s3; |
Aaron Durbin | bf396ff | 2013-02-11 21:50:35 -0600 | [diff] [blame] | 191 | struct romstage_handoff *handoff; |
Aaron Durbin | a267161 | 2013-02-06 21:41:01 -0600 | [diff] [blame] | 192 | |
Kyösti Mälkki | 3d45c40 | 2013-09-07 20:26:36 +0300 | [diff] [blame] | 193 | timestamp_init(get_initial_timestamp()); |
| 194 | timestamp_add_now(TS_START_ROMSTAGE); |
Aaron Durbin | a267161 | 2013-02-06 21:41:01 -0600 | [diff] [blame] | 195 | |
| 196 | if (params->bist == 0) |
| 197 | enable_lapic(); |
| 198 | |
| 199 | wake_from_s3 = early_pch_init(params->gpio_map, params->rcba_config); |
| 200 | |
Duncan Laurie | 7cced0d | 2013-06-04 10:03:34 -0700 | [diff] [blame] | 201 | #if CONFIG_EC_GOOGLE_CHROMEEC |
| 202 | /* Ensure the EC is in the right mode for recovery */ |
| 203 | google_chromeec_early_init(); |
| 204 | #endif |
| 205 | |
Aaron Durbin | a267161 | 2013-02-06 21:41:01 -0600 | [diff] [blame] | 206 | /* Halt if there was a built in self test failure */ |
| 207 | report_bist_failure(params->bist); |
| 208 | |
| 209 | /* Perform some early chipset initialization required |
| 210 | * before RAM initialization can work |
| 211 | */ |
| 212 | haswell_early_initialization(HASWELL_MOBILE); |
| 213 | printk(BIOS_DEBUG, "Back from haswell_early_initialization()\n"); |
| 214 | |
| 215 | if (wake_from_s3) { |
| 216 | #if CONFIG_HAVE_ACPI_RESUME |
| 217 | printk(BIOS_DEBUG, "Resume from S3 detected.\n"); |
Aaron Durbin | a267161 | 2013-02-06 21:41:01 -0600 | [diff] [blame] | 218 | #else |
| 219 | printk(BIOS_DEBUG, "Resume from S3 detected, but disabled.\n"); |
Aaron Durbin | bf396ff | 2013-02-11 21:50:35 -0600 | [diff] [blame] | 220 | wake_from_s3 = 0; |
Aaron Durbin | a267161 | 2013-02-06 21:41:01 -0600 | [diff] [blame] | 221 | #endif |
| 222 | } |
| 223 | |
Aaron Durbin | bf396ff | 2013-02-11 21:50:35 -0600 | [diff] [blame] | 224 | /* There are hard coded assumptions of 2 meaning s3 wake. Normalize |
| 225 | * the users of the 2 literal here based off wake_from_s3. */ |
| 226 | boot_mode = wake_from_s3 ? 2 : 0; |
| 227 | |
Aaron Durbin | a267161 | 2013-02-06 21:41:01 -0600 | [diff] [blame] | 228 | /* Prepare USB controller early in S3 resume */ |
Aaron Durbin | bf396ff | 2013-02-11 21:50:35 -0600 | [diff] [blame] | 229 | if (wake_from_s3) |
Aaron Durbin | a267161 | 2013-02-06 21:41:01 -0600 | [diff] [blame] | 230 | enable_usb_bar(); |
| 231 | |
| 232 | post_code(0x3a); |
| 233 | params->pei_data->boot_mode = boot_mode; |
Kyösti Mälkki | 3d45c40 | 2013-09-07 20:26:36 +0300 | [diff] [blame] | 234 | |
| 235 | timestamp_add_now(TS_BEFORE_INITRAM); |
Aaron Durbin | a267161 | 2013-02-06 21:41:01 -0600 | [diff] [blame] | 236 | |
| 237 | report_platform_info(); |
| 238 | |
Aaron Durbin | c7633f4 | 2013-06-13 17:29:36 -0700 | [diff] [blame] | 239 | if (params->copy_spd != NULL) |
| 240 | params->copy_spd(params->pei_data); |
| 241 | |
Aaron Durbin | a267161 | 2013-02-06 21:41:01 -0600 | [diff] [blame] | 242 | sdram_initialize(params->pei_data); |
| 243 | |
Kyösti Mälkki | 3d45c40 | 2013-09-07 20:26:36 +0300 | [diff] [blame] | 244 | timestamp_add_now(TS_AFTER_INITRAM); |
| 245 | |
Aaron Durbin | a267161 | 2013-02-06 21:41:01 -0600 | [diff] [blame] | 246 | post_code(0x3b); |
| 247 | |
| 248 | intel_early_me_status(); |
| 249 | |
| 250 | quick_ram_check(); |
| 251 | post_code(0x3e); |
| 252 | |
Aaron Durbin | c0cbd6e | 2013-03-13 13:51:20 -0500 | [diff] [blame] | 253 | if (!wake_from_s3) { |
| 254 | cbmem_initialize_empty(); |
| 255 | /* Save data returned from MRC on non-S3 resumes. */ |
Aaron Durbin | 2ad1dba | 2013-02-07 00:51:18 -0600 | [diff] [blame] | 256 | save_mrc_data(params->pei_data); |
Aaron Durbin | 42e6856 | 2015-06-09 13:55:51 -0500 | [diff] [blame] | 257 | } else if (cbmem_initialize()) { |
| 258 | #if CONFIG_HAVE_ACPI_RESUME |
| 259 | /* Failed S3 resume, reset to come up cleanly */ |
| 260 | reset_system(); |
| 261 | #endif |
Aaron Durbin | a267161 | 2013-02-06 21:41:01 -0600 | [diff] [blame] | 262 | } |
Aaron Durbin | bf396ff | 2013-02-11 21:50:35 -0600 | [diff] [blame] | 263 | |
| 264 | handoff = romstage_handoff_find_or_add(); |
| 265 | if (handoff != NULL) |
| 266 | handoff->s3_resume = wake_from_s3; |
| 267 | else |
| 268 | printk(BIOS_DEBUG, "Romstage handoff structure not added!\n"); |
| 269 | |
Aaron Durbin | a267161 | 2013-02-06 21:41:01 -0600 | [diff] [blame] | 270 | post_code(0x3f); |
Denis 'GNUtoo' Carikli | 0e92bb0 | 2016-02-20 17:32:03 +0100 | [diff] [blame] | 271 | if (IS_ENABLED(CONFIG_LPC_TPM)) { |
Vladimir Serbinenko | 0e90dae | 2015-05-18 10:29:06 +0200 | [diff] [blame] | 272 | init_tpm(wake_from_s3); |
| 273 | } |
Aaron Durbin | a267161 | 2013-02-06 21:41:01 -0600 | [diff] [blame] | 274 | } |
Aaron Durbin | 7492ec1 | 2013-02-08 22:18:04 -0600 | [diff] [blame] | 275 | |
Aaron Durbin | 7492ec1 | 2013-02-08 22:18:04 -0600 | [diff] [blame] | 276 | void romstage_after_car(void) |
| 277 | { |
Aaron Durbin | d02bb62 | 2013-03-01 17:40:49 -0600 | [diff] [blame] | 278 | struct romstage_handoff *handoff; |
| 279 | |
| 280 | handoff = romstage_handoff_find_or_add(); |
| 281 | |
Kyösti Mälkki | cf0e60f | 2016-06-20 20:40:32 +0300 | [diff] [blame^] | 282 | if (handoff != NULL && handoff->s3_resume) |
| 283 | acpi_prepare_for_resume(); |
Aaron Durbin | d02bb62 | 2013-03-01 17:40:49 -0600 | [diff] [blame] | 284 | |
Aaron Durbin | 7492ec1 | 2013-02-08 22:18:04 -0600 | [diff] [blame] | 285 | /* Load the ramstage. */ |
Stefan Reinauer | 648d166 | 2013-05-06 18:05:39 -0700 | [diff] [blame] | 286 | copy_and_run(); |
Aaron Durbin | 7492ec1 | 2013-02-08 22:18:04 -0600 | [diff] [blame] | 287 | } |
Aaron Durbin | f7cdfe5 | 2013-02-16 00:05:52 -0600 | [diff] [blame] | 288 | |
| 289 | |
Aaron Durbin | bd74a4b | 2015-03-06 23:17:33 -0600 | [diff] [blame] | 290 | #if IS_ENABLED(CONFIG_CACHE_RELOCATED_RAMSTAGE_OUTSIDE_CBMEM) |
Aaron Durbin | bd74a4b | 2015-03-06 23:17:33 -0600 | [diff] [blame] | 291 | void ramstage_cache_invalid(void) |
Aaron Durbin | f7cdfe5 | 2013-02-16 00:05:52 -0600 | [diff] [blame] | 292 | { |
Aaron Durbin | 75e2974 | 2013-10-10 20:37:04 -0500 | [diff] [blame] | 293 | #if CONFIG_RESET_ON_INVALID_RAMSTAGE_CACHE |
| 294 | reset_system(); |
| 295 | #endif |
Aaron Durbin | f7cdfe5 | 2013-02-16 00:05:52 -0600 | [diff] [blame] | 296 | } |
| 297 | #endif |