blob: 3bccd1a8eddc6da4a2d4fcbeaf1b1d851dcbb8e5 [file] [log] [blame]
wdenk324f6cf2002-10-07 21:13:39 +00001/*
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
wdenk228f29a2002-12-08 09:53:23 +000022 *
23 * Be sure to mark tests to be run before relocation as such with the
24 * CFG_POST_PREREL flag so that logging is done correctly if the
25 * logbuffer support is enabled.
wdenk324f6cf2002-10-07 21:13:39 +000026 */
27
28#include <common.h>
29
30#ifdef CONFIG_POST
31
32#include <post.h>
33
34extern int cache_post_test (int flags);
35extern int watchdog_post_test (int flags);
36extern int i2c_post_test (int flags);
37extern int rtc_post_test (int flags);
38extern int memory_post_test (int flags);
39extern int cpu_post_test (int flags);
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);
wdenk4532cb62003-04-27 22:52:51 +000045extern int sysmon_post_test (int flags);
wdenk5a8c51c2004-04-15 21:16:42 +000046extern int dsp_post_test (int flags);
wdenk79fa88f2004-06-07 23:46:25 +000047extern int codec_post_test (int flags);
wdenk4532cb62003-04-27 22:52:51 +000048
49extern int sysmon_init_f (void);
50
51extern void sysmon_reloc (void);
52
wdenk324f6cf2002-10-07 21:13:39 +000053
54struct post_test post_list[] =
55{
56#if CONFIG_POST & CFG_POST_CACHE
57 {
wdenk8bde7f72003-06-27 21:31:46 +000058 "Cache test",
59 "cache",
60 "This test verifies the CPU cache operation.",
61 POST_RAM | POST_ALWAYS,
62 &cache_post_test,
63 NULL,
64 NULL,
wdenk228f29a2002-12-08 09:53:23 +000065 CFG_POST_CACHE
wdenk324f6cf2002-10-07 21:13:39 +000066 },
67#endif
68#if CONFIG_POST & CFG_POST_WATCHDOG
69 {
wdenk8bde7f72003-06-27 21:31:46 +000070 "Watchdog timer test",
71 "watchdog",
72 "This test checks the watchdog timer.",
wdenk8564acf2003-07-14 22:13:32 +000073 POST_RAM | POST_POWERON | POST_SLOWTEST | POST_MANUAL | POST_REBOOT,
wdenk8bde7f72003-06-27 21:31:46 +000074 &watchdog_post_test,
75 NULL,
76 NULL,
wdenk228f29a2002-12-08 09:53:23 +000077 CFG_POST_WATCHDOG
wdenk324f6cf2002-10-07 21:13:39 +000078 },
79#endif
80#if CONFIG_POST & CFG_POST_I2C
81 {
wdenk8bde7f72003-06-27 21:31:46 +000082 "I2C test",
83 "i2c",
84 "This test verifies the I2C operation.",
85 POST_RAM | POST_ALWAYS,
86 &i2c_post_test,
87 NULL,
88 NULL,
wdenk228f29a2002-12-08 09:53:23 +000089 CFG_POST_I2C
wdenk324f6cf2002-10-07 21:13:39 +000090 },
91#endif
92#if CONFIG_POST & CFG_POST_RTC
93 {
wdenk8bde7f72003-06-27 21:31:46 +000094 "RTC test",
95 "rtc",
96 "This test verifies the RTC operation.",
wdenk8564acf2003-07-14 22:13:32 +000097 POST_RAM | POST_SLOWTEST | POST_MANUAL,
wdenk8bde7f72003-06-27 21:31:46 +000098 &rtc_post_test,
99 NULL,
100 NULL,
wdenk228f29a2002-12-08 09:53:23 +0000101 CFG_POST_RTC
wdenk324f6cf2002-10-07 21:13:39 +0000102 },
103#endif
104#if CONFIG_POST & CFG_POST_MEMORY
105 {
wdenk8bde7f72003-06-27 21:31:46 +0000106 "Memory test",
107 "memory",
108 "This test checks RAM.",
wdenk8564acf2003-07-14 22:13:32 +0000109 POST_ROM | POST_POWERON | POST_SLOWTEST | POST_PREREL,
wdenk8bde7f72003-06-27 21:31:46 +0000110 &memory_post_test,
111 NULL,
112 NULL,
wdenk228f29a2002-12-08 09:53:23 +0000113 CFG_POST_MEMORY
wdenk324f6cf2002-10-07 21:13:39 +0000114 },
115#endif
116#if CONFIG_POST & CFG_POST_CPU
117 {
wdenk8bde7f72003-06-27 21:31:46 +0000118 "CPU test",
119 "cpu",
120 "This test verifies the arithmetic logic unit of"
121 " CPU.",
122 POST_RAM | POST_ALWAYS,
123 &cpu_post_test,
124 NULL,
125 NULL,
wdenk228f29a2002-12-08 09:53:23 +0000126 CFG_POST_CPU
wdenk324f6cf2002-10-07 21:13:39 +0000127 },
128#endif
129#if CONFIG_POST & CFG_POST_UART
130 {
wdenk8bde7f72003-06-27 21:31:46 +0000131 "UART test",
132 "uart",
133 "This test verifies the UART operation.",
wdenk8564acf2003-07-14 22:13:32 +0000134 POST_RAM | POST_SLOWTEST | POST_MANUAL,
wdenk8bde7f72003-06-27 21:31:46 +0000135 &uart_post_test,
136 NULL,
137 NULL,
wdenk228f29a2002-12-08 09:53:23 +0000138 CFG_POST_UART
wdenk324f6cf2002-10-07 21:13:39 +0000139 },
140#endif
141#if CONFIG_POST & CFG_POST_ETHER
142 {
wdenk8bde7f72003-06-27 21:31:46 +0000143 "ETHERNET test",
144 "ethernet",
145 "This test verifies the ETHERNET operation.",
146 POST_RAM | POST_ALWAYS | POST_MANUAL,
147 &ether_post_test,
148 NULL,
149 NULL,
wdenk228f29a2002-12-08 09:53:23 +0000150 CFG_POST_ETHER
wdenk324f6cf2002-10-07 21:13:39 +0000151 },
152#endif
153#if CONFIG_POST & CFG_POST_SPI
154 {
wdenk8bde7f72003-06-27 21:31:46 +0000155 "SPI test",
156 "spi",
157 "This test verifies the SPI operation.",
158 POST_RAM | POST_ALWAYS | POST_MANUAL,
159 &spi_post_test,
160 NULL,
161 NULL,
wdenk228f29a2002-12-08 09:53:23 +0000162 CFG_POST_SPI
wdenk324f6cf2002-10-07 21:13:39 +0000163 },
164#endif
165#if CONFIG_POST & CFG_POST_USB
166 {
wdenk8bde7f72003-06-27 21:31:46 +0000167 "USB test",
168 "usb",
169 "This test verifies the USB operation.",
170 POST_RAM | POST_ALWAYS | POST_MANUAL,
171 &usb_post_test,
172 NULL,
173 NULL,
wdenk228f29a2002-12-08 09:53:23 +0000174 CFG_POST_USB
wdenk324f6cf2002-10-07 21:13:39 +0000175 },
176#endif
177#if CONFIG_POST & CFG_POST_SPR
178 {
wdenk8bde7f72003-06-27 21:31:46 +0000179 "SPR test",
180 "spr",
181 "This test checks SPR contents.",
182 POST_ROM | POST_ALWAYS | POST_PREREL,
183 &spr_post_test,
184 NULL,
185 NULL,
wdenk228f29a2002-12-08 09:53:23 +0000186 CFG_POST_SPR
wdenk324f6cf2002-10-07 21:13:39 +0000187 },
188#endif
wdenk4532cb62003-04-27 22:52:51 +0000189#if CONFIG_POST & CFG_POST_SYSMON
190 {
wdenk8bde7f72003-06-27 21:31:46 +0000191 "SYSMON test",
192 "sysmon",
193 "This test monitors system hardware.",
194 POST_RAM | POST_ALWAYS,
195 &sysmon_post_test,
196 &sysmon_init_f,
197 &sysmon_reloc,
wdenk4532cb62003-04-27 22:52:51 +0000198 CFG_POST_SYSMON
199 },
200#endif
wdenk5a8c51c2004-04-15 21:16:42 +0000201#if CONFIG_POST & CFG_POST_DSP
202 {
203 "DSP test",
204 "dsp",
205 "This test checks any connected DSP(s).",
206 POST_RAM | POST_MANUAL,
207 &dsp_post_test,
208 NULL,
209 NULL,
210 CFG_POST_DSP
211 },
212#endif
wdenk79fa88f2004-06-07 23:46:25 +0000213#if CONFIG_POST & CFG_POST_DSP
214 {
215 "CODEC test",
216 "codec",
217 "This test checks any connected codec(s).",
218 POST_RAM | POST_MANUAL,
219 &codec_post_test,
220 NULL,
221 NULL,
222 CFG_POST_CODEC
223 },
224#endif
wdenk324f6cf2002-10-07 21:13:39 +0000225};
226
227unsigned int post_list_size = sizeof (post_list) / sizeof (struct post_test);
228
229#endif /* CONFIG_POST */