blob: 36473e311f8606eb805ad037d8108c0b96b3f553 [file] [log] [blame]
wdenk324f6cf2002-10-07 21:13:39 +00001/*
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
wdenk228f29a2002-12-08 09:53:23 +000022 *
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.
wdenk324f6cf2002-10-07 21:13:39 +000026 */
27
28#include <common.h>
29
wdenk324f6cf2002-10-07 21:13:39 +000030#include <post.h>
31
32extern int cache_post_test (int flags);
33extern int watchdog_post_test (int flags);
34extern int i2c_post_test (int flags);
35extern int rtc_post_test (int flags);
36extern int memory_post_test (int flags);
37extern int cpu_post_test (int flags);
Igor Lisitsina11e0692007-03-28 19:06:19 +040038extern int fpu_post_test (int flags);
wdenk324f6cf2002-10-07 21:13:39 +000039extern int uart_post_test (int flags);
40extern int ether_post_test (int flags);
41extern int spi_post_test (int flags);
42extern int usb_post_test (int flags);
43extern int spr_post_test (int flags);
wdenk4532cb62003-04-27 22:52:51 +000044extern int sysmon_post_test (int flags);
wdenk5a8c51c2004-04-15 21:16:42 +000045extern int dsp_post_test (int flags);
wdenk79fa88f2004-06-07 23:46:25 +000046extern int codec_post_test (int flags);
Pavel Kolesnikov531e3e82007-07-20 15:03:03 +020047extern int ecc_post_test (int flags);
wdenk4532cb62003-04-27 22:52:51 +000048
Yuri Tikhonov65b20dc2008-02-04 14:10:42 +010049extern int dspic_init_post_test (int flags);
50extern int dspic_post_test (int flags);
51extern int gdc_post_test (int flags);
52extern int fpga_post_test (int flags);
53extern int lwmon5_watchdog_post_test(int flags);
54extern int sysmon1_post_test(int flags);
55
wdenk4532cb62003-04-27 22:52:51 +000056extern int sysmon_init_f (void);
57
58extern void sysmon_reloc (void);
59
wdenk324f6cf2002-10-07 21:13:39 +000060
61struct post_test post_list[] =
62{
63#if CONFIG_POST & CFG_POST_CACHE
64 {
wdenk8bde7f72003-06-27 21:31:46 +000065 "Cache test",
66 "cache",
67 "This test verifies the CPU cache operation.",
68 POST_RAM | POST_ALWAYS,
69 &cache_post_test,
70 NULL,
71 NULL,
wdenk228f29a2002-12-08 09:53:23 +000072 CFG_POST_CACHE
wdenk324f6cf2002-10-07 21:13:39 +000073 },
74#endif
75#if CONFIG_POST & CFG_POST_WATCHDOG
Yuri Tikhonov65b20dc2008-02-04 14:10:42 +010076#if defined(CONFIG_POST_WATCHDOG)
77 CONFIG_POST_WATCHDOG,
78#else
wdenk324f6cf2002-10-07 21:13:39 +000079 {
wdenk8bde7f72003-06-27 21:31:46 +000080 "Watchdog timer test",
81 "watchdog",
82 "This test checks the watchdog timer.",
wdenk8564acf2003-07-14 22:13:32 +000083 POST_RAM | POST_POWERON | POST_SLOWTEST | POST_MANUAL | POST_REBOOT,
wdenk8bde7f72003-06-27 21:31:46 +000084 &watchdog_post_test,
85 NULL,
86 NULL,
wdenk228f29a2002-12-08 09:53:23 +000087 CFG_POST_WATCHDOG
wdenk324f6cf2002-10-07 21:13:39 +000088 },
89#endif
Yuri Tikhonov65b20dc2008-02-04 14:10:42 +010090#endif
wdenk324f6cf2002-10-07 21:13:39 +000091#if CONFIG_POST & CFG_POST_I2C
92 {
wdenk8bde7f72003-06-27 21:31:46 +000093 "I2C test",
94 "i2c",
95 "This test verifies the I2C operation.",
96 POST_RAM | POST_ALWAYS,
97 &i2c_post_test,
98 NULL,
99 NULL,
wdenk228f29a2002-12-08 09:53:23 +0000100 CFG_POST_I2C
wdenk324f6cf2002-10-07 21:13:39 +0000101 },
102#endif
103#if CONFIG_POST & CFG_POST_RTC
104 {
wdenk8bde7f72003-06-27 21:31:46 +0000105 "RTC test",
106 "rtc",
107 "This test verifies the RTC operation.",
wdenk8564acf2003-07-14 22:13:32 +0000108 POST_RAM | POST_SLOWTEST | POST_MANUAL,
wdenk8bde7f72003-06-27 21:31:46 +0000109 &rtc_post_test,
110 NULL,
111 NULL,
wdenk228f29a2002-12-08 09:53:23 +0000112 CFG_POST_RTC
wdenk324f6cf2002-10-07 21:13:39 +0000113 },
114#endif
115#if CONFIG_POST & CFG_POST_MEMORY
116 {
wdenk8bde7f72003-06-27 21:31:46 +0000117 "Memory test",
118 "memory",
119 "This test checks RAM.",
wdenk8564acf2003-07-14 22:13:32 +0000120 POST_ROM | POST_POWERON | POST_SLOWTEST | POST_PREREL,
wdenk8bde7f72003-06-27 21:31:46 +0000121 &memory_post_test,
122 NULL,
123 NULL,
wdenk228f29a2002-12-08 09:53:23 +0000124 CFG_POST_MEMORY
wdenk324f6cf2002-10-07 21:13:39 +0000125 },
126#endif
127#if CONFIG_POST & CFG_POST_CPU
128 {
wdenk8bde7f72003-06-27 21:31:46 +0000129 "CPU test",
130 "cpu",
131 "This test verifies the arithmetic logic unit of"
132 " CPU.",
133 POST_RAM | POST_ALWAYS,
134 &cpu_post_test,
135 NULL,
136 NULL,
wdenk228f29a2002-12-08 09:53:23 +0000137 CFG_POST_CPU
wdenk324f6cf2002-10-07 21:13:39 +0000138 },
139#endif
Igor Lisitsina11e0692007-03-28 19:06:19 +0400140#if CONFIG_POST & CFG_POST_FPU
141 {
142 "FPU test",
143 "fpu",
144 "This test verifies the arithmetic logic unit of"
145 " FPU.",
146 POST_RAM | POST_ALWAYS,
147 &fpu_post_test,
148 NULL,
149 NULL,
150 CFG_POST_FPU
151 },
152#endif
wdenk324f6cf2002-10-07 21:13:39 +0000153#if CONFIG_POST & CFG_POST_UART
154 {
wdenk8bde7f72003-06-27 21:31:46 +0000155 "UART test",
156 "uart",
157 "This test verifies the UART operation.",
wdenk8564acf2003-07-14 22:13:32 +0000158 POST_RAM | POST_SLOWTEST | POST_MANUAL,
wdenk8bde7f72003-06-27 21:31:46 +0000159 &uart_post_test,
160 NULL,
161 NULL,
wdenk228f29a2002-12-08 09:53:23 +0000162 CFG_POST_UART
wdenk324f6cf2002-10-07 21:13:39 +0000163 },
164#endif
165#if CONFIG_POST & CFG_POST_ETHER
166 {
wdenk8bde7f72003-06-27 21:31:46 +0000167 "ETHERNET test",
168 "ethernet",
169 "This test verifies the ETHERNET operation.",
170 POST_RAM | POST_ALWAYS | POST_MANUAL,
171 &ether_post_test,
172 NULL,
173 NULL,
wdenk228f29a2002-12-08 09:53:23 +0000174 CFG_POST_ETHER
wdenk324f6cf2002-10-07 21:13:39 +0000175 },
176#endif
177#if CONFIG_POST & CFG_POST_SPI
178 {
wdenk8bde7f72003-06-27 21:31:46 +0000179 "SPI test",
180 "spi",
181 "This test verifies the SPI operation.",
182 POST_RAM | POST_ALWAYS | POST_MANUAL,
183 &spi_post_test,
184 NULL,
185 NULL,
wdenk228f29a2002-12-08 09:53:23 +0000186 CFG_POST_SPI
wdenk324f6cf2002-10-07 21:13:39 +0000187 },
188#endif
189#if CONFIG_POST & CFG_POST_USB
190 {
wdenk8bde7f72003-06-27 21:31:46 +0000191 "USB test",
192 "usb",
193 "This test verifies the USB operation.",
194 POST_RAM | POST_ALWAYS | POST_MANUAL,
195 &usb_post_test,
196 NULL,
197 NULL,
wdenk228f29a2002-12-08 09:53:23 +0000198 CFG_POST_USB
wdenk324f6cf2002-10-07 21:13:39 +0000199 },
200#endif
201#if CONFIG_POST & CFG_POST_SPR
202 {
wdenk8bde7f72003-06-27 21:31:46 +0000203 "SPR test",
204 "spr",
205 "This test checks SPR contents.",
Stefan Roeseb2e21422008-01-09 10:38:58 +0100206 POST_RAM | POST_ALWAYS,
wdenk8bde7f72003-06-27 21:31:46 +0000207 &spr_post_test,
208 NULL,
209 NULL,
wdenk228f29a2002-12-08 09:53:23 +0000210 CFG_POST_SPR
wdenk324f6cf2002-10-07 21:13:39 +0000211 },
212#endif
wdenk4532cb62003-04-27 22:52:51 +0000213#if CONFIG_POST & CFG_POST_SYSMON
214 {
wdenk8bde7f72003-06-27 21:31:46 +0000215 "SYSMON test",
216 "sysmon",
217 "This test monitors system hardware.",
218 POST_RAM | POST_ALWAYS,
219 &sysmon_post_test,
220 &sysmon_init_f,
221 &sysmon_reloc,
wdenk4532cb62003-04-27 22:52:51 +0000222 CFG_POST_SYSMON
223 },
224#endif
wdenk5a8c51c2004-04-15 21:16:42 +0000225#if CONFIG_POST & CFG_POST_DSP
226 {
227 "DSP test",
228 "dsp",
229 "This test checks any connected DSP(s).",
230 POST_RAM | POST_MANUAL,
231 &dsp_post_test,
232 NULL,
233 NULL,
234 CFG_POST_DSP
235 },
236#endif
Yuri Tikhonov8dc3b232008-02-04 14:10:01 +0100237#if CONFIG_POST & CFG_POST_CODEC
wdenk79fa88f2004-06-07 23:46:25 +0000238 {
239 "CODEC test",
240 "codec",
241 "This test checks any connected codec(s).",
242 POST_RAM | POST_MANUAL,
243 &codec_post_test,
244 NULL,
245 NULL,
246 CFG_POST_CODEC
247 },
248#endif
Pavel Kolesnikov531e3e82007-07-20 15:03:03 +0200249#if CONFIG_POST & CFG_POST_ECC
250 {
251 "ECC test",
252 "ecc",
Larry Johnson8dafa872008-01-12 23:35:33 -0500253 "This test checks the ECC facility of memory.",
254 POST_ROM | POST_ALWAYS | POST_PREREL,
Pavel Kolesnikov531e3e82007-07-20 15:03:03 +0200255 &ecc_post_test,
256 NULL,
257 NULL,
258 CFG_POST_ECC
259 },
260#endif
Yuri Tikhonov65b20dc2008-02-04 14:10:42 +0100261#if CONFIG_POST & CFG_POST_BSPEC1
262 CONFIG_POST_BSPEC1,
263#endif
264#if CONFIG_POST & CFG_POST_BSPEC2
265 CONFIG_POST_BSPEC2,
266#endif
267#if CONFIG_POST & CFG_POST_BSPEC3
268 CONFIG_POST_BSPEC3,
269#endif
270#if CONFIG_POST & CFG_POST_BSPEC4
271 CONFIG_POST_BSPEC4,
272#endif
273#if CONFIG_POST & CFG_POST_BSPEC4
274 CONFIG_POST_BSPEC5,
275#endif
wdenk324f6cf2002-10-07 21:13:39 +0000276};
277
278unsigned int post_list_size = sizeof (post_list) / sizeof (struct post_test);