x86: Emit post codes in startup code for Chromebooks
[oweals/u-boot.git] / arch / x86 / include / asm / post.h
1 /*
2  * Copyright (c) 2014 Google, Inc
3  *
4  * SPDX-License-Identifier:     GPL-2.0+
5  */
6
7 #ifndef _post_h
8 #define _post_h
9
10 /* port to use for post codes */
11 #define POST_PORT               0x80
12
13 /* post codes which represent various stages of init */
14 #define POST_START              0x1e
15 #define POST_CAR_START          0x1f
16
17 #define POST_START_STACK        0x29
18 #define POST_START_DONE         0x2a
19
20 /* Output a post code using al - value must be 0 to 0xff */
21 #ifdef __ASSEMBLY__
22 #define post_code(value) \
23         movb    $value, %al; \
24         outb    %al, $POST_PORT
25 #else
26 static inline void post_code(int code)
27 {
28         outb(code, POST_PORT);
29 }
30 #endif
31
32 #endif