wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 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 |
wdenk | 228f29a | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 22 | * |
| 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. |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 26 | */ |
| 27 | |
| 28 | #include <common.h> |
| 29 | |
| 30 | #ifdef CONFIG_POST |
| 31 | |
| 32 | #include <post.h> |
| 33 | |
| 34 | extern int cache_post_test (int flags); |
| 35 | extern int watchdog_post_test (int flags); |
| 36 | extern int i2c_post_test (int flags); |
| 37 | extern int rtc_post_test (int flags); |
| 38 | extern int memory_post_test (int flags); |
| 39 | extern int cpu_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); |
wdenk | 4532cb6 | 2003-04-27 22:52:51 +0000 | [diff] [blame] | 45 | extern int sysmon_post_test (int flags); |
wdenk | 5a8c51c | 2004-04-15 21:16:42 +0000 | [diff] [blame] | 46 | extern int dsp_post_test (int flags); |
wdenk | 79fa88f | 2004-06-07 23:46:25 +0000 | [diff] [blame] | 47 | extern int codec_post_test (int flags); |
wdenk | 4532cb6 | 2003-04-27 22:52:51 +0000 | [diff] [blame] | 48 | |
| 49 | extern int sysmon_init_f (void); |
| 50 | |
| 51 | extern void sysmon_reloc (void); |
| 52 | |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 53 | |
| 54 | struct post_test post_list[] = |
| 55 | { |
| 56 | #if CONFIG_POST & CFG_POST_CACHE |
| 57 | { |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 58 | "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, |
wdenk | 228f29a | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 65 | CFG_POST_CACHE |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 66 | }, |
| 67 | #endif |
| 68 | #if CONFIG_POST & CFG_POST_WATCHDOG |
| 69 | { |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 70 | "Watchdog timer test", |
| 71 | "watchdog", |
| 72 | "This test checks the watchdog timer.", |
wdenk | 8564acf | 2003-07-14 22:13:32 +0000 | [diff] [blame] | 73 | POST_RAM | POST_POWERON | POST_SLOWTEST | POST_MANUAL | POST_REBOOT, |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 74 | &watchdog_post_test, |
| 75 | NULL, |
| 76 | NULL, |
wdenk | 228f29a | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 77 | CFG_POST_WATCHDOG |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 78 | }, |
| 79 | #endif |
| 80 | #if CONFIG_POST & CFG_POST_I2C |
| 81 | { |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 82 | "I2C test", |
| 83 | "i2c", |
| 84 | "This test verifies the I2C operation.", |
| 85 | POST_RAM | POST_ALWAYS, |
| 86 | &i2c_post_test, |
| 87 | NULL, |
| 88 | NULL, |
wdenk | 228f29a | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 89 | CFG_POST_I2C |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 90 | }, |
| 91 | #endif |
| 92 | #if CONFIG_POST & CFG_POST_RTC |
| 93 | { |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 94 | "RTC test", |
| 95 | "rtc", |
| 96 | "This test verifies the RTC operation.", |
wdenk | 8564acf | 2003-07-14 22:13:32 +0000 | [diff] [blame] | 97 | POST_RAM | POST_SLOWTEST | POST_MANUAL, |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 98 | &rtc_post_test, |
| 99 | NULL, |
| 100 | NULL, |
wdenk | 228f29a | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 101 | CFG_POST_RTC |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 102 | }, |
| 103 | #endif |
| 104 | #if CONFIG_POST & CFG_POST_MEMORY |
| 105 | { |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 106 | "Memory test", |
| 107 | "memory", |
| 108 | "This test checks RAM.", |
wdenk | 8564acf | 2003-07-14 22:13:32 +0000 | [diff] [blame] | 109 | POST_ROM | POST_POWERON | POST_SLOWTEST | POST_PREREL, |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 110 | &memory_post_test, |
| 111 | NULL, |
| 112 | NULL, |
wdenk | 228f29a | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 113 | CFG_POST_MEMORY |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 114 | }, |
| 115 | #endif |
| 116 | #if CONFIG_POST & CFG_POST_CPU |
| 117 | { |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 118 | "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, |
wdenk | 228f29a | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 126 | CFG_POST_CPU |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 127 | }, |
| 128 | #endif |
| 129 | #if CONFIG_POST & CFG_POST_UART |
| 130 | { |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 131 | "UART test", |
| 132 | "uart", |
| 133 | "This test verifies the UART operation.", |
wdenk | 8564acf | 2003-07-14 22:13:32 +0000 | [diff] [blame] | 134 | POST_RAM | POST_SLOWTEST | POST_MANUAL, |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 135 | &uart_post_test, |
| 136 | NULL, |
| 137 | NULL, |
wdenk | 228f29a | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 138 | CFG_POST_UART |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 139 | }, |
| 140 | #endif |
| 141 | #if CONFIG_POST & CFG_POST_ETHER |
| 142 | { |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 143 | "ETHERNET test", |
| 144 | "ethernet", |
| 145 | "This test verifies the ETHERNET operation.", |
| 146 | POST_RAM | POST_ALWAYS | POST_MANUAL, |
| 147 | ðer_post_test, |
| 148 | NULL, |
| 149 | NULL, |
wdenk | 228f29a | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 150 | CFG_POST_ETHER |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 151 | }, |
| 152 | #endif |
| 153 | #if CONFIG_POST & CFG_POST_SPI |
| 154 | { |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 155 | "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, |
wdenk | 228f29a | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 162 | CFG_POST_SPI |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 163 | }, |
| 164 | #endif |
| 165 | #if CONFIG_POST & CFG_POST_USB |
| 166 | { |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 167 | "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, |
wdenk | 228f29a | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 174 | CFG_POST_USB |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 175 | }, |
| 176 | #endif |
| 177 | #if CONFIG_POST & CFG_POST_SPR |
| 178 | { |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 179 | "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, |
wdenk | 228f29a | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 186 | CFG_POST_SPR |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 187 | }, |
| 188 | #endif |
wdenk | 4532cb6 | 2003-04-27 22:52:51 +0000 | [diff] [blame] | 189 | #if CONFIG_POST & CFG_POST_SYSMON |
| 190 | { |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 191 | "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, |
wdenk | 4532cb6 | 2003-04-27 22:52:51 +0000 | [diff] [blame] | 198 | CFG_POST_SYSMON |
| 199 | }, |
| 200 | #endif |
wdenk | 5a8c51c | 2004-04-15 21:16:42 +0000 | [diff] [blame] | 201 | #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 |
wdenk | 79fa88f | 2004-06-07 23:46:25 +0000 | [diff] [blame] | 213 | #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 |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 225 | }; |
| 226 | |
| 227 | unsigned int post_list_size = sizeof (post_list) / sizeof (struct post_test); |
| 228 | |
| 229 | #endif /* CONFIG_POST */ |