blob: f627663f319b452357c4cf7c2523ccd3b10c2511 [file] [log] [blame]
Simon Glass245561d2014-11-12 22:42:09 -07001/*
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
Simon Glass98f139b2014-11-12 22:42:10 -070016#define POST_CAR_SIPI 0x20
17#define POST_CAR_MTRR 0x21
18#define POST_CAR_UNCACHEABLE 0x22
19#define POST_CAR_BASE_ADDRESS 0x23
20#define POST_CAR_MASK 0x24
21#define POST_CAR_FILL 0x25
22#define POST_CAR_ROM_CACHE 0x26
23#define POST_CAR_MRC_CACHE 0x27
24#define POST_CAR_CPU_CACHE 0x28
Simon Glass245561d2014-11-12 22:42:09 -070025#define POST_START_STACK 0x29
26#define POST_START_DONE 0x2a
Simon Glass98f139b2014-11-12 22:42:10 -070027#define POST_CPU_INIT 0x2b
Simon Glass30580fc2014-11-12 22:42:23 -070028#define POST_EARLY_INIT 0x2c
29#define POST_CPU_INFO 0x2d
Simon Glass268eefd2014-11-12 22:42:28 -070030#define POST_PRE_MRC 0x2e
31#define POST_MRC 0x2f
Simon Glass7f3ccae2016-03-06 19:28:18 -070032#define POST_DRAM 0x30
33#define POST_LAPIC 0x31
Bin Meng6ed10922017-04-21 07:24:30 -070034#define POST_OS_RESUME 0x40
Simon Glass268eefd2014-11-12 22:42:28 -070035
36#define POST_RAM_FAILURE 0xea
Bin Meng642d2482014-12-12 21:05:30 +080037#define POST_BIST_FAILURE 0xeb
38#define POST_CAR_FAILURE 0xec
Bin Meng6ed10922017-04-21 07:24:30 -070039#define POST_RESUME_FAILURE 0xed
Simon Glass245561d2014-11-12 22:42:09 -070040
41/* Output a post code using al - value must be 0 to 0xff */
42#ifdef __ASSEMBLY__
43#define post_code(value) \
44 movb $value, %al; \
45 outb %al, $POST_PORT
46#else
Simon Glass98f139b2014-11-12 22:42:10 -070047#include <asm/io.h>
48
Simon Glass245561d2014-11-12 22:42:09 -070049static inline void post_code(int code)
50{
51 outb(code, POST_PORT);
52}
53#endif
54
55#endif