tests.c 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  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. * Be sure to mark tests to be run before relocation as such with the
  24. * CFG_POST_PREREL flag so that logging is done correctly if the
  25. * logbuffer support is enabled.
  26. */
  27. #include <common.h>
  28. #ifdef CONFIG_POST
  29. #include <post.h>
  30. extern int cache_post_test (int flags);
  31. extern int watchdog_post_test (int flags);
  32. extern int i2c_post_test (int flags);
  33. extern int rtc_post_test (int flags);
  34. extern int memory_post_test (int flags);
  35. extern int cpu_post_test (int flags);
  36. extern int uart_post_test (int flags);
  37. extern int ether_post_test (int flags);
  38. extern int spi_post_test (int flags);
  39. extern int usb_post_test (int flags);
  40. extern int spr_post_test (int flags);
  41. extern int sysmon_post_test (int flags);
  42. extern int sysmon_init_f (void);
  43. extern void sysmon_reloc (void);
  44. struct post_test post_list[] =
  45. {
  46. #if CONFIG_POST & CFG_POST_CACHE
  47. {
  48. "Cache test",
  49. "cache",
  50. "This test verifies the CPU cache operation.",
  51. POST_RAM | POST_ALWAYS,
  52. &cache_post_test,
  53. NULL,
  54. NULL,
  55. CFG_POST_CACHE
  56. },
  57. #endif
  58. #if CONFIG_POST & CFG_POST_WATCHDOG
  59. {
  60. "Watchdog timer test",
  61. "watchdog",
  62. "This test checks the watchdog timer.",
  63. POST_RAM | POST_POWERON | POST_SLOWTEST | POST_MANUAL | POST_REBOOT,
  64. &watchdog_post_test,
  65. NULL,
  66. NULL,
  67. CFG_POST_WATCHDOG
  68. },
  69. #endif
  70. #if CONFIG_POST & CFG_POST_I2C
  71. {
  72. "I2C test",
  73. "i2c",
  74. "This test verifies the I2C operation.",
  75. POST_RAM | POST_ALWAYS,
  76. &i2c_post_test,
  77. NULL,
  78. NULL,
  79. CFG_POST_I2C
  80. },
  81. #endif
  82. #if CONFIG_POST & CFG_POST_RTC
  83. {
  84. "RTC test",
  85. "rtc",
  86. "This test verifies the RTC operation.",
  87. POST_RAM | POST_SLOWTEST | POST_MANUAL,
  88. &rtc_post_test,
  89. NULL,
  90. NULL,
  91. CFG_POST_RTC
  92. },
  93. #endif
  94. #if CONFIG_POST & CFG_POST_MEMORY
  95. {
  96. "Memory test",
  97. "memory",
  98. "This test checks RAM.",
  99. POST_ROM | POST_POWERON | POST_SLOWTEST | POST_PREREL,
  100. &memory_post_test,
  101. NULL,
  102. NULL,
  103. CFG_POST_MEMORY
  104. },
  105. #endif
  106. #if CONFIG_POST & CFG_POST_CPU
  107. {
  108. "CPU test",
  109. "cpu",
  110. "This test verifies the arithmetic logic unit of"
  111. " CPU.",
  112. POST_RAM | POST_ALWAYS,
  113. &cpu_post_test,
  114. NULL,
  115. NULL,
  116. CFG_POST_CPU
  117. },
  118. #endif
  119. #if CONFIG_POST & CFG_POST_UART
  120. {
  121. "UART test",
  122. "uart",
  123. "This test verifies the UART operation.",
  124. POST_RAM | POST_SLOWTEST | POST_MANUAL,
  125. &uart_post_test,
  126. NULL,
  127. NULL,
  128. CFG_POST_UART
  129. },
  130. #endif
  131. #if CONFIG_POST & CFG_POST_ETHER
  132. {
  133. "ETHERNET test",
  134. "ethernet",
  135. "This test verifies the ETHERNET operation.",
  136. POST_RAM | POST_ALWAYS | POST_MANUAL,
  137. &ether_post_test,
  138. NULL,
  139. NULL,
  140. CFG_POST_ETHER
  141. },
  142. #endif
  143. #if CONFIG_POST & CFG_POST_SPI
  144. {
  145. "SPI test",
  146. "spi",
  147. "This test verifies the SPI operation.",
  148. POST_RAM | POST_ALWAYS | POST_MANUAL,
  149. &spi_post_test,
  150. NULL,
  151. NULL,
  152. CFG_POST_SPI
  153. },
  154. #endif
  155. #if CONFIG_POST & CFG_POST_USB
  156. {
  157. "USB test",
  158. "usb",
  159. "This test verifies the USB operation.",
  160. POST_RAM | POST_ALWAYS | POST_MANUAL,
  161. &usb_post_test,
  162. NULL,
  163. NULL,
  164. CFG_POST_USB
  165. },
  166. #endif
  167. #if CONFIG_POST & CFG_POST_SPR
  168. {
  169. "SPR test",
  170. "spr",
  171. "This test checks SPR contents.",
  172. POST_ROM | POST_ALWAYS | POST_PREREL,
  173. &spr_post_test,
  174. NULL,
  175. NULL,
  176. CFG_POST_SPR
  177. },
  178. #endif
  179. #if CONFIG_POST & CFG_POST_SYSMON
  180. {
  181. "SYSMON test",
  182. "sysmon",
  183. "This test monitors system hardware.",
  184. POST_RAM | POST_ALWAYS,
  185. &sysmon_post_test,
  186. &sysmon_init_f,
  187. &sysmon_reloc,
  188. CFG_POST_SYSMON
  189. },
  190. #endif
  191. };
  192. unsigned int post_list_size = sizeof (post_list) / sizeof (struct post_test);
  193. #endif /* CONFIG_POST */