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 | |
| 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); |
| 45 | |
| 46 | struct post_test post_list[] = |
| 47 | { |
| 48 | #if CONFIG_POST & CFG_POST_CACHE |
| 49 | { |
| 50 | "Cache test", |
| 51 | "cache", |
| 52 | "This test verifies the CPU cache operation.", |
| 53 | POST_RAM | POST_ALWAYS, |
wdenk | 9dfa8d1 | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 54 | &cache_post_test, |
| 55 | CFG_POST_CACHE |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 56 | }, |
| 57 | #endif |
| 58 | #if CONFIG_POST & CFG_POST_WATCHDOG |
| 59 | { |
| 60 | "Watchdog timer test", |
| 61 | "watchdog", |
| 62 | "This test checks the watchdog timer.", |
| 63 | POST_RAM | POST_POWERON | POST_POWERFAIL | POST_MANUAL | POST_REBOOT, |
wdenk | 9dfa8d1 | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 64 | &watchdog_post_test, |
| 65 | CFG_POST_WATCHDOG |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 66 | }, |
| 67 | #endif |
| 68 | #if CONFIG_POST & CFG_POST_I2C |
| 69 | { |
| 70 | "I2C test", |
| 71 | "i2c", |
| 72 | "This test verifies the I2C operation.", |
| 73 | POST_RAM | POST_ALWAYS, |
wdenk | 9dfa8d1 | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 74 | &i2c_post_test, |
| 75 | CFG_POST_I2C |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 76 | }, |
| 77 | #endif |
| 78 | #if CONFIG_POST & CFG_POST_RTC |
| 79 | { |
| 80 | "RTC test", |
| 81 | "rtc", |
| 82 | "This test verifies the RTC operation.", |
| 83 | POST_RAM | POST_POWERFAIL | POST_MANUAL, |
wdenk | 9dfa8d1 | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 84 | &rtc_post_test, |
| 85 | CFG_POST_RTC |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 86 | }, |
| 87 | #endif |
| 88 | #if CONFIG_POST & CFG_POST_MEMORY |
| 89 | { |
| 90 | "Memory test", |
| 91 | "memory", |
| 92 | "This test checks RAM.", |
wdenk | 9dfa8d1 | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 93 | POST_ROM | POST_POWERON | POST_POWERFAIL | POST_PREREL, |
| 94 | &memory_post_test, |
| 95 | CFG_POST_MEMORY |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 96 | }, |
| 97 | #endif |
| 98 | #if CONFIG_POST & CFG_POST_CPU |
| 99 | { |
| 100 | "CPU test", |
| 101 | "cpu", |
| 102 | "This test verifies the arithmetic logic unit of" |
| 103 | " CPU.", |
| 104 | POST_RAM | POST_ALWAYS, |
wdenk | 9dfa8d1 | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 105 | &cpu_post_test, |
| 106 | CFG_POST_CPU |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 107 | }, |
| 108 | #endif |
| 109 | #if CONFIG_POST & CFG_POST_UART |
| 110 | { |
| 111 | "UART test", |
| 112 | "uart", |
| 113 | "This test verifies the UART operation.", |
| 114 | POST_RAM | POST_POWERFAIL | POST_MANUAL, |
wdenk | 9dfa8d1 | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 115 | &uart_post_test, |
| 116 | CFG_POST_UART |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 117 | }, |
| 118 | #endif |
| 119 | #if CONFIG_POST & CFG_POST_ETHER |
| 120 | { |
| 121 | "ETHERNET test", |
| 122 | "ethernet", |
| 123 | "This test verifies the ETHERNET operation.", |
| 124 | POST_RAM | POST_ALWAYS | POST_MANUAL, |
wdenk | 9dfa8d1 | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 125 | ðer_post_test, |
| 126 | CFG_POST_ETHER |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 127 | }, |
| 128 | #endif |
| 129 | #if CONFIG_POST & CFG_POST_SPI |
| 130 | { |
| 131 | "SPI test", |
| 132 | "spi", |
| 133 | "This test verifies the SPI operation.", |
| 134 | POST_RAM | POST_ALWAYS | POST_MANUAL, |
wdenk | 9dfa8d1 | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 135 | &spi_post_test, |
| 136 | CFG_POST_SPI |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 137 | }, |
| 138 | #endif |
| 139 | #if CONFIG_POST & CFG_POST_USB |
| 140 | { |
| 141 | "USB test", |
| 142 | "usb", |
| 143 | "This test verifies the USB operation.", |
| 144 | POST_RAM | POST_ALWAYS | POST_MANUAL, |
wdenk | 9dfa8d1 | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 145 | &usb_post_test, |
| 146 | CFG_POST_USB |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 147 | }, |
| 148 | #endif |
| 149 | #if CONFIG_POST & CFG_POST_SPR |
| 150 | { |
| 151 | "SPR test", |
| 152 | "spr", |
| 153 | "This test checks SPR contents.", |
wdenk | 9dfa8d1 | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 154 | POST_ROM | POST_ALWAYS | POST_PREREL, |
| 155 | &spr_post_test, |
| 156 | CFG_POST_SPR |
wdenk | 324f6cf | 2002-10-07 21:13:39 +0000 | [diff] [blame] | 157 | }, |
| 158 | #endif |
| 159 | }; |
| 160 | |
| 161 | unsigned int post_list_size = sizeof (post_list) / sizeof (struct post_test); |
| 162 | |
| 163 | #endif /* CONFIG_POST */ |