1/*
2 * Copyright (c) 2014 Google, Inc
3 *
4 * SPDX-License-Identifier:	GPL-2.0+
5 */
6
7.globl early_board_init
8early_board_init:
9	/* Enable post codes to EC */
10#ifdef CONFIG_EARLY_POST_CROS_EC
11	mov    $0x1b, %ecx
12	rdmsr
13	and    $0x100, %eax
14	test   %eax, %eax
15	je     1f
16
17	mov    $0x8000f8f0, %eax
18	mov    $0xcf8, %dx
19	out    %eax, (%dx)
20	mov    $0xfed1c001, %eax
21	mov    $0xcfc, %dx
22	out    %eax, (%dx)
23	mov    $0xfed1f410, %esp
24	mov    (%esp), %eax
25	and    $0xfffffffb, %eax
26	mov    %eax, (%esp)
271:
28#endif
29	jmp	early_board_init_ret
30