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