blob: 473c0ea1e1d04aa468ecf62cab39d31bb10c1de4 [file] [log] [blame]
wdenk324f6cf2002-10-07 21:13:39 +00001/*
2 * (C) Copyright 2002
3 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
wdenk324f6cf2002-10-07 21:13:39 +00006 */
7
8#include <common.h>
9
wdenk324f6cf2002-10-07 21:13:39 +000010#include <post.h>
11
Yuri Tikhonov6e8ec682008-05-08 15:42:47 +020012extern int ocm_post_test (int flags);
wdenk324f6cf2002-10-07 21:13:39 +000013extern int cache_post_test (int flags);
14extern int watchdog_post_test (int flags);
15extern int i2c_post_test (int flags);
16extern int rtc_post_test (int flags);
17extern int memory_post_test (int flags);
18extern int cpu_post_test (int flags);
Igor Lisitsina11e0692007-03-28 19:06:19 +040019extern int fpu_post_test (int flags);
wdenk324f6cf2002-10-07 21:13:39 +000020extern int uart_post_test (int flags);
21extern int ether_post_test (int flags);
22extern int spi_post_test (int flags);
23extern int usb_post_test (int flags);
24extern int spr_post_test (int flags);
wdenk4532cb62003-04-27 22:52:51 +000025extern int sysmon_post_test (int flags);
wdenk5a8c51c2004-04-15 21:16:42 +000026extern int dsp_post_test (int flags);
wdenk79fa88f2004-06-07 23:46:25 +000027extern int codec_post_test (int flags);
Pavel Kolesnikov531e3e82007-07-20 15:03:03 +020028extern int ecc_post_test (int flags);
Mike Frysingerf6f73952011-05-10 13:35:40 +000029extern int flash_post_test(int flags);
wdenk4532cb62003-04-27 22:52:51 +000030
Yuri Tikhonov65b20dc2008-02-04 14:10:42 +010031extern int dspic_init_post_test (int flags);
32extern int dspic_post_test (int flags);
33extern int gdc_post_test (int flags);
34extern int fpga_post_test (int flags);
35extern int lwmon5_watchdog_post_test(int flags);
36extern int sysmon1_post_test(int flags);
Anatolij Gustschin29fd7ce2010-04-24 19:27:11 +020037extern int coprocessor_post_test(int flags);
Mike Frysinger21513742011-05-10 16:22:25 -040038extern int led_post_test(int flags);
39extern int button_post_test(int flags);
Valentin Longchamp8d3fcb52011-09-12 04:18:40 +000040extern int memory_regions_post_test(int flags);
Yuri Tikhonov65b20dc2008-02-04 14:10:42 +010041
wdenk4532cb62003-04-27 22:52:51 +000042extern int sysmon_init_f (void);
43
44extern void sysmon_reloc (void);
45
wdenk324f6cf2002-10-07 21:13:39 +000046
47struct post_test post_list[] =
48{
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020049#if CONFIG_POST & CONFIG_SYS_POST_OCM
Yuri Tikhonov6e8ec682008-05-08 15:42:47 +020050 {
51 "OCM test",
52 "ocm",
53 "This test checks on chip memory (OCM).",
Yuri Tikhonov7845d492008-05-08 15:46:02 +020054 POST_ROM | POST_ALWAYS | POST_PREREL | POST_CRITICAL | POST_STOP,
Yuri Tikhonov6e8ec682008-05-08 15:42:47 +020055 &ocm_post_test,
56 NULL,
57 NULL,
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020058 CONFIG_SYS_POST_OCM
Yuri Tikhonov6e8ec682008-05-08 15:42:47 +020059 },
60#endif
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020061#if CONFIG_POST & CONFIG_SYS_POST_CACHE
wdenk324f6cf2002-10-07 21:13:39 +000062 {
wdenk8bde7f72003-06-27 21:31:46 +000063 "Cache test",
64 "cache",
65 "This test verifies the CPU cache operation.",
66 POST_RAM | POST_ALWAYS,
67 &cache_post_test,
68 NULL,
69 NULL,
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020070 CONFIG_SYS_POST_CACHE
wdenk324f6cf2002-10-07 21:13:39 +000071 },
72#endif
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020073#if CONFIG_POST & CONFIG_SYS_POST_WATCHDOG
Yuri Tikhonov65b20dc2008-02-04 14:10:42 +010074#if defined(CONFIG_POST_WATCHDOG)
75 CONFIG_POST_WATCHDOG,
76#else
wdenk324f6cf2002-10-07 21:13:39 +000077 {
wdenk8bde7f72003-06-27 21:31:46 +000078 "Watchdog timer test",
79 "watchdog",
80 "This test checks the watchdog timer.",
wdenk8564acf2003-07-14 22:13:32 +000081 POST_RAM | POST_POWERON | POST_SLOWTEST | POST_MANUAL | POST_REBOOT,
wdenk8bde7f72003-06-27 21:31:46 +000082 &watchdog_post_test,
83 NULL,
84 NULL,
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020085 CONFIG_SYS_POST_WATCHDOG
wdenk324f6cf2002-10-07 21:13:39 +000086 },
87#endif
Yuri Tikhonov65b20dc2008-02-04 14:10:42 +010088#endif
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020089#if CONFIG_POST & CONFIG_SYS_POST_I2C
wdenk324f6cf2002-10-07 21:13:39 +000090 {
wdenk8bde7f72003-06-27 21:31:46 +000091 "I2C test",
92 "i2c",
93 "This test verifies the I2C operation.",
94 POST_RAM | POST_ALWAYS,
95 &i2c_post_test,
96 NULL,
97 NULL,
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020098 CONFIG_SYS_POST_I2C
wdenk324f6cf2002-10-07 21:13:39 +000099 },
100#endif
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200101#if CONFIG_POST & CONFIG_SYS_POST_RTC
wdenk324f6cf2002-10-07 21:13:39 +0000102 {
wdenk8bde7f72003-06-27 21:31:46 +0000103 "RTC test",
104 "rtc",
105 "This test verifies the RTC operation.",
wdenk8564acf2003-07-14 22:13:32 +0000106 POST_RAM | POST_SLOWTEST | POST_MANUAL,
wdenk8bde7f72003-06-27 21:31:46 +0000107 &rtc_post_test,
108 NULL,
109 NULL,
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200110 CONFIG_SYS_POST_RTC
wdenk324f6cf2002-10-07 21:13:39 +0000111 },
112#endif
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200113#if CONFIG_POST & CONFIG_SYS_POST_MEMORY
wdenk324f6cf2002-10-07 21:13:39 +0000114 {
wdenk8bde7f72003-06-27 21:31:46 +0000115 "Memory test",
116 "memory",
117 "This test checks RAM.",
wdenk8564acf2003-07-14 22:13:32 +0000118 POST_ROM | POST_POWERON | POST_SLOWTEST | POST_PREREL,
wdenk8bde7f72003-06-27 21:31:46 +0000119 &memory_post_test,
120 NULL,
121 NULL,
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200122 CONFIG_SYS_POST_MEMORY
wdenk324f6cf2002-10-07 21:13:39 +0000123 },
124#endif
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200125#if CONFIG_POST & CONFIG_SYS_POST_CPU
wdenk324f6cf2002-10-07 21:13:39 +0000126 {
wdenk8bde7f72003-06-27 21:31:46 +0000127 "CPU test",
128 "cpu",
129 "This test verifies the arithmetic logic unit of"
130 " CPU.",
131 POST_RAM | POST_ALWAYS,
132 &cpu_post_test,
133 NULL,
134 NULL,
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200135 CONFIG_SYS_POST_CPU
wdenk324f6cf2002-10-07 21:13:39 +0000136 },
137#endif
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200138#if CONFIG_POST & CONFIG_SYS_POST_FPU
Igor Lisitsina11e0692007-03-28 19:06:19 +0400139 {
140 "FPU test",
141 "fpu",
142 "This test verifies the arithmetic logic unit of"
143 " FPU.",
144 POST_RAM | POST_ALWAYS,
145 &fpu_post_test,
146 NULL,
147 NULL,
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200148 CONFIG_SYS_POST_FPU
Igor Lisitsina11e0692007-03-28 19:06:19 +0400149 },
150#endif
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200151#if CONFIG_POST & CONFIG_SYS_POST_UART
Stefan Roese834a45d2010-10-07 14:16:25 +0200152#if defined(CONFIG_POST_UART)
153 CONFIG_POST_UART,
154#else
wdenk324f6cf2002-10-07 21:13:39 +0000155 {
wdenk8bde7f72003-06-27 21:31:46 +0000156 "UART test",
157 "uart",
158 "This test verifies the UART operation.",
wdenk8564acf2003-07-14 22:13:32 +0000159 POST_RAM | POST_SLOWTEST | POST_MANUAL,
wdenk8bde7f72003-06-27 21:31:46 +0000160 &uart_post_test,
161 NULL,
162 NULL,
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200163 CONFIG_SYS_POST_UART
wdenk324f6cf2002-10-07 21:13:39 +0000164 },
Stefan Roese834a45d2010-10-07 14:16:25 +0200165#endif /* CONFIG_POST_UART */
wdenk324f6cf2002-10-07 21:13:39 +0000166#endif
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200167#if CONFIG_POST & CONFIG_SYS_POST_ETHER
wdenk324f6cf2002-10-07 21:13:39 +0000168 {
wdenk8bde7f72003-06-27 21:31:46 +0000169 "ETHERNET test",
170 "ethernet",
171 "This test verifies the ETHERNET operation.",
Robert P. J. Day5735bca2016-03-27 10:18:55 -0400172 POST_RAM | POST_ALWAYS,
wdenk8bde7f72003-06-27 21:31:46 +0000173 &ether_post_test,
174 NULL,
175 NULL,
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200176 CONFIG_SYS_POST_ETHER
wdenk324f6cf2002-10-07 21:13:39 +0000177 },
178#endif
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200179#if CONFIG_POST & CONFIG_SYS_POST_USB
wdenk324f6cf2002-10-07 21:13:39 +0000180 {
wdenk8bde7f72003-06-27 21:31:46 +0000181 "USB test",
182 "usb",
183 "This test verifies the USB operation.",
Robert P. J. Day5735bca2016-03-27 10:18:55 -0400184 POST_RAM | POST_ALWAYS,
wdenk8bde7f72003-06-27 21:31:46 +0000185 &usb_post_test,
186 NULL,
187 NULL,
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200188 CONFIG_SYS_POST_USB
wdenk324f6cf2002-10-07 21:13:39 +0000189 },
190#endif
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200191#if CONFIG_POST & CONFIG_SYS_POST_SPR
wdenk324f6cf2002-10-07 21:13:39 +0000192 {
wdenk8bde7f72003-06-27 21:31:46 +0000193 "SPR test",
194 "spr",
195 "This test checks SPR contents.",
Stefan Roeseb2e21422008-01-09 10:38:58 +0100196 POST_RAM | POST_ALWAYS,
wdenk8bde7f72003-06-27 21:31:46 +0000197 &spr_post_test,
198 NULL,
199 NULL,
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200200 CONFIG_SYS_POST_SPR
wdenk324f6cf2002-10-07 21:13:39 +0000201 },
202#endif
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200203#if CONFIG_POST & CONFIG_SYS_POST_SYSMON
wdenk4532cb62003-04-27 22:52:51 +0000204 {
wdenk8bde7f72003-06-27 21:31:46 +0000205 "SYSMON test",
206 "sysmon",
207 "This test monitors system hardware.",
208 POST_RAM | POST_ALWAYS,
209 &sysmon_post_test,
210 &sysmon_init_f,
211 &sysmon_reloc,
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200212 CONFIG_SYS_POST_SYSMON
wdenk4532cb62003-04-27 22:52:51 +0000213 },
214#endif
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200215#if CONFIG_POST & CONFIG_SYS_POST_DSP
wdenk5a8c51c2004-04-15 21:16:42 +0000216 {
217 "DSP test",
218 "dsp",
219 "This test checks any connected DSP(s).",
Robert P. J. Day5735bca2016-03-27 10:18:55 -0400220 POST_RAM | POST_ALWAYS,
wdenk5a8c51c2004-04-15 21:16:42 +0000221 &dsp_post_test,
222 NULL,
223 NULL,
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200224 CONFIG_SYS_POST_DSP
wdenk5a8c51c2004-04-15 21:16:42 +0000225 },
226#endif
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200227#if CONFIG_POST & CONFIG_SYS_POST_CODEC
wdenk79fa88f2004-06-07 23:46:25 +0000228 {
229 "CODEC test",
230 "codec",
231 "This test checks any connected codec(s).",
232 POST_RAM | POST_MANUAL,
233 &codec_post_test,
234 NULL,
235 NULL,
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200236 CONFIG_SYS_POST_CODEC
wdenk79fa88f2004-06-07 23:46:25 +0000237 },
238#endif
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200239#if CONFIG_POST & CONFIG_SYS_POST_ECC
Pavel Kolesnikov531e3e82007-07-20 15:03:03 +0200240 {
241 "ECC test",
242 "ecc",
Larry Johnson8dafa872008-01-12 23:35:33 -0500243 "This test checks the ECC facility of memory.",
244 POST_ROM | POST_ALWAYS | POST_PREREL,
Pavel Kolesnikov531e3e82007-07-20 15:03:03 +0200245 &ecc_post_test,
246 NULL,
247 NULL,
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200248 CONFIG_SYS_POST_ECC
Pavel Kolesnikov531e3e82007-07-20 15:03:03 +0200249 },
250#endif
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200251#if CONFIG_POST & CONFIG_SYS_POST_BSPEC1
Yuri Tikhonov65b20dc2008-02-04 14:10:42 +0100252 CONFIG_POST_BSPEC1,
253#endif
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200254#if CONFIG_POST & CONFIG_SYS_POST_BSPEC2
Yuri Tikhonov65b20dc2008-02-04 14:10:42 +0100255 CONFIG_POST_BSPEC2,
256#endif
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200257#if CONFIG_POST & CONFIG_SYS_POST_BSPEC3
Yuri Tikhonov65b20dc2008-02-04 14:10:42 +0100258 CONFIG_POST_BSPEC3,
259#endif
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200260#if CONFIG_POST & CONFIG_SYS_POST_BSPEC4
Yuri Tikhonov65b20dc2008-02-04 14:10:42 +0100261 CONFIG_POST_BSPEC4,
262#endif
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +0200263#if CONFIG_POST & CONFIG_SYS_POST_BSPEC5
Yuri Tikhonov65b20dc2008-02-04 14:10:42 +0100264 CONFIG_POST_BSPEC5,
265#endif
Anatolij Gustschin29fd7ce2010-04-24 19:27:11 +0200266#if CONFIG_POST & CONFIG_SYS_POST_COPROC
267 {
268 "Coprocessors communication test",
269 "coproc_com",
270 "This test checks communication with coprocessors.",
271 POST_RAM | POST_ALWAYS | POST_CRITICAL,
272 &coprocessor_post_test,
273 NULL,
274 NULL,
275 CONFIG_SYS_POST_COPROC
Mike Frysingerf6f73952011-05-10 13:35:40 +0000276 },
277#endif
278#if CONFIG_POST & CONFIG_SYS_POST_FLASH
279 {
280 "Parallel NOR flash test",
281 "flash",
282 "This test verifies parallel flash operations.",
283 POST_RAM | POST_SLOWTEST | POST_MANUAL,
284 &flash_post_test,
285 NULL,
286 NULL,
287 CONFIG_SYS_POST_FLASH
288 },
Anatolij Gustschin29fd7ce2010-04-24 19:27:11 +0200289#endif
Valentin Longchamp8d3fcb52011-09-12 04:18:40 +0000290#if CONFIG_POST & CONFIG_SYS_POST_MEM_REGIONS
291 {
292 "Memory regions test",
293 "mem_regions",
294 "This test checks regularly placed regions of the RAM.",
295 POST_ROM | POST_SLOWTEST | POST_PREREL,
296 &memory_regions_post_test,
297 NULL,
298 NULL,
299 CONFIG_SYS_POST_MEM_REGIONS
300 },
301#endif
wdenk324f6cf2002-10-07 21:13:39 +0000302};
303
Mike Frysingerd2397812011-05-10 07:28:35 +0000304unsigned int post_list_size = ARRAY_SIZE(post_list);