tests.c 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  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 dsp_post_test (int flags);
  43. extern int sysmon_init_f (void);
  44. extern void sysmon_reloc (void);
  45. struct post_test post_list[] =
  46. {
  47. #if CONFIG_POST & CFG_POST_CACHE
  48. {
  49. "Cache test",
  50. "cache",
  51. "This test verifies the CPU cache operation.",
  52. POST_RAM | POST_ALWAYS,
  53. &cache_post_test,
  54. NULL,
  55. NULL,
  56. CFG_POST_CACHE
  57. },
  58. #endif
  59. #if CONFIG_POST & CFG_POST_WATCHDOG
  60. {
  61. "Watchdog timer test",
  62. "watchdog",
  63. "This test checks the watchdog timer.",
  64. POST_RAM | POST_POWERON | POST_SLOWTEST | POST_MANUAL | POST_REBOOT,
  65. &watchdog_post_test,
  66. NULL,
  67. NULL,
  68. CFG_POST_WATCHDOG
  69. },
  70. #endif
  71. #if CONFIG_POST & CFG_POST_I2C
  72. {
  73. "I2C test",
  74. "i2c",
  75. "This test verifies the I2C operation.",
  76. POST_RAM | POST_ALWAYS,
  77. &i2c_post_test,
  78. NULL,
  79. NULL,
  80. CFG_POST_I2C
  81. },
  82. #endif
  83. #if CONFIG_POST & CFG_POST_RTC
  84. {
  85. "RTC test",
  86. "rtc",
  87. "This test verifies the RTC operation.",
  88. POST_RAM | POST_SLOWTEST | POST_MANUAL,
  89. &rtc_post_test,
  90. NULL,
  91. NULL,
  92. CFG_POST_RTC
  93. },
  94. #endif
  95. #if CONFIG_POST & CFG_POST_MEMORY
  96. {
  97. "Memory test",
  98. "memory",
  99. "This test checks RAM.",
  100. POST_ROM | POST_POWERON | POST_SLOWTEST | POST_PREREL,
  101. &memory_post_test,
  102. NULL,
  103. NULL,
  104. CFG_POST_MEMORY
  105. },
  106. #endif
  107. #if CONFIG_POST & CFG_POST_CPU
  108. {
  109. "CPU test",
  110. "cpu",
  111. "This test verifies the arithmetic logic unit of"
  112. " CPU.",
  113. POST_RAM | POST_ALWAYS,
  114. &cpu_post_test,
  115. NULL,
  116. NULL,
  117. CFG_POST_CPU
  118. },
  119. #endif
  120. #if CONFIG_POST & CFG_POST_UART
  121. {
  122. "UART test",
  123. "uart",
  124. "This test verifies the UART operation.",
  125. POST_RAM | POST_SLOWTEST | POST_MANUAL,
  126. &uart_post_test,
  127. NULL,
  128. NULL,
  129. CFG_POST_UART
  130. },
  131. #endif
  132. #if CONFIG_POST & CFG_POST_ETHER
  133. {
  134. "ETHERNET test",
  135. "ethernet",
  136. "This test verifies the ETHERNET operation.",
  137. POST_RAM | POST_ALWAYS | POST_MANUAL,
  138. &ether_post_test,
  139. NULL,
  140. NULL,
  141. CFG_POST_ETHER
  142. },
  143. #endif
  144. #if CONFIG_POST & CFG_POST_SPI
  145. {
  146. "SPI test",
  147. "spi",
  148. "This test verifies the SPI operation.",
  149. POST_RAM | POST_ALWAYS | POST_MANUAL,
  150. &spi_post_test,
  151. NULL,
  152. NULL,
  153. CFG_POST_SPI
  154. },
  155. #endif
  156. #if CONFIG_POST & CFG_POST_USB
  157. {
  158. "USB test",
  159. "usb",
  160. "This test verifies the USB operation.",
  161. POST_RAM | POST_ALWAYS | POST_MANUAL,
  162. &usb_post_test,
  163. NULL,
  164. NULL,
  165. CFG_POST_USB
  166. },
  167. #endif
  168. #if CONFIG_POST & CFG_POST_SPR
  169. {
  170. "SPR test",
  171. "spr",
  172. "This test checks SPR contents.",
  173. POST_ROM | POST_ALWAYS | POST_PREREL,
  174. &spr_post_test,
  175. NULL,
  176. NULL,
  177. CFG_POST_SPR
  178. },
  179. #endif
  180. #if CONFIG_POST & CFG_POST_SYSMON
  181. {
  182. "SYSMON test",
  183. "sysmon",
  184. "This test monitors system hardware.",
  185. POST_RAM | POST_ALWAYS,
  186. &sysmon_post_test,
  187. &sysmon_init_f,
  188. &sysmon_reloc,
  189. CFG_POST_SYSMON
  190. },
  191. #endif
  192. #if CONFIG_POST & CFG_POST_DSP
  193. {
  194. "DSP test",
  195. "dsp",
  196. "This test checks any connected DSP(s).",
  197. POST_RAM | POST_MANUAL,
  198. &dsp_post_test,
  199. NULL,
  200. NULL,
  201. CFG_POST_DSP
  202. },
  203. #endif
  204. };
  205. unsigned int post_list_size = sizeof (post_list) / sizeof (struct post_test);
  206. #endif /* CONFIG_POST */