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); |
| 46 | |
| 47 | extern int sysmon_init_f (void); |
| 48 | |
| 49 | extern void sysmon_reloc (void); |
| 50 | |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 51 | |
| 52 | struct post_test post_list[] = |
| 53 | { |
| 54 | #if CONFIG_POST & CFG_POST_CACHE |
| 55 | { |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 56 | "Cache test", |
| 57 | "cache", |
| 58 | "This test verifies the CPU cache operation.", |
| 59 | POST_RAM | POST_ALWAYS, |
| 60 | &cache_post_test, |
| 61 | NULL, |
| 62 | NULL, |
wdenk | 228f29a | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 63 | CFG_POST_CACHE |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 64 | }, |
| 65 | #endif |
| 66 | #if CONFIG_POST & CFG_POST_WATCHDOG |
| 67 | { |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 68 | "Watchdog timer test", |
| 69 | "watchdog", |
| 70 | "This test checks the watchdog timer.", |
wdenk | 8564acf | 2003-07-14 22:13:32 +0000 | [diff] [blame] | 71 | POST_RAM | POST_POWERON | POST_SLOWTEST | POST_MANUAL | POST_REBOOT, |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 72 | &watchdog_post_test, |
| 73 | NULL, |
| 74 | NULL, |
wdenk | 228f29a | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 75 | CFG_POST_WATCHDOG |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 76 | }, |
| 77 | #endif |
| 78 | #if CONFIG_POST & CFG_POST_I2C |
| 79 | { |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 80 | "I2C test", |
| 81 | "i2c", |
| 82 | "This test verifies the I2C operation.", |
| 83 | POST_RAM | POST_ALWAYS, |
| 84 | &i2c_post_test, |
| 85 | NULL, |
| 86 | NULL, |
wdenk | 228f29a | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 87 | CFG_POST_I2C |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 88 | }, |
| 89 | #endif |
| 90 | #if CONFIG_POST & CFG_POST_RTC |
| 91 | { |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 92 | "RTC test", |
| 93 | "rtc", |
| 94 | "This test verifies the RTC operation.", |
wdenk | 8564acf | 2003-07-14 22:13:32 +0000 | [diff] [blame] | 95 | POST_RAM | POST_SLOWTEST | POST_MANUAL, |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 96 | &rtc_post_test, |
| 97 | NULL, |
| 98 | NULL, |
wdenk | 228f29a | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 99 | CFG_POST_RTC |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 100 | }, |
| 101 | #endif |
| 102 | #if CONFIG_POST & CFG_POST_MEMORY |
| 103 | { |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 104 | "Memory test", |
| 105 | "memory", |
| 106 | "This test checks RAM.", |
wdenk | 8564acf | 2003-07-14 22:13:32 +0000 | [diff] [blame] | 107 | POST_ROM | POST_POWERON | POST_SLOWTEST | POST_PREREL, |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 108 | &memory_post_test, |
| 109 | NULL, |
| 110 | NULL, |
wdenk | 228f29a | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 111 | CFG_POST_MEMORY |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 112 | }, |
| 113 | #endif |
| 114 | #if CONFIG_POST & CFG_POST_CPU |
| 115 | { |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 116 | "CPU test", |
| 117 | "cpu", |
| 118 | "This test verifies the arithmetic logic unit of" |
| 119 | " CPU.", |
| 120 | POST_RAM | POST_ALWAYS, |
| 121 | &cpu_post_test, |
| 122 | NULL, |
| 123 | NULL, |
wdenk | 228f29a | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 124 | CFG_POST_CPU |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 125 | }, |
| 126 | #endif |
| 127 | #if CONFIG_POST & CFG_POST_UART |
| 128 | { |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 129 | "UART test", |
| 130 | "uart", |
| 131 | "This test verifies the UART operation.", |
wdenk | 8564acf | 2003-07-14 22:13:32 +0000 | [diff] [blame] | 132 | POST_RAM | POST_SLOWTEST | POST_MANUAL, |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 133 | &uart_post_test, |
| 134 | NULL, |
| 135 | NULL, |
wdenk | 228f29a | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 136 | CFG_POST_UART |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 137 | }, |
| 138 | #endif |
| 139 | #if CONFIG_POST & CFG_POST_ETHER |
| 140 | { |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 141 | "ETHERNET test", |
| 142 | "ethernet", |
| 143 | "This test verifies the ETHERNET operation.", |
| 144 | POST_RAM | POST_ALWAYS | POST_MANUAL, |
| 145 | ðer_post_test, |
| 146 | NULL, |
| 147 | NULL, |
wdenk | 228f29a | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 148 | CFG_POST_ETHER |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 149 | }, |
| 150 | #endif |
| 151 | #if CONFIG_POST & CFG_POST_SPI |
| 152 | { |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 153 | "SPI test", |
| 154 | "spi", |
| 155 | "This test verifies the SPI operation.", |
| 156 | POST_RAM | POST_ALWAYS | POST_MANUAL, |
| 157 | &spi_post_test, |
| 158 | NULL, |
| 159 | NULL, |
wdenk | 228f29a | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 160 | CFG_POST_SPI |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 161 | }, |
| 162 | #endif |
| 163 | #if CONFIG_POST & CFG_POST_USB |
| 164 | { |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 165 | "USB test", |
| 166 | "usb", |
| 167 | "This test verifies the USB operation.", |
| 168 | POST_RAM | POST_ALWAYS | POST_MANUAL, |
| 169 | &usb_post_test, |
| 170 | NULL, |
| 171 | NULL, |
wdenk | 228f29a | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 172 | CFG_POST_USB |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 173 | }, |
| 174 | #endif |
| 175 | #if CONFIG_POST & CFG_POST_SPR |
| 176 | { |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 177 | "SPR test", |
| 178 | "spr", |
| 179 | "This test checks SPR contents.", |
| 180 | POST_ROM | POST_ALWAYS | POST_PREREL, |
| 181 | &spr_post_test, |
| 182 | NULL, |
| 183 | NULL, |
wdenk | 228f29a | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 184 | CFG_POST_SPR |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 185 | }, |
| 186 | #endif |
wdenk | 4532cb6 | 2003-04-27 22:52:51 +0000 | [diff] [blame] | 187 | #if CONFIG_POST & CFG_POST_SYSMON |
| 188 | { |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 189 | "SYSMON test", |
| 190 | "sysmon", |
| 191 | "This test monitors system hardware.", |
| 192 | POST_RAM | POST_ALWAYS, |
| 193 | &sysmon_post_test, |
| 194 | &sysmon_init_f, |
| 195 | &sysmon_reloc, |
wdenk | 4532cb6 | 2003-04-27 22:52:51 +0000 | [diff] [blame] | 196 | CFG_POST_SYSMON |
| 197 | }, |
| 198 | #endif |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 199 | }; |
| 200 | |
| 201 | unsigned int post_list_size = sizeof (post_list) / sizeof (struct post_test); |
| 202 | |
| 203 | #endif /* CONFIG_POST */ |