Simon Glass | 8ef0757 | 2014-11-12 22:42:07 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2014 Google, Inc |
| 3 | * |
| 4 | * SPDX-License-Identifier: GPL-2.0+ |
| 5 | */ |
| 6 | |
| 7 | .globl early_board_init |
| 8 | early_board_init: |
Simon Glass | d1cd045 | 2014-11-12 22:42:09 -0700 | [diff] [blame] | 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) |
| 27 | 1: |
| 28 | #endif |
Simon Glass | 8ef0757 | 2014-11-12 22:42:07 -0700 | [diff] [blame] | 29 | jmp early_board_init_ret |