post.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. /*
  2. * (C) Copyright 2002
  3. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  4. *
  5. * See file CREDITS for list of people who contributed to this
  6. * project.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License as
  10. * published by the Free Software Foundation; either version 2 of
  11. * the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  21. * MA 02111-1307 USA
  22. */
  23. #ifndef _POST_H
  24. #define _POST_H
  25. #ifndef __ASSEMBLY__
  26. #include <common.h>
  27. #endif
  28. #ifdef CONFIG_POST
  29. #define POST_POWERON 0x01 /* test runs on power-on booting */
  30. #define POST_NORMAL 0x02 /* test runs on normal booting */
  31. #define POST_SLOWTEST 0x04 /* test is slow, enabled by key press */
  32. #define POST_POWERTEST 0x08 /* test runs after watchdog reset */
  33. #define POST_COLDBOOT 0x80 /* first boot after power-on */
  34. #define POST_ROM 0x0100 /* test runs in ROM */
  35. #define POST_RAM 0x0200 /* test runs in RAM */
  36. #define POST_MANUAL 0x0400 /* test runs on diag command */
  37. #define POST_REBOOT 0x0800 /* test may cause rebooting */
  38. #define POST_PREREL 0x1000 /* test runs before relocation */
  39. #define POST_CRITICAL 0x2000 /* Use failbootcmd if test failed */
  40. #define POST_STOP 0x4000 /* Interrupt POST sequence on fail */
  41. #define POST_MEM (POST_RAM | POST_ROM)
  42. #define POST_ALWAYS (POST_NORMAL | \
  43. POST_SLOWTEST | \
  44. POST_MANUAL | \
  45. POST_POWERON )
  46. #define POST_FAIL_SAVE 0x80
  47. #ifndef __ASSEMBLY__
  48. struct post_test {
  49. char *name;
  50. char *cmd;
  51. char *desc;
  52. int flags;
  53. int (*test) (int flags);
  54. int (*init_f) (void);
  55. void (*reloc) (void);
  56. unsigned long testid;
  57. };
  58. int post_init_f (void);
  59. void post_bootmode_init (void);
  60. int post_bootmode_get (unsigned int * last_test);
  61. void post_bootmode_clear (void);
  62. void post_output_backlog ( void );
  63. int post_run (char *name, int flags);
  64. int post_info (char *name);
  65. int post_log (char *format, ...);
  66. #ifndef CONFIG_RELOC_FIXUP_WORKS
  67. void post_reloc (void);
  68. #endif
  69. unsigned long post_time_ms (unsigned long base);
  70. extern struct post_test post_list[];
  71. extern unsigned int post_list_size;
  72. extern int post_hotkeys_pressed(void);
  73. /*
  74. * If GCC is configured to use a version of GAS that supports
  75. * the .gnu_attribute directive, it will use that directive to
  76. * record certain properties of the output code.
  77. * This feature is new to GCC 4.3.0.
  78. * .gnu_attribute is new to GAS 2.18.
  79. */
  80. #if (__GNUC__ >= 4 && __GNUC_MINOR__ >= 3)
  81. /* Tag_GNU_Power_ABI_FP/soft-float */
  82. #define GNU_FPOST_ATTR asm(".gnu_attribute 4, 2");
  83. #else
  84. #define GNU_FPOST_ATTR
  85. #endif /* __GNUC__ */
  86. #endif /* __ASSEMBLY__ */
  87. #define CONFIG_SYS_POST_RTC 0x00000001
  88. #define CONFIG_SYS_POST_WATCHDOG 0x00000002
  89. #define CONFIG_SYS_POST_MEMORY 0x00000004
  90. #define CONFIG_SYS_POST_CPU 0x00000008
  91. #define CONFIG_SYS_POST_I2C 0x00000010
  92. #define CONFIG_SYS_POST_CACHE 0x00000020
  93. #define CONFIG_SYS_POST_UART 0x00000040
  94. #define CONFIG_SYS_POST_ETHER 0x00000080
  95. #define CONFIG_SYS_POST_SPI 0x00000100
  96. #define CONFIG_SYS_POST_USB 0x00000200
  97. #define CONFIG_SYS_POST_SPR 0x00000400
  98. #define CONFIG_SYS_POST_SYSMON 0x00000800
  99. #define CONFIG_SYS_POST_DSP 0x00001000
  100. #define CONFIG_SYS_POST_OCM 0x00002000
  101. #define CONFIG_SYS_POST_FPU 0x00004000
  102. #define CONFIG_SYS_POST_ECC 0x00008000
  103. #define CONFIG_SYS_POST_BSPEC1 0x00010000
  104. #define CONFIG_SYS_POST_BSPEC2 0x00020000
  105. #define CONFIG_SYS_POST_BSPEC3 0x00040000
  106. #define CONFIG_SYS_POST_BSPEC4 0x00080000
  107. #define CONFIG_SYS_POST_BSPEC5 0x00100000
  108. #define CONFIG_SYS_POST_CODEC 0x00200000
  109. #endif /* CONFIG_POST */
  110. #endif /* _POST_H */