Simon Glass | 245561d | 2014-11-12 22:42:09 -0700 | [diff] [blame] | 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 |
Simon Glass | 98f139b | 2014-11-12 22:42:10 -0700 | [diff] [blame] | 16 | #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 Glass | 245561d | 2014-11-12 22:42:09 -0700 | [diff] [blame] | 25 | #define POST_START_STACK 0x29 |
| 26 | #define POST_START_DONE 0x2a |
Simon Glass | 98f139b | 2014-11-12 22:42:10 -0700 | [diff] [blame] | 27 | #define POST_CPU_INIT 0x2b |
Simon Glass | 30580fc | 2014-11-12 22:42:23 -0700 | [diff] [blame] | 28 | #define POST_EARLY_INIT 0x2c |
| 29 | #define POST_CPU_INFO 0x2d |
Simon Glass | 268eefd | 2014-11-12 22:42:28 -0700 | [diff] [blame] | 30 | #define POST_PRE_MRC 0x2e |
| 31 | #define POST_MRC 0x2f |
| 32 | #define POST_DRAM 0x2f |
Simon Glass | 3121dbd | 2014-11-24 21:18:15 -0700 | [diff] [blame] | 33 | #define POST_LAPIC 0x30 |
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 |
Simon Glass | 245561d | 2014-11-12 22:42:09 -0700 | [diff] [blame] | 38 | |
| 39 | /* Output a post code using al - value must be 0 to 0xff */ |
| 40 | #ifdef __ASSEMBLY__ |
| 41 | #define post_code(value) \ |
| 42 | movb $value, %al; \ |
| 43 | outb %al, $POST_PORT |
| 44 | #else |
Simon Glass | 98f139b | 2014-11-12 22:42:10 -0700 | [diff] [blame] | 45 | #include <asm/io.h> |
| 46 | |
Simon Glass | 245561d | 2014-11-12 22:42:09 -0700 | [diff] [blame] | 47 | static inline void post_code(int code) |
| 48 | { |
| 49 | outb(code, POST_PORT); |
| 50 | } |
| 51 | #endif |
| 52 | |
| 53 | #endif |