]>
Commit | Line | Data |
---|---|---|
324f6cfd WD |
1 | /* |
2 | * (C) Copyright 2002 | |
3 | * Wolfgang Denk, DENX Software Engineering, [email protected]. | |
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 | |
228f29ac WD |
22 | * |
23 | * Be sure to mark tests to be run before relocation as such with the | |
6d0f6bcf | 24 | * CONFIG_SYS_POST_PREREL flag so that logging is done correctly if the |
228f29ac | 25 | * logbuffer support is enabled. |
324f6cfd WD |
26 | */ |
27 | ||
28 | #include <common.h> | |
29 | ||
324f6cfd WD |
30 | #include <post.h> |
31 | ||
6e8ec682 | 32 | extern int ocm_post_test (int flags); |
324f6cfd WD |
33 | extern int cache_post_test (int flags); |
34 | extern int watchdog_post_test (int flags); | |
35 | extern int i2c_post_test (int flags); | |
36 | extern int rtc_post_test (int flags); | |
37 | extern int memory_post_test (int flags); | |
38 | extern int cpu_post_test (int flags); | |
a11e0696 | 39 | extern int fpu_post_test (int flags); |
324f6cfd WD |
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); | |
4532cb69 | 45 | extern int sysmon_post_test (int flags); |
5a8c51cd | 46 | extern int dsp_post_test (int flags); |
79fa88f3 | 47 | extern int codec_post_test (int flags); |
531e3e8b | 48 | extern int ecc_post_test (int flags); |
f6f7395e | 49 | extern int flash_post_test(int flags); |
4532cb69 | 50 | |
65b20dce YT |
51 | extern int dspic_init_post_test (int flags); |
52 | extern int dspic_post_test (int flags); | |
53 | extern int gdc_post_test (int flags); | |
54 | extern int fpga_post_test (int flags); | |
55 | extern int lwmon5_watchdog_post_test(int flags); | |
56 | extern int sysmon1_post_test(int flags); | |
29fd7ceb | 57 | extern int coprocessor_post_test(int flags); |
65b20dce | 58 | |
4532cb69 WD |
59 | extern int sysmon_init_f (void); |
60 | ||
61 | extern void sysmon_reloc (void); | |
62 | ||
324f6cfd WD |
63 | |
64 | struct post_test post_list[] = | |
65 | { | |
6d0f6bcf | 66 | #if CONFIG_POST & CONFIG_SYS_POST_OCM |
6e8ec682 YT |
67 | { |
68 | "OCM test", | |
69 | "ocm", | |
70 | "This test checks on chip memory (OCM).", | |
7845d490 | 71 | POST_ROM | POST_ALWAYS | POST_PREREL | POST_CRITICAL | POST_STOP, |
6e8ec682 YT |
72 | &ocm_post_test, |
73 | NULL, | |
74 | NULL, | |
6d0f6bcf | 75 | CONFIG_SYS_POST_OCM |
6e8ec682 YT |
76 | }, |
77 | #endif | |
6d0f6bcf | 78 | #if CONFIG_POST & CONFIG_SYS_POST_CACHE |
324f6cfd | 79 | { |
8bde7f77 WD |
80 | "Cache test", |
81 | "cache", | |
82 | "This test verifies the CPU cache operation.", | |
83 | POST_RAM | POST_ALWAYS, | |
84 | &cache_post_test, | |
85 | NULL, | |
86 | NULL, | |
6d0f6bcf | 87 | CONFIG_SYS_POST_CACHE |
324f6cfd WD |
88 | }, |
89 | #endif | |
6d0f6bcf | 90 | #if CONFIG_POST & CONFIG_SYS_POST_WATCHDOG |
65b20dce YT |
91 | #if defined(CONFIG_POST_WATCHDOG) |
92 | CONFIG_POST_WATCHDOG, | |
93 | #else | |
324f6cfd | 94 | { |
8bde7f77 WD |
95 | "Watchdog timer test", |
96 | "watchdog", | |
97 | "This test checks the watchdog timer.", | |
8564acf9 | 98 | POST_RAM | POST_POWERON | POST_SLOWTEST | POST_MANUAL | POST_REBOOT, |
8bde7f77 WD |
99 | &watchdog_post_test, |
100 | NULL, | |
101 | NULL, | |
6d0f6bcf | 102 | CONFIG_SYS_POST_WATCHDOG |
324f6cfd WD |
103 | }, |
104 | #endif | |
65b20dce | 105 | #endif |
6d0f6bcf | 106 | #if CONFIG_POST & CONFIG_SYS_POST_I2C |
324f6cfd | 107 | { |
8bde7f77 WD |
108 | "I2C test", |
109 | "i2c", | |
110 | "This test verifies the I2C operation.", | |
111 | POST_RAM | POST_ALWAYS, | |
112 | &i2c_post_test, | |
113 | NULL, | |
114 | NULL, | |
6d0f6bcf | 115 | CONFIG_SYS_POST_I2C |
324f6cfd WD |
116 | }, |
117 | #endif | |
6d0f6bcf | 118 | #if CONFIG_POST & CONFIG_SYS_POST_RTC |
324f6cfd | 119 | { |
8bde7f77 WD |
120 | "RTC test", |
121 | "rtc", | |
122 | "This test verifies the RTC operation.", | |
8564acf9 | 123 | POST_RAM | POST_SLOWTEST | POST_MANUAL, |
8bde7f77 WD |
124 | &rtc_post_test, |
125 | NULL, | |
126 | NULL, | |
6d0f6bcf | 127 | CONFIG_SYS_POST_RTC |
324f6cfd WD |
128 | }, |
129 | #endif | |
6d0f6bcf | 130 | #if CONFIG_POST & CONFIG_SYS_POST_MEMORY |
324f6cfd | 131 | { |
8bde7f77 WD |
132 | "Memory test", |
133 | "memory", | |
134 | "This test checks RAM.", | |
8564acf9 | 135 | POST_ROM | POST_POWERON | POST_SLOWTEST | POST_PREREL, |
8bde7f77 WD |
136 | &memory_post_test, |
137 | NULL, | |
138 | NULL, | |
6d0f6bcf | 139 | CONFIG_SYS_POST_MEMORY |
324f6cfd WD |
140 | }, |
141 | #endif | |
6d0f6bcf | 142 | #if CONFIG_POST & CONFIG_SYS_POST_CPU |
324f6cfd | 143 | { |
8bde7f77 WD |
144 | "CPU test", |
145 | "cpu", | |
146 | "This test verifies the arithmetic logic unit of" | |
147 | " CPU.", | |
148 | POST_RAM | POST_ALWAYS, | |
149 | &cpu_post_test, | |
150 | NULL, | |
151 | NULL, | |
6d0f6bcf | 152 | CONFIG_SYS_POST_CPU |
324f6cfd WD |
153 | }, |
154 | #endif | |
6d0f6bcf | 155 | #if CONFIG_POST & CONFIG_SYS_POST_FPU |
a11e0696 IL |
156 | { |
157 | "FPU test", | |
158 | "fpu", | |
159 | "This test verifies the arithmetic logic unit of" | |
160 | " FPU.", | |
161 | POST_RAM | POST_ALWAYS, | |
162 | &fpu_post_test, | |
163 | NULL, | |
164 | NULL, | |
6d0f6bcf | 165 | CONFIG_SYS_POST_FPU |
a11e0696 IL |
166 | }, |
167 | #endif | |
6d0f6bcf | 168 | #if CONFIG_POST & CONFIG_SYS_POST_UART |
834a45d7 SR |
169 | #if defined(CONFIG_POST_UART) |
170 | CONFIG_POST_UART, | |
171 | #else | |
324f6cfd | 172 | { |
8bde7f77 WD |
173 | "UART test", |
174 | "uart", | |
175 | "This test verifies the UART operation.", | |
8564acf9 | 176 | POST_RAM | POST_SLOWTEST | POST_MANUAL, |
8bde7f77 WD |
177 | &uart_post_test, |
178 | NULL, | |
179 | NULL, | |
6d0f6bcf | 180 | CONFIG_SYS_POST_UART |
324f6cfd | 181 | }, |
834a45d7 | 182 | #endif /* CONFIG_POST_UART */ |
324f6cfd | 183 | #endif |
6d0f6bcf | 184 | #if CONFIG_POST & CONFIG_SYS_POST_ETHER |
324f6cfd | 185 | { |
8bde7f77 WD |
186 | "ETHERNET test", |
187 | "ethernet", | |
188 | "This test verifies the ETHERNET operation.", | |
189 | POST_RAM | POST_ALWAYS | POST_MANUAL, | |
190 | ðer_post_test, | |
191 | NULL, | |
192 | NULL, | |
6d0f6bcf | 193 | CONFIG_SYS_POST_ETHER |
324f6cfd WD |
194 | }, |
195 | #endif | |
6d0f6bcf | 196 | #if CONFIG_POST & CONFIG_SYS_POST_SPI |
324f6cfd | 197 | { |
8bde7f77 WD |
198 | "SPI test", |
199 | "spi", | |
200 | "This test verifies the SPI operation.", | |
201 | POST_RAM | POST_ALWAYS | POST_MANUAL, | |
202 | &spi_post_test, | |
203 | NULL, | |
204 | NULL, | |
6d0f6bcf | 205 | CONFIG_SYS_POST_SPI |
324f6cfd WD |
206 | }, |
207 | #endif | |
6d0f6bcf | 208 | #if CONFIG_POST & CONFIG_SYS_POST_USB |
324f6cfd | 209 | { |
8bde7f77 WD |
210 | "USB test", |
211 | "usb", | |
212 | "This test verifies the USB operation.", | |
213 | POST_RAM | POST_ALWAYS | POST_MANUAL, | |
214 | &usb_post_test, | |
215 | NULL, | |
216 | NULL, | |
6d0f6bcf | 217 | CONFIG_SYS_POST_USB |
324f6cfd WD |
218 | }, |
219 | #endif | |
6d0f6bcf | 220 | #if CONFIG_POST & CONFIG_SYS_POST_SPR |
324f6cfd | 221 | { |
8bde7f77 WD |
222 | "SPR test", |
223 | "spr", | |
224 | "This test checks SPR contents.", | |
b2e2142c | 225 | POST_RAM | POST_ALWAYS, |
8bde7f77 WD |
226 | &spr_post_test, |
227 | NULL, | |
228 | NULL, | |
6d0f6bcf | 229 | CONFIG_SYS_POST_SPR |
324f6cfd WD |
230 | }, |
231 | #endif | |
6d0f6bcf | 232 | #if CONFIG_POST & CONFIG_SYS_POST_SYSMON |
4532cb69 | 233 | { |
8bde7f77 WD |
234 | "SYSMON test", |
235 | "sysmon", | |
236 | "This test monitors system hardware.", | |
237 | POST_RAM | POST_ALWAYS, | |
238 | &sysmon_post_test, | |
239 | &sysmon_init_f, | |
240 | &sysmon_reloc, | |
6d0f6bcf | 241 | CONFIG_SYS_POST_SYSMON |
4532cb69 WD |
242 | }, |
243 | #endif | |
6d0f6bcf | 244 | #if CONFIG_POST & CONFIG_SYS_POST_DSP |
5a8c51cd WD |
245 | { |
246 | "DSP test", | |
247 | "dsp", | |
248 | "This test checks any connected DSP(s).", | |
5744ddc6 | 249 | POST_RAM | POST_ALWAYS | POST_MANUAL, |
5a8c51cd WD |
250 | &dsp_post_test, |
251 | NULL, | |
252 | NULL, | |
6d0f6bcf | 253 | CONFIG_SYS_POST_DSP |
5a8c51cd WD |
254 | }, |
255 | #endif | |
6d0f6bcf | 256 | #if CONFIG_POST & CONFIG_SYS_POST_CODEC |
79fa88f3 WD |
257 | { |
258 | "CODEC test", | |
259 | "codec", | |
260 | "This test checks any connected codec(s).", | |
261 | POST_RAM | POST_MANUAL, | |
262 | &codec_post_test, | |
263 | NULL, | |
264 | NULL, | |
6d0f6bcf | 265 | CONFIG_SYS_POST_CODEC |
79fa88f3 WD |
266 | }, |
267 | #endif | |
6d0f6bcf | 268 | #if CONFIG_POST & CONFIG_SYS_POST_ECC |
531e3e8b PK |
269 | { |
270 | "ECC test", | |
271 | "ecc", | |
8dafa874 LJ |
272 | "This test checks the ECC facility of memory.", |
273 | POST_ROM | POST_ALWAYS | POST_PREREL, | |
531e3e8b PK |
274 | &ecc_post_test, |
275 | NULL, | |
276 | NULL, | |
6d0f6bcf | 277 | CONFIG_SYS_POST_ECC |
531e3e8b PK |
278 | }, |
279 | #endif | |
6d0f6bcf | 280 | #if CONFIG_POST & CONFIG_SYS_POST_BSPEC1 |
65b20dce YT |
281 | CONFIG_POST_BSPEC1, |
282 | #endif | |
6d0f6bcf | 283 | #if CONFIG_POST & CONFIG_SYS_POST_BSPEC2 |
65b20dce YT |
284 | CONFIG_POST_BSPEC2, |
285 | #endif | |
6d0f6bcf | 286 | #if CONFIG_POST & CONFIG_SYS_POST_BSPEC3 |
65b20dce YT |
287 | CONFIG_POST_BSPEC3, |
288 | #endif | |
6d0f6bcf | 289 | #if CONFIG_POST & CONFIG_SYS_POST_BSPEC4 |
65b20dce YT |
290 | CONFIG_POST_BSPEC4, |
291 | #endif | |
6d0f6bcf | 292 | #if CONFIG_POST & CONFIG_SYS_POST_BSPEC5 |
65b20dce YT |
293 | CONFIG_POST_BSPEC5, |
294 | #endif | |
29fd7ceb AG |
295 | #if CONFIG_POST & CONFIG_SYS_POST_COPROC |
296 | { | |
297 | "Coprocessors communication test", | |
298 | "coproc_com", | |
299 | "This test checks communication with coprocessors.", | |
300 | POST_RAM | POST_ALWAYS | POST_CRITICAL, | |
301 | &coprocessor_post_test, | |
302 | NULL, | |
303 | NULL, | |
304 | CONFIG_SYS_POST_COPROC | |
f6f7395e MF |
305 | }, |
306 | #endif | |
307 | #if CONFIG_POST & CONFIG_SYS_POST_FLASH | |
308 | { | |
309 | "Parallel NOR flash test", | |
310 | "flash", | |
311 | "This test verifies parallel flash operations.", | |
312 | POST_RAM | POST_SLOWTEST | POST_MANUAL, | |
313 | &flash_post_test, | |
314 | NULL, | |
315 | NULL, | |
316 | CONFIG_SYS_POST_FLASH | |
317 | }, | |
29fd7ceb | 318 | #endif |
324f6cfd WD |
319 | }; |
320 | ||
d2397817 | 321 | unsigned int post_list_size = ARRAY_SIZE(post_list); |