1324f6cfdSwdenk /* 2324f6cfdSwdenk * (C) Copyright 2002 3324f6cfdSwdenk * Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4324f6cfdSwdenk * 5324f6cfdSwdenk * See file CREDITS for list of people who contributed to this 6324f6cfdSwdenk * project. 7324f6cfdSwdenk * 8324f6cfdSwdenk * This program is free software; you can redistribute it and/or 9324f6cfdSwdenk * modify it under the terms of the GNU General Public License as 10324f6cfdSwdenk * published by the Free Software Foundation; either version 2 of 11324f6cfdSwdenk * the License, or (at your option) any later version. 12324f6cfdSwdenk * 13324f6cfdSwdenk * This program is distributed in the hope that it will be useful, 14324f6cfdSwdenk * but WITHOUT ANY WARRANTY; without even the implied warranty of 15324f6cfdSwdenk * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16324f6cfdSwdenk * GNU General Public License for more details. 17324f6cfdSwdenk * 18324f6cfdSwdenk * You should have received a copy of the GNU General Public License 19324f6cfdSwdenk * along with this program; if not, write to the Free Software 20324f6cfdSwdenk * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21324f6cfdSwdenk * MA 02111-1307 USA 22228f29acSwdenk * 23228f29acSwdenk * Be sure to mark tests to be run before relocation as such with the 24228f29acSwdenk * CFG_POST_PREREL flag so that logging is done correctly if the 25228f29acSwdenk * logbuffer support is enabled. 26324f6cfdSwdenk */ 27324f6cfdSwdenk 28324f6cfdSwdenk #include <common.h> 29324f6cfdSwdenk 30324f6cfdSwdenk #ifdef CONFIG_POST 31324f6cfdSwdenk 32324f6cfdSwdenk #include <post.h> 33324f6cfdSwdenk 34324f6cfdSwdenk extern int cache_post_test (int flags); 35324f6cfdSwdenk extern int watchdog_post_test (int flags); 36324f6cfdSwdenk extern int i2c_post_test (int flags); 37324f6cfdSwdenk extern int rtc_post_test (int flags); 38324f6cfdSwdenk extern int memory_post_test (int flags); 39324f6cfdSwdenk extern int cpu_post_test (int flags); 40324f6cfdSwdenk extern int uart_post_test (int flags); 41324f6cfdSwdenk extern int ether_post_test (int flags); 42324f6cfdSwdenk extern int spi_post_test (int flags); 43324f6cfdSwdenk extern int usb_post_test (int flags); 44324f6cfdSwdenk extern int spr_post_test (int flags); 454532cb69Swdenk extern int sysmon_post_test (int flags); 46*5a8c51cdSwdenk extern int dsp_post_test (int flags); 474532cb69Swdenk 484532cb69Swdenk extern int sysmon_init_f (void); 494532cb69Swdenk 504532cb69Swdenk extern void sysmon_reloc (void); 514532cb69Swdenk 52324f6cfdSwdenk 53324f6cfdSwdenk struct post_test post_list[] = 54324f6cfdSwdenk { 55324f6cfdSwdenk #if CONFIG_POST & CFG_POST_CACHE 56324f6cfdSwdenk { 57324f6cfdSwdenk "Cache test", 58324f6cfdSwdenk "cache", 59324f6cfdSwdenk "This test verifies the CPU cache operation.", 60324f6cfdSwdenk POST_RAM | POST_ALWAYS, 61228f29acSwdenk &cache_post_test, 624532cb69Swdenk NULL, 634532cb69Swdenk NULL, 64228f29acSwdenk CFG_POST_CACHE 65324f6cfdSwdenk }, 66324f6cfdSwdenk #endif 67324f6cfdSwdenk #if CONFIG_POST & CFG_POST_WATCHDOG 68324f6cfdSwdenk { 69324f6cfdSwdenk "Watchdog timer test", 70324f6cfdSwdenk "watchdog", 71324f6cfdSwdenk "This test checks the watchdog timer.", 728564acf9Swdenk POST_RAM | POST_POWERON | POST_SLOWTEST | POST_MANUAL | POST_REBOOT, 73228f29acSwdenk &watchdog_post_test, 744532cb69Swdenk NULL, 754532cb69Swdenk NULL, 76228f29acSwdenk CFG_POST_WATCHDOG 77324f6cfdSwdenk }, 78324f6cfdSwdenk #endif 79324f6cfdSwdenk #if CONFIG_POST & CFG_POST_I2C 80324f6cfdSwdenk { 81324f6cfdSwdenk "I2C test", 82324f6cfdSwdenk "i2c", 83324f6cfdSwdenk "This test verifies the I2C operation.", 84324f6cfdSwdenk POST_RAM | POST_ALWAYS, 85228f29acSwdenk &i2c_post_test, 864532cb69Swdenk NULL, 874532cb69Swdenk NULL, 88228f29acSwdenk CFG_POST_I2C 89324f6cfdSwdenk }, 90324f6cfdSwdenk #endif 91324f6cfdSwdenk #if CONFIG_POST & CFG_POST_RTC 92324f6cfdSwdenk { 93324f6cfdSwdenk "RTC test", 94324f6cfdSwdenk "rtc", 95324f6cfdSwdenk "This test verifies the RTC operation.", 968564acf9Swdenk POST_RAM | POST_SLOWTEST | POST_MANUAL, 97228f29acSwdenk &rtc_post_test, 984532cb69Swdenk NULL, 994532cb69Swdenk NULL, 100228f29acSwdenk CFG_POST_RTC 101324f6cfdSwdenk }, 102324f6cfdSwdenk #endif 103324f6cfdSwdenk #if CONFIG_POST & CFG_POST_MEMORY 104324f6cfdSwdenk { 105324f6cfdSwdenk "Memory test", 106324f6cfdSwdenk "memory", 107324f6cfdSwdenk "This test checks RAM.", 1088564acf9Swdenk POST_ROM | POST_POWERON | POST_SLOWTEST | POST_PREREL, 109228f29acSwdenk &memory_post_test, 1104532cb69Swdenk NULL, 1114532cb69Swdenk NULL, 112228f29acSwdenk CFG_POST_MEMORY 113324f6cfdSwdenk }, 114324f6cfdSwdenk #endif 115324f6cfdSwdenk #if CONFIG_POST & CFG_POST_CPU 116324f6cfdSwdenk { 117324f6cfdSwdenk "CPU test", 118324f6cfdSwdenk "cpu", 119324f6cfdSwdenk "This test verifies the arithmetic logic unit of" 120324f6cfdSwdenk " CPU.", 121324f6cfdSwdenk POST_RAM | POST_ALWAYS, 122228f29acSwdenk &cpu_post_test, 1234532cb69Swdenk NULL, 1244532cb69Swdenk NULL, 125228f29acSwdenk CFG_POST_CPU 126324f6cfdSwdenk }, 127324f6cfdSwdenk #endif 128324f6cfdSwdenk #if CONFIG_POST & CFG_POST_UART 129324f6cfdSwdenk { 130324f6cfdSwdenk "UART test", 131324f6cfdSwdenk "uart", 132324f6cfdSwdenk "This test verifies the UART operation.", 1338564acf9Swdenk POST_RAM | POST_SLOWTEST | POST_MANUAL, 134228f29acSwdenk &uart_post_test, 1354532cb69Swdenk NULL, 1364532cb69Swdenk NULL, 137228f29acSwdenk CFG_POST_UART 138324f6cfdSwdenk }, 139324f6cfdSwdenk #endif 140324f6cfdSwdenk #if CONFIG_POST & CFG_POST_ETHER 141324f6cfdSwdenk { 142324f6cfdSwdenk "ETHERNET test", 143324f6cfdSwdenk "ethernet", 144324f6cfdSwdenk "This test verifies the ETHERNET operation.", 145324f6cfdSwdenk POST_RAM | POST_ALWAYS | POST_MANUAL, 146228f29acSwdenk ðer_post_test, 1474532cb69Swdenk NULL, 1484532cb69Swdenk NULL, 149228f29acSwdenk CFG_POST_ETHER 150324f6cfdSwdenk }, 151324f6cfdSwdenk #endif 152324f6cfdSwdenk #if CONFIG_POST & CFG_POST_SPI 153324f6cfdSwdenk { 154324f6cfdSwdenk "SPI test", 155324f6cfdSwdenk "spi", 156324f6cfdSwdenk "This test verifies the SPI operation.", 157324f6cfdSwdenk POST_RAM | POST_ALWAYS | POST_MANUAL, 158228f29acSwdenk &spi_post_test, 1594532cb69Swdenk NULL, 1604532cb69Swdenk NULL, 161228f29acSwdenk CFG_POST_SPI 162324f6cfdSwdenk }, 163324f6cfdSwdenk #endif 164324f6cfdSwdenk #if CONFIG_POST & CFG_POST_USB 165324f6cfdSwdenk { 166324f6cfdSwdenk "USB test", 167324f6cfdSwdenk "usb", 168324f6cfdSwdenk "This test verifies the USB operation.", 169324f6cfdSwdenk POST_RAM | POST_ALWAYS | POST_MANUAL, 170228f29acSwdenk &usb_post_test, 1714532cb69Swdenk NULL, 1724532cb69Swdenk NULL, 173228f29acSwdenk CFG_POST_USB 174324f6cfdSwdenk }, 175324f6cfdSwdenk #endif 176324f6cfdSwdenk #if CONFIG_POST & CFG_POST_SPR 177324f6cfdSwdenk { 178324f6cfdSwdenk "SPR test", 179324f6cfdSwdenk "spr", 180324f6cfdSwdenk "This test checks SPR contents.", 181228f29acSwdenk POST_ROM | POST_ALWAYS | POST_PREREL, 182228f29acSwdenk &spr_post_test, 1834532cb69Swdenk NULL, 1844532cb69Swdenk NULL, 185228f29acSwdenk CFG_POST_SPR 186324f6cfdSwdenk }, 187324f6cfdSwdenk #endif 1884532cb69Swdenk #if CONFIG_POST & CFG_POST_SYSMON 1894532cb69Swdenk { 1904532cb69Swdenk "SYSMON test", 1914532cb69Swdenk "sysmon", 1924532cb69Swdenk "This test monitors system hardware.", 1934532cb69Swdenk POST_RAM | POST_ALWAYS, 1944532cb69Swdenk &sysmon_post_test, 1954532cb69Swdenk &sysmon_init_f, 1964532cb69Swdenk &sysmon_reloc, 1974532cb69Swdenk CFG_POST_SYSMON 1984532cb69Swdenk }, 1994532cb69Swdenk #endif 200*5a8c51cdSwdenk #if CONFIG_POST & CFG_POST_DSP 201*5a8c51cdSwdenk { 202*5a8c51cdSwdenk "DSP test", 203*5a8c51cdSwdenk "dsp", 204*5a8c51cdSwdenk "This test checks any connected DSP(s).", 205*5a8c51cdSwdenk POST_RAM | POST_MANUAL, 206*5a8c51cdSwdenk &dsp_post_test, 207*5a8c51cdSwdenk NULL, 208*5a8c51cdSwdenk NULL, 209*5a8c51cdSwdenk CFG_POST_DSP 210*5a8c51cdSwdenk }, 211*5a8c51cdSwdenk #endif 212324f6cfdSwdenk }; 213324f6cfdSwdenk 214324f6cfdSwdenk unsigned int post_list_size = sizeof (post_list) / sizeof (struct post_test); 215324f6cfdSwdenk 216324f6cfdSwdenk #endif /* CONFIG_POST */ 217