tests.c 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. /*
  2. * (C) Copyright 2002
  3. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  4. *
  5. * SPDX-License-Identifier: GPL-2.0+
  6. */
  7. #include <common.h>
  8. #include <post.h>
  9. extern int ocm_post_test (int flags);
  10. extern int cache_post_test (int flags);
  11. extern int watchdog_post_test (int flags);
  12. extern int i2c_post_test (int flags);
  13. extern int rtc_post_test (int flags);
  14. extern int memory_post_test (int flags);
  15. extern int cpu_post_test (int flags);
  16. extern int fpu_post_test (int flags);
  17. extern int uart_post_test (int flags);
  18. extern int ether_post_test (int flags);
  19. extern int spi_post_test (int flags);
  20. extern int usb_post_test (int flags);
  21. extern int spr_post_test (int flags);
  22. extern int sysmon_post_test (int flags);
  23. extern int dsp_post_test (int flags);
  24. extern int codec_post_test (int flags);
  25. extern int ecc_post_test (int flags);
  26. extern int flash_post_test(int flags);
  27. extern int dspic_init_post_test (int flags);
  28. extern int dspic_post_test (int flags);
  29. extern int gdc_post_test (int flags);
  30. extern int fpga_post_test (int flags);
  31. extern int lwmon5_watchdog_post_test(int flags);
  32. extern int sysmon1_post_test(int flags);
  33. extern int coprocessor_post_test(int flags);
  34. extern int led_post_test(int flags);
  35. extern int button_post_test(int flags);
  36. extern int memory_regions_post_test(int flags);
  37. extern int sysmon_init_f (void);
  38. extern void sysmon_reloc (void);
  39. struct post_test post_list[] =
  40. {
  41. #if CONFIG_POST & CONFIG_SYS_POST_OCM
  42. {
  43. "OCM test",
  44. "ocm",
  45. "This test checks on chip memory (OCM).",
  46. POST_ROM | POST_ALWAYS | POST_PREREL | POST_CRITICAL | POST_STOP,
  47. &ocm_post_test,
  48. NULL,
  49. NULL,
  50. CONFIG_SYS_POST_OCM
  51. },
  52. #endif
  53. #if CONFIG_POST & CONFIG_SYS_POST_CACHE
  54. {
  55. "Cache test",
  56. "cache",
  57. "This test verifies the CPU cache operation.",
  58. POST_RAM | POST_ALWAYS,
  59. &cache_post_test,
  60. NULL,
  61. NULL,
  62. CONFIG_SYS_POST_CACHE
  63. },
  64. #endif
  65. #if CONFIG_POST & CONFIG_SYS_POST_WATCHDOG
  66. #if defined(CONFIG_POST_WATCHDOG)
  67. CONFIG_POST_WATCHDOG,
  68. #else
  69. {
  70. "Watchdog timer test",
  71. "watchdog",
  72. "This test checks the watchdog timer.",
  73. POST_RAM | POST_POWERON | POST_SLOWTEST | POST_MANUAL | POST_REBOOT,
  74. &watchdog_post_test,
  75. NULL,
  76. NULL,
  77. CONFIG_SYS_POST_WATCHDOG
  78. },
  79. #endif
  80. #endif
  81. #if CONFIG_POST & CONFIG_SYS_POST_I2C
  82. {
  83. "I2C test",
  84. "i2c",
  85. "This test verifies the I2C operation.",
  86. POST_RAM | POST_ALWAYS,
  87. &i2c_post_test,
  88. NULL,
  89. NULL,
  90. CONFIG_SYS_POST_I2C
  91. },
  92. #endif
  93. #if CONFIG_POST & CONFIG_SYS_POST_RTC
  94. {
  95. "RTC test",
  96. "rtc",
  97. "This test verifies the RTC operation.",
  98. POST_RAM | POST_SLOWTEST | POST_MANUAL,
  99. &rtc_post_test,
  100. NULL,
  101. NULL,
  102. CONFIG_SYS_POST_RTC
  103. },
  104. #endif
  105. #if CONFIG_POST & CONFIG_SYS_POST_MEMORY
  106. {
  107. "Memory test",
  108. "memory",
  109. "This test checks RAM.",
  110. POST_ROM | POST_POWERON | POST_SLOWTEST | POST_PREREL,
  111. &memory_post_test,
  112. NULL,
  113. NULL,
  114. CONFIG_SYS_POST_MEMORY
  115. },
  116. #endif
  117. #if CONFIG_POST & CONFIG_SYS_POST_CPU
  118. {
  119. "CPU test",
  120. "cpu",
  121. "This test verifies the arithmetic logic unit of"
  122. " CPU.",
  123. POST_RAM | POST_ALWAYS,
  124. &cpu_post_test,
  125. NULL,
  126. NULL,
  127. CONFIG_SYS_POST_CPU
  128. },
  129. #endif
  130. #if CONFIG_POST & CONFIG_SYS_POST_FPU
  131. {
  132. "FPU test",
  133. "fpu",
  134. "This test verifies the arithmetic logic unit of"
  135. " FPU.",
  136. POST_RAM | POST_ALWAYS,
  137. &fpu_post_test,
  138. NULL,
  139. NULL,
  140. CONFIG_SYS_POST_FPU
  141. },
  142. #endif
  143. #if CONFIG_POST & CONFIG_SYS_POST_UART
  144. #if defined(CONFIG_POST_UART)
  145. CONFIG_POST_UART,
  146. #else
  147. {
  148. "UART test",
  149. "uart",
  150. "This test verifies the UART operation.",
  151. POST_RAM | POST_SLOWTEST | POST_MANUAL,
  152. &uart_post_test,
  153. NULL,
  154. NULL,
  155. CONFIG_SYS_POST_UART
  156. },
  157. #endif /* CONFIG_POST_UART */
  158. #endif
  159. #if CONFIG_POST & CONFIG_SYS_POST_ETHER
  160. {
  161. "ETHERNET test",
  162. "ethernet",
  163. "This test verifies the ETHERNET operation.",
  164. POST_RAM | POST_ALWAYS,
  165. &ether_post_test,
  166. NULL,
  167. NULL,
  168. CONFIG_SYS_POST_ETHER
  169. },
  170. #endif
  171. #if CONFIG_POST & CONFIG_SYS_POST_USB
  172. {
  173. "USB test",
  174. "usb",
  175. "This test verifies the USB operation.",
  176. POST_RAM | POST_ALWAYS,
  177. &usb_post_test,
  178. NULL,
  179. NULL,
  180. CONFIG_SYS_POST_USB
  181. },
  182. #endif
  183. #if CONFIG_POST & CONFIG_SYS_POST_SPR
  184. {
  185. "SPR test",
  186. "spr",
  187. "This test checks SPR contents.",
  188. POST_RAM | POST_ALWAYS,
  189. &spr_post_test,
  190. NULL,
  191. NULL,
  192. CONFIG_SYS_POST_SPR
  193. },
  194. #endif
  195. #if CONFIG_POST & CONFIG_SYS_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. CONFIG_SYS_POST_SYSMON
  205. },
  206. #endif
  207. #if CONFIG_POST & CONFIG_SYS_POST_DSP
  208. {
  209. "DSP test",
  210. "dsp",
  211. "This test checks any connected DSP(s).",
  212. POST_RAM | POST_ALWAYS,
  213. &dsp_post_test,
  214. NULL,
  215. NULL,
  216. CONFIG_SYS_POST_DSP
  217. },
  218. #endif
  219. #if CONFIG_POST & CONFIG_SYS_POST_CODEC
  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. CONFIG_SYS_POST_CODEC
  229. },
  230. #endif
  231. #if CONFIG_POST & CONFIG_SYS_POST_ECC
  232. {
  233. "ECC test",
  234. "ecc",
  235. "This test checks the ECC facility of memory.",
  236. POST_ROM | POST_ALWAYS | POST_PREREL,
  237. &ecc_post_test,
  238. NULL,
  239. NULL,
  240. CONFIG_SYS_POST_ECC
  241. },
  242. #endif
  243. #if CONFIG_POST & CONFIG_SYS_POST_BSPEC1
  244. CONFIG_POST_BSPEC1,
  245. #endif
  246. #if CONFIG_POST & CONFIG_SYS_POST_BSPEC2
  247. CONFIG_POST_BSPEC2,
  248. #endif
  249. #if CONFIG_POST & CONFIG_SYS_POST_BSPEC3
  250. CONFIG_POST_BSPEC3,
  251. #endif
  252. #if CONFIG_POST & CONFIG_SYS_POST_BSPEC4
  253. CONFIG_POST_BSPEC4,
  254. #endif
  255. #if CONFIG_POST & CONFIG_SYS_POST_BSPEC5
  256. CONFIG_POST_BSPEC5,
  257. #endif
  258. #if CONFIG_POST & CONFIG_SYS_POST_COPROC
  259. {
  260. "Coprocessors communication test",
  261. "coproc_com",
  262. "This test checks communication with coprocessors.",
  263. POST_RAM | POST_ALWAYS | POST_CRITICAL,
  264. &coprocessor_post_test,
  265. NULL,
  266. NULL,
  267. CONFIG_SYS_POST_COPROC
  268. },
  269. #endif
  270. #if CONFIG_POST & CONFIG_SYS_POST_FLASH
  271. {
  272. "Parallel NOR flash test",
  273. "flash",
  274. "This test verifies parallel flash operations.",
  275. POST_RAM | POST_SLOWTEST | POST_MANUAL,
  276. &flash_post_test,
  277. NULL,
  278. NULL,
  279. CONFIG_SYS_POST_FLASH
  280. },
  281. #endif
  282. #if CONFIG_POST & CONFIG_SYS_POST_MEM_REGIONS
  283. {
  284. "Memory regions test",
  285. "mem_regions",
  286. "This test checks regularly placed regions of the RAM.",
  287. POST_ROM | POST_SLOWTEST | POST_PREREL,
  288. &memory_regions_post_test,
  289. NULL,
  290. NULL,
  291. CONFIG_SYS_POST_MEM_REGIONS
  292. },
  293. #endif
  294. };
  295. unsigned int post_list_size = ARRAY_SIZE(post_list);