tizen 2.4 release
[profile/mobile/platform/kernel/u-boot-tm1.git] / arch / arm / include / asm / arch-sc8800g / boot_drvapi.h
1 /******************************************************************************
2  ** File Name:      boot_drvapi.h                                               *
3  ** Author:         Jeff Li                                                   *
4  ** DATE:           31/08/2010                                                *
5  ** Copyright:      2002 Spreatrum, Incoporated. All Rights Reserved.         *
6  ** Description:    This file defines the logic interfaces called during boot,*
7  **                 including reset mode setting, initialization etc.
8  ******************************************************************************
9
10  ******************************************************************************
11  **                        Edit History                                       *
12  ** ------------------------------------------------------------------------- *
13  ** DATE           NAME             DESCRIPTION                               *
14  ** 31/08/2010     Jeff.Li          Create.                                   *
15  ******************************************************************************/
16 #ifndef _BOOT_DRVAPI_H_
17 #define _BOOT_DRVAPI_H_
18
19 /**---------------------------------------------------------------------------*
20  **                         Compiler Flag                                     *
21  **---------------------------------------------------------------------------*/
22 #ifdef __cplusplus
23 extern   "C"
24 {
25 #endif
26
27 typedef enum{
28 TYPE_RESET = 0,           //bit[4:0]
29 TYPE_BACKLIGHT,         //bit[5]
30 TYPE_DSPEXCEPTION,  //bit[6]
31 TYPE_USB,                    //bit[7]
32 TYPE_MAX
33 }WDG_HW_FLAG_T;
34
35 /**---------------------------------------------------------------------------*
36  **                         Function Prototypes                               *
37  **---------------------------------------------------------------------------*/
38 /*****************************************************************************/
39 //  Description:    Sets the different kinds of reset modes, used in normal p-
40 //                  ower up mode, watchdog reset mode and calibration mode etc.
41 //  Author:         Jeff.Li
42 //  Note:
43 /*****************************************************************************/
44 PUBLIC void BOOT_SetRstMode (uint32 val);
45
46 /*****************************************************************************/
47 //  Description:    Gets the current reset mode.
48 //  Author:         Jeff.Li
49 //  Note:
50 /*****************************************************************************/
51 PUBLIC uint32 BOOT_GetRstMode (void);
52
53 /*****************************************************************************/
54 //  Description:    Sets the backup flag
55 //  Author:         Yong.Li
56 //  Note:
57 /*****************************************************************************/
58 PUBLIC void BOOT_SetResetFlag (WDG_HW_FLAG_T type, uint32 val);
59
60 /*****************************************************************************/
61 //  Description:    Gets the current backup flag.
62 //  Author:         Yong.Li
63 //  Note:
64 /*****************************************************************************/
65 PUBLIC uint32 BOOT_GetResetFlag (WDG_HW_FLAG_T type);
66
67 /*****************************************************************************/
68 //  Description:    After normal power on, the HW_RST flag should be reset in
69 //                  order to judge differrent reset conditions between normal
70 //                  power on reset and watchdog reset.
71 //  Author:         Jeff.Li
72 //  Note:
73 /*****************************************************************************/
74 PUBLIC void BOOT_ResetHWFlag ();
75
76 /*****************************************************************************/
77 //  Description:   Get HW Flag
78 //  Author:         Yong.Li
79 //  Note:
80 /*****************************************************************************/
81 PUBLIC uint32 BOOT_GetWDGHWFlag (WDG_HW_FLAG_T type);
82
83 /*****************************************************************************/
84 //  Description:    Before watchdog reset, writting HW_RST flag is uesed to j-
85 //                  udge differrent watchdog reset conditions between MCU reset
86 //                  and system-halted.
87 //  Author:         Jeff.Li
88 //  Modified by:  Yong.Li
89 //  Note:
90 /*****************************************************************************/
91 PUBLIC void BOOT_SetWDGHWFlag (WDG_HW_FLAG_T type, uint32 val);
92
93 /*****************************************************************************/
94 //  Description:    Gets the flag.
95 //  Author:
96 //  Note:
97 /*****************************************************************************/
98 PUBLIC BOOLEAN GetWatchdogMode (void);
99
100 /*****************************************************************************/
101 //  Description:    Sets the flag when watchdog resets the system in debug mode.
102 //  Author:
103 /*****************************************************************************/
104 PUBLIC void SetWatchdogMode (BOOLEAN mode);
105
106
107 PUBLIC void BOOT_ResetHWVal(uint32 val);
108
109
110 /**---------------------------------------------------------------------------*
111  **                         Compiler Flag                                     *
112  **---------------------------------------------------------------------------*/
113 #ifdef __cplusplus
114 }
115 #endif
116
117 #endif //_BOOT_DRVAPI_H_
118