blob: 6282d7e5719faf194294c2a118b9fc61e699cd43 [file] [log] [blame]
Angel Ponsae593872020-04-04 18:50:57 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Marshall Dawson9df969a2017-07-25 18:46:46 -06002
3/******************************************************************************
4 * $Workfile:: cache_as_ram.S
5 *
6 * Description: CAR setup called from bootblock_crt0.S.
7 *
8 ******************************************************************************
9 */
10
Marshall Dawson9df969a2017-07-25 18:46:46 -060011#include <cpu/x86/post_code.h>
12
Kyösti Mälkki7522a8f2020-11-20 16:47:38 +020013.section .init
14
15.code32
16
17_cache_as_ram_setup:
18
19#include "gcccar.inc"
20
Marshall Dawson9df969a2017-07-25 18:46:46 -060021/*
22 * on entry:
23 * mm0: BIST (ignored)
24 * mm2_mm1: timestamp at bootblock_protected_mode_entry
25 */
26
27.global bootblock_pre_c_entry
28bootblock_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
43before_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älkki7522a8f2020-11-20 16:47:38 +020053
54_cache_as_ram_setup_end: