summaryrefslogtreecommitdiff
path: root/src/cpu/amd
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2017-07-13 14:11:52 +0300
committerKyösti Mälkki <kyosti.malkki@gmail.com>2017-08-22 20:25:15 +0000
commit14382453349f0ca1c11870ed10f8e7fd839851cc (patch)
tree15b11d650d02aa7d7195b53fbda460d7ec0d3905 /src/cpu/amd
parent90e07b460cffb4fbfee336a2b614cb8d08e4bfaa (diff)
downloadcoreboot-14382453349f0ca1c11870ed10f8e7fd839851cc.tar.xz
AMD K8 fam10-15: Tidy up CAR stack switch
Return to empty stack before making the switch. Change-Id: I6d6f633933fac5bc08d9542c371715f737fb42cf Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/20574 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz> Tested-by: Raptor Engineering Automated Test Stand <noreply@raptorengineeringinc.com>
Diffstat (limited to 'src/cpu/amd')
-rw-r--r--src/cpu/amd/car/cache_as_ram.inc13
-rw-r--r--src/cpu/amd/car/post_cache_as_ram.c8
2 files changed, 6 insertions, 15 deletions
diff --git a/src/cpu/amd/car/cache_as_ram.inc b/src/cpu/amd/car/cache_as_ram.inc
index 4d70c9e6bc..6161048b29 100644
--- a/src/cpu/amd/car/cache_as_ram.inc
+++ b/src/cpu/amd/car/cache_as_ram.inc
@@ -599,21 +599,14 @@ CAR_FAM10_ap_out:
call cache_as_ram_main
call post_cache_as_ram
+ movl %eax, %esp
+
+ call cache_as_ram_new_stack
/* We will not go back. */
post_code(0xaf) /* Should never see this POST code. */
- .globl cache_as_ram_switch_stack
-
-cache_as_ram_switch_stack:
- /* Return address. */
- popl %eax
- /* New stack. */
- popl %eax
- movl %eax, %esp
- call cache_as_ram_new_stack
-
all_mtrr_msrs:
/* fixed MTRR MSRs */
.long MTRR_FIX_64K_00000
diff --git a/src/cpu/amd/car/post_cache_as_ram.c b/src/cpu/amd/car/post_cache_as_ram.c
index c647254c70..d51e431560 100644
--- a/src/cpu/amd/car/post_cache_as_ram.c
+++ b/src/cpu/amd/car/post_cache_as_ram.c
@@ -125,7 +125,7 @@ static void vErrata343(void)
wrmsr(BU_CFG2_MSR, msr);
}
-void post_cache_as_ram(void)
+asmlinkage void * post_cache_as_ram(void)
{
uint32_t family = amd_fam1x_cpu_family();
@@ -171,12 +171,10 @@ void post_cache_as_ram(void)
/* New stack grows right below migrated_car. */
print_car_debug("Switching to use RAM as stack...");
- cache_as_ram_switch_stack(migrated_car);
-
- /* We do not come back. */
+ return migrated_car;
}
-void cache_as_ram_new_stack(void)
+asmlinkage void cache_as_ram_new_stack(void)
{
print_car_debug("Disabling cache as RAM now\n");
disable_cache_as_ram_real(0); // inline