wdenk | 7133d4c | 2002-09-12 22:42:52 +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 |
| 22 | */ |
| 23 | #ifndef _POST_H |
| 24 | #define _POST_H |
| 25 | |
| 26 | #ifndef __ASSEMBLY__ |
| 27 | #include <common.h> |
| 28 | #endif |
| 29 | |
| 30 | #ifdef CONFIG_POST |
| 31 | |
| 32 | #define POST_POWERON 0x01 /* test runs on power-on booting */ |
| 33 | #define POST_POWERNORMAL 0x02 /* test runs on normal booting */ |
| 34 | #define POST_POWERFAIL 0x04 /* test runs on power-fail booting */ |
| 35 | #define POST_POWERTEST 0x08 /* test runs after watchdog reset */ |
| 36 | |
| 37 | #define POST_ROM 0x0100 /* test runs in ROM */ |
| 38 | #define POST_RAM 0x0200 /* test runs in RAM */ |
| 39 | #define POST_MANUAL 0x0400 /* test runs on diag command */ |
| 40 | #define POST_REBOOT 0x0800 /* test may cause rebooting */ |
| 41 | |
| 42 | #define POST_MEM (POST_RAM | POST_ROM) |
| 43 | #define POST_ALWAYS (POST_POWERNORMAL | \ |
| 44 | POST_POWERFAIL | \ |
| 45 | POST_MANUAL | \ |
| 46 | POST_POWERON ) |
| 47 | |
| 48 | #ifndef __ASSEMBLY__ |
| 49 | |
| 50 | struct post_test { |
| 51 | char *name; |
| 52 | char *cmd; |
| 53 | char *desc; |
| 54 | int flags; |
| 55 | int (*test) (int flags); |
| 56 | }; |
| 57 | void post_bootmode_init (void); |
| 58 | int post_bootmode_get (unsigned int * last_test); |
| 59 | void post_bootmode_clear (void); |
| 60 | int post_run (char *name, int flags); |
| 61 | int post_info (char *name); |
| 62 | int post_log (char *format, ...); |
| 63 | void post_reloc (void); |
| 64 | |
| 65 | extern struct post_test post_list[]; |
| 66 | extern unsigned int post_list_size; |
| 67 | |
| 68 | #endif /* __ASSEMBLY__ */ |
| 69 | |
| 70 | #define CFG_POST_RTC 0x00000001 |
| 71 | #define CFG_POST_WATCHDOG 0x00000002 |
| 72 | #define CFG_POST_MEMORY 0x00000004 |
| 73 | #define CFG_POST_CPU 0x00000008 |
| 74 | #define CFG_POST_I2C 0x00000010 |
| 75 | #define CFG_POST_CACHE 0x00000020 |
| 76 | #define CFG_POST_UART 0x00000040 |
| 77 | #define CFG_POST_ETHER 0x00000080 |
| 78 | #define CFG_POST_SPI 0x00000100 |
| 79 | #define CFG_POST_USB 0x00000200 |
| 80 | #define CFG_POST_SPR 0x00000400 |
| 81 | |
| 82 | #endif /* CONFIG_POST */ |
| 83 | |
| 84 | #endif /* _POST_H */ |