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