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 | |
Martin Roth | 8180427 | 2022-11-20 20:30:18 -0700 | [diff] [blame] | 11 | #include <amdblocks/post_codes.h> |
Marshall Dawson | 9df969a | 2017-07-25 18:46:46 -0600 | [diff] [blame] | 12 | #include <cpu/x86/post_code.h> |
| 13 | |
Kyösti Mälkki | 7522a8f | 2020-11-20 16:47:38 +0200 | [diff] [blame] | 14 | .section .init |
| 15 | |
| 16 | .code32 |
| 17 | |
| 18 | _cache_as_ram_setup: |
| 19 | |
| 20 | #include "gcccar.inc" |
| 21 | |
Marshall Dawson | 9df969a | 2017-07-25 18:46:46 -0600 | [diff] [blame] | 22 | /* |
| 23 | * on entry: |
| 24 | * mm0: BIST (ignored) |
Kyösti Mälkki | 6c7441f | 2020-12-05 08:39:57 +0200 | [diff] [blame] | 25 | * mm2_mm1: timestamp |
Marshall Dawson | 9df969a | 2017-07-25 18:46:46 -0600 | [diff] [blame] | 26 | */ |
| 27 | |
| 28 | .global bootblock_pre_c_entry |
| 29 | bootblock_pre_c_entry: |
| 30 | |
Martin Roth | 8180427 | 2022-11-20 20:30:18 -0700 | [diff] [blame] | 31 | post_code(POST_BOOTBLOCK_PRE_C_ENTRY) |
Marshall Dawson | 9df969a | 2017-07-25 18:46:46 -0600 | [diff] [blame] | 32 | |
| 33 | AMD_ENABLE_STACK |
| 34 | |
| 35 | /* Align the stack and keep aligned for call to bootblock_c_entry() */ |
| 36 | and $0xfffffff0, %esp |
| 37 | sub $8, %esp |
| 38 | |
| 39 | movd %mm2, %eax |
| 40 | pushl %eax /* tsc[63:32] */ |
| 41 | movd %mm1, %eax |
| 42 | pushl %eax /* tsc[31:0] */ |
| 43 | |
| 44 | before_carstage: |
Martin Roth | 8180427 | 2022-11-20 20:30:18 -0700 | [diff] [blame] | 45 | post_code(POST_BOOTBLOCK_PRE_C_DONE) |
Marshall Dawson | 9df969a | 2017-07-25 18:46:46 -0600 | [diff] [blame] | 46 | |
| 47 | call bootblock_c_entry |
| 48 | /* Never reached */ |
| 49 | |
| 50 | .halt_forever: |
lilacious | 40cb3fe | 2023-06-21 23:24:14 +0200 | [diff] [blame^] | 51 | post_code(POSTCODE_DEAD_CODE) |
Marshall Dawson | 9df969a | 2017-07-25 18:46:46 -0600 | [diff] [blame] | 52 | hlt |
| 53 | jmp .halt_forever |
Kyösti Mälkki | 7522a8f | 2020-11-20 16:47:38 +0200 | [diff] [blame] | 54 | |
| 55 | _cache_as_ram_setup_end: |