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 */ |
wdenk | 8564acf | 2003-07-14 22:13:32 +0000 | [diff] [blame] | 33 | #define POST_NORMAL 0x02 /* test runs on normal booting */ |
| 34 | #define POST_SLOWTEST 0x04 /* test is slow, enabled by key press */ |
wdenk | 7133d4c | 2002-09-12 22:42:52 +0000 | [diff] [blame] | 35 | #define POST_POWERTEST 0x08 /* test runs after watchdog reset */ |
| 36 | |
wdenk | 27b207f | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 37 | #define POST_COLDBOOT 0x80 /* first boot after power-on */ |
| 38 | |
wdenk | 7133d4c | 2002-09-12 22:42:52 +0000 | [diff] [blame] | 39 | #define POST_ROM 0x0100 /* test runs in ROM */ |
| 40 | #define POST_RAM 0x0200 /* test runs in RAM */ |
| 41 | #define POST_MANUAL 0x0400 /* test runs on diag command */ |
| 42 | #define POST_REBOOT 0x0800 /* test may cause rebooting */ |
wdenk | 228f29a | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 43 | #define POST_PREREL 0x1000 /* test runs before relocation */ |
wdenk | 7133d4c | 2002-09-12 22:42:52 +0000 | [diff] [blame] | 44 | |
Yuri Tikhonov | b428f6a | 2008-02-04 14:11:03 +0100 | [diff] [blame] | 45 | #define POST_CRITICAL 0x2000 /* Use failbootcmd if test failed */ |
| 46 | |
wdenk | 7133d4c | 2002-09-12 22:42:52 +0000 | [diff] [blame] | 47 | #define POST_MEM (POST_RAM | POST_ROM) |
wdenk | 8564acf | 2003-07-14 22:13:32 +0000 | [diff] [blame] | 48 | #define POST_ALWAYS (POST_NORMAL | \ |
| 49 | POST_SLOWTEST | \ |
| 50 | POST_MANUAL | \ |
wdenk | 7133d4c | 2002-09-12 22:42:52 +0000 | [diff] [blame] | 51 | POST_POWERON ) |
| 52 | |
Yuri Tikhonov | b428f6a | 2008-02-04 14:11:03 +0100 | [diff] [blame] | 53 | #define POST_FAIL_SAVE 0x80 |
| 54 | |
wdenk | 7133d4c | 2002-09-12 22:42:52 +0000 | [diff] [blame] | 55 | #ifndef __ASSEMBLY__ |
| 56 | |
| 57 | struct post_test { |
| 58 | char *name; |
| 59 | char *cmd; |
| 60 | char *desc; |
| 61 | int flags; |
| 62 | int (*test) (int flags); |
wdenk | 4532cb6 | 2003-04-27 22:52:51 +0000 | [diff] [blame] | 63 | int (*init_f) (void); |
| 64 | void (*reloc) (void); |
wdenk | 228f29a | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 65 | unsigned long testid; |
wdenk | 7133d4c | 2002-09-12 22:42:52 +0000 | [diff] [blame] | 66 | }; |
wdenk | 4532cb6 | 2003-04-27 22:52:51 +0000 | [diff] [blame] | 67 | int post_init_f (void); |
wdenk | 7133d4c | 2002-09-12 22:42:52 +0000 | [diff] [blame] | 68 | void post_bootmode_init (void); |
| 69 | int post_bootmode_get (unsigned int * last_test); |
| 70 | void post_bootmode_clear (void); |
wdenk | 228f29a | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 71 | void post_output_backlog ( void ); |
wdenk | 7133d4c | 2002-09-12 22:42:52 +0000 | [diff] [blame] | 72 | int post_run (char *name, int flags); |
| 73 | int post_info (char *name); |
| 74 | int post_log (char *format, ...); |
| 75 | void post_reloc (void); |
wdenk | 4532cb6 | 2003-04-27 22:52:51 +0000 | [diff] [blame] | 76 | unsigned long post_time_ms (unsigned long base); |
wdenk | 7133d4c | 2002-09-12 22:42:52 +0000 | [diff] [blame] | 77 | |
| 78 | extern struct post_test post_list[]; |
| 79 | extern unsigned int post_list_size; |
wdenk | 27b207f | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 80 | extern int post_hotkeys_pressed(void); |
wdenk | 7133d4c | 2002-09-12 22:42:52 +0000 | [diff] [blame] | 81 | |
| 82 | #endif /* __ASSEMBLY__ */ |
| 83 | |
| 84 | #define CFG_POST_RTC 0x00000001 |
| 85 | #define CFG_POST_WATCHDOG 0x00000002 |
| 86 | #define CFG_POST_MEMORY 0x00000004 |
| 87 | #define CFG_POST_CPU 0x00000008 |
| 88 | #define CFG_POST_I2C 0x00000010 |
| 89 | #define CFG_POST_CACHE 0x00000020 |
| 90 | #define CFG_POST_UART 0x00000040 |
| 91 | #define CFG_POST_ETHER 0x00000080 |
| 92 | #define CFG_POST_SPI 0x00000100 |
| 93 | #define CFG_POST_USB 0x00000200 |
| 94 | #define CFG_POST_SPR 0x00000400 |
wdenk | 4532cb6 | 2003-04-27 22:52:51 +0000 | [diff] [blame] | 95 | #define CFG_POST_SYSMON 0x00000800 |
wdenk | 5a8c51c | 2004-04-15 21:16:42 +0000 | [diff] [blame] | 96 | #define CFG_POST_DSP 0x00001000 |
wdenk | 79fa88f | 2004-06-07 23:46:25 +0000 | [diff] [blame] | 97 | #define CFG_POST_CODEC 0x00002000 |
Igor Lisitsin | a11e069 | 2007-03-28 19:06:19 +0400 | [diff] [blame] | 98 | #define CFG_POST_FPU 0x00004000 |
Pavel Kolesnikov | 531e3e8 | 2007-07-20 15:03:03 +0200 | [diff] [blame] | 99 | #define CFG_POST_ECC 0x00008000 |
Yuri Tikhonov | 8f15d4a | 2008-02-04 14:10:42 +0100 | [diff] [blame] | 100 | #define CFG_POST_BSPEC1 0x00010000 |
| 101 | #define CFG_POST_BSPEC2 0x00020000 |
| 102 | #define CFG_POST_BSPEC3 0x00040000 |
| 103 | #define CFG_POST_BSPEC4 0x00080000 |
| 104 | #define CFG_POST_BSPEC5 0x00100000 |
wdenk | 7133d4c | 2002-09-12 22:42:52 +0000 | [diff] [blame] | 105 | |
| 106 | #endif /* CONFIG_POST */ |
| 107 | |
| 108 | #endif /* _POST_H */ |