Angel Pons | ae59387 | 2020-04-04 18:50:57 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Marshall Dawson | 9df969a | 2017-07-25 18:46:46 -0600 | [diff] [blame] | 2 | |
| 3 | /****************************************************************************** |
| 4 | * $Workfile:: cache_as_ram.S |
| 5 | * |
| 6 | * Description: CAR setup called from bootblock_crt0.S. |
| 7 | * |
| 8 | ****************************************************************************** |
| 9 | */ |
| 10 | |
Marshall Dawson | 9df969a | 2017-07-25 18:46:46 -0600 | [diff] [blame] | 11 | #include <cpu/x86/post_code.h> |
| 12 | |
Kyösti Mälkki | 7522a8f | 2020-11-20 16:47:38 +0200 | [diff] [blame] | 13 | .section .init |
| 14 | |
| 15 | .code32 |
| 16 | |
| 17 | _cache_as_ram_setup: |
| 18 | |
| 19 | #include "gcccar.inc" |
| 20 | |
Marshall Dawson | 9df969a | 2017-07-25 18:46:46 -0600 | [diff] [blame] | 21 | /* |
| 22 | * on entry: |
| 23 | * mm0: BIST (ignored) |
Kyösti Mälkki | 6c7441f | 2020-12-05 08:39:57 +0200 | [diff] [blame] | 24 | * mm2_mm1: timestamp |
Marshall Dawson | 9df969a | 2017-07-25 18:46:46 -0600 | [diff] [blame] | 25 | */ |
| 26 | |
| 27 | .global bootblock_pre_c_entry |
| 28 | bootblock_pre_c_entry: |
| 29 | |
| 30 | post_code(0xa0) |
| 31 | |
| 32 | AMD_ENABLE_STACK |
| 33 | |
| 34 | /* Align the stack and keep aligned for call to bootblock_c_entry() */ |
| 35 | and $0xfffffff0, %esp |
| 36 | sub $8, %esp |
| 37 | |
| 38 | movd %mm2, %eax |
| 39 | pushl %eax /* tsc[63:32] */ |
| 40 | movd %mm1, %eax |
| 41 | pushl %eax /* tsc[31:0] */ |
| 42 | |
| 43 | before_carstage: |
| 44 | post_code(0xa2) |
| 45 | |
| 46 | call bootblock_c_entry |
| 47 | /* Never reached */ |
| 48 | |
| 49 | .halt_forever: |
| 50 | post_code(POST_DEAD_CODE) |
| 51 | hlt |
| 52 | jmp .halt_forever |
Kyösti Mälkki | 7522a8f | 2020-11-20 16:47:38 +0200 | [diff] [blame] | 53 | |
| 54 | _cache_as_ram_setup_end: |