1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 /* For starting coreboot in protected mode */
6 * This is the modern bootblock. It prepares the system for C environment runtime
7 * setup. The actual setup is done by hardware-specific code.
9 * It provides a bootflow similar to other architectures, and thus is considered
10 * to be the modern approach.
14 #include <arch/rom_segs.h>
15 #include <cpu/x86/cr.h>
16 #include <cpu/x86/post_code.h>
18 .section .init, "ax", @progbits
22 * When we come here we are in protected mode.
23 * NOTE aligned to 4 so that we are sure that the prefetch
24 * cache will be reloaded.
28 .globl bootblock_protected_mode_entry
29 bootblock_protected_mode_entry:
31 /* Save the BIST value */
34 post_code(POSTCODE_ENTER_PROTECTED_MODE)
36 movw $ROM_DATA_SEG, %ax
40 xor %ax, %ax /* zero out the gs and fs segment index */
42 movw %ax, %gs /* Will be used for cpu_info */
44 /* Restore the BIST value to %eax */
47 #if CONFIG(BOOTBLOCK_DEBUG_SPINLOOP)
49 /* Wait for a JTAG debugger to break in and set EBX non-zero */
57 /* MMX registers required here */
59 /* BIST result in eax */
64 /* Get an early timestamp */
74 #endif /* CONFIG(SSE) */
76 /* We're done. Now it's up to platform-specific code */
77 jmp bootblock_pre_c_entry