tests.c 6.5 KB

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