tests.c 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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. #ifdef CONFIG_POST
  29. #include <post.h>
  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 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. struct post_test post_list[] =
  42. {
  43. #if CONFIG_POST & CFG_POST_CACHE
  44. {
  45. "Cache test",
  46. "cache",
  47. "This test verifies the CPU cache operation.",
  48. POST_RAM | POST_ALWAYS,
  49. &cache_post_test,
  50. CFG_POST_CACHE
  51. },
  52. #endif
  53. #if CONFIG_POST & CFG_POST_WATCHDOG
  54. {
  55. "Watchdog timer test",
  56. "watchdog",
  57. "This test checks the watchdog timer.",
  58. POST_RAM | POST_POWERON | POST_POWERFAIL | POST_MANUAL | POST_REBOOT,
  59. &watchdog_post_test,
  60. CFG_POST_WATCHDOG
  61. },
  62. #endif
  63. #if CONFIG_POST & CFG_POST_I2C
  64. {
  65. "I2C test",
  66. "i2c",
  67. "This test verifies the I2C operation.",
  68. POST_RAM | POST_ALWAYS,
  69. &i2c_post_test,
  70. CFG_POST_I2C
  71. },
  72. #endif
  73. #if CONFIG_POST & CFG_POST_RTC
  74. {
  75. "RTC test",
  76. "rtc",
  77. "This test verifies the RTC operation.",
  78. POST_RAM | POST_POWERFAIL | POST_MANUAL,
  79. &rtc_post_test,
  80. CFG_POST_RTC
  81. },
  82. #endif
  83. #if CONFIG_POST & CFG_POST_MEMORY
  84. {
  85. "Memory test",
  86. "memory",
  87. "This test checks RAM.",
  88. POST_ROM | POST_POWERON | POST_POWERFAIL | POST_PREREL,
  89. &memory_post_test,
  90. CFG_POST_MEMORY
  91. },
  92. #endif
  93. #if CONFIG_POST & CFG_POST_CPU
  94. {
  95. "CPU test",
  96. "cpu",
  97. "This test verifies the arithmetic logic unit of"
  98. " CPU.",
  99. POST_RAM | POST_ALWAYS,
  100. &cpu_post_test,
  101. CFG_POST_CPU
  102. },
  103. #endif
  104. #if CONFIG_POST & CFG_POST_UART
  105. {
  106. "UART test",
  107. "uart",
  108. "This test verifies the UART operation.",
  109. POST_RAM | POST_POWERFAIL | POST_MANUAL,
  110. &uart_post_test,
  111. CFG_POST_UART
  112. },
  113. #endif
  114. #if CONFIG_POST & CFG_POST_ETHER
  115. {
  116. "ETHERNET test",
  117. "ethernet",
  118. "This test verifies the ETHERNET operation.",
  119. POST_RAM | POST_ALWAYS | POST_MANUAL,
  120. &ether_post_test,
  121. CFG_POST_ETHER
  122. },
  123. #endif
  124. #if CONFIG_POST & CFG_POST_SPI
  125. {
  126. "SPI test",
  127. "spi",
  128. "This test verifies the SPI operation.",
  129. POST_RAM | POST_ALWAYS | POST_MANUAL,
  130. &spi_post_test,
  131. CFG_POST_SPI
  132. },
  133. #endif
  134. #if CONFIG_POST & CFG_POST_USB
  135. {
  136. "USB test",
  137. "usb",
  138. "This test verifies the USB operation.",
  139. POST_RAM | POST_ALWAYS | POST_MANUAL,
  140. &usb_post_test,
  141. CFG_POST_USB
  142. },
  143. #endif
  144. #if CONFIG_POST & CFG_POST_SPR
  145. {
  146. "SPR test",
  147. "spr",
  148. "This test checks SPR contents.",
  149. POST_ROM | POST_ALWAYS | POST_PREREL,
  150. &spr_post_test,
  151. CFG_POST_SPR
  152. },
  153. #endif
  154. };
  155. unsigned int post_list_size = sizeof (post_list) / sizeof (struct post_test);
  156. #endif /* CONFIG_POST */