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