tests.c 3.7 KB

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