tests.c 4.9 KB

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