tizen 2.4 release
[profile/mobile/platform/kernel/u-boot-tm1.git] / arch / arm / include / asm / arch-sc9630 / 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 typedef enum{
36 TDPLL_REF0 = 0,
37 TDPLL_REF1,
38 TDPLL_MAX,
39 }TDPLL_REF_T;
40 /**---------------------------------------------------------------------------*
41  **                         Function Prototypes                               *
42  **---------------------------------------------------------------------------*/
43 /*****************************************************************************/
44 //  Description:    Sets the different kinds of reset modes, used in normal p-
45 //                  ower up mode, watchdog reset mode and calibration mode etc.
46 //  Author:         Jeff.Li
47 //  Note:
48 /*****************************************************************************/
49 PUBLIC void BOOT_SetRstMode (uint32 val);
50
51 /*****************************************************************************/
52 //  Description:    Gets the current reset mode.
53 //  Author:         Jeff.Li
54 //  Note:
55 /*****************************************************************************/
56 PUBLIC uint32 BOOT_GetRstMode (void);
57
58 /*****************************************************************************/
59 //  Description:    Sets the backup flag
60 //  Author:         Yong.Li
61 //  Note:
62 /*****************************************************************************/
63 PUBLIC void BOOT_SetResetFlag (WDG_HW_FLAG_T type, uint32 val);
64
65 /*****************************************************************************/
66 //  Description:    Gets the current backup flag.
67 //  Author:         Yong.Li
68 //  Note:
69 /*****************************************************************************/
70 PUBLIC uint32 BOOT_GetResetFlag (WDG_HW_FLAG_T type);
71
72 /*****************************************************************************/
73 //  Description:    After normal power on, the HW_RST flag should be reset in
74 //                  order to judge differrent reset conditions between normal
75 //                  power on reset and watchdog reset.
76 //  Author:         Jeff.Li
77 //  Note:
78 /*****************************************************************************/
79 PUBLIC void BOOT_ResetHWFlag ();
80
81 /*****************************************************************************/
82 //  Description:   Get HW Flag
83 //  Author:         Yong.Li
84 //  Note:
85 /*****************************************************************************/
86 PUBLIC uint32 BOOT_GetWDGHWFlag (WDG_HW_FLAG_T type);
87
88 /*****************************************************************************/
89 //  Description:    Before watchdog reset, writting HW_RST flag is uesed to j-
90 //                  udge differrent watchdog reset conditions between MCU reset
91 //                  and system-halted.
92 //  Author:         Jeff.Li
93 //  Modified by:  Yong.Li
94 //  Note:
95 /*****************************************************************************/
96 PUBLIC void BOOT_SetWDGHWFlag (WDG_HW_FLAG_T type, uint32 val);
97
98 /*****************************************************************************/
99 //  Description:    Gets the flag.
100 //  Author:
101 //  Note:
102 /*****************************************************************************/
103 PUBLIC BOOLEAN GetWatchdogMode (void);
104
105 /*****************************************************************************/
106 //  Description:    Sets the flag when watchdog resets the system in debug mode.
107 //  Author:
108 /*****************************************************************************/
109 PUBLIC void SetWatchdogMode (BOOLEAN mode);
110
111
112 PUBLIC void BOOT_ResetHWVal(uint32 val);
113
114
115 /**---------------------------------------------------------------------------*
116  **                         Compiler Flag                                     *
117  **---------------------------------------------------------------------------*/
118 #ifdef __cplusplus
119 }
120 #endif
121
122 #endif //_BOOT_DRVAPI_H_
123