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 | 9dfa8d1 | 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 | |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 30 | #include <post.h> |
| 31 | |
Yuri Tikhonov | c3655b8 | 2008-05-08 15:42:47 +0200 | [diff] [blame] | 32 | extern int ocm_post_test (int flags); |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 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); |
Igor Lisitsin | 95bcd38 | 2007-03-28 19:06:19 +0400 | [diff] [blame] | 39 | extern int fpu_post_test (int flags); |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 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 | c08f158 | 2003-04-27 22:52:51 +0000 | [diff] [blame] | 45 | extern int sysmon_post_test (int flags); |
wdenk | 6164217 | 2004-04-15 21:16:42 +0000 | [diff] [blame] | 46 | extern int dsp_post_test (int flags); |
wdenk | c4e854f | 2004-06-07 23:46:25 +0000 | [diff] [blame] | 47 | extern int codec_post_test (int flags); |
Pavel Kolesnikov | 5d89611 | 2007-07-20 15:03:03 +0200 | [diff] [blame] | 48 | extern int ecc_post_test (int flags); |
wdenk | c08f158 | 2003-04-27 22:52:51 +0000 | [diff] [blame] | 49 | |
Yuri Tikhonov | c147d48 | 2008-02-04 14:10:42 +0100 | [diff] [blame] | 50 | extern int dspic_init_post_test (int flags); |
| 51 | extern int dspic_post_test (int flags); |
| 52 | extern int gdc_post_test (int flags); |
| 53 | extern int fpga_post_test (int flags); |
| 54 | extern int lwmon5_watchdog_post_test(int flags); |
| 55 | extern int sysmon1_post_test(int flags); |
| 56 | |
wdenk | c08f158 | 2003-04-27 22:52:51 +0000 | [diff] [blame] | 57 | extern int sysmon_init_f (void); |
| 58 | |
| 59 | extern void sysmon_reloc (void); |
| 60 | |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 61 | |
| 62 | struct post_test post_list[] = |
| 63 | { |
Yuri Tikhonov | c3655b8 | 2008-05-08 15:42:47 +0200 | [diff] [blame] | 64 | #if CONFIG_POST & CFG_POST_OCM |
| 65 | { |
| 66 | "OCM test", |
| 67 | "ocm", |
| 68 | "This test checks on chip memory (OCM).", |
Yuri Tikhonov | 9c667bf | 2008-05-08 15:46:02 +0200 | [diff] [blame] | 69 | POST_ROM | POST_ALWAYS | POST_PREREL | POST_CRITICAL | POST_STOP, |
Yuri Tikhonov | c3655b8 | 2008-05-08 15:42:47 +0200 | [diff] [blame] | 70 | &ocm_post_test, |
| 71 | NULL, |
| 72 | NULL, |
| 73 | CFG_POST_OCM |
| 74 | }, |
| 75 | #endif |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 76 | #if CONFIG_POST & CFG_POST_CACHE |
| 77 | { |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 78 | "Cache test", |
| 79 | "cache", |
| 80 | "This test verifies the CPU cache operation.", |
| 81 | POST_RAM | POST_ALWAYS, |
| 82 | &cache_post_test, |
| 83 | NULL, |
| 84 | NULL, |
wdenk | 9dfa8d1 | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 85 | CFG_POST_CACHE |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 86 | }, |
| 87 | #endif |
| 88 | #if CONFIG_POST & CFG_POST_WATCHDOG |
Yuri Tikhonov | c147d48 | 2008-02-04 14:10:42 +0100 | [diff] [blame] | 89 | #if defined(CONFIG_POST_WATCHDOG) |
| 90 | CONFIG_POST_WATCHDOG, |
| 91 | #else |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 92 | { |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 93 | "Watchdog timer test", |
| 94 | "watchdog", |
| 95 | "This test checks the watchdog timer.", |
wdenk | dccbda0 | 2003-07-14 22:13:32 +0000 | [diff] [blame] | 96 | POST_RAM | POST_POWERON | POST_SLOWTEST | POST_MANUAL | POST_REBOOT, |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 97 | &watchdog_post_test, |
| 98 | NULL, |
| 99 | NULL, |
wdenk | 9dfa8d1 | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 100 | CFG_POST_WATCHDOG |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 101 | }, |
| 102 | #endif |
Yuri Tikhonov | c147d48 | 2008-02-04 14:10:42 +0100 | [diff] [blame] | 103 | #endif |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 104 | #if CONFIG_POST & CFG_POST_I2C |
| 105 | { |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 106 | "I2C test", |
| 107 | "i2c", |
| 108 | "This test verifies the I2C operation.", |
| 109 | POST_RAM | POST_ALWAYS, |
| 110 | &i2c_post_test, |
| 111 | NULL, |
| 112 | NULL, |
wdenk | 9dfa8d1 | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 113 | CFG_POST_I2C |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 114 | }, |
| 115 | #endif |
| 116 | #if CONFIG_POST & CFG_POST_RTC |
| 117 | { |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 118 | "RTC test", |
| 119 | "rtc", |
| 120 | "This test verifies the RTC operation.", |
wdenk | dccbda0 | 2003-07-14 22:13:32 +0000 | [diff] [blame] | 121 | POST_RAM | POST_SLOWTEST | POST_MANUAL, |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 122 | &rtc_post_test, |
| 123 | NULL, |
| 124 | NULL, |
wdenk | 9dfa8d1 | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 125 | CFG_POST_RTC |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 126 | }, |
| 127 | #endif |
| 128 | #if CONFIG_POST & CFG_POST_MEMORY |
| 129 | { |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 130 | "Memory test", |
| 131 | "memory", |
| 132 | "This test checks RAM.", |
wdenk | dccbda0 | 2003-07-14 22:13:32 +0000 | [diff] [blame] | 133 | POST_ROM | POST_POWERON | POST_SLOWTEST | POST_PREREL, |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 134 | &memory_post_test, |
| 135 | NULL, |
| 136 | NULL, |
wdenk | 9dfa8d1 | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 137 | CFG_POST_MEMORY |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 138 | }, |
| 139 | #endif |
| 140 | #if CONFIG_POST & CFG_POST_CPU |
| 141 | { |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 142 | "CPU test", |
| 143 | "cpu", |
| 144 | "This test verifies the arithmetic logic unit of" |
| 145 | " CPU.", |
| 146 | POST_RAM | POST_ALWAYS, |
| 147 | &cpu_post_test, |
| 148 | NULL, |
| 149 | NULL, |
wdenk | 9dfa8d1 | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 150 | CFG_POST_CPU |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 151 | }, |
| 152 | #endif |
Igor Lisitsin | 95bcd38 | 2007-03-28 19:06:19 +0400 | [diff] [blame] | 153 | #if CONFIG_POST & CFG_POST_FPU |
| 154 | { |
| 155 | "FPU test", |
| 156 | "fpu", |
| 157 | "This test verifies the arithmetic logic unit of" |
| 158 | " FPU.", |
| 159 | POST_RAM | POST_ALWAYS, |
| 160 | &fpu_post_test, |
| 161 | NULL, |
| 162 | NULL, |
| 163 | CFG_POST_FPU |
| 164 | }, |
| 165 | #endif |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 166 | #if CONFIG_POST & CFG_POST_UART |
| 167 | { |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 168 | "UART test", |
| 169 | "uart", |
| 170 | "This test verifies the UART operation.", |
wdenk | dccbda0 | 2003-07-14 22:13:32 +0000 | [diff] [blame] | 171 | POST_RAM | POST_SLOWTEST | POST_MANUAL, |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 172 | &uart_post_test, |
| 173 | NULL, |
| 174 | NULL, |
wdenk | 9dfa8d1 | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 175 | CFG_POST_UART |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 176 | }, |
| 177 | #endif |
| 178 | #if CONFIG_POST & CFG_POST_ETHER |
| 179 | { |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 180 | "ETHERNET test", |
| 181 | "ethernet", |
| 182 | "This test verifies the ETHERNET operation.", |
| 183 | POST_RAM | POST_ALWAYS | POST_MANUAL, |
| 184 | ðer_post_test, |
| 185 | NULL, |
| 186 | NULL, |
wdenk | 9dfa8d1 | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 187 | CFG_POST_ETHER |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 188 | }, |
| 189 | #endif |
| 190 | #if CONFIG_POST & CFG_POST_SPI |
| 191 | { |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 192 | "SPI test", |
| 193 | "spi", |
| 194 | "This test verifies the SPI operation.", |
| 195 | POST_RAM | POST_ALWAYS | POST_MANUAL, |
| 196 | &spi_post_test, |
| 197 | NULL, |
| 198 | NULL, |
wdenk | 9dfa8d1 | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 199 | CFG_POST_SPI |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 200 | }, |
| 201 | #endif |
| 202 | #if CONFIG_POST & CFG_POST_USB |
| 203 | { |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 204 | "USB test", |
| 205 | "usb", |
| 206 | "This test verifies the USB operation.", |
| 207 | POST_RAM | POST_ALWAYS | POST_MANUAL, |
| 208 | &usb_post_test, |
| 209 | NULL, |
| 210 | NULL, |
wdenk | 9dfa8d1 | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 211 | CFG_POST_USB |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 212 | }, |
| 213 | #endif |
| 214 | #if CONFIG_POST & CFG_POST_SPR |
| 215 | { |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 216 | "SPR test", |
| 217 | "spr", |
| 218 | "This test checks SPR contents.", |
Stefan Roese | 191a8dc | 2008-01-09 10:38:58 +0100 | [diff] [blame] | 219 | POST_RAM | POST_ALWAYS, |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 220 | &spr_post_test, |
| 221 | NULL, |
| 222 | NULL, |
wdenk | 9dfa8d1 | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 223 | CFG_POST_SPR |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 224 | }, |
| 225 | #endif |
wdenk | c08f158 | 2003-04-27 22:52:51 +0000 | [diff] [blame] | 226 | #if CONFIG_POST & CFG_POST_SYSMON |
| 227 | { |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 228 | "SYSMON test", |
| 229 | "sysmon", |
| 230 | "This test monitors system hardware.", |
| 231 | POST_RAM | POST_ALWAYS, |
| 232 | &sysmon_post_test, |
| 233 | &sysmon_init_f, |
| 234 | &sysmon_reloc, |
wdenk | c08f158 | 2003-04-27 22:52:51 +0000 | [diff] [blame] | 235 | CFG_POST_SYSMON |
| 236 | }, |
| 237 | #endif |
wdenk | 6164217 | 2004-04-15 21:16:42 +0000 | [diff] [blame] | 238 | #if CONFIG_POST & CFG_POST_DSP |
| 239 | { |
| 240 | "DSP test", |
| 241 | "dsp", |
| 242 | "This test checks any connected DSP(s).", |
Sascha Laue | 0015053 | 2008-05-30 09:48:14 +0200 | [diff] [blame] | 243 | POST_RAM | POST_ALWAYS | POST_MANUAL, |
wdenk | 6164217 | 2004-04-15 21:16:42 +0000 | [diff] [blame] | 244 | &dsp_post_test, |
| 245 | NULL, |
| 246 | NULL, |
| 247 | CFG_POST_DSP |
| 248 | }, |
| 249 | #endif |
Yuri Tikhonov | c67468c | 2008-02-04 14:10:01 +0100 | [diff] [blame] | 250 | #if CONFIG_POST & CFG_POST_CODEC |
wdenk | c4e854f | 2004-06-07 23:46:25 +0000 | [diff] [blame] | 251 | { |
| 252 | "CODEC test", |
| 253 | "codec", |
| 254 | "This test checks any connected codec(s).", |
| 255 | POST_RAM | POST_MANUAL, |
| 256 | &codec_post_test, |
| 257 | NULL, |
| 258 | NULL, |
| 259 | CFG_POST_CODEC |
| 260 | }, |
| 261 | #endif |
Pavel Kolesnikov | 5d89611 | 2007-07-20 15:03:03 +0200 | [diff] [blame] | 262 | #if CONFIG_POST & CFG_POST_ECC |
| 263 | { |
| 264 | "ECC test", |
| 265 | "ecc", |
Larry Johnson | c2abd6e | 2008-01-12 23:35:33 -0500 | [diff] [blame] | 266 | "This test checks the ECC facility of memory.", |
| 267 | POST_ROM | POST_ALWAYS | POST_PREREL, |
Pavel Kolesnikov | 5d89611 | 2007-07-20 15:03:03 +0200 | [diff] [blame] | 268 | &ecc_post_test, |
| 269 | NULL, |
| 270 | NULL, |
| 271 | CFG_POST_ECC |
| 272 | }, |
| 273 | #endif |
Yuri Tikhonov | c147d48 | 2008-02-04 14:10:42 +0100 | [diff] [blame] | 274 | #if CONFIG_POST & CFG_POST_BSPEC1 |
| 275 | CONFIG_POST_BSPEC1, |
| 276 | #endif |
| 277 | #if CONFIG_POST & CFG_POST_BSPEC2 |
| 278 | CONFIG_POST_BSPEC2, |
| 279 | #endif |
| 280 | #if CONFIG_POST & CFG_POST_BSPEC3 |
| 281 | CONFIG_POST_BSPEC3, |
| 282 | #endif |
| 283 | #if CONFIG_POST & CFG_POST_BSPEC4 |
| 284 | CONFIG_POST_BSPEC4, |
| 285 | #endif |
Yuri Tikhonov | 7e3769f | 2008-05-08 15:40:39 +0200 | [diff] [blame] | 286 | #if CONFIG_POST & CFG_POST_BSPEC5 |
Yuri Tikhonov | c147d48 | 2008-02-04 14:10:42 +0100 | [diff] [blame] | 287 | CONFIG_POST_BSPEC5, |
| 288 | #endif |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 289 | }; |
| 290 | |
| 291 | unsigned int post_list_size = sizeof (post_list) / sizeof (struct post_test); |