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