blob: 4ec307b33979c31025b7e8e3857bc549af569e37 [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);
45
46struct post_test post_list[] =
47{
48#if CONFIG_POST & CFG_POST_CACHE
49 {
50 "Cache test",
51 "cache",
52 "This test verifies the CPU cache operation.",
53 POST_RAM | POST_ALWAYS,
wdenk228f29a2002-12-08 09:53:23 +000054 &cache_post_test,
55 CFG_POST_CACHE
wdenk324f6cf2002-10-07 21:13:39 +000056 },
57#endif
58#if CONFIG_POST & CFG_POST_WATCHDOG
59 {
60 "Watchdog timer test",
61 "watchdog",
62 "This test checks the watchdog timer.",
63 POST_RAM | POST_POWERON | POST_POWERFAIL | POST_MANUAL | POST_REBOOT,
wdenk228f29a2002-12-08 09:53:23 +000064 &watchdog_post_test,
65 CFG_POST_WATCHDOG
wdenk324f6cf2002-10-07 21:13:39 +000066 },
67#endif
68#if CONFIG_POST & CFG_POST_I2C
69 {
70 "I2C test",
71 "i2c",
72 "This test verifies the I2C operation.",
73 POST_RAM | POST_ALWAYS,
wdenk228f29a2002-12-08 09:53:23 +000074 &i2c_post_test,
75 CFG_POST_I2C
wdenk324f6cf2002-10-07 21:13:39 +000076 },
77#endif
78#if CONFIG_POST & CFG_POST_RTC
79 {
80 "RTC test",
81 "rtc",
82 "This test verifies the RTC operation.",
83 POST_RAM | POST_POWERFAIL | POST_MANUAL,
wdenk228f29a2002-12-08 09:53:23 +000084 &rtc_post_test,
85 CFG_POST_RTC
wdenk324f6cf2002-10-07 21:13:39 +000086 },
87#endif
88#if CONFIG_POST & CFG_POST_MEMORY
89 {
90 "Memory test",
91 "memory",
92 "This test checks RAM.",
wdenk228f29a2002-12-08 09:53:23 +000093 POST_ROM | POST_POWERON | POST_POWERFAIL | POST_PREREL,
94 &memory_post_test,
95 CFG_POST_MEMORY
wdenk324f6cf2002-10-07 21:13:39 +000096 },
97#endif
98#if CONFIG_POST & CFG_POST_CPU
99 {
100 "CPU test",
101 "cpu",
102 "This test verifies the arithmetic logic unit of"
103 " CPU.",
104 POST_RAM | POST_ALWAYS,
wdenk228f29a2002-12-08 09:53:23 +0000105 &cpu_post_test,
106 CFG_POST_CPU
wdenk324f6cf2002-10-07 21:13:39 +0000107 },
108#endif
109#if CONFIG_POST & CFG_POST_UART
110 {
111 "UART test",
112 "uart",
113 "This test verifies the UART operation.",
114 POST_RAM | POST_POWERFAIL | POST_MANUAL,
wdenk228f29a2002-12-08 09:53:23 +0000115 &uart_post_test,
116 CFG_POST_UART
wdenk324f6cf2002-10-07 21:13:39 +0000117 },
118#endif
119#if CONFIG_POST & CFG_POST_ETHER
120 {
121 "ETHERNET test",
122 "ethernet",
123 "This test verifies the ETHERNET operation.",
124 POST_RAM | POST_ALWAYS | POST_MANUAL,
wdenk228f29a2002-12-08 09:53:23 +0000125 &ether_post_test,
126 CFG_POST_ETHER
wdenk324f6cf2002-10-07 21:13:39 +0000127 },
128#endif
129#if CONFIG_POST & CFG_POST_SPI
130 {
131 "SPI test",
132 "spi",
133 "This test verifies the SPI operation.",
134 POST_RAM | POST_ALWAYS | POST_MANUAL,
wdenk228f29a2002-12-08 09:53:23 +0000135 &spi_post_test,
136 CFG_POST_SPI
wdenk324f6cf2002-10-07 21:13:39 +0000137 },
138#endif
139#if CONFIG_POST & CFG_POST_USB
140 {
141 "USB test",
142 "usb",
143 "This test verifies the USB operation.",
144 POST_RAM | POST_ALWAYS | POST_MANUAL,
wdenk228f29a2002-12-08 09:53:23 +0000145 &usb_post_test,
146 CFG_POST_USB
wdenk324f6cf2002-10-07 21:13:39 +0000147 },
148#endif
149#if CONFIG_POST & CFG_POST_SPR
150 {
151 "SPR test",
152 "spr",
153 "This test checks SPR contents.",
wdenk228f29a2002-12-08 09:53:23 +0000154 POST_ROM | POST_ALWAYS | POST_PREREL,
155 &spr_post_test,
156 CFG_POST_SPR
wdenk324f6cf2002-10-07 21:13:39 +0000157 },
158#endif
159};
160
161unsigned int post_list_size = sizeof (post_list) / sizeof (struct post_test);
162
163#endif /* CONFIG_POST */