blob: 3eb76707840d44ee30ec2e16684ef8fb51d4bfe1 [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
11#include "gcccar.inc"
Marshall Dawson9df969a2017-07-25 18:46:46 -060012#include <cpu/x86/post_code.h>
13
14/*
15 * on entry:
16 * mm0: BIST (ignored)
17 * mm2_mm1: timestamp at bootblock_protected_mode_entry
18 */
19
20.global bootblock_pre_c_entry
21bootblock_pre_c_entry:
22
23 post_code(0xa0)
24
25 AMD_ENABLE_STACK
26
27 /* Align the stack and keep aligned for call to bootblock_c_entry() */
28 and $0xfffffff0, %esp
29 sub $8, %esp
30
31 movd %mm2, %eax
32 pushl %eax /* tsc[63:32] */
33 movd %mm1, %eax
34 pushl %eax /* tsc[31:0] */
35
36before_carstage:
37 post_code(0xa2)
38
39 call bootblock_c_entry
40 /* Never reached */
41
42.halt_forever:
43 post_code(POST_DEAD_CODE)
44 hlt
45 jmp .halt_forever