tests.c 5.9 KB

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