blob: b203dc99b063b5b4ae097a4d4e064a2bc5f5226e [file] [log] [blame]
Simon Glassd1cd0452014-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 Glass70a09c62014-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 Glassd1cd0452014-11-12 22:42:09 -070025#define POST_START_STACK 0x29
26#define POST_START_DONE 0x2a
Simon Glass70a09c62014-11-12 22:42:10 -070027#define POST_CPU_INIT 0x2b
Simon Glassd1cd0452014-11-12 22:42:09 -070028
29/* Output a post code using al - value must be 0 to 0xff */
30#ifdef __ASSEMBLY__
31#define post_code(value) \
32 movb $value, %al; \
33 outb %al, $POST_PORT
34#else
Simon Glass70a09c62014-11-12 22:42:10 -070035#include <asm/io.h>
36
Simon Glassd1cd0452014-11-12 22:42:09 -070037static inline void post_code(int code)
38{
39 outb(code, POST_PORT);
40}
41#endif
42
43#endif