blob: 3da959d9a35cd13c7f5f36dd57e7155ed81fd85b [file] [log] [blame]
wdenk7133d4c2002-09-12 22:42:52 +00001/*
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 */
wdenkdccbda02003-07-14 22:13:32 +000033#define POST_NORMAL 0x02 /* test runs on normal booting */
34#define POST_SLOWTEST 0x04 /* test is slow, enabled by key press */
wdenk7133d4c2002-09-12 22:42:52 +000035#define POST_POWERTEST 0x08 /* test runs after watchdog reset */
36
wdenk874ac262003-07-24 23:38:38 +000037#define POST_COLDBOOT 0x80 /* first boot after power-on */
38
wdenk7133d4c2002-09-12 22:42:52 +000039#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 */
wdenk9dfa8d12002-12-08 09:53:23 +000043#define POST_PREREL 0x1000 /* test runs before relocation */
wdenk7133d4c2002-09-12 22:42:52 +000044
Yuri Tikhonovd773efb2008-02-04 14:11:03 +010045#define POST_CRITICAL 0x2000 /* Use failbootcmd if test failed */
Yuri Tikhonovbc439b02008-05-08 15:45:26 +020046#define POST_STOP 0x4000 /* Interrupt POST sequence on fail */
Yuri Tikhonovd773efb2008-02-04 14:11:03 +010047
wdenk7133d4c2002-09-12 22:42:52 +000048#define POST_MEM (POST_RAM | POST_ROM)
wdenkdccbda02003-07-14 22:13:32 +000049#define POST_ALWAYS (POST_NORMAL | \
50 POST_SLOWTEST | \
51 POST_MANUAL | \
wdenk7133d4c2002-09-12 22:42:52 +000052 POST_POWERON )
53
Yuri Tikhonovd773efb2008-02-04 14:11:03 +010054#define POST_FAIL_SAVE 0x80
55
Michael Zaidmane3ac2b92010-03-01 11:47:36 +020056#define POST_BEFORE 1
57#define POST_AFTER 0
58#define POST_PASSED 1
59#define POST_FAILED 0
60
wdenk7133d4c2002-09-12 22:42:52 +000061#ifndef __ASSEMBLY__
62
63struct post_test {
64 char *name;
65 char *cmd;
66 char *desc;
67 int flags;
68 int (*test) (int flags);
wdenkc08f1582003-04-27 22:52:51 +000069 int (*init_f) (void);
70 void (*reloc) (void);
wdenk9dfa8d12002-12-08 09:53:23 +000071 unsigned long testid;
wdenk7133d4c2002-09-12 22:42:52 +000072};
wdenkc08f1582003-04-27 22:52:51 +000073int post_init_f (void);
wdenk7133d4c2002-09-12 22:42:52 +000074void post_bootmode_init (void);
75int post_bootmode_get (unsigned int * last_test);
76void post_bootmode_clear (void);
wdenk9dfa8d12002-12-08 09:53:23 +000077void post_output_backlog ( void );
wdenk7133d4c2002-09-12 22:42:52 +000078int post_run (char *name, int flags);
79int post_info (char *name);
80int post_log (char *format, ...);
Peter Tyser9057cbf2009-09-21 11:20:36 -050081#ifndef CONFIG_RELOC_FIXUP_WORKS
wdenk7133d4c2002-09-12 22:42:52 +000082void post_reloc (void);
Peter Tyser9057cbf2009-09-21 11:20:36 -050083#endif
wdenkc08f1582003-04-27 22:52:51 +000084unsigned long post_time_ms (unsigned long base);
wdenk7133d4c2002-09-12 22:42:52 +000085
86extern struct post_test post_list[];
87extern unsigned int post_list_size;
wdenk874ac262003-07-24 23:38:38 +000088extern int post_hotkeys_pressed(void);
wdenk7133d4c2002-09-12 22:42:52 +000089
Yuri Tikhonov7ed66f72008-12-20 14:54:21 +030090/*
91 * If GCC is configured to use a version of GAS that supports
92 * the .gnu_attribute directive, it will use that directive to
93 * record certain properties of the output code.
94 * This feature is new to GCC 4.3.0.
95 * .gnu_attribute is new to GAS 2.18.
96 */
97#if (__GNUC__ >= 4 && __GNUC_MINOR__ >= 3)
98/* Tag_GNU_Power_ABI_FP/soft-float */
99#define GNU_FPOST_ATTR asm(".gnu_attribute 4, 2");
100#else
101#define GNU_FPOST_ATTR
102#endif /* __GNUC__ */
wdenk7133d4c2002-09-12 22:42:52 +0000103#endif /* __ASSEMBLY__ */
104
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200105#define CONFIG_SYS_POST_RTC 0x00000001
106#define CONFIG_SYS_POST_WATCHDOG 0x00000002
107#define CONFIG_SYS_POST_MEMORY 0x00000004
108#define CONFIG_SYS_POST_CPU 0x00000008
109#define CONFIG_SYS_POST_I2C 0x00000010
110#define CONFIG_SYS_POST_CACHE 0x00000020
111#define CONFIG_SYS_POST_UART 0x00000040
112#define CONFIG_SYS_POST_ETHER 0x00000080
113#define CONFIG_SYS_POST_SPI 0x00000100
114#define CONFIG_SYS_POST_USB 0x00000200
115#define CONFIG_SYS_POST_SPR 0x00000400
116#define CONFIG_SYS_POST_SYSMON 0x00000800
117#define CONFIG_SYS_POST_DSP 0x00001000
118#define CONFIG_SYS_POST_OCM 0x00002000
119#define CONFIG_SYS_POST_FPU 0x00004000
120#define CONFIG_SYS_POST_ECC 0x00008000
121#define CONFIG_SYS_POST_BSPEC1 0x00010000
122#define CONFIG_SYS_POST_BSPEC2 0x00020000
123#define CONFIG_SYS_POST_BSPEC3 0x00040000
124#define CONFIG_SYS_POST_BSPEC4 0x00080000
125#define CONFIG_SYS_POST_BSPEC5 0x00100000
126#define CONFIG_SYS_POST_CODEC 0x00200000
Anatolij Gustschin810b2072010-04-24 19:27:11 +0200127#define CONFIG_SYS_POST_COPROC 0x00400000
wdenk7133d4c2002-09-12 22:42:52 +0000128
129#endif /* CONFIG_POST */
130
131#endif /* _POST_H */