post.h 1.1 KB

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