3 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
5 * See file CREDITS for list of people who contributed to this
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.
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.
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,
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.
32 #define CONFIG_SYS_POST_FLASH 0x00004000
33 #define CONFIG_SYS_POST_LED 0x00008000
34 #define CONFIG_SYS_POST_BUTTON 0x00010000
36 extern int cache_post_test(int flags);
37 extern int watchdog_post_test(int flags);
38 extern int i2c_post_test(int flags);
39 extern int rtc_post_test(int flags);
40 extern int memory_post_test(int flags);
41 extern int cpu_post_test(int flags);
42 extern int uart_post_test(int flags);
43 extern int ether_post_test(int flags);
44 extern int spi_post_test(int flags);
45 extern int usb_post_test(int flags);
46 extern int spr_post_test(int flags);
47 extern int sysmon_post_test(int flags);
48 extern int dsp_post_test(int flags);
49 extern int codec_post_test(int flags);
51 extern int sysmon_init_f(void);
53 extern void sysmon_reloc(void);
55 extern int flash_post_test(int flags);
56 extern int led_post_test(int flags);
57 extern int button_post_test(int flags);
59 struct post_test post_list[] = {
60 #if CONFIG_POST & CONFIG_SYS_POST_CACHE
64 "This test verifies the CPU cache operation.",
65 POST_RAM | POST_ALWAYS,
69 CONFIG_SYS_POST_CACHE},
71 #if CONFIG_POST & CONFIG_SYS_POST_WATCHDOG
73 "Watchdog timer test",
75 "This test checks the watchdog timer.",
76 POST_RAM | POST_POWERON | POST_SLOWTEST | POST_MANUAL | POST_REBOOT,
80 CONFIG_SYS_POST_WATCHDOG},
82 #if CONFIG_POST & CONFIG_SYS_POST_I2C
86 "This test verifies the I2C operation.",
87 POST_RAM | POST_ALWAYS,
93 #if CONFIG_POST & CONFIG_SYS_POST_RTC
97 "This test verifies the RTC operation.",
98 POST_RAM | POST_SLOWTEST | POST_MANUAL,
102 CONFIG_SYS_POST_RTC},
104 #if CONFIG_POST & CONFIG_SYS_POST_MEMORY
108 "This test checks RAM.",
109 POST_ROM | POST_POWERON | POST_SLOWTEST | POST_PREREL,
113 CONFIG_SYS_POST_MEMORY},
115 #if CONFIG_POST & CONFIG_SYS_POST_CPU
119 "This test verifies the arithmetic logic unit of" " CPU.",
120 POST_RAM | POST_ALWAYS,
124 CONFIG_SYS_POST_CPU},
126 #if CONFIG_POST & CONFIG_SYS_POST_UART
130 "This test verifies the UART operation.",
131 POST_RAM | POST_SLOWTEST | POST_MANUAL,
135 CONFIG_SYS_POST_UART},
137 #if CONFIG_POST & CONFIG_SYS_POST_ETHER
141 "This test verifies the ETHERNET operation.",
142 POST_RAM | POST_ALWAYS | POST_MANUAL,
146 CONFIG_SYS_POST_ETHER},
148 #if CONFIG_POST & CONFIG_SYS_POST_SPI
152 "This test verifies the SPI operation.",
153 POST_RAM | POST_ALWAYS | POST_MANUAL,
157 CONFIG_SYS_POST_SPI},
159 #if CONFIG_POST & CONFIG_SYS_POST_USB
163 "This test verifies the USB operation.",
164 POST_RAM | POST_ALWAYS | POST_MANUAL,
168 CONFIG_SYS_POST_USB},
170 #if CONFIG_POST & CONFIG_SYS_POST_SPR
174 "This test checks SPR contents.",
175 POST_ROM | POST_ALWAYS | POST_PREREL,
179 CONFIG_SYS_POST_SPR},
181 #if CONFIG_POST & CONFIG_SYS_POST_SYSMON
185 "This test monitors system hardware.",
186 POST_RAM | POST_ALWAYS,
190 CONFIG_SYS_POST_SYSMON},
192 #if CONFIG_POST & CONFIG_SYS_POST_DSP
196 "This test checks any connected DSP(s).",
197 POST_RAM | POST_MANUAL,
201 CONFIG_SYS_POST_DSP},
203 #if CONFIG_POST & CONFIG_SYS_POST_CODEC
207 "This test checks any connected codec(s).",
208 POST_RAM | POST_MANUAL,
212 CONFIG_SYS_POST_CODEC},
214 #if CONFIG_POST & CONFIG_SYS_POST_FLASH
218 "This test checks flash.",
219 POST_RAM | POST_ALWAYS | POST_MANUAL,
223 CONFIG_SYS_POST_FLASH},
225 #if CONFIG_POST & CONFIG_SYS_POST_LED
229 "This test checks LED ",
230 POST_RAM | POST_ALWAYS | POST_MANUAL,
234 CONFIG_SYS_POST_LED},
236 #if CONFIG_POST & CONFIG_SYS_POST_BUTTON
240 "This test checks Button ",
241 POST_RAM | POST_ALWAYS | POST_MANUAL,
245 CONFIG_SYS_POST_BUTTON},
250 unsigned int post_list_size = sizeof(post_list) / sizeof(struct post_test);