tests.c 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  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. #include <post.h>
  29. extern int cache_post_test (int flags);
  30. extern int watchdog_post_test (int flags);
  31. extern int i2c_post_test (int flags);
  32. extern int rtc_post_test (int flags);
  33. extern int memory_post_test (int flags);
  34. extern int cpu_post_test (int flags);
  35. extern int fpu_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 ecc_post_test (int flags);
  45. extern int dspic_init_post_test (int flags);
  46. extern int dspic_post_test (int flags);
  47. extern int gdc_post_test (int flags);
  48. extern int fpga_post_test (int flags);
  49. extern int lwmon5_watchdog_post_test(int flags);
  50. extern int sysmon1_post_test(int flags);
  51. extern int sysmon_init_f (void);
  52. extern void sysmon_reloc (void);
  53. struct post_test post_list[] =
  54. {
  55. #if CONFIG_POST & CFG_POST_CACHE
  56. {
  57. "Cache test",
  58. "cache",
  59. "This test verifies the CPU cache operation.",
  60. POST_RAM | POST_ALWAYS,
  61. &cache_post_test,
  62. NULL,
  63. NULL,
  64. CFG_POST_CACHE
  65. },
  66. #endif
  67. #if CONFIG_POST & CFG_POST_WATCHDOG
  68. #if defined(CONFIG_POST_WATCHDOG)
  69. CONFIG_POST_WATCHDOG,
  70. #else
  71. {
  72. "Watchdog timer test",
  73. "watchdog",
  74. "This test checks the watchdog timer.",
  75. POST_RAM | POST_POWERON | POST_SLOWTEST | POST_MANUAL | POST_REBOOT,
  76. &watchdog_post_test,
  77. NULL,
  78. NULL,
  79. CFG_POST_WATCHDOG
  80. },
  81. #endif
  82. #endif
  83. #if CONFIG_POST & CFG_POST_I2C
  84. {
  85. "I2C test",
  86. "i2c",
  87. "This test verifies the I2C operation.",
  88. POST_RAM | POST_ALWAYS,
  89. &i2c_post_test,
  90. NULL,
  91. NULL,
  92. CFG_POST_I2C
  93. },
  94. #endif
  95. #if CONFIG_POST & CFG_POST_RTC
  96. {
  97. "RTC test",
  98. "rtc",
  99. "This test verifies the RTC operation.",
  100. POST_RAM | POST_SLOWTEST | POST_MANUAL,
  101. &rtc_post_test,
  102. NULL,
  103. NULL,
  104. CFG_POST_RTC
  105. },
  106. #endif
  107. #if CONFIG_POST & CFG_POST_MEMORY
  108. {
  109. "Memory test",
  110. "memory",
  111. "This test checks RAM.",
  112. POST_ROM | POST_POWERON | POST_SLOWTEST | POST_PREREL,
  113. &memory_post_test,
  114. NULL,
  115. NULL,
  116. CFG_POST_MEMORY
  117. },
  118. #endif
  119. #if CONFIG_POST & CFG_POST_CPU
  120. {
  121. "CPU test",
  122. "cpu",
  123. "This test verifies the arithmetic logic unit of"
  124. " CPU.",
  125. POST_RAM | POST_ALWAYS,
  126. &cpu_post_test,
  127. NULL,
  128. NULL,
  129. CFG_POST_CPU
  130. },
  131. #endif
  132. #if CONFIG_POST & CFG_POST_FPU
  133. {
  134. "FPU test",
  135. "fpu",
  136. "This test verifies the arithmetic logic unit of"
  137. " FPU.",
  138. POST_RAM | POST_ALWAYS,
  139. &fpu_post_test,
  140. NULL,
  141. NULL,
  142. CFG_POST_FPU
  143. },
  144. #endif
  145. #if CONFIG_POST & CFG_POST_UART
  146. {
  147. "UART test",
  148. "uart",
  149. "This test verifies the UART operation.",
  150. POST_RAM | POST_SLOWTEST | POST_MANUAL,
  151. &uart_post_test,
  152. NULL,
  153. NULL,
  154. CFG_POST_UART
  155. },
  156. #endif
  157. #if CONFIG_POST & CFG_POST_ETHER
  158. {
  159. "ETHERNET test",
  160. "ethernet",
  161. "This test verifies the ETHERNET operation.",
  162. POST_RAM | POST_ALWAYS | POST_MANUAL,
  163. &ether_post_test,
  164. NULL,
  165. NULL,
  166. CFG_POST_ETHER
  167. },
  168. #endif
  169. #if CONFIG_POST & CFG_POST_SPI
  170. {
  171. "SPI test",
  172. "spi",
  173. "This test verifies the SPI operation.",
  174. POST_RAM | POST_ALWAYS | POST_MANUAL,
  175. &spi_post_test,
  176. NULL,
  177. NULL,
  178. CFG_POST_SPI
  179. },
  180. #endif
  181. #if CONFIG_POST & CFG_POST_USB
  182. {
  183. "USB test",
  184. "usb",
  185. "This test verifies the USB operation.",
  186. POST_RAM | POST_ALWAYS | POST_MANUAL,
  187. &usb_post_test,
  188. NULL,
  189. NULL,
  190. CFG_POST_USB
  191. },
  192. #endif
  193. #if CONFIG_POST & CFG_POST_SPR
  194. {
  195. "SPR test",
  196. "spr",
  197. "This test checks SPR contents.",
  198. POST_RAM | POST_ALWAYS,
  199. &spr_post_test,
  200. NULL,
  201. NULL,
  202. CFG_POST_SPR
  203. },
  204. #endif
  205. #if CONFIG_POST & CFG_POST_SYSMON
  206. {
  207. "SYSMON test",
  208. "sysmon",
  209. "This test monitors system hardware.",
  210. POST_RAM | POST_ALWAYS,
  211. &sysmon_post_test,
  212. &sysmon_init_f,
  213. &sysmon_reloc,
  214. CFG_POST_SYSMON
  215. },
  216. #endif
  217. #if CONFIG_POST & CFG_POST_DSP
  218. {
  219. "DSP test",
  220. "dsp",
  221. "This test checks any connected DSP(s).",
  222. POST_RAM | POST_MANUAL,
  223. &dsp_post_test,
  224. NULL,
  225. NULL,
  226. CFG_POST_DSP
  227. },
  228. #endif
  229. #if CONFIG_POST & CFG_POST_CODEC
  230. {
  231. "CODEC test",
  232. "codec",
  233. "This test checks any connected codec(s).",
  234. POST_RAM | POST_MANUAL,
  235. &codec_post_test,
  236. NULL,
  237. NULL,
  238. CFG_POST_CODEC
  239. },
  240. #endif
  241. #if CONFIG_POST & CFG_POST_ECC
  242. {
  243. "ECC test",
  244. "ecc",
  245. "This test checks the ECC facility of memory.",
  246. POST_ROM | POST_ALWAYS | POST_PREREL,
  247. &ecc_post_test,
  248. NULL,
  249. NULL,
  250. CFG_POST_ECC
  251. },
  252. #endif
  253. #if CONFIG_POST & CFG_POST_BSPEC1
  254. CONFIG_POST_BSPEC1,
  255. #endif
  256. #if CONFIG_POST & CFG_POST_BSPEC2
  257. CONFIG_POST_BSPEC2,
  258. #endif
  259. #if CONFIG_POST & CFG_POST_BSPEC3
  260. CONFIG_POST_BSPEC3,
  261. #endif
  262. #if CONFIG_POST & CFG_POST_BSPEC4
  263. CONFIG_POST_BSPEC4,
  264. #endif
  265. #if CONFIG_POST & CFG_POST_BSPEC4
  266. CONFIG_POST_BSPEC5,
  267. #endif
  268. };
  269. unsigned int post_list_size = sizeof (post_list) / sizeof (struct post_test);