]> git.ipfire.org Git - people/ms/u-boot.git/blame - lib_blackfin/tests.c
rename CFG_ macros to CONFIG_SYS
[people/ms/u-boot.git] / lib_blackfin / tests.c
CommitLineData
3f0606ad
AL
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
6d0f6bcf 24 * CONFIG_SYS_POST_PREREL flag so that logging is done correctly if the
3f0606ad
AL
25 * logbuffer support is enabled.
26 */
27
28#include <common.h>
29#include <config.h>
30#ifdef CONFIG_POST
31
32#include <post.h>
6d0f6bcf
JCPV
33#define CONFIG_SYS_POST_FLASH 0x00004000
34#define CONFIG_SYS_POST_LED 0x00008000
35#define CONFIG_SYS_POST_BUTTON 0x00010000
3f0606ad
AL
36
37extern int cache_post_test(int flags);
38extern int watchdog_post_test(int flags);
39extern int i2c_post_test(int flags);
40extern int rtc_post_test(int flags);
41extern int memory_post_test(int flags);
42extern int cpu_post_test(int flags);
43extern int uart_post_test(int flags);
44extern int ether_post_test(int flags);
45extern int spi_post_test(int flags);
46extern int usb_post_test(int flags);
47extern int spr_post_test(int flags);
48extern int sysmon_post_test(int flags);
49extern int dsp_post_test(int flags);
50extern int codec_post_test(int flags);
51
52extern int sysmon_init_f(void);
53
54extern void sysmon_reloc(void);
55
56extern int flash_post_test(int flags);
57extern int led_post_test(int flags);
58extern int button_post_test(int flags);
59
60struct post_test post_list[] = {
6d0f6bcf 61#if CONFIG_POST & CONFIG_SYS_POST_CACHE
3f0606ad
AL
62 {
63 "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,
6d0f6bcf 70 CONFIG_SYS_POST_CACHE},
3f0606ad 71#endif
6d0f6bcf 72#if CONFIG_POST & CONFIG_SYS_POST_WATCHDOG
3f0606ad
AL
73 {
74 "Watchdog timer test",
75 "watchdog",
76 "This test checks the watchdog timer.",
77 POST_RAM | POST_POWERON | POST_SLOWTEST | POST_MANUAL | POST_REBOOT,
78 &watchdog_post_test,
79 NULL,
80 NULL,
6d0f6bcf 81 CONFIG_SYS_POST_WATCHDOG},
3f0606ad 82#endif
6d0f6bcf 83#if CONFIG_POST & CONFIG_SYS_POST_I2C
3f0606ad
AL
84 {
85 "I2C test",
86 "i2c",
87 "This test verifies the I2C operation.",
88 POST_RAM | POST_ALWAYS,
89 &i2c_post_test,
90 NULL,
91 NULL,
6d0f6bcf 92 CONFIG_SYS_POST_I2C},
3f0606ad 93#endif
6d0f6bcf 94#if CONFIG_POST & CONFIG_SYS_POST_RTC
3f0606ad
AL
95 {
96 "RTC test",
97 "rtc",
98 "This test verifies the RTC operation.",
99 POST_RAM | POST_SLOWTEST | POST_MANUAL,
100 &rtc_post_test,
101 NULL,
102 NULL,
6d0f6bcf 103 CONFIG_SYS_POST_RTC},
3f0606ad 104#endif
6d0f6bcf 105#if CONFIG_POST & CONFIG_SYS_POST_MEMORY
3f0606ad
AL
106 {
107 "Memory test",
108 "memory",
109 "This test checks RAM.",
110 POST_ROM | POST_POWERON | POST_SLOWTEST | POST_PREREL,
111 &memory_post_test,
112 NULL,
113 NULL,
6d0f6bcf 114 CONFIG_SYS_POST_MEMORY},
3f0606ad 115#endif
6d0f6bcf 116#if CONFIG_POST & CONFIG_SYS_POST_CPU
3f0606ad
AL
117 {
118 "CPU test",
119 "cpu",
120 "This test verifies the arithmetic logic unit of" " CPU.",
121 POST_RAM | POST_ALWAYS,
122 &cpu_post_test,
123 NULL,
124 NULL,
6d0f6bcf 125 CONFIG_SYS_POST_CPU},
3f0606ad 126#endif
6d0f6bcf 127#if CONFIG_POST & CONFIG_SYS_POST_UART
3f0606ad
AL
128 {
129 "UART test",
130 "uart",
131 "This test verifies the UART operation.",
132 POST_RAM | POST_SLOWTEST | POST_MANUAL,
133 &uart_post_test,
134 NULL,
135 NULL,
6d0f6bcf 136 CONFIG_SYS_POST_UART},
3f0606ad 137#endif
6d0f6bcf 138#if CONFIG_POST & CONFIG_SYS_POST_ETHER
3f0606ad
AL
139 {
140 "ETHERNET test",
141 "ethernet",
142 "This test verifies the ETHERNET operation.",
143 POST_RAM | POST_ALWAYS | POST_MANUAL,
144 &ether_post_test,
145 NULL,
146 NULL,
6d0f6bcf 147 CONFIG_SYS_POST_ETHER},
3f0606ad 148#endif
6d0f6bcf 149#if CONFIG_POST & CONFIG_SYS_POST_SPI
3f0606ad
AL
150 {
151 "SPI test",
152 "spi",
153 "This test verifies the SPI operation.",
154 POST_RAM | POST_ALWAYS | POST_MANUAL,
155 &spi_post_test,
156 NULL,
157 NULL,
6d0f6bcf 158 CONFIG_SYS_POST_SPI},
3f0606ad 159#endif
6d0f6bcf 160#if CONFIG_POST & CONFIG_SYS_POST_USB
3f0606ad
AL
161 {
162 "USB test",
163 "usb",
164 "This test verifies the USB operation.",
165 POST_RAM | POST_ALWAYS | POST_MANUAL,
166 &usb_post_test,
167 NULL,
168 NULL,
6d0f6bcf 169 CONFIG_SYS_POST_USB},
3f0606ad 170#endif
6d0f6bcf 171#if CONFIG_POST & CONFIG_SYS_POST_SPR
3f0606ad
AL
172 {
173 "SPR test",
174 "spr",
175 "This test checks SPR contents.",
176 POST_ROM | POST_ALWAYS | POST_PREREL,
177 &spr_post_test,
178 NULL,
179 NULL,
6d0f6bcf 180 CONFIG_SYS_POST_SPR},
3f0606ad 181#endif
6d0f6bcf 182#if CONFIG_POST & CONFIG_SYS_POST_SYSMON
3f0606ad
AL
183 {
184 "SYSMON test",
185 "sysmon",
186 "This test monitors system hardware.",
187 POST_RAM | POST_ALWAYS,
188 &sysmon_post_test,
189 &sysmon_init_f,
190 &sysmon_reloc,
6d0f6bcf 191 CONFIG_SYS_POST_SYSMON},
3f0606ad 192#endif
6d0f6bcf 193#if CONFIG_POST & CONFIG_SYS_POST_DSP
3f0606ad
AL
194 {
195 "DSP test",
196 "dsp",
197 "This test checks any connected DSP(s).",
198 POST_RAM | POST_MANUAL,
199 &dsp_post_test,
200 NULL,
201 NULL,
6d0f6bcf 202 CONFIG_SYS_POST_DSP},
3f0606ad 203#endif
6d0f6bcf 204#if CONFIG_POST & CONFIG_SYS_POST_CODEC
3f0606ad
AL
205 {
206 "CODEC test",
207 "codec",
208 "This test checks any connected codec(s).",
209 POST_RAM | POST_MANUAL,
210 &codec_post_test,
211 NULL,
212 NULL,
6d0f6bcf 213 CONFIG_SYS_POST_CODEC},
3f0606ad 214#endif
6d0f6bcf 215#if CONFIG_POST & CONFIG_SYS_POST_FLASH
3f0606ad
AL
216 {
217 "FLASH test",
218 "flash",
219 "This test checks flash.",
220 POST_RAM | POST_ALWAYS | POST_MANUAL,
221 &flash_post_test,
222 NULL,
223 NULL,
6d0f6bcf 224 CONFIG_SYS_POST_FLASH},
3f0606ad 225#endif
6d0f6bcf 226#if CONFIG_POST & CONFIG_SYS_POST_LED
3f0606ad
AL
227 {
228 "LED test",
229 "LED",
230 "This test checks LED ",
231 POST_RAM | POST_ALWAYS | POST_MANUAL,
232 &led_post_test,
233 NULL,
234 NULL,
6d0f6bcf 235 CONFIG_SYS_POST_LED},
3f0606ad 236#endif
6d0f6bcf 237#if CONFIG_POST & CONFIG_SYS_POST_BUTTON
3f0606ad
AL
238 {
239 "Button test",
240 "button",
241 "This test checks Button ",
242 POST_RAM | POST_ALWAYS | POST_MANUAL,
243 &button_post_test,
244 NULL,
245 NULL,
6d0f6bcf 246 CONFIG_SYS_POST_BUTTON},
3f0606ad
AL
247#endif
248
249};
250
251unsigned int post_list_size = sizeof(post_list) / sizeof(struct post_test);
252
253#endif /* CONFIG_POST */