blob: 9fbce5dbb57aeba8de79098a3f64138a46e9ad65 [file] [log] [blame]
Alexandru Gagniuc6be6c8f2016-01-26 18:22:43 -08001/*
2 * This is the modern bootblock. It is used by platforms which select
3 * C_ENVIRONMENT_BOOTBLOCK, and it prepares the system for C environment runtime
4 * setup. The actual setup is done by hardware-specific code.
5 *
6 * It provides a bootflow similar to other architectures, and thus is considered
7 * to be the modern approach.
8 *
9 * This file is part of the coreboot project.
10 *
11 * Copyright (C) 2015 Alexandru Gagniuc <mr.nuke.me@gmail.com>
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
Martin Rothcfc80c22016-02-02 06:14:44 -070017 *
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
Alexandru Gagniuc6be6c8f2016-01-26 18:22:43 -080022 */
23
Furquan Shaikhb3ee03c2016-04-13 17:15:36 -070024#include <cpu/x86/cr.h>
Alexandru Gagniuc6be6c8f2016-01-26 18:22:43 -080025
26/*
27 * Include the old code for reset vector and protected mode entry. That code has
28 * withstood the test of time.
29 */
30#include <arch/x86/prologue.inc>
31#include <cpu/x86/16bit/entry16.inc>
32#include <cpu/x86/16bit/reset16.inc>
33#include <cpu/x86/32bit/entry32.inc>
34
35
36bootblock_protected_mode_entry:
37 /* Save BIST result */
38 movd %eax, %mm0
39 /* Save an early timestamp */
40 rdtsc
41 movd %eax, %mm1
42 movd %edx, %mm2
43
Lee Leahy38925972016-06-08 07:11:48 -070044#if IS_ENABLED(CONFIG_SSE)
Alexandru Gagniuc6be6c8f2016-01-26 18:22:43 -080045enable_sse:
Alexandru Gagniuc6be6c8f2016-01-26 18:22:43 -080046 mov %cr4, %eax
Lee Leahy38925972016-06-08 07:11:48 -070047 or $CR4_OSFXSR, %ax
Alexandru Gagniuc6be6c8f2016-01-26 18:22:43 -080048 mov %eax, %cr4
49#endif /* IS_ENABLED(CONFIG_SSE) */
50
51 /* We're done. Now it's up to platform-specific code */
52 jmp bootblock_pre_c_entry