Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Simon Glass | 8ef0757 | 2014-11-12 22:42:07 -0700 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (c) 2014 Google, Inc |
Simon Glass | 8ef0757 | 2014-11-12 22:42:07 -0700 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | .globl early_board_init |
| 7 | early_board_init: |
Simon Glass | d1cd045 | 2014-11-12 22:42:09 -0700 | [diff] [blame] | 8 | /* Enable post codes to EC */ |
| 9 | #ifdef CONFIG_EARLY_POST_CROS_EC |
| 10 | mov $0x1b, %ecx |
| 11 | rdmsr |
| 12 | and $0x100, %eax |
| 13 | test %eax, %eax |
| 14 | je 1f |
| 15 | |
| 16 | mov $0x8000f8f0, %eax |
| 17 | mov $0xcf8, %dx |
| 18 | out %eax, (%dx) |
| 19 | mov $0xfed1c001, %eax |
| 20 | mov $0xcfc, %dx |
| 21 | out %eax, (%dx) |
| 22 | mov $0xfed1f410, %esp |
| 23 | mov (%esp), %eax |
| 24 | and $0xfffffffb, %eax |
| 25 | mov %eax, (%esp) |
| 26 | 1: |
| 27 | #endif |
Simon Glass | 8ef0757 | 2014-11-12 22:42:07 -0700 | [diff] [blame] | 28 | jmp early_board_init_ret |