tests.c 6.1 KB

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