tests.c 4.6 KB

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