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 22*228f29acSwdenk * 23*228f29acSwdenk * Be sure to mark tests to be run before relocation as such with the 24*228f29acSwdenk * CFG_POST_PREREL flag so that logging is done correctly if the 25*228f29acSwdenk * 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); 45324f6cfdSwdenk 46324f6cfdSwdenk struct post_test post_list[] = 47324f6cfdSwdenk { 48324f6cfdSwdenk #if CONFIG_POST & CFG_POST_CACHE 49324f6cfdSwdenk { 50324f6cfdSwdenk "Cache test", 51324f6cfdSwdenk "cache", 52324f6cfdSwdenk "This test verifies the CPU cache operation.", 53324f6cfdSwdenk POST_RAM | POST_ALWAYS, 54*228f29acSwdenk &cache_post_test, 55*228f29acSwdenk CFG_POST_CACHE 56324f6cfdSwdenk }, 57324f6cfdSwdenk #endif 58324f6cfdSwdenk #if CONFIG_POST & CFG_POST_WATCHDOG 59324f6cfdSwdenk { 60324f6cfdSwdenk "Watchdog timer test", 61324f6cfdSwdenk "watchdog", 62324f6cfdSwdenk "This test checks the watchdog timer.", 63324f6cfdSwdenk POST_RAM | POST_POWERON | POST_POWERFAIL | POST_MANUAL | POST_REBOOT, 64*228f29acSwdenk &watchdog_post_test, 65*228f29acSwdenk CFG_POST_WATCHDOG 66324f6cfdSwdenk }, 67324f6cfdSwdenk #endif 68324f6cfdSwdenk #if CONFIG_POST & CFG_POST_I2C 69324f6cfdSwdenk { 70324f6cfdSwdenk "I2C test", 71324f6cfdSwdenk "i2c", 72324f6cfdSwdenk "This test verifies the I2C operation.", 73324f6cfdSwdenk POST_RAM | POST_ALWAYS, 74*228f29acSwdenk &i2c_post_test, 75*228f29acSwdenk CFG_POST_I2C 76324f6cfdSwdenk }, 77324f6cfdSwdenk #endif 78324f6cfdSwdenk #if CONFIG_POST & CFG_POST_RTC 79324f6cfdSwdenk { 80324f6cfdSwdenk "RTC test", 81324f6cfdSwdenk "rtc", 82324f6cfdSwdenk "This test verifies the RTC operation.", 83324f6cfdSwdenk POST_RAM | POST_POWERFAIL | POST_MANUAL, 84*228f29acSwdenk &rtc_post_test, 85*228f29acSwdenk CFG_POST_RTC 86324f6cfdSwdenk }, 87324f6cfdSwdenk #endif 88324f6cfdSwdenk #if CONFIG_POST & CFG_POST_MEMORY 89324f6cfdSwdenk { 90324f6cfdSwdenk "Memory test", 91324f6cfdSwdenk "memory", 92324f6cfdSwdenk "This test checks RAM.", 93*228f29acSwdenk POST_ROM | POST_POWERON | POST_POWERFAIL | POST_PREREL, 94*228f29acSwdenk &memory_post_test, 95*228f29acSwdenk CFG_POST_MEMORY 96324f6cfdSwdenk }, 97324f6cfdSwdenk #endif 98324f6cfdSwdenk #if CONFIG_POST & CFG_POST_CPU 99324f6cfdSwdenk { 100324f6cfdSwdenk "CPU test", 101324f6cfdSwdenk "cpu", 102324f6cfdSwdenk "This test verifies the arithmetic logic unit of" 103324f6cfdSwdenk " CPU.", 104324f6cfdSwdenk POST_RAM | POST_ALWAYS, 105*228f29acSwdenk &cpu_post_test, 106*228f29acSwdenk CFG_POST_CPU 107324f6cfdSwdenk }, 108324f6cfdSwdenk #endif 109324f6cfdSwdenk #if CONFIG_POST & CFG_POST_UART 110324f6cfdSwdenk { 111324f6cfdSwdenk "UART test", 112324f6cfdSwdenk "uart", 113324f6cfdSwdenk "This test verifies the UART operation.", 114324f6cfdSwdenk POST_RAM | POST_POWERFAIL | POST_MANUAL, 115*228f29acSwdenk &uart_post_test, 116*228f29acSwdenk CFG_POST_UART 117324f6cfdSwdenk }, 118324f6cfdSwdenk #endif 119324f6cfdSwdenk #if CONFIG_POST & CFG_POST_ETHER 120324f6cfdSwdenk { 121324f6cfdSwdenk "ETHERNET test", 122324f6cfdSwdenk "ethernet", 123324f6cfdSwdenk "This test verifies the ETHERNET operation.", 124324f6cfdSwdenk POST_RAM | POST_ALWAYS | POST_MANUAL, 125*228f29acSwdenk ðer_post_test, 126*228f29acSwdenk CFG_POST_ETHER 127324f6cfdSwdenk }, 128324f6cfdSwdenk #endif 129324f6cfdSwdenk #if CONFIG_POST & CFG_POST_SPI 130324f6cfdSwdenk { 131324f6cfdSwdenk "SPI test", 132324f6cfdSwdenk "spi", 133324f6cfdSwdenk "This test verifies the SPI operation.", 134324f6cfdSwdenk POST_RAM | POST_ALWAYS | POST_MANUAL, 135*228f29acSwdenk &spi_post_test, 136*228f29acSwdenk CFG_POST_SPI 137324f6cfdSwdenk }, 138324f6cfdSwdenk #endif 139324f6cfdSwdenk #if CONFIG_POST & CFG_POST_USB 140324f6cfdSwdenk { 141324f6cfdSwdenk "USB test", 142324f6cfdSwdenk "usb", 143324f6cfdSwdenk "This test verifies the USB operation.", 144324f6cfdSwdenk POST_RAM | POST_ALWAYS | POST_MANUAL, 145*228f29acSwdenk &usb_post_test, 146*228f29acSwdenk CFG_POST_USB 147324f6cfdSwdenk }, 148324f6cfdSwdenk #endif 149324f6cfdSwdenk #if CONFIG_POST & CFG_POST_SPR 150324f6cfdSwdenk { 151324f6cfdSwdenk "SPR test", 152324f6cfdSwdenk "spr", 153324f6cfdSwdenk "This test checks SPR contents.", 154*228f29acSwdenk POST_ROM | POST_ALWAYS | POST_PREREL, 155*228f29acSwdenk &spr_post_test, 156*228f29acSwdenk CFG_POST_SPR 157324f6cfdSwdenk }, 158324f6cfdSwdenk #endif 159324f6cfdSwdenk }; 160324f6cfdSwdenk 161324f6cfdSwdenk unsigned int post_list_size = sizeof (post_list) / sizeof (struct post_test); 162324f6cfdSwdenk 163324f6cfdSwdenk #endif /* CONFIG_POST */ 164