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