Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame^] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Simon Glass | 245561d | 2014-11-12 22:42:09 -0700 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (c) 2014 Google, Inc |
Simon Glass | 245561d | 2014-11-12 22:42:09 -0700 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | #ifndef _post_h |
| 7 | #define _post_h |
| 8 | |
| 9 | /* port to use for post codes */ |
| 10 | #define POST_PORT 0x80 |
| 11 | |
| 12 | /* post codes which represent various stages of init */ |
| 13 | #define POST_START 0x1e |
| 14 | #define POST_CAR_START 0x1f |
Simon Glass | 98f139b | 2014-11-12 22:42:10 -0700 | [diff] [blame] | 15 | #define POST_CAR_SIPI 0x20 |
| 16 | #define POST_CAR_MTRR 0x21 |
| 17 | #define POST_CAR_UNCACHEABLE 0x22 |
| 18 | #define POST_CAR_BASE_ADDRESS 0x23 |
| 19 | #define POST_CAR_MASK 0x24 |
| 20 | #define POST_CAR_FILL 0x25 |
| 21 | #define POST_CAR_ROM_CACHE 0x26 |
| 22 | #define POST_CAR_MRC_CACHE 0x27 |
| 23 | #define POST_CAR_CPU_CACHE 0x28 |
Simon Glass | 245561d | 2014-11-12 22:42:09 -0700 | [diff] [blame] | 24 | #define POST_START_STACK 0x29 |
| 25 | #define POST_START_DONE 0x2a |
Simon Glass | 98f139b | 2014-11-12 22:42:10 -0700 | [diff] [blame] | 26 | #define POST_CPU_INIT 0x2b |
Simon Glass | 30580fc | 2014-11-12 22:42:23 -0700 | [diff] [blame] | 27 | #define POST_EARLY_INIT 0x2c |
| 28 | #define POST_CPU_INFO 0x2d |
Simon Glass | 268eefd | 2014-11-12 22:42:28 -0700 | [diff] [blame] | 29 | #define POST_PRE_MRC 0x2e |
| 30 | #define POST_MRC 0x2f |
Simon Glass | 7f3ccae | 2016-03-06 19:28:18 -0700 | [diff] [blame] | 31 | #define POST_DRAM 0x30 |
| 32 | #define POST_LAPIC 0x31 |
Bin Meng | 6ed1092 | 2017-04-21 07:24:30 -0700 | [diff] [blame] | 33 | #define POST_OS_RESUME 0x40 |
Simon Glass | 268eefd | 2014-11-12 22:42:28 -0700 | [diff] [blame] | 34 | |
| 35 | #define POST_RAM_FAILURE 0xea |
Bin Meng | 642d248 | 2014-12-12 21:05:30 +0800 | [diff] [blame] | 36 | #define POST_BIST_FAILURE 0xeb |
| 37 | #define POST_CAR_FAILURE 0xec |
Bin Meng | 6ed1092 | 2017-04-21 07:24:30 -0700 | [diff] [blame] | 38 | #define POST_RESUME_FAILURE 0xed |
Simon Glass | 245561d | 2014-11-12 22:42:09 -0700 | [diff] [blame] | 39 | |
| 40 | /* Output a post code using al - value must be 0 to 0xff */ |
| 41 | #ifdef __ASSEMBLY__ |
| 42 | #define post_code(value) \ |
| 43 | movb $value, %al; \ |
| 44 | outb %al, $POST_PORT |
| 45 | #else |
Simon Glass | 98f139b | 2014-11-12 22:42:10 -0700 | [diff] [blame] | 46 | #include <asm/io.h> |
| 47 | |
Simon Glass | 245561d | 2014-11-12 22:42:09 -0700 | [diff] [blame] | 48 | static inline void post_code(int code) |
| 49 | { |
| 50 | outb(code, POST_PORT); |
| 51 | } |
| 52 | #endif |
| 53 | |
| 54 | #endif |