wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 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 |
wdenk | 9dfa8d1 | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 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. |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 26 | */ |
| 27 | |
| 28 | #include <common.h> |
| 29 | |
| 30 | #ifdef CONFIG_POST |
| 31 | |
| 32 | #include <post.h> |
| 33 | |
| 34 | extern int cache_post_test (int flags); |
| 35 | extern int watchdog_post_test (int flags); |
| 36 | extern int i2c_post_test (int flags); |
| 37 | extern int rtc_post_test (int flags); |
| 38 | extern int memory_post_test (int flags); |
| 39 | extern int cpu_post_test (int flags); |
| 40 | extern int uart_post_test (int flags); |
| 41 | extern int ether_post_test (int flags); |
| 42 | extern int spi_post_test (int flags); |
| 43 | extern int usb_post_test (int flags); |
| 44 | extern int spr_post_test (int flags); |
wdenk | c08f158 | 2003-04-27 22:52:51 +0000 | [diff] [blame] | 45 | extern int sysmon_post_test (int flags); |
wdenk | 6164217 | 2004-04-15 21:16:42 +0000 | [diff] [blame^] | 46 | extern int dsp_post_test (int flags); |
wdenk | c08f158 | 2003-04-27 22:52:51 +0000 | [diff] [blame] | 47 | |
| 48 | extern int sysmon_init_f (void); |
| 49 | |
| 50 | extern void sysmon_reloc (void); |
| 51 | |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 52 | |
| 53 | struct post_test post_list[] = |
| 54 | { |
| 55 | #if CONFIG_POST & CFG_POST_CACHE |
| 56 | { |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 57 | "Cache test", |
| 58 | "cache", |
| 59 | "This test verifies the CPU cache operation.", |
| 60 | POST_RAM | POST_ALWAYS, |
| 61 | &cache_post_test, |
| 62 | NULL, |
| 63 | NULL, |
wdenk | 9dfa8d1 | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 64 | CFG_POST_CACHE |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 65 | }, |
| 66 | #endif |
| 67 | #if CONFIG_POST & CFG_POST_WATCHDOG |
| 68 | { |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 69 | "Watchdog timer test", |
| 70 | "watchdog", |
| 71 | "This test checks the watchdog timer.", |
wdenk | dccbda0 | 2003-07-14 22:13:32 +0000 | [diff] [blame] | 72 | POST_RAM | POST_POWERON | POST_SLOWTEST | POST_MANUAL | POST_REBOOT, |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 73 | &watchdog_post_test, |
| 74 | NULL, |
| 75 | NULL, |
wdenk | 9dfa8d1 | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 76 | CFG_POST_WATCHDOG |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 77 | }, |
| 78 | #endif |
| 79 | #if CONFIG_POST & CFG_POST_I2C |
| 80 | { |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 81 | "I2C test", |
| 82 | "i2c", |
| 83 | "This test verifies the I2C operation.", |
| 84 | POST_RAM | POST_ALWAYS, |
| 85 | &i2c_post_test, |
| 86 | NULL, |
| 87 | NULL, |
wdenk | 9dfa8d1 | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 88 | CFG_POST_I2C |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 89 | }, |
| 90 | #endif |
| 91 | #if CONFIG_POST & CFG_POST_RTC |
| 92 | { |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 93 | "RTC test", |
| 94 | "rtc", |
| 95 | "This test verifies the RTC operation.", |
wdenk | dccbda0 | 2003-07-14 22:13:32 +0000 | [diff] [blame] | 96 | POST_RAM | POST_SLOWTEST | POST_MANUAL, |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 97 | &rtc_post_test, |
| 98 | NULL, |
| 99 | NULL, |
wdenk | 9dfa8d1 | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 100 | CFG_POST_RTC |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 101 | }, |
| 102 | #endif |
| 103 | #if CONFIG_POST & CFG_POST_MEMORY |
| 104 | { |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 105 | "Memory test", |
| 106 | "memory", |
| 107 | "This test checks RAM.", |
wdenk | dccbda0 | 2003-07-14 22:13:32 +0000 | [diff] [blame] | 108 | POST_ROM | POST_POWERON | POST_SLOWTEST | POST_PREREL, |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 109 | &memory_post_test, |
| 110 | NULL, |
| 111 | NULL, |
wdenk | 9dfa8d1 | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 112 | CFG_POST_MEMORY |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 113 | }, |
| 114 | #endif |
| 115 | #if CONFIG_POST & CFG_POST_CPU |
| 116 | { |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 117 | "CPU test", |
| 118 | "cpu", |
| 119 | "This test verifies the arithmetic logic unit of" |
| 120 | " CPU.", |
| 121 | POST_RAM | POST_ALWAYS, |
| 122 | &cpu_post_test, |
| 123 | NULL, |
| 124 | NULL, |
wdenk | 9dfa8d1 | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 125 | CFG_POST_CPU |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 126 | }, |
| 127 | #endif |
| 128 | #if CONFIG_POST & CFG_POST_UART |
| 129 | { |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 130 | "UART test", |
| 131 | "uart", |
| 132 | "This test verifies the UART operation.", |
wdenk | dccbda0 | 2003-07-14 22:13:32 +0000 | [diff] [blame] | 133 | POST_RAM | POST_SLOWTEST | POST_MANUAL, |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 134 | &uart_post_test, |
| 135 | NULL, |
| 136 | NULL, |
wdenk | 9dfa8d1 | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 137 | CFG_POST_UART |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 138 | }, |
| 139 | #endif |
| 140 | #if CONFIG_POST & CFG_POST_ETHER |
| 141 | { |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 142 | "ETHERNET test", |
| 143 | "ethernet", |
| 144 | "This test verifies the ETHERNET operation.", |
| 145 | POST_RAM | POST_ALWAYS | POST_MANUAL, |
| 146 | ðer_post_test, |
| 147 | NULL, |
| 148 | NULL, |
wdenk | 9dfa8d1 | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 149 | CFG_POST_ETHER |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 150 | }, |
| 151 | #endif |
| 152 | #if CONFIG_POST & CFG_POST_SPI |
| 153 | { |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 154 | "SPI test", |
| 155 | "spi", |
| 156 | "This test verifies the SPI operation.", |
| 157 | POST_RAM | POST_ALWAYS | POST_MANUAL, |
| 158 | &spi_post_test, |
| 159 | NULL, |
| 160 | NULL, |
wdenk | 9dfa8d1 | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 161 | CFG_POST_SPI |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 162 | }, |
| 163 | #endif |
| 164 | #if CONFIG_POST & CFG_POST_USB |
| 165 | { |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 166 | "USB test", |
| 167 | "usb", |
| 168 | "This test verifies the USB operation.", |
| 169 | POST_RAM | POST_ALWAYS | POST_MANUAL, |
| 170 | &usb_post_test, |
| 171 | NULL, |
| 172 | NULL, |
wdenk | 9dfa8d1 | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 173 | CFG_POST_USB |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 174 | }, |
| 175 | #endif |
| 176 | #if CONFIG_POST & CFG_POST_SPR |
| 177 | { |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 178 | "SPR test", |
| 179 | "spr", |
| 180 | "This test checks SPR contents.", |
| 181 | POST_ROM | POST_ALWAYS | POST_PREREL, |
| 182 | &spr_post_test, |
| 183 | NULL, |
| 184 | NULL, |
wdenk | 9dfa8d1 | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 185 | CFG_POST_SPR |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 186 | }, |
| 187 | #endif |
wdenk | c08f158 | 2003-04-27 22:52:51 +0000 | [diff] [blame] | 188 | #if CONFIG_POST & CFG_POST_SYSMON |
| 189 | { |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 190 | "SYSMON test", |
| 191 | "sysmon", |
| 192 | "This test monitors system hardware.", |
| 193 | POST_RAM | POST_ALWAYS, |
| 194 | &sysmon_post_test, |
| 195 | &sysmon_init_f, |
| 196 | &sysmon_reloc, |
wdenk | c08f158 | 2003-04-27 22:52:51 +0000 | [diff] [blame] | 197 | CFG_POST_SYSMON |
| 198 | }, |
| 199 | #endif |
wdenk | 6164217 | 2004-04-15 21:16:42 +0000 | [diff] [blame^] | 200 | #if CONFIG_POST & CFG_POST_DSP |
| 201 | { |
| 202 | "DSP test", |
| 203 | "dsp", |
| 204 | "This test checks any connected DSP(s).", |
| 205 | POST_RAM | POST_MANUAL, |
| 206 | &dsp_post_test, |
| 207 | NULL, |
| 208 | NULL, |
| 209 | CFG_POST_DSP |
| 210 | }, |
| 211 | #endif |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 212 | }; |
| 213 | |
| 214 | unsigned int post_list_size = sizeof (post_list) / sizeof (struct post_test); |
| 215 | |
| 216 | #endif /* CONFIG_POST */ |