post.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright (c) 2014 Google, Inc
  4. */
  5. #ifndef _post_h
  6. #define _post_h
  7. /* port to use for post codes */
  8. #define POST_PORT 0x80
  9. /* post codes which represent various stages of init */
  10. #define POST_START 0x1e
  11. #define POST_CAR_START 0x1f
  12. #define POST_CAR_SIPI 0x20
  13. #define POST_CAR_MTRR 0x21
  14. #define POST_CAR_UNCACHEABLE 0x22
  15. #define POST_CAR_BASE_ADDRESS 0x23
  16. #define POST_CAR_MASK 0x24
  17. #define POST_CAR_FILL 0x25
  18. #define POST_CAR_ROM_CACHE 0x26
  19. #define POST_CAR_MRC_CACHE 0x27
  20. #define POST_CAR_CPU_CACHE 0x28
  21. #define POST_START_STACK 0x29
  22. #define POST_START_DONE 0x2a
  23. #define POST_CPU_INIT 0x2b
  24. #define POST_EARLY_INIT 0x2c
  25. #define POST_CPU_INFO 0x2d
  26. #define POST_PRE_MRC 0x2e
  27. #define POST_MRC 0x2f
  28. #define POST_DRAM 0x30
  29. #define POST_LAPIC 0x31
  30. #define POST_OS_RESUME 0x40
  31. #define POST_RAM_FAILURE 0xea
  32. #define POST_BIST_FAILURE 0xeb
  33. #define POST_CAR_FAILURE 0xec
  34. #define POST_RESUME_FAILURE 0xed
  35. /* Output a post code using al - value must be 0 to 0xff */
  36. #ifdef __ASSEMBLY__
  37. #define post_code(value) \
  38. movb $value, %al; \
  39. outb %al, $POST_PORT
  40. #else
  41. #include <asm/io.h>
  42. static inline void post_code(int code)
  43. {
  44. outb(code, POST_PORT);
  45. }
  46. #endif
  47. #endif